/* ==========================================================================
   Noah Cellan — design system
   A literary/scientific voice: warm paper, deep ink, one living accent.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Surfaces */
  --paper:        #FBF9F5;
  --surface:      #FFFFFF;
  --surface-sunk: #F2EFE8;

  /* Text */
  --ink:          #16191B;
  --ink-soft:     #3A4145;
  --muted:        #6B7378;

  /* The single living accent — viridian, the colour of a culture dish */
  --accent:       #0F7B6C;
  --accent-deep:  #0A5C50;
  --accent-wash:  rgba(15, 123, 108, 0.08);

  /* Secondary warmth, used sparingly for "signal" moments */
  --ember:        #B4682A;

  --line:         rgba(22, 25, 27, 0.12);
  --line-soft:    rgba(22, 25, 27, 0.07);

  --shadow-sm: 0 1px 2px rgba(22, 25, 27, 0.05), 0 2px 8px rgba(22, 25, 27, 0.04);
  --shadow-md: 0 4px 12px rgba(22, 25, 27, 0.07), 0 16px 40px rgba(22, 25, 27, 0.07);
  --shadow-lg: 0 8px 24px rgba(22, 25, 27, 0.10), 0 32px 72px rgba(22, 25, 27, 0.12);

  /* Type */
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Rhythm */
  --measure: 34rem;          /* optimal reading width */
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --wrap: 72rem;

  --radius: 4px;
  --radius-lg: 10px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:        #0C0F11;
    --surface:      #13181B;
    --surface-sunk: #171D21;
    --ink:          #E9EBEB;
    --ink-soft:     #C3C9CB;
    --muted:        #8E989D;
    --accent:       #4ECBB4;
    --accent-deep:  #7FDCC9;
    --accent-wash:  rgba(78, 203, 180, 0.10);
    --ember:        #E0954F;
    --line:         rgba(233, 235, 235, 0.14);
    --line-soft:    rgba(233, 235, 235, 0.08);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.45), 0 16px 40px rgba(0,0,0,0.35);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5), 0 32px 72px rgba(0,0,0,0.45);
  }
}

:root[data-theme="dark"] {
  --paper:        #0C0F11;
  --surface:      #13181B;
  --surface-sunk: #171D21;
  --ink:          #E9EBEB;
  --ink-soft:     #C3C9CB;
  --muted:        #8E989D;
  --accent:       #4ECBB4;
  --accent-deep:  #7FDCC9;
  --accent-wash:  rgba(78, 203, 180, 0.10);
  --ember:        #E0954F;
  --line:         rgba(233, 235, 235, 0.14);
  --line-soft:    rgba(233, 235, 235, 0.08);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.45), 0 16px 40px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5), 0 32px 72px rgba(0,0,0,0.45);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  /* Stops iOS Safari inflating text when the phone is turned to landscape.
     Both forms are required: Safari — the browser this property exists for —
     only understands the prefixed one, while Chrome and Edge take the
     standard one. Neither is redundant. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.99rem + 0.34vw, 1.1875rem);
  line-height: 1.68;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ---------- Type ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.13;
  letter-spacing: -0.021em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4.4rem); }
h2 { font-size: clamp(1.85rem, 1.4rem + 2vw, 2.8rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.55rem); line-height: 1.28; }
h4 { font-size: 1.0625rem; font-family: var(--sans); font-weight: 600; letter-spacing: -0.01em; }

p { margin: 0 0 1.15em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-deep); }

strong { font-weight: 600; }
em { font-style: italic; }

::selection { background: var(--accent); color: var(--paper); }

/* Small caps label — the connective tissue of the whole site */
.eyebrow {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: var(--accent);
  flex: none;
}
.eyebrow--plain::before { display: none; }

.lede {
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  line-height: 1.55;
  color: var(--ink-soft);
}

.muted { color: var(--muted); }

/* Long-form answer copy — softer than headings, stronger than metadata. */
.answer { color: var(--ink-soft); max-width: var(--measure); }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: 46rem; }

.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.section--tight { padding-block: clamp(3rem, 6vw, 4.5rem); }
.section--sunk { background: var(--surface-sunk); }
.section + .section--bordered { border-top: 1px solid var(--line-soft); }

.stack > * + * { margin-top: 1.15em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 550;
  letter-spacing: -0.006em;
  line-height: 1;
  padding: 0.95rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease),
              color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--accent);
  color: var(--paper);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--accent-deep); color: var(--paper); box-shadow: var(--shadow-md); }

.btn--ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* Text link with arrow */
.arrow-link {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 550;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.arrow-link::after {
  content: "→";
  transition: transform 0.2s var(--ease);
}
.arrow-link:hover::after { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--line-soft); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.brand {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand__mark { flex: none; color: var(--accent); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 480;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius);
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.nav__links a:hover { color: var(--ink); background: var(--accent-wash); }
.nav__links a[aria-current="page"] { color: var(--accent); }

.nav__actions { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-wash); }

.nav__toggle { display: none; }

@media (max-width: 47.9375rem) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: absolute;
    inset: 100% 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-block: 1px solid var(--line-soft);
    padding: 0.5rem var(--gutter) 1.25rem;
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 0.85rem 0; font-size: 1rem; border-bottom: 1px solid var(--line-soft); border-radius: 0; }
  .nav__links li:last-child a { border-bottom: 0; }
  .nav__cta { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4rem, 10vw, 8.5rem) clamp(4rem, 9vw, 7rem);
  isolation: isolate;
}
#colony-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.75;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 80% 70% at 65% 45%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 65% 45%, #000 30%, transparent 78%);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.85fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
@media (max-width: 55rem) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { order: -1; max-width: 17rem; margin-inline: auto; }
}

.hero h1 { margin-bottom: 0.35em; }
.hero__sub {
  font-size: clamp(1.15rem, 1.02rem + 0.6vw, 1.45rem);
  line-height: 1.45;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 1.5rem;
}
.hero__blurb { max-width: 32rem; color: var(--ink-soft); margin-bottom: 2rem; }

/* ---------- Book cover ---------- */
.cover {
  position: relative;
  border-radius: 3px 6px 6px 3px;
  box-shadow: var(--shadow-lg);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
  transform-origin: center;
}
.cover::after {
  /* spine shading — makes a flat image read as a physical object */
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 9%;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(90deg, rgba(0,0,0,0.30) 0%, rgba(0,0,0,0.06) 55%, rgba(255,255,255,0.10) 100%);
  pointer-events: none;
}
a.cover:hover, .cover--hover:hover { transform: translateY(-6px) rotate(-0.6deg); box-shadow: var(--shadow-lg); }

.cover-frame { perspective: 1400px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.card--link:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line); }

/* Card body copy sits one step down from headings, but stays readable —
   --muted is for labels and metadata, not for paragraphs. */
.card p { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.62; }
.card h3 { margin-bottom: 0.6rem; }

.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.75rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }

/* ---------- Pull quote / epigraph ---------- */
.epigraph {
  font-size: clamp(1.3rem, 1.1rem + 1.1vw, 2rem);
  line-height: 1.4;
  font-style: italic;
  color: var(--ink);
  border-left: 2px solid var(--accent);
  padding-left: clamp(1.25rem, 3vw, 2.25rem);
  margin: 0;
  max-width: 30ch;
  text-wrap: balance;
}
.epigraph cite {
  display: block;
  margin-top: 1.25rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Chapter list ---------- */
.chapters { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }

.chapter {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 0 clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.5rem, 3vw, 2.25rem) 0;
  border-bottom: 1px solid var(--line-soft);
  transition: background-color 0.25s var(--ease);
}
.chapter:hover { background: var(--accent-wash); }

.chapter__num {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-top: 0.5rem;
  font-variant-numeric: tabular-nums;
}
.chapter__title { font-size: clamp(1.2rem, 1.08rem + 0.55vw, 1.5rem); margin-bottom: 0.5rem; }
.chapter__epi {
  font-style: italic;
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 0;
}
@media (max-width: 34rem) {
  .chapter { grid-template-columns: 1fr; gap: 0.5rem; }
  .chapter__num { padding-top: 0; }
}

/* ---------- Facts / spec table ---------- */
.facts { list-style: none; margin: 0; padding: 0; }
.facts li {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--sans);
  font-size: 0.875rem;
}
.facts li:last-child { border-bottom: 0; }
.facts dt, .facts .k { color: var(--muted); }
.facts .v { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Newsletter ---------- */
.subscribe {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  max-width: 30rem;
}
.subscribe input[type="email"] {
  flex: 1 1 14rem;
  min-width: 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.9rem 1.05rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.subscribe input[type="email"]::placeholder { color: var(--muted); }
.subscribe input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.form-note { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); margin-top: 0.9rem; }

/* ---------- Forms (contact) ---------- */
.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 550;
  letter-spacing: 0.02em;
  margin-bottom: 0.45rem;
  color: var(--ink-soft);
}
.field input, .field textarea, .field select {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.field textarea { min-height: 9rem; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-soft);
  background: var(--surface-sunk);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
  font-family: var(--sans);
  font-size: 0.875rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: 3rem;
}
@media (max-width: 44rem) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__brand { grid-column: 1 / -1; } }

.footer__brand p { color: var(--muted); max-width: 26rem; font-size: 0.875rem; line-height: 1.6; }
/* h3, not h4: the nearest preceding heading is an h2, and skipping a level
   breaks heading-by-heading navigation for screen reader users. */
.site-footer h3 {
  margin-bottom: 1rem;
  font-size: 0.75rem;
  line-height: 1.13;   /* h3 sets 1.28; these are labels, not headings to read */
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  font-family: var(--sans);
}
.footer__list { list-style: none; margin: 0; padding: 0; }
.footer__list li + li { margin-top: 0.6rem; }
.footer__list a { color: var(--ink-soft); text-decoration: none; }
.footer__list a:hover { color: var(--accent); }

.footer__bottom {
  border-top: 1px solid var(--line-soft);
  padding-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.8125rem;
}

/* ---------- Page header (interior pages) ---------- */
.page-head {
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line-soft);
}
.page-head h1 { max-width: 18ch; }
.page-head .lede { max-width: var(--measure); }

/* ---------- Prose ---------- */
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.25em; }
.prose h3 { margin-top: 1.9em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 1.15em; }
.prose li { margin-bottom: 0.5em; }
.prose li::marker { color: var(--accent); }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 100;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.875rem;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0.5rem; color: var(--paper); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);       /* deprecated, kept for older browsers */
  clip-path: inset(50%);     /* the modern replacement */
  white-space: nowrap;
  border: 0;
}

/* ---------- Page-specific layouts ---------- */

/* Two-column splits. The ratios differ by page because the content does:
   a cover needs less room than the prose beside it, an aside less than a form. */
.split { display: grid; align-items: start; }
.split--cover  { grid-template-columns: minmax(0, 0.55fr) minmax(0, 1fr);
                 gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.split--form   { grid-template-columns: minmax(0, 1fr) minmax(0, 0.62fr);
                 gap: clamp(2rem, 6vw, 4.5rem); }
.split--aside  { grid-template-columns: minmax(0, 1fr) minmax(0, 0.5fr);
                 gap: clamp(2rem, 6vw, 5rem); }

/* These were previously inline and had no breakpoint, so a cover and its
   description stayed side by side on a phone at roughly 120px each. */
@media (max-width: 55rem) {
  .split--cover, .split--form, .split--aside { grid-template-columns: 1fr; }
  /* Stacked, a full-bleed cover would fill most of a phone screen. Cap it
     to match the hero cover so the description stays in view beneath it. */
  .split--cover > :first-child { max-width: 15rem; margin-inline: auto; width: 100%; }
}

/* Modifiers for the auto-fit .grid, which supplies its own columns. */
.grid--center { align-items: center; gap: clamp(2rem, 5vw, 4.5rem); }
.gap-lg { gap: clamp(2rem, 5vw, 4rem); }

/* Compact hero for interior pages, which carry a breadcrumb above the title. */
.hero--compact { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 7vw, 5.5rem); }

/* Standalone centred page (404). */
.page-full { min-height: 100vh; display: flex; align-items: center; }

/* Placeholder standing in for an unannounced book's cover. */
.cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1000 / 1600;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

/* Headline sizes that step down from the global h1 scale. */
.title-md { font-size: clamp(2.1rem, 1.5rem + 3vw, 3.7rem); }
.title-sm { font-size: clamp(2rem, 1.5rem + 2.5vw, 3.2rem); }
.epigraph--sm { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.45rem); }

/* Breadcrumb links: take the surrounding colour but keep their underline,
   which is the only thing marking them as clickable at that size. */
.link-plain { color: inherit; }
.link-title { color: var(--ink); text-decoration: none; }
.link-title:hover { color: var(--accent); }

.text-soft { color: var(--ink-soft); }

/* Centred call-to-action row closing a page. */
.btn-row--cta { justify-content: center; margin-top: 2.25rem; }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.center .eyebrow { justify-content: center; }
.center .epigraph { margin-inline: auto; border-left: 0; padding-left: 0; }

/* Spacing. A small fixed scale — enough for the handful of one-off nudges
   the components don't already cover.

   Each selector is doubled (.mt-lg.mt-lg) on purpose. These replaced inline
   styles, which outranked everything; a single class does not. `.card h3`
   is one class plus one element, so it would quietly beat a plain `.mb-sm`
   and the nudge would do nothing. Doubling raises the utility above
   component rules without reaching for !important. */
.mt-0.mt-0   { margin-top: 0; }
.mt-md.mt-md { margin-top: 1.25rem; }
.mt-lg.mt-lg { margin-top: 1.5rem; }
.mt-xl.mt-xl { margin-top: 1.75rem; }
.mt-2xl.mt-2xl { margin-top: 2rem; }
.mt-3xl.mt-3xl { margin-top: 2.5rem; }
.mt-4xl.mt-4xl { margin-top: 3rem; }
.mb-sm.mb-sm   { margin-bottom: 0.75rem; }
.mb-md.mb-md   { margin-bottom: 1rem; }
.mb-lg.mb-lg   { margin-bottom: 1.25rem; }
.mb-xl.mb-xl   { margin-bottom: 1.5rem; }
.mb-2xl.mb-2xl { margin-bottom: 2rem; }
.mb-3xl.mb-3xl { margin-bottom: 2.5rem; }
.m-0.m-0       { margin: 0; }
.my-xl.my-xl   { margin: 1.75rem 0; }

/* Widths. `measure` is the reading column; the rest are deliberate one-offs. */
.measure.measure { max-width: var(--measure); }
.w-34.w-34       { max-width: 34rem; }
.w-38.w-38       { max-width: 38rem; }
.w-33.w-33       { max-width: 33rem; }
.w-32.w-32       { max-width: 32rem; }
.w-26ch.w-26ch   { max-width: 26ch; }
.w-24.w-24       { max-width: 24rem; }
.w-16ch.w-16ch   { max-width: 16ch; }
.w-14ch.w-14ch   { max-width: 14ch; }
.center-block.center-block { margin-inline: auto; }

.justify-center { justify-content: center; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ember);
  border: 1px solid color-mix(in srgb, var(--ember) 35%, transparent);
  background: color-mix(in srgb, var(--ember) 8%, transparent);
  padding: 0.35rem 0.7rem;
  border-radius: 100px;
}
.badge--accent {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--accent-wash);
}
