/* scalafoundations.com — site chrome. Quiet frame; the book is the product. */

:root {
  --crimson: #A01E28;
  --coral: #E8583C;
  --navy: #12333F;
  --teal: #1B5464;
  --cream: #F3E6C7;
  --ink: #1c2b31;
  --paper: #fbfaf6;
  --muted: #5c6b70;
  --line: #e3ddcf;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--crimson); }

/* --- Toolbar --------------------------------------------------------- */

.sf-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(0.9rem, 3vw, 1.6rem);
  background: rgba(251, 250, 246, 0.94);
  backdrop-filter: saturate(1.1) blur(6px);
  border-bottom: 1px solid var(--line);
}

.sf-brand {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--crimson);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sf-links {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1.25rem);
  font-size: 0.9rem;
}

.sf-links a {
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.sf-links a:hover { color: var(--crimson); }

.sf-links a.sf-dl {
  color: var(--muted);
  font-variant: small-caps;
  letter-spacing: 0.03em;
}

.sf-links a.sf-dl:hover { color: var(--teal); }

/* --- Page shell ------------------------------------------------------ */

.sf-page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(52px + 3rem) clamp(1.1rem, 5vw, 2.5rem) 4rem;
}

/* --- Landing hero ---------------------------------------------------- */

.sf-hero {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  align-items: start;
}

.sf-cover {
  position: relative;
  aspect-ratio: 1024 / 1536;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(18, 51, 63, 0.22), 0 2px 6px rgba(18, 51, 63, 0.12);
  background-image: url("/assets/cover-art.png");
  background-size: cover;
  background-position: center;
  container-type: inline-size; /* overlay text scales with the card, not the viewport */
}

.sf-cover-head {
  position: absolute;
  top: 5.5%;
  left: 7%;
  right: 11%;
}

.sf-cover-title {
  color: var(--cream);
  font-weight: 800;
  line-height: 1.04;
  font-size: 8.2cqw;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.sf-cover-rule {
  width: 40%;
  height: 0.9cqw;
  min-height: 3px;
  margin-top: 3.2cqw;
  background: var(--coral);
}

.sf-cover-author {
  position: absolute;
  bottom: 5.5%;
  left: 7%;
  color: var(--navy);
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 3.4cqw;
}

.sf-pitch h1 {
  margin: 0 0 0.2rem;
  font-size: clamp(1.7rem, 4.4vw, 2.55rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.sf-byline {
  margin: 0 0 1.4rem;
  color: var(--muted);
  font-size: 1rem;
}

.sf-lede {
  font-size: 1.12rem;
  color: #2a3a40;
  margin: 0 0 1.8rem;
}

.sf-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.4rem;
  margin-bottom: 1.4rem;
}

.sf-start {
  display: inline-block;
  background: var(--crimson);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.7rem 1.5rem;
  border-radius: 5px;
}

.sf-start:hover { background: #8a1922; }

.sf-formats {
  font-size: 0.95rem;
  color: var(--muted);
}

.sf-formats a { color: var(--teal); text-decoration: none; }
.sf-formats a:hover { text-decoration: underline; }

.sf-meta {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

/* --- Prose (about) --------------------------------------------------- */

.sf-prose {
  max-width: 42rem;
}

.sf-prose h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 1rem;
}

.sf-prose p { margin: 0 0 1.1rem; }

.sf-draft {
  background: #fff6e9;
  border: 1px solid #f0d8a8;
  border-left: 4px solid var(--coral);
  border-radius: 4px;
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
  color: #6b4a17;
  margin: 0 0 1.6rem;
}

.sf-todo {
  color: var(--muted);
  font-style: italic;
}

/* --- Footer ---------------------------------------------------------- */

.sf-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem clamp(1.1rem, 5vw, 2.5rem) 3rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

/* --- Responsive ------------------------------------------------------ */

@media (max-width: 720px) {
  .sf-hero { grid-template-columns: 1fr; }
  .sf-cover { max-width: 320px; margin: 0 auto; }
  .sf-brand { font-size: 0.82rem; max-width: 45vw; }
  .sf-links { font-size: 0.82rem; }
}
