/* ============================================================
   THE MULTIVERSE OF MARCUS SARVILLE — author site
   Sibling of the Clarke portfolio, not a clone:
   literary-cosmic — the vintage logo up front, Cormorant serif,
   champagne-gold ink, chapter headers, a bookmark ribbon,
   a star cursor. The spinning galaxy stays (it's the house).
   ============================================================ */

/* self-hosted fonts (latin subset) — zero external requests */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../fonts/bricolage-grotesque.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/space-grotesk.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-italic.woff2") format("woff2");
}

:root {
  --bg: #07070f;
  --bg-2: #0d0b16;
  --ink: #f2efe4;
  --muted: #a29eb6;
  --faint: #6f6b84;
  --line: rgba(255, 255, 255, 0.09);
  --card: rgba(255, 255, 255, 0.028);
  --card-hover: rgba(255, 255, 255, 0.055);
  --gold: #e8c67a;
  --gold-bright: #ffd97a;
  --gold-deep: #a97e28;
  --accent: var(--gold);
  --accent-2: #8fb4ff;
  --paper: #f1ebdd;
  --paper-ink: #2b2620;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;
  --radius: 18px;
  --nav-h: 96px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(232, 198, 122, 0.4); color: #fff; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 1000;
  padding: 10px 18px;
  background: var(--gold);
  color: #241a04;
  border-radius: 10px;
  font-weight: 600;
  transition: top 0.25s;
}
.skip-link:focus { top: 12px; }

/* ============ ambient background ============ */

#starfield {
  position: fixed;
  inset: 0;
  z-index: -3;
  display: block;
}

/* the barred spiral — the multiverse's signature */
#galaxy {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(155vmin, 1600px);
  height: min(155vmin, 1600px);
  margin: calc(min(155vmin, 1600px) / -2) 0 0 calc(min(155vmin, 1600px) / -2);
  z-index: -2;
  border-radius: 50%;
  background: url("images/galaxy.jpg") center / cover no-repeat;
  opacity: 0.55;
  filter: saturate(1.2) brightness(0.92);
  -webkit-mask-image: radial-gradient(circle, #000 0%, rgba(0,0,0,0.85) 36%, transparent 70%);
  mask-image: radial-gradient(circle, #000 0%, rgba(0,0,0,0.85) 36%, transparent 70%);
  animation: galaxySpin 240s linear infinite;
  will-change: transform, opacity;
  pointer-events: none;
}
@keyframes galaxySpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
/* soft vignette so text always wins */
#vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 0%, rgba(7, 7, 15, 0.3) 0%, transparent 55%),
    radial-gradient(ellipse 140% 100% at 50% 110%, rgba(7, 7, 15, 0.82) 0%, transparent 60%);
}

/* ============ star cursor ============ */

.cursor-star {
  position: fixed;
  top: 0; left: 0;
  z-index: 9999;
  pointer-events: none;
  font-size: 17px;
  line-height: 1;
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(255, 217, 122, 0.85);
  display: none;
  will-change: transform;
}
body.has-cursor .cursor-star { display: block; }
body.has-cursor,
body.has-cursor a,
body.has-cursor button { cursor: none; }

/* ============ nav ============ */

#site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 48px);
  transition: background 0.35s, border-color 0.35s, backdrop-filter 0.35s;
  border-bottom: 1px solid transparent;
}
#site-nav.scrolled {
  background: rgba(7, 7, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
}
/* the logo in the nav — screen blend lets its starfield-black
   dissolve into whatever is behind the bar */
.brand-logo {
  height: 88px;
  width: auto;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 16px rgba(255, 214, 140, 0.28)) saturate(1.05);
  transition: filter 0.3s;
}
.brand:hover .brand-logo {
  filter: drop-shadow(0 0 26px rgba(255, 214, 140, 0.5)) saturate(1.15);
}

#nav-links { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 30px); }
#nav-links > a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  position: relative;
  transition: color 0.25s;
}
#nav-links > a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--gold-bright), var(--gold-deep));
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
#nav-links > a:not(.btn):hover { color: var(--ink); }
#nav-links > a:not(.btn):hover::after { transform: scaleX(1); }

#nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  z-index: 110;
}
#nav-toggle span {
  width: 24px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
#nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#nav-toggle.open span:nth-child(2) { opacity: 0; }
#nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ buttons ============ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s, border-color 0.25s, color 0.25s;
  will-change: transform;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(120deg, var(--gold-bright), var(--gold-deep));
  color: #241a04;
  box-shadow: 0 6px 24px rgba(232, 198, 122, 0.28);
}
.btn-primary:hover { box-shadow: 0 10px 34px rgba(255, 217, 122, 0.42); }

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.02);
}
.btn-ghost:hover { border-color: rgba(232, 198, 122, 0.55); background: rgba(232, 198, 122, 0.06); }

.btn-sm { padding: 9px 18px; font-size: 13.5px; }

/* nav pills — the id-scoped nav link color would otherwise win over the
   button colors and wash the gold pill out */
#nav-links > a.btn-primary,
#nav-links > a.btn-primary:hover { color: #241a04; }
#nav-links > a.btn-ghost,
#nav-links > a.btn-ghost:hover { color: var(--ink); }

/* ============ hero ============ */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: calc(var(--nav-h) + 40px) 24px 80px;
  position: relative;
}

.hero-status {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 38px;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 0 0 rgba(255, 217, 122, 0.6);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 217, 122, 0.55); }
  70%  { box-shadow: 0 0 0 11px rgba(255, 217, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 217, 122, 0); }
}

/* the name — each line is its own block so the scramble
   decode never reflows the layout */
.tl-line { display: block; }

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 11vw, 8rem);
  line-height: 1.02;
  letter-spacing: 0.005em;
  margin-bottom: 28px;
}
.hero-title .tl-line {
  background: linear-gradient(180deg, #ffffff 20%, #d9c89a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-title .hero-kicker {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--gold);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(0.72rem, 1.6vw, 0.95rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero-title .hero-kicker-sub { margin-bottom: 0; }

.hero-sub {
  font-size: 16px;
  color: var(--muted);
  max-width: 58ch;
  margin-bottom: 40px;
}
.hero-sub em {
  font-style: normal;
  font-weight: 600;
  color: var(--ink);
}
.hero-sub em:nth-of-type(1) { color: var(--gold-bright); }
.hero-sub em:nth-of-type(2) { color: var(--accent-2); }
.hero-sub em:nth-of-type(3) { color: #f79ac0; }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 54px;
}


/* ============ inscription (dedication) ============ */

.inscription {
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(70px, 12vh, 120px) 24px;
}
.ins-orn {
  color: var(--gold);
  font-size: 15px;
  margin-bottom: 24px;
  opacity: 0.85;
}
.ins-text {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.4rem, 3.4vw, 2.1rem);
  line-height: 1.5;
  color: var(--ink);
}
.ins-src {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 24px;
}

/* ============ sections ============ */

.section {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(70px, 10vh, 110px) clamp(20px, 4vw, 48px);
  position: relative;
}

.chap-head {
  text-align: center;
  margin-bottom: 56px;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}
.chap-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.chap-kicker::before,
.chap-kicker::after {
  content: "";
  flex: 0 0 44px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.chap-kicker::after {
  background: linear-gradient(270deg, transparent, var(--gold));
}
.chap-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 3.9rem);
  line-height: 1.08;
  letter-spacing: 0.005em;
  margin-bottom: 14px;
}
.chap-orn {
  color: var(--gold);
  font-size: 14px;
  margin-bottom: 18px;
  opacity: 0.85;
}
.chap-sub {
  color: var(--muted);
  font-size: 16.5px;
  max-width: 60ch;
  margin: 0 auto;
}
.chap-sub b { color: var(--ink); font-weight: 600; }

/* ============ the arc (novels) ============ */

.arc-card {
  --glow: color-mix(in srgb, var(--gold) 20%, transparent);
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 46px 26px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  transition: transform 0.16s ease-out, border-color 0.3s, background 0.3s;
  transform-style: preserve-3d;
  will-change: transform;
}
.arc-card:hover {
  border-color: rgba(232, 198, 122, 0.5);
  background: var(--card-hover);
}
.arc-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 45%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
.arc-card:hover::before { opacity: 1; }
.arc-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  opacity: 0;
  transition: opacity 0.35s;
}
.arc-card:hover::after { opacity: 1; }

.arc-star {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 15px;
  line-height: 1;
  color: var(--gold-bright);
  text-shadow: 0 0 14px rgba(255, 217, 122, 0.9);
}
.arc-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.15rem;
  letter-spacing: 0.005em;
  line-height: 1.05;
}
.arc-desc {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  flex: 1;
}
/* the primary work — one big card */
.arc-primary {
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 36px 30px;
  align-items: center;
  text-align: center;
}
.arc-cover {
  width: 216px;
  max-width: 100%;
  margin: 0 auto;
}
.arc-cover img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  transition: box-shadow 0.35s, border-color 0.35s;
}
.arc-primary:hover .arc-cover img {
  border-color: rgba(232, 198, 122, 0.6);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.6), 0 0 34px var(--glow);
}
.arc-primary .arc-title { font-size: 2.5rem; }
.arc-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #241a04;
  background: var(--gold-bright);
  border-radius: 999px;
  padding: 5px 14px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

/* the journey trilogy — three small books */
.trilogy-head {
  text-align: center;
  max-width: 660px;
  margin: 72px auto 34px;
}
.trilogy-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.6vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: 0.005em;
  margin-bottom: 12px;
}
.trilogy-sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}
.trilogy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}
/* the constellation thread */
.trilogy-grid::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 9%;
  right: 9%;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(232, 198, 122, 0.5) 0 5px, transparent 5px 14px);
  z-index: 0;
}
.trilogy-grid .book { width: auto; }

/* ============ bookshelf ============ */

.bookshelf {
  overflow: hidden;
  padding: 34px 0 24px;
  /* the shelf plank — books sit just above it */
  background:
    linear-gradient(90deg, transparent, rgba(232, 198, 122, 0.16) 8%, rgba(232, 198, 122, 0.16) 92%, transparent)
    0 calc(100% - 21px) / 100% 3px no-repeat;
}
/* the cover stream — constant drift, pauses on hover or touch.
   Margin (not gap) after each book so the -50% loop point lands
   exactly on the clone set. */
.bookshelf-track {
  display: flex;
  align-items: flex-start;
  width: max-content;
  animation: bookshelf 45s linear infinite;
}
.bookshelf-track .book { margin-right: clamp(18px, 2.6vw, 30px); }
.bookshelf:hover .bookshelf-track,
.bookshelf.paused .bookshelf-track { animation-play-state: paused; }
@keyframes bookshelf {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.book {
  --glow: color-mix(in srgb, var(--accent) 30%, transparent);
  position: relative;
  flex: 0 0 auto;
  width: 210px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.16s ease-out;
  will-change: transform;
}
.book-frame { position: relative; }
.book img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  transition: box-shadow 0.35s, border-color 0.35s;
}
.book:hover { transform: translateY(-10px) rotateY(7deg) rotate(-1deg); }
.book:hover img {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.6), 0 0 34px var(--glow);
}
.book-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  text-align: center;
  color: var(--ink);
  line-height: 1.2;
}
.book-line {
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  color: var(--muted);
}

/* ============ a taste (the reader) ============ */

.reader {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}
.reader-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 14px 14px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}
.reader-tab {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  padding: 11px 18px 13px;
  border-radius: 12px 12px 0 0;
  position: relative;
  transition: color 0.25s, background 0.25s;
}
.reader-tab::after {
  content: "";
  position: absolute;
  left: 18px; right: 18px; bottom: -1px;
  height: 2px;
  background: var(--accent, var(--gold));
  transform: scaleX(0);
  transition: transform 0.3s;
}
.reader-tab:hover { color: var(--ink); background: rgba(255, 255, 255, 0.03); }
.reader-tab.active { color: var(--ink); }
.reader-tab.active::after { transform: scaleX(1); }

.reader-page {
  display: none;
  margin: clamp(20px, 4vw, 44px);
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: 6px;
  padding: clamp(28px, 5vw, 56px) clamp(24px, 5.5vw, 64px);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    inset 0 0 60px rgba(120, 96, 60, 0.12);
  position: relative;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17.5px;
  line-height: 1.8;
}
.reader-page.active { display: block; animation: pageIn 0.45s ease-out; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px) rotate(0.2deg); }
  to   { opacity: 1; transform: none; }
}
.reader-page::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 34px;
  background: linear-gradient(90deg, rgba(90, 70, 40, 0.18), transparent);
  border-radius: 6px 0 0 6px;
  pointer-events: none;
}
.reader-book {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}
.reader-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a7a5e;
  margin-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.reader-page p { margin-bottom: 1.1em; }
.reader-page p:last-child { margin-bottom: 0; }
.reader-page .dropcap::first-letter {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.3em;
  float: left;
  line-height: 0.82;
  padding: 5px 10px 0 0;
  color: #6b4a12;
}
.reader-more {
  margin-top: 28px;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #8a7a5e;
  border-top: 1px dashed rgba(120, 96, 60, 0.4);
  padding-top: 16px;
}
.reader-page .scene-break {
  text-align: center;
  margin: 18px 0;
  color: #8a7a5e;
  font-size: 14px;
  letter-spacing: 0.6em;
  text-indent: 0.6em;
}

/* ============ the archive ============ */

.archive-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}
.chip {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  transition: color 0.25s, border-color 0.25s, background 0.25s, transform 0.2s;
}
.chip:hover { color: var(--ink); border-color: rgba(232, 198, 122, 0.5); transform: translateY(-2px); }
.chip.active {
  color: #241a04;
  background: linear-gradient(120deg, var(--gold-bright), var(--gold));
  border-color: transparent;
  font-weight: 700;
}
.chip .chip-count { opacity: 0.65; margin-left: 6px; }

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 22px;
}
.archive-card {
  --accent: var(--accent-2);
  --glow: color-mix(in srgb, var(--accent) 30%, transparent);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.16s ease-out, opacity 0.4s;
  will-change: transform;
}
.archive-card:hover { transform: translateY(-10px); }
.archive-card.is-hidden { display: none; }
.ac-cover { position: relative; }
.ac-cover img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  transition: box-shadow 0.35s, border-color 0.35s;
}
.archive-card:hover .ac-cover img {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.6), 0 0 34px var(--glow);
}
.ac-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.2;
  letter-spacing: 0.005em;
  text-align: center;
  color: var(--ink);
}
.ac-line {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
  text-align: center;
}
/* ============ the author ============ */

.author-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 640px;
  margin: 0 auto 64px;
}
.author-center .artifact { width: min(340px, 78vw); }
.artifact {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #f5f2ea;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  transform: rotate(-1.2deg);
  transition: transform 0.4s;
}
.artifact:hover { transform: rotate(0deg) scale(1.015); }
.artifact img { width: 100%; }
.artifact figcaption {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #6d6353;
  background: #f5f2ea;
  padding: 12px 16px;
  text-align: center;
}
.author-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.1rem;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.author-name small {
  display: block;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 8px;
}
.author-bio {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.22rem;
  line-height: 1.65;
  color: var(--muted);
}
.author-bio b { color: var(--ink); font-weight: 700; }

/* ============ contact ============ */

.contact { text-align: center; max-width: 860px; }
.contact-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 7.5vw, 4.8rem);
  line-height: 1.08;
  letter-spacing: 0.005em;
  margin: 18px 0 20px;
  background: linear-gradient(100deg, #fff 15%, var(--gold) 62%, var(--gold-bright) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.contact-sub { color: var(--muted); font-size: 17px; max-width: 48ch; margin: 0 auto 40px; }
.contact-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 34px;
}
.contact-loc { font-family: var(--font-mono); font-size: 13px; color: var(--faint); }

/* ============ footer ============ */

.footer {
  border-top: 1px solid var(--line);
  padding: 38px clamp(20px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--faint);
  font-size: 13.5px;
  background: rgba(7, 7, 15, 0.5);
  text-align: center;
}
/* the writer's seal — background removed in the asset itself */
.footer-seal {
  width: 84px;
  height: 84px;
}
.footer a { color: var(--muted); transition: color 0.25s; }
.footer a:hover { color: var(--gold-bright); }
/* ============ reveal on scroll ============
   (animation, not transition — so tilt/hover transforms stay snappy) */

.reveal {
  opacity: 0;
  transform: translateY(26px);
}
.reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .reveal.in-view {
    animation: rise 0.7s cubic-bezier(0.2, 0.6, 0.2, 1) backwards;
    animation-delay: calc(var(--i, 0) * 80ms);
  }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
}

/* ============ settle (title reveal — blur into focus) ============ */

.settle {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(14px);
}
.settle.settled {
  animation: settle 0.9s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 120ms);
}
@keyframes settle {
  to { opacity: 1; filter: blur(0); transform: none; }
}

/* ============ responsive ============ */

@media (max-width: 620px) {
  .trilogy-grid { grid-template-columns: 1fr; max-width: 250px; margin: 0 auto; }
  .trilogy-grid::before { display: none; }
}

@media (max-width: 1200px) {
  .brand-logo { height: 64px; }
  #nav-links { gap: 12px; }
  #nav-links > a { font-size: 13px; }
}

@media (max-width: 980px) {
  #nav-toggle { display: flex; }
  #nav-links {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    background: rgba(7, 7, 15, 0.97);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  #nav-links.open { opacity: 1; pointer-events: auto; }
  #nav-links > a { font-size: 22px; font-family: var(--font-display); font-weight: 700; }
  body.menu-open { overflow: hidden; }
}

@media (max-width: 720px) {
  .book { width: 176px; }
}

/* ============ reduced motion ============ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #galaxy { animation: none; }
  .bookshelf-track { animation: none; }
  .reveal, .settle { opacity: 1; filter: none; transform: none; }
  .cursor-star { display: none !important; }
}
