/* =================================================================
   33 PUBLISHING — Sky Medicine dark-field design system
   Deep near-black fields, clean off-white UI typography, celestial
   star graphics. Serif (Palatino) headings.
   Gold is reserved for: the nav highlight, the hero heading accent,
   the small eyebrow/rule labels above headings, and the light cast
   by the book covers. All other chrome stays restrained (off-white)
   so the covers carry the light.
   ================================================================= */

:root {
  /* Fields */
  --field:        #0a0b12;   /* deep near-black background */
  --field-deep:   #06070d;   /* darkest wells */
  --panel:        #12131f;   /* raised panels */
  --panel-edge:   #23243a;   /* hairline borders */

  /* Champagne gold — nav highlight, hero accent, eyebrows, cover light */
  --gold:         #d8b878;
  --gold-bright:  #f0d9a6;   /* brighter for small text / hover */
  --gold-deep:    #a07f42;

  /* Warm off-white — UI accents (eyebrows, rules, labels) */
  --ivory:        #e9e6dc;

  /* Silvers / text */
  --title:        #f2f3f8;   /* white-silver titles */
  --text:         #cfd2de;   /* body text (high contrast on field) */
  --text-dim:     #9aa0b4;   /* secondary text */

  /* Type */
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", P052, "Georgia", serif;

  --measure: 68ch;
  --rule: 1px solid var(--panel-edge);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--field);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* -------------------------------------------------------------
   Celestial starfield — fixed layered background
   ------------------------------------------------------------- */
.starfield {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(46, 41, 78, 0.55), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, rgba(30, 44, 66, 0.45), transparent 60%),
    linear-gradient(180deg, var(--field-deep) 0%, var(--field) 40%, var(--field) 100%);
}

.starfield::before,
.starfield::after {
  content: "";
  position: absolute;
  inset: -50%;
  background-repeat: repeat;
}

/* small dense stars */
.starfield::before {
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 140px 90px, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 250px 200px, rgba(230,232,244,0.8), transparent),
    radial-gradient(1px 1px at 330px 60px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.5px 1.5px at 400px 300px, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 520px 160px, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 90px 380px, rgba(230,232,244,0.7), transparent);
  background-size: 600px 420px;
  opacity: 0.7;
  animation: drift 220s linear infinite;
}

/* sparse larger, twinkling stars */
.starfield::after {
  background-image:
    radial-gradient(2px 2px at 80px 120px, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 460px 40px, rgba(230,232,244,0.9), transparent),
    radial-gradient(1.5px 1.5px at 300px 260px, rgba(255,255,255,0.85), transparent),
    radial-gradient(2.5px 2.5px at 620px 220px, rgba(255,255,255,0.9), transparent);
  background-size: 760px 520px;
  opacity: 0.5;
  animation: twinkle 6s ease-in-out infinite alternate, drift 320s linear infinite;
}

@keyframes twinkle {
  from { opacity: 0.25; }
  to   { opacity: 0.65; }
}
@keyframes drift {
  from { transform: translateY(0); }
  to   { transform: translateY(-120px); }
}

@media (prefers-reduced-motion: reduce) {
  .starfield::before, .starfield::after { animation: none; }
  html { scroll-behavior: auto; }
}

/* -------------------------------------------------------------
   Layout helpers
   ------------------------------------------------------------- */
.wrap { width: min(1160px, 92vw); margin-inline: auto; }
.section { padding: clamp(3.5rem, 8vw, 7rem) 0; }

/* -------------------------------------------------------------
   Skip link (accessibility)
   ------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--title);
  color: #12100a;
  padding: 0.75rem 1.25rem;
  z-index: 100;
  font-weight: 700;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* -------------------------------------------------------------
   Shared "eyebrow" — spaced small caps series header
   ------------------------------------------------------------- */
.eyebrow {
  font-size: 0.82rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin: 0;
}

/* thin gold rule lines flanking a word */
.volume-rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  color: var(--gold);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.8rem;
}
.volume-rule::before,
.volume-rule::after {
  content: "";
  height: 1px;
  width: clamp(28px, 8vw, 90px);
  background: linear-gradient(90deg, transparent, var(--gold-deep), var(--gold));
}
.volume-rule::after {
  background: linear-gradient(90deg, var(--gold), var(--gold-deep), transparent);
}

/* -------------------------------------------------------------
   Navigation
   ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(6, 7, 13, 0.72);
  border-bottom: var(--rule);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--title);
}
.brand img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(242,243,248,0.28)); }
.brand-name {
  font-size: 1.15rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.brand-name b { color: var(--title); font-weight: 700; }
.nav-links { display: flex; gap: clamp(1rem, 3vw, 2.2rem); align-items: center; }
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.98rem;
  letter-spacing: 0.06em;
  transition: color 0.2s ease;
}
.nav-links a:hover,
.nav-links a:focus-visible { color: var(--gold-bright); }
.nav-links a[aria-current="page"] { color: var(--gold-bright); }

/* --- About dropdown --- */
.nav-dropdown { position: relative; }
.nav-drop-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 0.98rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.nav-drop-btn:hover,
.nav-drop-btn:focus-visible,
.nav-drop-btn[aria-expanded="true"],
.nav-drop-btn.is-current { color: var(--gold-bright); }
.drop-caret {
  width: 0.55em;
  height: 0.55em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s ease;
}
.nav-drop-btn[aria-expanded="true"] .drop-caret {
  transform: rotate(225deg) translateY(-2px);
}
.nav-drop-menu {
  position: absolute;
  top: calc(100% + 0.85rem);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 220px;
  background: linear-gradient(180deg, var(--panel), var(--field-deep));
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(242,243,248,0.08);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 60;
}
/* hairline at the top of the panel */
.nav-drop-menu::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233,230,220,0.6), transparent);
}
.nav-dropdown.open .nav-drop-menu,
.nav-dropdown:focus-within .nav-drop-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
@media (hover: hover) {
  .nav-dropdown:hover .nav-drop-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
}
.nav-drop-menu a {
  display: block;
  padding: 0.6rem 0.9rem;
  border-radius: 5px;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.95rem;
}
.nav-drop-menu a:hover,
.nav-drop-menu a:focus-visible {
  background: rgba(216, 184, 120, 0.1);
  color: var(--gold-bright);
}
.nav-drop-menu a[aria-current="page"] { color: var(--gold-bright); }

@media (max-width: 560px) {
  /* keep the panel on-screen on small viewports */
  .nav-drop-menu { left: auto; right: -1rem; transform: translateY(-6px); }
  .nav-dropdown.open .nav-drop-menu,
  .nav-dropdown:focus-within .nav-drop-menu { transform: translateY(0); }
}

/* -------------------------------------------------------------
   Inner page hero
   ------------------------------------------------------------- */
.page-hero {
  text-align: center;
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2rem, 5vw, 3rem);
}
.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--title);
  font-weight: 500;
  margin: 0.6rem 0 0.8rem;
  line-height: 1.12;
}
.page-hero .lede {
  max-width: 58ch;
  margin: 0 auto;
  color: var(--text);
  font-style: italic;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
}

/* -------------------------------------------------------------
   Resource cards
   ------------------------------------------------------------- */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(1.5rem, 3vw, 2rem);
}
.resource-card {
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 3vw, 2rem);
  background: linear-gradient(180deg, var(--panel), var(--field-deep));
  border: var(--rule);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.resource-card:hover,
.resource-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--text-dim);
  box-shadow: 0 16px 32px rgba(0,0,0,0.45);
}
.resource-card h3 {
  color: var(--title);
  font-size: 1.35rem;
  font-weight: 500;
  margin: 0 0 0.6rem;
}
.resource-card p { color: var(--text-dim); margin: 0 0 1rem; flex: 1; }
.resource-card .card-link {
  color: var(--title);
  letter-spacing: 0.08em;
  font-size: 0.92rem;
}
.resource-card .card-link::after { content: " →"; }
/* outbound links get a departure arrow instead of the internal arrow */
.resource-card .card-link.external::after { content: " ↗"; }

.placeholder-panel {
  padding: clamp(2rem, 4vw, 3rem);
  background: linear-gradient(140deg, var(--panel), var(--field-deep));
  border: var(--rule);
  border-radius: 8px;
  text-align: center;
}
.placeholder-panel p { color: var(--text-dim); max-width: 48ch; margin: 0.6rem auto 0; font-style: italic; }

.series-block { margin-bottom: clamp(3rem, 6vw, 5rem); }
.series-block:last-child { margin-bottom: 0; }
.series-block h2 {
  color: var(--title);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 500;
  margin: 0 0 0.5rem;
}
.series-block .series-desc { color: var(--text-dim); max-width: 62ch; margin-bottom: 2rem; }

/* Catalog page — centered rhythm. Headers and descriptions sit on the
   page axis; the card rows use the shared .catalog-track slider, which
   centers itself while it fits (see "catalog slideshow" below). */
.catalog-page .series-block .eyebrow,
.catalog-page .series-block h2 { text-align: center; }
.catalog-page .series-desc {
  text-align: center;
  margin-inline: auto;
}

/* -------------------------------------------------------------
   Email signup (Coming Soon page)
   ------------------------------------------------------------- */
.signup-panel {
  padding: clamp(2.5rem, 5vw, 4rem);
  background: linear-gradient(140deg, var(--panel), var(--field-deep));
  border: var(--rule);
  border-radius: 12px;
  text-align: center;
}
.signup-panel h2 {
  color: var(--title);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 500;
  margin: 1rem 0 0.5rem;
}
.signup-lede {
  color: var(--text-dim);
  max-width: 52ch;
  margin: 0 auto 2rem;
}
.signup-form {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 560px;
  margin-inline: auto;
}
.signup-form input[type="email"] {
  flex: 1 1 280px;
  padding: 0.85rem 1.1rem;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--title);
  background: rgba(6, 7, 13, 0.7);
  border: 1px solid var(--panel-edge);
  border-radius: 2px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.signup-form input[type="email"]::placeholder { color: var(--text-dim); opacity: 0.8; }
.signup-form input[type="email"]:focus {
  outline: none;
  border-color: var(--title);
  box-shadow: 0 0 0 3px rgba(242, 243, 248, 0.18);
}
.signup-status { min-height: 1.5em; margin: 1.2rem auto 0; max-width: 52ch; font-style: italic; }
.signup-status.ok { color: #a9d8c6; }
.signup-status.err { color: #e8a9a9; }

/* honeypot — removed from view and from the tab order */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* screen-reader-only labels */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* links inside body prose — underlined so they read as links in white */
.text-link {
  color: var(--title);
  text-decoration: underline;
  text-decoration-color: rgba(242, 243, 248, 0.45);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}
.text-link:hover,
.text-link:focus-visible { text-decoration-color: var(--title); }

/* focus visibility for keyboard users */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--title);
  outline-offset: 3px;
  border-radius: 2px;
}

/* -------------------------------------------------------------
   Hero
   ------------------------------------------------------------- */
/* Fills the viewport below the sticky header (~72px) and scales type
   and spacing with viewport height too, so the whole hero — buttons
   included — stays above the fold at any window size. */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - var(--header-h, 72px));
  min-height: calc(100svh - var(--header-h, 72px));
  padding: clamp(0.75rem, 3vh, 4rem) 0;
  padding: clamp(0.75rem, 3svh, 4rem) 0;
}
.hero .eyebrow { margin-bottom: clamp(0.6rem, 2.5vh, 1.5rem); }
.hero h1 {
  font-size: clamp(1.6rem, min(6.5vw, 8.5vh), 4.6rem);
  font-size: clamp(1.6rem, min(6.5vw, 8.5svh), 4.6rem);
  line-height: 1.08;
  margin: 0.4rem 0 clamp(0.7rem, 2.5vh, 1.4rem);
  color: var(--title);
  font-weight: 500;
  text-shadow: 0 0 40px rgba(120,130,180,0.25);
}
.hero h1 em { font-style: italic; }
.hero .lede {
  max-width: 60ch;
  margin: 0 auto clamp(1rem, 3.5vh, 2.2rem);
  font-size: clamp(0.95rem, min(2.2vw, 3.2vh), 1.3rem);
  font-size: clamp(0.95rem, min(2.2vw, 3.2svh), 1.3rem);
  color: var(--text);
  font-style: italic;
}

/* -------------------------------------------------------------
   Home page editorial sections
   ------------------------------------------------------------- */
body.home main p,
body.home main h1,
body.home main h2,
body.home main h3,
body.home main .subtitle,
body.home main .eyebrow {
  text-align: center;
}
body.home main .btn-row { justify-content: center; }
body.home .feature-body p,
body.home .program-card p,
body.home .pub-body p {
  margin-inline: auto;
}

.press-location { color: var(--text-dim); font-style: italic; font-size: 0.95rem; }

/* Editorial values — horizontal card slider (reader-controlled) */
.values-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
.values-intro h2 {
  color: var(--title);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 0.4rem;
}
.values-intro p { color: var(--text-dim); margin: 0; }

.values-nav { display: flex; gap: 0.6rem; }
.values-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--title);
  background: rgba(242, 243, 248, 0.05);
  border: 1px solid rgba(242, 243, 248, 0.35);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.values-nav-btn:hover:not(:disabled),
.values-nav-btn:focus-visible:not(:disabled) {
  background: rgba(242, 243, 248, 0.12);
  border-color: var(--title);
}
.values-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.values-slider { width: 100%; }
.values-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0.35rem 0 1.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--panel-edge) transparent;
}
.values-track:focus-visible {
  outline: 2px solid var(--title);
  outline-offset: 4px;
}
.value-card {
  flex: 0 0 clamp(260px, 38%, 340px);
  scroll-snap-align: start;
  padding: 1.5rem 1.4rem 1.7rem;
  background: linear-gradient(180deg, var(--panel), var(--field-deep));
  border: var(--rule);
  border-radius: 8px;
  min-height: 11rem;
  text-align: center;
}
.value-card h3 {
  color: var(--title);
  font-weight: 500;
  font-size: 1.15rem;
  margin: 0 0 0.7rem;
}
.value-card p { color: var(--text-dim); margin: 0; line-height: 1.65; }

@media (prefers-reduced-motion: reduce) {
  .values-track { scroll-behavior: auto; }
}
@media (max-width: 720px) {
  .value-card { flex-basis: min(78vw, 300px); }
}

/* Repeatable research-program card */
.program-card {
  padding: clamp(2rem, 4vw, 3rem);
  background: linear-gradient(140deg, var(--panel), var(--field-deep));
  border: var(--rule);
  border-radius: 12px;
  text-align: center;
}
.program-card h3 {
  color: var(--title);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 1rem;
}
.program-card p { color: var(--text); max-width: var(--measure); margin: 0 auto 1.6rem; }
.program-card .btn-row { justify-content: center; }
.program-card + .program-card { margin-top: 2rem; }

/* Closing band: section links above the signup form */
.closing-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.8rem;
  color: var(--text-dim);
}
.closing-links a {
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
  text-transform: uppercase;
  transition: color 0.2s ease;
}
.closing-links a:hover,
.closing-links a:focus-visible { color: var(--gold-bright); }

/* -------------------------------------------------------------
   Buttons
   ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.7rem;
  border-radius: 2px;
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn-primary {
  background: rgba(242, 243, 248, 0.07);
  color: var(--title);
  border: 1px solid rgba(242, 243, 248, 0.5);
}
.btn-primary:hover {
  border-color: var(--title);
  background: rgba(242, 243, 248, 0.13);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--panel-edge);
}
.btn-ghost:hover {
  border-color: var(--text-dim);
  color: var(--title);
  transform: translateY(-2px);
}
.btn-row { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

/* -------------------------------------------------------------
   Section headings
   ------------------------------------------------------------- */
.section-head { text-align: center; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--title);
  font-weight: 500;
  margin: 0.8rem 0 0.6rem;
}
.section-head p { color: var(--text-dim); max-width: 58ch; margin: 0 auto; }

/* -------------------------------------------------------------
   Featured publication (asymmetric: cover + copy)
   ------------------------------------------------------------- */
.feature {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) 1.15fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.feature.reverse { grid-template-columns: 1.15fr minmax(240px, 0.85fr); }
.feature.reverse .feature-cover { order: 2; }

.feature-cover {
  position: relative;
  perspective: 1600px;
}
.feature-cover img {
  width: 100%;
  max-width: 420px;
  display: block;
  margin-inline: auto;
  border-radius: 6px;
  box-shadow:
    0 30px 60px rgba(0,0,0,0.6),
    0 0 0 1px rgba(216,184,120,0.18),
    0 0 60px rgba(216,184,120,0.12);
  transition: transform 0.5s cubic-bezier(0.2,0.7,0.2,1);
}
.feature-cover img:hover { transform: rotateY(-8deg) translateY(-6px); }
/* soft aura behind the cover */
.feature-cover::after {
  content: "";
  position: absolute;
  inset: 8% 12%;
  z-index: -1;
  background: radial-gradient(circle at 50% 40%, rgba(216,184,120,0.22), transparent 70%);
  filter: blur(30px);
}

.feature-body .eyebrow { margin-bottom: 0.6rem; }
.feature-body h3 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  color: var(--title);
  margin: 0.3rem 0 0.4rem;
  font-weight: 500;
  line-height: 1.1;
}
.feature-body .subtitle {
  font-style: italic;
  color: var(--ivory);
  font-size: 1.2rem;
  margin: 0 0 1.4rem;
}
.feature-body p { color: var(--text); max-width: var(--measure); }
.feature-body .btn-row { justify-content: flex-start; margin-top: 1.8rem; }
body.home .feature-body { text-align: center; }
body.home .feature-body .btn-row { justify-content: center; }
body.home .feature-body p { margin-inline: auto; }

.pill {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ivory);
  border: 1px solid rgba(233, 230, 220, 0.45);
  border-radius: 100px;
  padding: 0.3rem 0.9rem;
  margin-bottom: 1.2rem;
}
.pill.upcoming { color: #a9d8c6; border-color: #3c6a58; }

/* -------------------------------------------------------------
   Catalog grid (fallback) — same fixed card width as the track,
   centered so sparse rows don't pack left.
   ------------------------------------------------------------- */
.catalog {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.catalog .book-card {
  flex: 0 0 300px;
  width: 300px;
  max-width: 100%;
}
.book-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: linear-gradient(180deg, var(--panel), var(--field-deep));
  border: var(--rule);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.book-card:hover,
.book-card:focus-visible,
.book-card:focus-within {
  transform: translateY(-6px);
  border-color: var(--text-dim);
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}
.book-card .cover-frame {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--field-deep);
}
.book-card .cover-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-card .card-body { padding: 1rem 1.15rem 1.2rem; }
.book-card .card-vol { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ivory); }
.book-card .card-title { color: var(--title); font-size: 1.2rem; margin: 0.35rem 0 0.25rem; }
.book-card .card-sub { color: var(--text-dim); font-style: italic; font-size: 0.92rem; }
.book-card .card-blurb {
  margin: 0.65rem 0 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}
.book-card .card-status {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--title);
}
.book-card .card-status.upcoming { color: #a9d8c6; }

/* -------------------------------------------------------------
   Home page catalog slideshow
   Reuses .book-card in a horizontal scroll-snap track. The nav
   arrows stay hidden until js/main.js counts more than three books.
   ------------------------------------------------------------- */
.catalog-track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0.25rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--panel-edge) transparent;
}
.catalog-track:focus-visible {
  outline: 2px solid var(--title);
  outline-offset: 4px;
}
/* Fixed 300px cards so home, catalog, and series rows match.
   Track centers while the row fits; extras scroll. */
.catalog-track .book-card {
  flex: 0 0 300px;
  width: 300px;
  min-width: 300px;
  scroll-snap-align: start;
}
/* Pull the heading closer to the cards than the site-wide default,
   so it sits inside the same viewport as the row. */
#catalog .section-head { margin-bottom: 1.5rem; }
#catalog.section { padding-top: clamp(2.5rem, 4vw, 4rem); }
/* Centered while the row fits; falls back to flow-start once it scrolls. */
.catalog-track { justify-content: safe center; }
/* Cards with a store button split into an inner page link + actions
   footer, since links cannot nest. */
.book-card .card-link {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  text-decoration: none;
}
.book-card .card-actions {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
  margin-top: auto;
  padding: 0 1.2rem 1.3rem;
}
.card-amazon {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--title);
  text-decoration: none;
  background: rgba(242, 243, 248, 0.07);
  border: 1px solid rgba(242, 243, 248, 0.5);
  border-radius: 2px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.card-amazon:hover,
.card-amazon:focus-visible {
  border-color: var(--title);
  background: rgba(242, 243, 248, 0.13);
}
/* quieter companion to .card-amazon — leads to the book's own page */
.card-more {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--panel-edge);
  border-radius: 2px;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.card-more:hover,
.card-more:focus-visible {
  border-color: var(--title);
  color: var(--title);
  background: rgba(242, 243, 248, 0.07);
}
.catalog-nav {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1.2rem;
}
.catalog-nav[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .catalog-track { scroll-behavior: auto; }
}
@media (max-width: 720px) {
  .catalog-track .book-card,
  .catalog .book-card {
    flex-basis: min(85vw, 300px);
    width: min(85vw, 300px);
    min-width: 280px;
  }
}

/* -------------------------------------------------------------
   Author section
   ------------------------------------------------------------- */
.author {
  display: grid;
  grid-template-columns: minmax(200px, 300px) 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  background: linear-gradient(140deg, var(--panel), var(--field-deep));
  border: var(--rule);
  border-radius: 12px;
  padding: clamp(2rem, 5vw, 3.5rem);
}
.author-photo {
  filter: grayscale(100%) contrast(1.08);
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 20px 45px rgba(0,0,0,0.55), 0 0 0 1px rgba(242,243,248,0.18);
  aspect-ratio: 683 / 1024;
  object-fit: cover;
}
.author-body h2 { color: var(--title); font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0.4rem 0 0.3rem; font-weight: 500; }
.author-body .credential { color: var(--ivory); font-style: italic; margin-bottom: 1.2rem; }
.author-body p { color: var(--text); }

/* -------------------------------------------------------------
   Footer
   ------------------------------------------------------------- */
.site-footer {
  border-top: var(--rule);
  background: var(--field-deep);
  padding: clamp(2.5rem, 5vw, 4rem) 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
}
.footer-grid h4 {
  color: var(--ivory);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0 0 1rem;
}
.footer-grid a { display: block; color: var(--text-dim); text-decoration: none; margin-bottom: 0.6rem; transition: color 0.2s; }
.footer-grid a:hover { color: var(--title); }
.footer-brand { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1rem; }
.footer-brand img { width: 40px; height: 40px; filter: drop-shadow(0 0 8px rgba(242,243,248,0.25)); }
.footer-brand span { font-size: 1.2rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--title); }
.footer-tag { color: var(--text-dim); font-style: italic; max-width: 40ch; font-size: 0.95rem; }
.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: var(--rule);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* -------------------------------------------------------------
   Publication (book) page
   ------------------------------------------------------------- */
.pub-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) 1.1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding: clamp(1rem, 2.5vw, 1.75rem) 0 clamp(2rem, 5vw, 4rem);
}
.pub-hero .feature-cover img { max-width: 460px; }
.pub-hero > div:not(.feature-cover) { text-align: center; }
.pub-hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  color: var(--title);
  font-weight: 500;
  line-height: 1.08;
  margin: 0.5rem 0 0.4rem;
}
.pub-hero .subtitle { font-style: italic; color: var(--ivory); font-size: clamp(1.1rem,2.5vw,1.4rem); margin: 0 0 1rem; }
.pub-hero .byline { color: var(--text-dim); letter-spacing: 0.1em; margin-bottom: 1.6rem; }

.pub-body { max-width: var(--measure); margin-inline: auto; }
.pub-body h2 {
  color: var(--title);
  font-weight: 500;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin: 2.6rem 0 0.8rem;
}
.pub-body p { color: var(--text); margin: 0 0 1.2rem; }
.pub-body ul { list-style: none; padding: 0; margin: 0 0 1.4rem; }
.pub-body li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: 1rem;
  color: var(--text);
}
.pub-body li::before {
  content: "\2726"; /* four-pointed star */
  position: absolute;
  left: 0;
  top: 0.05em;
  color: var(--ivory);
}
/* lead-in terms in starred lists */
.pub-body li strong { color: var(--title); font-weight: 600; }
.pub-body blockquote {
  border-left: 2px solid var(--text-dim);
  margin: 2rem 0;
  padding: 0.6rem 0 0.6rem 1.6rem;
  font-style: italic;
  color: var(--text);
  font-size: 1.15rem;
}
.divider-star {
  text-align: center;
  color: var(--ivory);
  letter-spacing: 1.2em;
  margin: 3rem 0;
  opacity: 0.7;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.back-link:hover { color: var(--title); }
.back-link-top { margin: clamp(1.25rem, 3vw, 2rem) 0 0; }

/* meta chips on pub page */
.pub-meta { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 1.6rem 0; }
.pub-meta div { border-left: 1px solid var(--panel-edge); padding-left: 1rem; }
.pub-meta dt { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ivory); margin-bottom: 0.25rem; }
.pub-meta dd { margin: 0; color: var(--text); }

/* -------------------------------------------------------------
   Reveal on scroll
   ------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* -------------------------------------------------------------
   Responsive
   ------------------------------------------------------------- */
@media (max-width: 860px) {
  .feature, .feature.reverse { grid-template-columns: 1fr; text-align: center; }
  .feature.reverse .feature-cover { order: 0; }
  .feature-body .btn-row { justify-content: center; }
  .feature-body p { margin-inline: auto; }
  .author { grid-template-columns: 1fr; text-align: center; }
  .author-photo { max-width: 260px; margin-inline: auto; }
  .pub-hero { grid-template-columns: 1fr; text-align: center; }
  .pub-meta { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { gap: 1rem; }
}
@media (max-width: 640px) {
  /* Brand + links don't fit on one row; wrap the links to a second
     centered row instead of letting them overflow off-screen. */
  .nav { flex-wrap: wrap; justify-content: center; row-gap: 0.15rem; padding: 0.7rem 0; }
  .nav-links { flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .nav-links a.nav-hide { display: none; }
  /* Tighten the wrapped nav row so all four links fit on one line
     even at 320px-wide screens. */
  .nav-links { gap: 0.8rem; }
  .nav-links a, .nav-drop-btn { font-size: 0.92rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
}

/* -------------------------------------------------------------
   Contact form
   ------------------------------------------------------------- */
.contact-panel { align-items: start; }
.contact-panel .author-body { text-align: left; }
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
  max-width: 36rem;
}
.contact-field label {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ivory);
  margin-bottom: 0.4rem;
}
.contact-field .req { color: var(--gold-bright); }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  padding: 0.85rem 1.1rem;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--title);
  background: rgba(6, 7, 13, 0.7);
  border: 1px solid var(--panel-edge);
  border-radius: 2px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.contact-form textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--text-dim); opacity: 0.8; }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--title);
  box-shadow: 0 0 0 3px rgba(242, 243, 248, 0.18);
}
.contact-status { min-height: 1.5em; margin: 0 0 0.5rem; font-style: italic; }
.contact-status.ok { color: #a9d8c6; }
.contact-status.err { color: #e8a9a9; }
@media (max-width: 768px) {
  .contact-panel { text-align: center; }
  .contact-panel .author-body { text-align: center; }
  .contact-form { margin-inline: auto; }
  .contact-panel .btn-row { justify-content: center; }
}

/* HTTPForms embed — match site dark theme */
.httpform-mount { margin-top: 1.5rem; max-width: 36rem; }
.httpform-mount .httpform-container {
  font-family: var(--serif) !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.httpform-mount .httpform-container > h3 { display: none; }
.httpform-mount .httpform-container label,
.httpform-mount .httpform-container div[style*="font-weight: bold"] {
  font-size: 0.82rem !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: var(--ivory) !important;
  font-weight: 400 !important;
}
.httpform-mount .httpform-container input[type="text"],
.httpform-mount .httpform-container input[type="email"],
.httpform-mount .httpform-container input[type="tel"],
.httpform-mount .httpform-container textarea,
.httpform-mount .httpform-container select {
  width: 100% !important;
  padding: 0.85rem 1.1rem !important;
  font-family: var(--serif) !important;
  font-size: 1rem !important;
  color: var(--title) !important;
  background: rgba(6, 7, 13, 0.7) !important;
  border: 1px solid var(--panel-edge) !important;
  border-radius: 2px !important;
}
.httpform-mount .httpform-container textarea { min-height: 140px !important; }
.httpform-mount .httpform-container button[type="submit"] {
  display: inline-flex !important;
  align-items: center !important;
  font-family: var(--serif) !important;
  font-size: 1rem !important;
  letter-spacing: 0.08em !important;
  padding: 0.85rem 1.7rem !important;
  border-radius: 2px !important;
  border: 1px solid rgba(242, 243, 248, 0.5) !important;
  background: rgba(242, 243, 248, 0.07) !important;
  color: var(--title) !important;
  cursor: pointer !important;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease !important;
}
.httpform-mount .httpform-container button[type="submit"]:hover {
  border-color: var(--title) !important;
  background: rgba(242, 243, 248, 0.13) !important;
  transform: translateY(-2px) !important;
}
