/* ============================================================
   QUINLAN — author site
   Type system: display/body serif pairing quotes the books'
   own production faces (Palatino via mathpazo, Charter),
   with a monospace face for dates, counts and status — the
   same instrumentation vocabulary the Physics series uses
   for its "scale ladder".
   ============================================================ */

:root{
  --font-display: "Palatino Linotype", Palatino, "URW Palladio L", "Book Antiqua", "Iowan Old Style", Georgia, serif;
  --font-body: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Avenir Next", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --ink:        #14161c;
  --paper:      #eceeec;
  --paper-raised: #ffffff;

  /* Deliberately theme-independent. --ink and --paper swap between light and
     dark because they mean "ink" and "paper", not "dark" and "light". The hero
     is a night sky and the cover letterbox mattes artwork; both must stay dark
     in either theme, so they take this and never var(--ink). Defining it once
     here and never in the theme blocks is what keeps it fixed. */
  --night:      #14161c;
  --line:       rgba(20,22,28,0.14);
  --line-soft:  rgba(20,22,28,0.08);
  --text:       #1c1f26;
  --text-soft:  rgba(28,31,38,0.64);
  --text-faint: rgba(28,31,38,0.42);

  --brass:      #a8813c;
  --brass-soft: rgba(168,129,60,0.14);
  --brass-line: rgba(168,129,60,0.5);

  --shelf-anthro:       #2f6f68;
  --shelf-anthro-soft:  rgba(47,111,104,0.12);
  --shelf-physics:      #4d4a86;
  --shelf-physics-soft: rgba(77,74,134,0.12);
  --shelf-scifi:        #4b515c;
  --shelf-scifi-spark:  #a35950;
  --shelf-scifi-soft:   rgba(75,81,92,0.12);
  --shelf-novels:       #3c5266;
  --shelf-novels-spark: #b3893f;
  --shelf-novels-soft:  rgba(60,82,102,0.12);

  --shadow: 0 1px 2px rgba(20,22,28,0.06), 0 12px 28px -18px rgba(20,22,28,0.35);
  --radius: 3px;
}

@media (prefers-color-scheme: dark){
  :root{
    --ink:        #eceeec;
    --paper:      #101217;
    --paper-raised: #171a21;
    --line:       rgba(236,238,236,0.14);
    --line-soft:  rgba(236,238,236,0.08);
    --text:       #e6e7e4;
    --text-soft:  rgba(230,231,228,0.66);
    --text-faint: rgba(230,231,228,0.44);

    --brass:      #d3ab6c;
    --brass-soft: rgba(211,171,108,0.14);
    --brass-line: rgba(211,171,108,0.45);

    --shelf-anthro:       #6bb0a6;
    --shelf-anthro-soft:  rgba(107,176,166,0.14);
    --shelf-physics:      #9491d1;
    --shelf-physics-soft: rgba(148,145,209,0.14);
    --shelf-scifi:        #a4aab3;
    --shelf-scifi-spark:  #cf8a82;
    --shelf-scifi-soft:   rgba(164,170,179,0.14);
    --shelf-novels:       #8ca9bd;
    --shelf-novels-spark: #e0bd82;
    --shelf-novels-soft:  rgba(140,169,189,0.14);

    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 16px 32px -18px rgba(0,0,0,0.6);
  }
}

:root[data-theme="dark"]{
  --ink:        #eceeec;
  --paper:      #101217;
  --paper-raised: #171a21;
  --line:       rgba(236,238,236,0.14);
  --line-soft:  rgba(236,238,236,0.08);
  --text:       #e6e7e4;
  --text-soft:  rgba(230,231,228,0.66);
  --text-faint: rgba(230,231,228,0.44);
  --brass:      #d3ab6c;
  --brass-soft: rgba(211,171,108,0.14);
  --brass-line: rgba(211,171,108,0.45);
  --shelf-anthro:       #6bb0a6;
  --shelf-anthro-soft:  rgba(107,176,166,0.14);
  --shelf-physics:      #9491d1;
  --shelf-physics-soft: rgba(148,145,209,0.14);
  --shelf-scifi:        #a4aab3;
  --shelf-scifi-spark:  #cf8a82;
  --shelf-scifi-soft:   rgba(164,170,179,0.14);
  --shelf-novels:       #8ca9bd;
  --shelf-novels-spark: #e0bd82;
  --shelf-novels-soft:  rgba(140,169,189,0.14);
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 16px 32px -18px rgba(0,0,0,0.6);
}

:root[data-theme="light"]{
  --ink:        #14161c;
  --paper:      #eceeec;
  --paper-raised: #ffffff;
  --line:       rgba(20,22,28,0.14);
  --line-soft:  rgba(20,22,28,0.08);
  --text:       #1c1f26;
  --text-soft:  rgba(28,31,38,0.64);
  --text-faint: rgba(28,31,38,0.42);
  --brass:      #a8813c;
  --brass-soft: rgba(168,129,60,0.14);
  --brass-line: rgba(168,129,60,0.5);
  --shelf-anthro:       #2f6f68;
  --shelf-anthro-soft:  rgba(47,111,104,0.12);
  --shelf-physics:      #4d4a86;
  --shelf-physics-soft: rgba(77,74,134,0.12);
  --shelf-scifi:        #4b515c;
  --shelf-scifi-spark:  #a35950;
  --shelf-scifi-soft:   rgba(75,81,92,0.12);
  --shelf-novels:       #3c5266;
  --shelf-novels-spark: #b3893f;
  --shelf-novels-soft:  rgba(60,82,102,0.12);
  --shadow: 0 1px 2px rgba(20,22,28,0.06), 0 12px 28px -18px rgba(20,22,28,0.35);
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *, *::before, *::after{ animation-duration:0.001ms !important; animation-iteration-count:1 !important; transition-duration:0.001ms !important; scroll-behavior:auto !important; }
}

body{
  margin:0;
  background:var(--paper);
  color:var(--text);
  font-family:var(--font-body);
  font-size:17px;
  line-height:1.62;
  -webkit-font-smoothing:antialiased;
}

a{ color:inherit; }
h1,h2,h3,h4{ font-family:var(--font-display); font-weight:700; text-wrap:balance; margin:0; }
p{ margin:0; }
img{ max-width:100%; display:block; }
:focus-visible{ outline:2px solid var(--brass); outline-offset:3px; }

.container{ max-width:1180px; margin:0 auto; padding:0 28px; }

/* ---------- top nav ---------- */
.site-nav{
  position:sticky; top:0; z-index:50;
  background:color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter:saturate(140%) blur(10px);
  border-bottom:1px solid var(--line-soft);
}
.site-nav .container{ display:flex; align-items:center; justify-content:space-between; height:64px; }
.wordmark{ font-family:var(--font-display); font-weight:700; font-size:1.05rem; letter-spacing:0.04em; text-decoration:none; }
.nav-links{ display:flex; gap:2rem; list-style:none; margin:0; padding:0; }
.nav-links a{
  text-decoration:none; font-family:var(--font-sans); font-size:0.82rem;
  letter-spacing:0.08em; text-transform:uppercase; color:var(--text-soft);
  padding:0.4rem 0; border-bottom:1px solid transparent;
  transition:color 0.15s ease, border-color 0.15s ease;
}
.nav-links a:hover{ color:var(--text); border-color:var(--brass-line); }
.nav-toggle{ display:none; }

/* ---------- hero ---------- */
.hero{
  background:
    radial-gradient(ellipse 60% 50% at 20% -10%, rgba(211,171,108,0.10), transparent 60%),
    var(--night);
  color:#eceeec;
  padding:5.5rem 0 4rem;
  position:relative;
  overflow:hidden;
}
.hero::after{
  content:"";
  position:absolute; inset:0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 82% 15%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 68% 42%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1.5px 1.5px at 30% 68%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 90% 78%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 50% 8%, rgba(255,255,255,0.35), transparent);
  pointer-events:none;
  opacity:0.7;
}
.hero .container{ position:relative; }
.eyebrow{
  font-family:var(--font-sans); font-size:0.78rem; letter-spacing:0.14em; text-transform:uppercase;
  color:#d3ab6c; margin-bottom:1rem; display:block;
}
.hero h1{ font-size:clamp(2.6rem, 6vw, 4rem); letter-spacing:0.01em; color:#f4f0e8; }
.hero .dek{
  font-family:var(--font-body); font-size:1.18rem; line-height:1.55; color:rgba(244,240,232,0.82);
  max-width:640px; margin-top:1.1rem;
}

/* ---------- the ruler ---------- */
.ruler-wrap{ margin-top:4.2rem; padding-top:0.5rem; }
.ruler-track{
  position:relative;
  height:2px;
  background:linear-gradient(90deg, rgba(244,240,232,0.15), rgba(244,240,232,0.4) 4%, rgba(244,240,232,0.4) 96%, rgba(244,240,232,0.15));
  margin:0 6px;
}
.ruler-mark{
  position:absolute; top:0; transform:translateX(-50%);
  text-decoration:none; display:flex; flex-direction:column; align-items:center;
  color:inherit;
}
.ruler-mark.align-start{ transform:translateX(0); align-items:flex-start; }
.ruler-mark.align-end{ transform:translateX(-100%); align-items:flex-end; }
.ruler-tick{
  position:relative; top:-4px;
  width:9px; height:9px; border-radius:50%; flex:none;
  background:var(--paper); border:2px solid #d3ab6c;
  box-shadow:0 0 0 4px var(--night);
  transition:transform 0.15s ease;
}
.ruler-mark:hover .ruler-tick{ transform:scale(1.3); }
.ruler-label{ display:flex; flex-direction:column; gap:0.15rem; }
/* Desktop track: labels are pulled out of flow so an "above" mark's text
   sits fully above the tick and a "below" mark's fully below it — marks
   only ~5% apart on the ruler would otherwise land in the same vertical
   band (flex `order` alone doesn't move the box, just the paint order)
   and their text would overlap. */
.ruler-track .ruler-label{
  position:absolute; left:50%; transform:translateX(-50%);
}
.ruler-track .ruler-mark.align-start .ruler-label{ left:0; transform:none; }
.ruler-track .ruler-mark.align-end .ruler-label{ left:auto; right:0; transform:none; }
.ruler-track .ruler-mark[data-pos="above"] .ruler-label{ bottom:calc(100% + 0.6rem); }
.ruler-track .ruler-mark[data-pos="below"] .ruler-label{ top:calc(100% + 0.6rem); }
.ruler-label strong{
  font-family:var(--font-mono); font-size:0.92rem; color:#f4f0e8; white-space:nowrap;
}
.ruler-label small{
  font-family:var(--font-sans); font-size:0.72rem; letter-spacing:0.03em; color:rgba(244,240,232,0.58); white-space:nowrap;
}

.hero-note{
  max-width:680px; margin-top:3rem; padding-top:2rem; border-top:1px solid rgba(244,240,232,0.16);
  font-size:1.02rem; color:rgba(244,240,232,0.78); line-height:1.68;
}
.hero-note strong{ color:#f4f0e8; font-weight:600; }

/* ---------- shelves ---------- */
.shelf{ padding:5rem 0; border-bottom:1px solid var(--line-soft); }
.shelf:last-of-type{ border-bottom:none; }
.shelf-head{ max-width:760px; margin-bottom:3rem; }
.shelf-kicker{
  font-family:var(--font-mono); font-size:0.78rem; letter-spacing:0.1em; text-transform:uppercase;
  display:inline-flex; align-items:center; gap:0.55rem; margin-bottom:0.9rem;
}
.shelf-kicker::before{ content:""; width:22px; height:2px; background:currentColor; display:inline-block; }
.shelf-head h2{ font-size:clamp(1.8rem, 3.4vw, 2.4rem); margin-bottom:0.9rem; }
.shelf-head p{ color:var(--text-soft); font-size:1.05rem; max-width:66ch; }

/* The pen name for this shelf. Three names, one surname. */
.shelf-head p.shelf-byline{
  font-family:var(--font-mono); font-size:0.8rem; letter-spacing:0.04em;
  text-transform:uppercase; color:var(--text-soft); opacity:0.75;
  margin-top:-0.4rem; margin-bottom:1rem;
}
.shelf-head p.shelf-byline strong{ font-weight:700; opacity:1; }

#anthropology .shelf-kicker{ color:var(--shelf-anthro); }
#physics .shelf-kicker{ color:var(--shelf-physics); }
#scifi .shelf-kicker{ color:var(--shelf-scifi-spark); }
#novels .shelf-kicker{ color:var(--shelf-novels-spark); }

#anthropology .shelf-byline strong{ color:var(--shelf-anthro); }
#physics .shelf-byline strong{ color:var(--shelf-physics); }
#scifi .shelf-byline strong{ color:var(--shelf-scifi-spark); }
#novels .shelf-byline strong{ color:var(--shelf-novels-spark); }

.shelf-banner{
  display:flex; align-items:center; gap:2rem; margin-bottom:3rem;
  padding:1.6rem; border:1px solid var(--line); border-radius:var(--radius);
  background:var(--paper-raised);
}
.shelf-banner img{ width:96px; flex:none; box-shadow:var(--shadow); }
.shelf-banner p{ color:var(--text-soft); font-size:0.98rem; }
.shelf-banner p strong{ color:var(--text); font-family:var(--font-display); font-size:1.05rem; display:block; margin-bottom:0.3rem; }

/* book grid + cards */
.book-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:2.2rem;
}
.book-card{
  display:flex; flex-direction:column; gap:1rem;
  opacity:0; transform:translateY(14px);
  transition:opacity 0.5s ease, transform 0.5s ease;
}
.book-card.is-visible{ opacity:1; transform:translateY(0); }
@media (prefers-reduced-motion: reduce){
  .book-card{ opacity:1; transform:none; }
}

.cover{
  position:relative; aspect-ratio:2/3; overflow:hidden;
  box-shadow:var(--shadow); border-radius:2px;
  background:var(--night);
}
.cover img{ width:100%; height:100%; object-fit:cover; }

.cover.placeholder{
  display:flex; flex-direction:column; justify-content:space-between;
  padding:1.3rem; color:#f2f0ea;
}
.cover.placeholder .plate-eyebrow{
  font-family:var(--font-mono); font-size:0.62rem; letter-spacing:0.14em; text-transform:uppercase; opacity:0.7;
}
.cover.placeholder h3{
  font-size:1.35rem; line-height:1.18; color:#f6f4ef;
}
.cover.placeholder .plate-sub{
  font-family:var(--font-sans); font-size:0.68rem; letter-spacing:0.08em; text-transform:uppercase; opacity:0.75; margin-top:0.5rem;
}
.cover.placeholder .plate-motif{ opacity:0.55; }
.cover.placeholder .plate-rule{ width:28px; height:2px; background:#d3ab6c; margin-bottom:0.7rem; }

.cover-anthro.placeholder{ background:linear-gradient(160deg, var(--shelf-anthro), #16302c 78%); }
.cover-physics.placeholder{ background:linear-gradient(160deg, var(--shelf-physics), #201f3a 78%); }
.cover-scifi.placeholder{ background:linear-gradient(160deg, #2c2f36, #100e10 82%); }

.cover-howmatter{ background:#16302c url("../covers/howmatter-motif.png") center 38% / 150% no-repeat; position:relative; }
.cover-howmatter::before{ content:""; position:absolute; inset:0; background:linear-gradient(180deg, rgba(16,20,18,0.35), rgba(12,15,14,0.92) 78%); }
.cover-howmatter > *{ position:relative; }

.book-meta{ display:flex; flex-wrap:wrap; gap:0.5rem; align-items:center; }
.chip{
  font-family:var(--font-mono); font-size:0.68rem; letter-spacing:0.04em;
  padding:0.22rem 0.55rem; border-radius:20px; border:1px solid var(--line);
  color:var(--text-soft); white-space:nowrap;
}
/* Status chips, three states and they are meant to read at a glance:
     published    filled in the shelf colour  — you can buy it
     preparation  outlined in the shelf colour — it is next
     planning     plain outline, faint         — it is coming
   Preparation sits deliberately between the other two: same hue as published so
   the eye groups them, no fill so it never reads as available. */
.chip.status{ border-color:transparent; }
.chip.status.status-published{ background:var(--shelf-anthro-soft); color:var(--shelf-anthro); }
.chip.status.status-preparation{ background:transparent; border-color:currentColor; }
.chip.status.status-planning{ border-color:var(--line); color:var(--text-faint); background:transparent; }

#anthropology .chip.status.status-published{ background:var(--shelf-anthro-soft); color:var(--shelf-anthro); }
#anthropology .chip.status.status-preparation{ color:var(--shelf-anthro); }
#physics .chip.status.status-published{ background:var(--shelf-physics-soft); color:var(--shelf-physics); }
#physics .chip.status.status-preparation{ color:var(--shelf-physics); }
#scifi .chip.status.status-published{ background:var(--shelf-scifi-soft); color:var(--shelf-scifi-spark); }
#scifi .chip.status.status-preparation{ color:var(--shelf-scifi-spark); }
#novels .chip.status.status-published{ background:var(--shelf-novels-soft); color:var(--shelf-novels-spark); }
#novels .chip.status.status-preparation{ color:var(--shelf-novels-spark); }

.book-card h3.title{ font-size:1.28rem; line-height:1.28; }
.book-card .subtitle{ font-family:var(--font-body); font-style:italic; color:var(--text-soft); font-size:0.95rem; margin-top:0.25rem; }
.book-card .blurb{ font-size:0.96rem; color:var(--text-soft); line-height:1.6; }
.book-card .byline{ font-family:var(--font-mono); font-size:0.76rem; color:var(--text-faint); }

.figures-link{
  display:inline-flex; align-items:center; gap:0.4rem;
  font-family:var(--font-mono); font-size:0.74rem; letter-spacing:0.03em;
  color:var(--text-soft); text-decoration:none;
  padding-top:0.15rem;
  border-top:1px solid var(--line-soft);
  margin-top:0.2rem;
  transition:color 0.15s ease;
}
.figures-link::before{ content:"↓"; color:var(--brass); font-family:var(--font-sans); }
.figures-link:hover{ color:var(--text); }

/* series intro card variant for sci-fi/novels lead card */
.book-card.lead .cover{ background:var(--night); }

/* ---------- volume list (Before the Engines) ----------
   Twenty-one volumes is too many for cover cards: the grid stops being a
   shelf and becomes a wall. A numbered list reads as what the series is —
   a reference run — and keeps the status legible per volume. */
.vol-list-wrap{ border-top:1px solid var(--line); }
.vol-list{ list-style:none; margin:0; padding:0;
  columns:2; column-gap:3rem; }
.vol-list li{
  display:flex; align-items:baseline; gap:0.8rem;
  padding:0.62rem 0; border-bottom:1px solid var(--line-soft);
  break-inside:avoid;
}
.vol-list .vol-no{
  font-family:var(--font-mono); font-size:0.82rem; color:var(--text-faint);
  flex:none; min-width:1.9em;
}
.vol-list .vol-title{
  font-family:var(--font-display); font-size:1.04rem; color:var(--text);
  flex:1 1 auto;
}
.vol-list .chip.status{ flex:none; }
#engines .chip.status.status-preparation{ color:var(--brass); }
@media (max-width:760px){ .vol-list{ columns:1; } }

/* ---------- footer ---------- */
footer{ padding:3.5rem 0 4rem; }
footer .container{ display:flex; flex-direction:column; gap:0.6rem; }
footer p{ font-size:0.85rem; color:var(--text-faint); }
footer .colophon{ max-width:60ch; }

/* ---------- responsive ---------- */
@media (max-width:760px){
  .nav-links{ gap:1.1rem; }
  .nav-links a{ font-size:0.72rem; }
  .hero{ padding:3.6rem 0 3rem; }
  .ruler-wrap{ margin-top:2.6rem; }
  .ruler-track{ display:none; }
  .ruler-list{ display:flex; flex-direction:column; gap:1rem; }
  .ruler-list .ruler-mark{
    position:static; transform:none; flex-direction:row; align-items:baseline; gap:0.7rem;
  }
  .ruler-list .ruler-tick{ box-shadow:none; }
  .shelf{ padding:3.4rem 0; }
  .shelf-banner{ flex-direction:column; align-items:flex-start; }
  .shelf-banner img{ width:120px; }
}
@media (min-width:761px){
  .ruler-list{ display:none; }
}
