/* =====================================================================
   MORIBUND — "Dark myth cinema" visual layer
   Loaded after styles.css on every page. Dark only.

   Brand marks  assets/brand   official wordmark, emblem, seal, Book I cover
   Sequences    assets/seq     Higgsfield clips cut into frames (-l wide, -p tall)
   Art          assets/art     your abstract Axia pieces (silhouette, geometry, star)
   Scenes       assets/scenes  generated stills behind inner-page headers
   Icons        assets/icons   official door-arch icon family

   Contents
     1  Tokens            6  Acts (scroll engine)     11  Reader and Book page
     2  Platform          7  Act layouts              12  Account and forms
     3  Type              8  Home sections            13  Footer
     4  Header and menu   9  Inner pages              14  Page transitions
     5  Buttons, panels   10 Components on phones     15  Reduced motion
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root,
html[data-theme="light"],
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #040405;
  --bg-soft: #08080a;
  --surface: rgba(232, 234, 240, .035);
  --surface-2: rgba(232, 234, 240, .06);
  --text: #eceef2;
  --muted: #a6a9b3;
  --line: rgba(214, 218, 228, .13);
  --line-strong: rgba(214, 218, 228, .3);
  --silver: #cdd0d8;
  --accent: #eceef2;
  --accent-text: #060607;
  --glow: rgba(214, 218, 228, .07);
  --shadow: 0 30px 90px rgba(0, 0, 0, .6);
  --radius: 3px;
  --header-h: 72px;
  --gutter: clamp(20px, 5.4vw, 44px);
  --copy: "EB Garamond", Georgia, "Times New Roman", serif;
  --metal: linear-gradient(180deg, #fbfbfc 0%, #c9ccd3 46%, #9a9da6 54%, #e4e6ea 100%);
  --axia: linear-gradient(90deg, transparent, #ff4d4d 12%, #ff9f43 24%, #ffd84d 36%, #5ee083 50%, #5aa7ff 64%, #6f6dff 76%, #b46cff 88%, transparent);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ---------- 2. Platform: the details that make a site feel native on a phone ---------- */
html {
  -webkit-tap-highlight-color: transparent;   /* no grey flash on tap; :active states below replace it */
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
html, body { overflow-x: clip; }
body { background: var(--bg); }
a, button, summary, select, label, [role="tab"] { touch-action: manipulation; }   /* no double-tap delay */
button, .btn, summary, [role="tab"] { -webkit-user-select: none; user-select: none; }
input, textarea, select { font-size: 16px; }   /* under 16px iOS zooms the page on focus */
.container { width: min(calc(100% - 2 * var(--gutter)), var(--max)); }
html[data-theme="light"] .starfield { opacity: 1; }
.starfield { overflow: hidden; }

/* Touch screens keep :hover after a tap; undo the base stylesheet's hover motion there. */
@media (hover: none) {
  .btn:hover, .archive-card:hover, .policy-card:hover, .pager-link:hover, .axia-option:hover { transform: none; box-shadow: none; }
  .record-card:hover img { transform: none; }
}

/* ---------- 3. Type ---------- */
.section-head h2, .callout h2, .page-head h1 { font-weight: 500; text-wrap: balance; letter-spacing: -.005em; }
.section-head h2 { font-size: clamp(2.1rem, 7.4vw, 4.2rem); line-height: 1.02; margin: 0 0 .35em; }
.page-head h1 { font-size: clamp(2.7rem, 10.5vw, 6rem); line-height: .96; }
.section-head p, .page-head .lede, .callout p, .closing p, .way-body span, .book-copy p, .stack-layout p, .archive-head p, .axia-layout p, .guest-strip p {
  font-family: var(--copy); font-size: clamp(1.1rem, 3.7vw, 1.28rem); line-height: 1.5; text-wrap: pretty;
}
.section-head p { max-width: 36em; color: var(--muted); }
.section-head.center p { margin-inline: auto; }
.eyebrow { font-family: var(--display); letter-spacing: .3em; font-size: .72rem; }
.muted { color: var(--muted); }
.numeral { font-family: var(--display); font-weight: 500; color: var(--silver); line-height: 1; }
.arrow { width: 26px; height: 12px; flex: none; transition: transform .5s var(--ease-out); }
.text-link { display: inline-flex; align-items: center; gap: 12px; margin-top: 22px; font-family: var(--display); font-size: .74rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; text-decoration: none; padding: 10px 0; border-bottom: 1px solid var(--line-strong); }

/* ---------- 4. Header and menu ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding-top: var(--safe-t);
  background: none; border-bottom: 1px solid transparent;
  /* No filter, backdrop-filter or will-change on the header itself: any of them makes it the
     containing block for the fixed phone menu inside it and squashes that menu to the header's height. */
  -webkit-backdrop-filter: none; backdrop-filter: none;
  transition: border-color .5s var(--ease-out), transform .5s var(--ease-out);
}
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(4, 4, 5, .82), rgba(4, 4, 5, 0));
  transition: background .5s var(--ease-out);
}
.site-header.scrolled, .menu-open .site-header { border-bottom-color: var(--line); }
.site-header.scrolled::before, .menu-open .site-header::before {
  background: rgba(4, 4, 5, .88);
  -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1);
}
.menu-open .site-header { transform: none; }
.menu-open .site-header::before { background: var(--bg); }
.header-away .site-header { transform: translate3d(0, -100%, 0); }
/* The grain sheet is a full-screen layer over everything; blending it live while the page scrolls is heavy on phones. */
@media (hover: none), (max-width: 1050px) { .site-noise { mix-blend-mode: normal !important; } }
@media (prefers-reduced-motion: reduce) { .site-header, .reader-toolbar { transition: none !important; } }
main { padding-top: calc(var(--header-h) + var(--safe-t)); }
.home main { padding-top: 0; }
.nav-wrap { height: var(--header-h); }
.nav-actions { margin-left: auto; }
.brand-wordmark { display: block; height: 22px; width: auto; }
.desktop-nav { margin-left: auto; gap: 2px; }
@media (min-width: 1051px) { .desktop-nav + .nav-actions { margin-left: 0; } }
.desktop-nav a {
  position: relative; font-family: var(--display); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); padding: 10px 12px; border-radius: 0; background: none !important;
}
.desktop-nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 1px; background: var(--text);
  transform: scaleX(0); transition: transform .45s var(--ease-out);
}
.desktop-nav a[aria-current="page"] { color: var(--text); }
.desktop-nav a[aria-current="page"]::after { transform: scaleX(1); }
.desktop-nav .nav-account { margin-left: 12px; border: 1px solid var(--line-strong); color: var(--text); }
.desktop-nav .nav-account::after { display: none; }
.theme-menu, [data-theme-toggle] { display: none !important; }

.menu-btn { width: 44px; height: 44px; border: 1px solid var(--line); background: transparent; border-radius: 0; }
.menu-lines { position: relative; width: 18px; height: 10px; display: block; }
.menu-lines span { position: absolute; left: 0; right: 0; height: 1.5px; background: var(--text); transition: transform .4s var(--ease-out), top .4s var(--ease-out); }
.menu-lines span:first-child { top: 0; }
.menu-lines span:last-child { top: 8.5px; }
.menu-btn[aria-expanded="true"] .menu-lines span:first-child { top: 4.25px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-lines span:last-child { top: 4.25px; transform: rotate(-45deg); }

/* The menu sits after the header in the page, never inside it, so nothing on the header can trap it. */
.mobile-panel {
  z-index: 99; position: fixed; top: calc(var(--header-h) + var(--safe-t)); left: 0; right: 0; bottom: 0; width: auto; margin: 0;
  padding: 18px var(--gutter) calc(32px + var(--safe-b));
  background: var(--bg); overflow-y: auto; overscroll-behavior: contain; align-content: start; gap: 0;
}
.mobile-panel a {
  font-family: var(--serif); font-size: clamp(1.9rem, 8.4vw, 2.6rem); line-height: 1.1; padding: 13px 0;
  border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text);
}
.mobile-panel a[aria-current="page"] { color: var(--silver); font-style: italic; }
.mobile-panel .nav-account { border: 0 !important; border-bottom: 1px solid var(--line) !important; }
.mobile-minor { display: flex; flex-wrap: wrap; gap: 6px 26px; padding-top: 26px; }
.mobile-minor a { font-family: var(--display); font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; border: 0; padding: 10px 0; color: var(--muted); }
.mobile-panel.open > * { animation: rise-in .6s var(--ease-out) both; }
.mobile-panel.open > :nth-child(2) { animation-delay: .04s; } .mobile-panel.open > :nth-child(3) { animation-delay: .08s; }
.mobile-panel.open > :nth-child(4) { animation-delay: .12s; } .mobile-panel.open > :nth-child(5) { animation-delay: .16s; }
.mobile-panel.open > :nth-child(6) { animation-delay: .2s; } .mobile-panel.open > :nth-child(7) { animation-delay: .24s; }
.mobile-panel.open > :nth-child(8) { animation-delay: .28s; }

/* ---------- 5. Buttons and panels ---------- */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 52px; padding: 0 26px; border-radius: 0; border: 1px solid var(--line-strong);
  background: rgba(4, 4, 5, .4); color: var(--text); text-align: center;
  font-family: var(--display); font-size: .72rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  transition: transform .14s var(--ease-out), border-color .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .9s var(--ease-out);
}
.btn:active { transform: scale(.975); }   /* press feedback on every input type */
.btn.primary { background: var(--metal); color: #08080a; border-color: transparent; }
.btn.primary::before { background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .85) 50%, transparent 70%); }
.btn.ghost { background: rgba(4, 4, 5, .3); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.hero-actions { gap: 12px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: none; border-color: var(--text); box-shadow: 0 14px 40px rgba(0, 0, 0, .55); }
  .btn:hover::before { transform: translateX(120%); }
  .btn.primary:hover { box-shadow: 0 0 34px rgba(230, 232, 238, .22), 0 14px 40px rgba(0, 0, 0, .55); }
  .desktop-nav a:hover { color: var(--text); }
  .desktop-nav a:hover::after { transform: scaleX(1); }
  .brand:hover .brand-wordmark { filter: drop-shadow(0 0 10px rgba(255, 255, 255, .35)); }
  .text-link:hover .arrow, .way:hover .arrow { transform: translateX(8px); }
  .record-card:hover img { opacity: 1; transform: scale(1.04); }
  .way:hover .way-name { color: var(--text); }
  .desk:hover em { color: var(--text); border-bottom-color: var(--text); }
}

.card, .archive-card, .policy-card, .feature-panel, .contact-card, .stat-card, .faq-item, .app-panel, .callout, .auth-card, .account-panel, .legal-card {
  border-radius: var(--radius);
  background:
    linear-gradient(var(--line-strong), var(--line-strong)) top left / 14px 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) top left / 1px 14px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) bottom right / 14px 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) bottom right / 1px 14px no-repeat,
    linear-gradient(180deg, rgba(232, 234, 240, .045), rgba(232, 234, 240, .012));
  box-shadow: none;
}
.callout { padding: clamp(26px, 6vw, 56px); }
.notice { border-radius: 0; }
.section { padding: clamp(76px, 13vw, 150px) 0; }

.axia-line { height: 1px; background: var(--axia); background-size: 200% 100%; opacity: .6; }
@keyframes axia-drift { to { background-position: -200% 0; } }

/* ---------- 6. Acts: pinned scenes driven by cinema.js ----------
   Without the .cinema class (no JS, reduced motion) every act is an ordinary
   full-height section with its still poster behind it and all text visible. */
.act { position: relative; background: #000; color: var(--text); }
.act-stage { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; isolation: isolate; background: #000; }
.act-poster, .act-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -3; display: block; }
.act-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.act-canvas { z-index: -2; opacity: 0; transition: opacity .7s ease; }
.act-canvas.ready { opacity: 1; }
.act-shade, .act-flash { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.act-inner {
  position: relative; display: grid; width: min(calc(100% - 2 * var(--gutter)), var(--max)); margin: 0 auto;
  min-height: 100vh; min-height: 100svh;
  padding: calc(var(--header-h) + var(--safe-t) + 20px) 0 calc(26px + var(--safe-b));
}
.act h2, .act h3 { text-shadow: 0 2px 26px rgba(0, 0, 0, .9); }
.act p { text-shadow: 0 1px 16px rgba(0, 0, 0, .9); }

.cinema .act { height: calc(var(--len, 200) * 1vh); height: calc(var(--len, 200) * 1svh); background: none; pointer-events: none; }
/* The next act is already pinned under the end of this one, so scenes crossfade instead of cutting. */
.cinema .act + .act { margin-top: -145vh; margin-top: calc(-100lvh - 45svh); }
.cinema .act-stage { position: sticky; top: 0; height: 100vh; height: 100lvh; min-height: 0; pointer-events: none; will-change: opacity; }
.cinema .act.is-live .act-stage { pointer-events: auto; }
.cinema .act + .act .act-stage { opacity: 0; }
.cinema .act-inner { height: 100vh; height: 100svh; min-height: 0; }

.cinema .beat { opacity: 0; transform: translate3d(0, 22px, 0); pointer-events: none; transition: opacity .8s var(--ease-out), transform 1s var(--ease-out); }
.cinema .beat.on { opacity: 1; transform: none; pointer-events: auto; }
.cinema .beat.past { transform: translate3d(0, -22px, 0); }
.cinema .beat.fade { transform: none; transition: opacity 1.5s ease; }

/* ---------- 7. Act layouts ---------- */
/* I. The Door */
.hero-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; text-align: center; }
.hero-layout > * { grid-column: 1; }
.act-door .act-shade {
  background: linear-gradient(to bottom, rgba(0, 0, 0, .66) 0%, rgba(0, 0, 0, .12) 32%, rgba(0, 0, 0, 0) 56%, rgba(0, 0, 0, .8) 100%);
  opacity: calc(1 - var(--p, 0) * 2.4);
}
.act-flash {
  background: radial-gradient(ellipse 62% 52% at 50% 52%, rgba(255, 255, 255, .95), rgba(228, 232, 245, .3) 45%, transparent 76%);
  mix-blend-mode: screen; opacity: var(--flash, 0);
}
.hero-top { grid-row: 1; margin-top: clamp(10px, 6svh, 90px); }
.hero-wordmark { margin: 0 auto; width: min(100%, 780px); line-height: 0; }
.hero-wordmark img { width: 100%; height: auto; filter: drop-shadow(0 0 28px rgba(255, 255, 255, .16)); }
.hero-kicker {
  margin: clamp(14px, 2.4svh, 26px) 0 0; font-family: var(--display); font-weight: 600; font-size: clamp(.62rem, 2.5vw, .8rem);
  line-height: 1.9; letter-spacing: .32em; padding-left: .32em; text-transform: uppercase; color: var(--silver); text-wrap: balance;
}
.hero-epigraph { grid-row: 2 / 4; align-self: end; justify-self: center; margin: 0 0 clamp(36px, 12svh, 130px); max-width: 21em; }
.hero-epigraph p { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(1.7rem, 6.6vw, 3rem); line-height: 1.14; text-wrap: balance; text-shadow: 0 2px 30px #000, 0 0 60px rgba(0, 0, 0, .8); }
.hero-epigraph cite { display: block; margin-top: 16px; font-family: var(--display); font-style: normal; font-weight: 600; font-size: .68rem; letter-spacing: .3em; text-transform: uppercase; color: var(--silver); }
.hero-bottom { grid-row: 3; align-self: end; display: grid; justify-items: center; gap: clamp(12px, 2svh, 20px); width: 100%; }
.hero-sub { margin: 0; max-width: 34em; font-family: var(--copy); font-size: clamp(1.08rem, 3.8vw, 1.3rem); line-height: 1.42; color: var(--text-2); text-wrap: balance; }
.hero-status { margin: 0; display: flex; align-items: center; gap: 10px; font-size: .78rem; color: var(--muted); text-shadow: none; }
.scroll-cue { position: relative; display: block; width: 22px; height: 36px; border: 1px solid var(--line-strong); border-radius: 12px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 2px; height: 7px; margin-left: -1px; background: var(--text); border-radius: 2px; }
@keyframes cue { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 80% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: no-preference) { .scroll-cue span { animation: cue 2.2s ease-in-out 1.5s infinite; } }

/* II. Book I */
.book-layout { align-content: center; justify-items: center; gap: clamp(18px, 3.4svh, 38px); text-align: center; }
.act-book .act-shade { background: linear-gradient(to bottom, rgba(0, 0, 0, .5), rgba(0, 0, 0, .1) 30%, rgba(0, 0, 0, .35) 62%, rgba(0, 0, 0, .86)); }
.cover-frame { margin: 0; position: relative; }
.act .cover-frame { height: min(41svh, 400px); aspect-ratio: 2 / 3; }
.cover-frame img { display: block; width: 100%; height: 100%; object-fit: cover; border: 1px solid var(--line-strong); box-shadow: 0 34px 90px rgba(0, 0, 0, .85); view-transition-name: book-cover; }
.cover-frame::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(255, 255, 255, .08); pointer-events: none; }
.book-copy { max-width: 36rem; }
.book-copy h2 { margin: 0 0 12px; font-family: var(--serif); font-weight: 500; font-size: clamp(1.9rem, 7vw, 3.7rem); line-height: 1.03; text-wrap: balance; }
.book-copy p { margin: 0 auto; max-width: 30em; color: var(--text-2); }
.book-copy .hero-actions { margin-top: clamp(16px, 2.8svh, 28px); }
.cinema .cover-frame.beat { transform: translate3d(0, 34px, 0) scale(.96); transition-duration: 1.1s, 1.4s; }
.cinema .cover-frame.beat.on { transform: none; }

/* III. The universe */
.stack-layout { place-items: center; text-align: center; }
.cinema .stack-layout > * { grid-area: 1 / 1; }
.stack-layout > * + * { margin-top: 56px; }
.cinema .stack-layout > * + * { margin-top: 0; }
.act-universe .act-shade { background: radial-gradient(ellipse 92% 58% at 50% 50%, rgba(0, 0, 0, .78), rgba(0, 0, 0, .3) 72%), linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent 30%, transparent 70%, rgba(0, 0, 0, .7)); }
.stack-layout h2 { margin: 0 0 20px; font-family: var(--serif); font-weight: 500; font-size: clamp(2.3rem, 9vw, 4.8rem); line-height: 1; text-wrap: balance; }
.stack-layout p { margin: 0 auto; max-width: 30em; color: var(--text-2); }
.pillar-beat .numeral { display: block; font-size: clamp(2.8rem, 13vw, 5.4rem); margin-bottom: clamp(10px, 2svh, 20px); }
.pillar-beat h3 { margin: 0 0 12px; font-family: var(--serif); font-weight: 600; font-size: clamp(1.8rem, 7vw, 3rem); line-height: 1.05; text-wrap: balance; }

/* IV. The archive: a corridor of doors that slides past as you scroll */
.archive-layout { grid-template-rows: auto 1fr; row-gap: clamp(14px, 3svh, 34px); }
.act-archive .act-shade { background: linear-gradient(to bottom, rgba(0, 0, 0, .78), rgba(0, 0, 0, .28) 34%, rgba(0, 0, 0, .28) 70%, rgba(0, 0, 0, .8)); }
.archive-head { text-align: center; }
.archive-head h2 { margin: 0 0 10px; font-family: var(--serif); font-weight: 500; font-size: clamp(2.1rem, 8.2vw, 4.4rem); line-height: 1; text-wrap: balance; }
.archive-head p { margin: 0 auto; max-width: 28em; color: var(--text-2); }
.door-rail-wrap { width: 100vw; margin-left: calc(50% - 50vw); align-self: center; }
.door-rail { list-style: none; margin: 0; padding: 0 var(--gutter); display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cinema .door-rail { display: flex; gap: clamp(12px, 2vw, 24px); width: max-content; padding-inline: max(var(--gutter), calc(50vw - var(--max) / 2)); will-change: transform; }
.arch-door {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; text-align: center;
  min-height: 250px; padding: 44px 16px 24px; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: 999px 999px 0 0;
  /* no backdrop blur: eight moving blurred panes are heavy on phones */
  background: radial-gradient(ellipse 70% 42% at 50% 0%, rgba(232, 234, 240, .14), transparent 72%), rgba(6, 6, 8, .84);
}
.cinema .arch-door { flex: none; width: clamp(200px, 60vw, 290px); height: min(50svh, 430px); min-height: 0; }
.arch-door::before { content: ""; position: absolute; top: 9px; left: 9px; right: 9px; bottom: 0; border: 1px solid rgba(232, 234, 240, .09); border-bottom: 0; border-radius: 999px 999px 0 0; pointer-events: none; }
.arch-door .numeral { font-size: clamp(1.6rem, 6vw, 2.2rem); margin-bottom: auto; padding-top: 10px; }
.arch-door h3 { margin: 14px 0 6px; font-family: var(--serif); font-weight: 600; font-size: clamp(1.2rem, 4.8vw, 1.5rem); line-height: 1.1; text-shadow: none; }
.arch-door p { margin: 0; font-family: var(--copy); font-size: 1.02rem; line-height: 1.35; color: var(--muted); text-shadow: none; }

/* V. Axia: your art dissolves from a point of light to the full spectrum */
.axia-art { position: absolute; inset: 0; z-index: -3; background: #000; }
.axia-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 32%; display: none; }
.axia-art .axia-last { display: block; }
.cinema .axia-art img { display: block; }
.act-axia .act-shade { background: linear-gradient(to bottom, rgba(0, 0, 0, .6) 0%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 46%, rgba(0, 0, 0, .9) 78%, #000 100%); }
.axia-layout { align-content: end; text-align: center; justify-items: center; }
.cinema .axia-layout > * { grid-area: 1 / 1; align-self: end; }
.axia-layout > * + * { margin-top: 22px; }
.cinema .axia-layout > * + * { margin-top: 0; }
.axia-intro h2 { margin: 0 0 14px; font-family: var(--serif); font-weight: 500; font-size: clamp(2.3rem, 9vw, 4.6rem); line-height: 1; text-wrap: balance; }
.axia-layout p { margin: 0 auto; max-width: 28em; color: var(--text-2); }
p.axia-q { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(1.8rem, 7.6vw, 3.4rem); line-height: 1.1; color: var(--text); max-width: 15em; text-wrap: balance; padding-bottom: clamp(20px, 7svh, 80px); }
.axia-final { display: grid; justify-items: center; gap: clamp(14px, 2.4svh, 22px); width: 100%; }
.axia-final > p { font-size: clamp(1.02rem, 3.5vw, 1.2rem); }
.spectrum { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; text-align: left; width: min(100%, 30rem); }
.spectrum li { display: grid; grid-template-columns: 9px 1fr; column-gap: 10px; align-items: center; }
.spectrum li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 14px 1px var(--c); grid-row: 1 / span 2; align-self: start; margin-top: 4px; }
.spectrum b { font-family: var(--display); font-weight: 600; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; }
.spectrum span { font-size: .8rem; line-height: 1.3; color: var(--muted); }
.spectrum li:last-child { grid-column: 1 / -1; }

/* ---------- 8. Home sections after the acts ---------- */
.records { padding-top: clamp(90px, 16vw, 170px); }
.record-rail { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: clamp(28px, 5vw, 48px); }
.record-card { position: relative; aspect-ratio: 3 / 4.3; min-height: 0; border-radius: 0; border: 1px solid var(--line); background: #000; overflow: hidden; box-shadow: none; }
.record-card img { width: 100%; height: 100%; object-fit: cover; opacity: .86; transition: transform 1.2s var(--ease-out), opacity .6s; }
.record-label { position: absolute; inset: auto 0 0 0; padding: 40px 20px 20px; border: 0; border-radius: 0; background: linear-gradient(to top, rgba(0, 0, 0, .94), rgba(0, 0, 0, 0)); -webkit-backdrop-filter: none; backdrop-filter: none; }
.record-label span { font-family: var(--display); font-size: .66rem; letter-spacing: .26em; color: var(--silver); }
.record-label h3 { margin: 6px 0 0; font-family: var(--serif); font-weight: 600; font-size: 1.5rem; line-height: 1.1; }

.reader-record { display: grid; gap: clamp(22px, 4vw, 44px); }
.reader-record .section-head { margin-bottom: 0; }
.guest-strip { display: grid; gap: 18px; justify-items: start; padding-top: 22px; border-top: 1px solid var(--line-strong); }
.guest-strip p { margin: 0; color: var(--muted); max-width: 34em; }
.record-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 0 26px; border-top: 1px solid var(--line-strong); }
.record-facts > div { padding: 22px 22px 22px 0; border-right: 1px solid var(--line); margin-right: 22px; }
.record-facts > div:last-child { border-right: 0; margin-right: 0; }
.record-facts dt { font-family: var(--display); font-size: .68rem; letter-spacing: .26em; text-transform: uppercase; color: var(--silver); margin-bottom: 10px; }
.record-facts dd { margin: 0; font-family: var(--serif); font-size: 1.6rem; line-height: 1.12; overflow-wrap: anywhere; }
.record-facts dd.sub { font-family: var(--sans); font-size: .9rem; line-height: 1.45; color: var(--muted); margin-top: 6px; }
.home-account-preview .hero-actions { justify-content: flex-start; margin-top: 0; }

.ways { padding-top: 0; }
.ways .container { border-top: 1px solid var(--line-strong); }
.way { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px 24px; padding: clamp(26px, 5vw, 44px) 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.way-name { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; font-family: var(--display); font-weight: 600; font-size: .78rem; letter-spacing: .28em; text-transform: uppercase; color: var(--silver); transition: color .3s; }
.way-name img { width: 28px; height: 28px; }
.way-body { display: grid; gap: 10px; }
.way-body strong { font-family: var(--serif); font-weight: 500; font-size: clamp(1.8rem, 6.8vw, 3.2rem); line-height: 1.04; text-wrap: balance; }
.way-body span { color: var(--muted); max-width: 34em; }

.closing { position: relative; isolation: isolate; overflow: hidden; padding: clamp(110px, 20vw, 210px) 0; text-align: center; background: #000; }
.closing-art { position: absolute; left: 50%; top: 50%; z-index: -1; width: min(150vw, 980px); height: auto; transform: translate(-50%, -50%); opacity: .5; -webkit-mask-image: radial-gradient(closest-side, #000 52%, transparent 100%); mask-image: radial-gradient(closest-side, #000 52%, transparent 100%); }
.closing-inner { display: grid; justify-items: center; gap: clamp(18px, 3vw, 28px); }
.closing h2 { margin: 0; max-width: 13em; font-family: var(--serif); font-weight: 500; font-size: clamp(2.3rem, 8.6vw, 5rem); line-height: 1; text-wrap: balance; text-shadow: 0 2px 30px #000; }
.closing p { margin: 0; max-width: 34em; color: var(--text-2); text-shadow: 0 1px 18px #000; }
.format-list { list-style: none; margin: 4px 0 6px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 0; font-family: var(--display); font-size: .74rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--silver); }
.format-list li { display: flex; align-items: center; }
.format-list li + li::before { content: ""; width: 4px; height: 4px; margin: 0 14px; background: var(--line-strong); transform: rotate(45deg); }

.desks { padding-top: clamp(70px, 11vw, 130px); }
.desk-list { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-strong); margin-top: clamp(24px, 4vw, 40px); }
.desk { display: grid; gap: 8px; align-content: start; padding: 24px 24px 24px 0; text-decoration: none; }
.desk + .desk { padding-left: 24px; border-left: 1px solid var(--line); }
.desk b { font-family: var(--serif); font-weight: 600; font-size: 1.5rem; }
.desk span { font-family: var(--copy); font-size: 1.08rem; line-height: 1.4; color: var(--muted); }
.desk em { justify-self: start; font-style: normal; font-size: .92rem; color: var(--silver); border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; overflow-wrap: anywhere; transition: color .3s, border-color .3s; }

.reveal { transform: translateY(26px); transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out); }
.reveal.visible { transform: none; }

/* ---------- 9. Inner pages: each opens on its own scene ---------- */
body[data-scene="void"] { --page-scene: url("assets/scenes/void.jpg"); }
body[data-scene="hall"] { --page-scene: url("assets/scenes/hall.jpg"); }
body[data-scene="path"] { --page-scene: url("assets/scenes/path.jpg"); }
body[data-scene="stone"] { --page-scene: url("assets/scenes/stone.jpg"); }
body[data-scene] main { position: relative; isolation: isolate; }
body[data-scene] main::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: min(92svh, 780px); z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(4, 4, 5, .25), rgba(4, 4, 5, .6) 55%, var(--bg) 100%), var(--page-scene) center 40% / cover no-repeat;
  opacity: .9;
}
@keyframes page-scene-in { from { opacity: 0; transform: scale(1.06); } to { opacity: .9; transform: none; } }
.page { padding: clamp(28px, 6vw, 70px) 0 clamp(80px, 12vw, 120px); }
.page-head { margin-bottom: clamp(28px, 5vw, 48px); }
.breadcrumbs { font-size: .8rem; margin-bottom: clamp(18px, 4vw, 28px); color: var(--muted); }

/* ---------- 10. Components on phones ---------- */
.feature-row { align-items: baseline; gap: 14px; }
.feature-row strong { min-width: 0; flex: 1 1 auto; }
.feature-row > span { flex: 0 0 auto; text-align: right; max-width: 46%; }
.feature-row:has(.row-icon) { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; }
.row-icon { width: 26px; height: 26px; opacity: .85; }
.muted-row { opacity: .55; }
.status-pill { max-width: 100%; text-align: left; line-height: 1.4; border-radius: 0; }
.points-table { border-radius: 0; }
.badge { border-radius: 0; }

/* ---------- 11. Reader and Book page ---------- */
.reader-page main { padding-top: calc(var(--header-h) + var(--safe-t)); }
/* While reading down, the header and the chapter bar glide away together and leave only the page.
   Scrolling back up (or reaching the top) brings both back. A hairline at the top keeps your place. */
.reader-toolbar {
  position: sticky; top: calc(var(--header-h) + var(--safe-t)); z-index: 50;
  background: rgba(4, 4, 5, .96);   /* solid: a live blur behind a bar the page scrolls under is costly on phones */
  transition: transform .55s var(--ease-out), opacity .4s ease;
}
.header-away .reader-toolbar { transform: translate3d(0, calc(-100% - var(--header-h) - var(--safe-t) - 2px), 0); opacity: 0; pointer-events: none; }
.reader-page .site-header { transition: transform .55s var(--ease-out), background .5s var(--ease-out), border-color .5s var(--ease-out); }
.reader-page > .reader-progress { position: fixed; top: var(--safe-t); left: 0; right: 0; bottom: auto; height: 2px; z-index: 120; pointer-events: none; }
.reader-page > .reader-progress span { opacity: .55; transition: opacity .4s ease; }
.header-away .reader-page > .reader-progress span { opacity: .9; }
.reader-toolbar-inner { flex-wrap: nowrap; min-height: 54px; gap: 10px; padding: 7px 0; }
.reader-back { flex: none; }
.reader-select { flex: 1 1 auto; min-width: 0; max-width: 460px; height: 40px; border-radius: 0; font-size: 16px; }
.reader-size { flex: none; }
.reader-size button { border-radius: 0; }
.reader-article:focus, .reader-article:focus-visible { outline: none; }
.reader-shell { padding-top: clamp(18px, 4vw, 34px); }
.chapter-byline { text-align: center; font-style: italic; color: var(--muted); margin: 0 0 1.6em; }
.chapter-body.is-verse p { margin: 0 0 .52em; }
.chapter-body.is-verse h2 { margin: 2.4em 0 1.1em; font-family: var(--serif); font-size: 1.36em; font-weight: 600; letter-spacing: .01em; }
.chapter-body.is-verse > p:first-child:first-line { font-variant: normal; letter-spacing: 0; }
.chapter-body { text-wrap: pretty; }
.reader-gate, .reader-end, .reader-notice { border-radius: 0; }
.pager-link { border-radius: 0; }
.book-cover-real { width: 100%; max-width: 340px; }
.toc-row { border-radius: 0; }
.toc-state { border-radius: 0; }

/* ---------- 12. Account and forms ---------- */
.auth-card { padding: clamp(22px, 5vw, 32px); }
.auth-tabs { border-radius: 0; background: rgba(0, 0, 0, .35); }
.auth-tab { border-radius: 0; min-height: 44px; font-family: var(--display); font-size: .72rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.auth-tab.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -1px 0 var(--text); }
.form-group label { font-family: var(--display); font-weight: 600; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; }
.form-control { border-radius: 0; min-height: 50px; background: rgba(0, 0, 0, .45); border-color: var(--line-strong); font-size: 16px; }
.form-control:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.recovery-card { max-width: 460px; margin: 0 0 28px; }
.recovery-card h2 { margin: 0 0 8px; font-family: var(--serif); font-weight: 500; font-size: clamp(1.9rem, 6vw, 2.6rem); line-height: 1.05; }
.account-tab-btn { border-radius: 0; min-height: 44px; }
.app-panel, .app-stat, .axia-feature, .readiness-item, .empty-state, .prelaunch-state, .story-consent-card, .story-consent-toggle, .account-pending, .axia-option, .axia-result-cell, .axia-progress-card, .store-placeholder, .app-only-strip, .supabase-setup-note { border-radius: var(--radius); }
@media (max-width: 400px) { .auth-tab { letter-spacing: .1em; padding-inline: 6px; } }
.axia-progress-track { border-radius: 0; height: 2px; }
.axia-progress-fill { border-radius: 0; background: var(--axia); background-size: 100vw 100%; }


/* Inner pages on phones: fewer boxes, more reading rhythm.
   Numbered cards, stats, policy links and contact desks become hairline lists. */
@media (max-width: 820px) {
  .page-head h1 { margin-top: 0; }
  .card { min-height: 0; }
  .grid-3:has(> .card .card-index), .grid-3:has(> .stat-card) { gap: 0; border-top: 1px solid var(--line-strong); }
  .grid-3 > .card:has(.card-index) { display: grid; grid-template-columns: 46px minmax(0, 1fr); column-gap: 6px; padding: 20px 0; background: none; border: 0; border-bottom: 1px solid var(--line); }
  .grid-3 > .card .card-index { grid-row: 1 / span 2; font-size: 1.35rem; line-height: 1.25; }
  .grid-3 > .card:has(.card-index) h3 { margin: 0 0 4px; font-size: 1.05rem; }
  .grid-3 > .stat-card { display: grid; grid-template-columns: 78px minmax(0, 1fr); column-gap: 10px; padding: 20px 0; background: none; border: 0; border-bottom: 1px solid var(--line); }
  .stat-card .metric { grid-row: 1 / span 2; font-size: 2.2rem; line-height: 1; }
  .stat-card h3 { margin: 2px 0 4px; font-size: 1.05rem; }
  .policy-grid, .contact-grid { gap: 0; border-top: 1px solid var(--line-strong); }
  .policy-card, .contact-card { padding: 18px 0; background: none; border: 0; border-bottom: 1px solid var(--line); }
  .contact-card h3 { margin-bottom: 4px; }
  .contact-card p { margin: 0 0 8px; }
  .callout { padding: 26px 22px; }
  .notice { font-size: .94rem; line-height: 1.55; }
  .split { gap: 30px; }
  .points-table th, .points-table td { padding: 13px 14px; }
  .book-hero { margin-bottom: 48px; }
  .book-cover-real { width: min(62vw, 260px); }
  .faq-item { padding: 0 18px; }
  .badge-list { gap: 8px; }
}

/* Card titles that are real h2s (pages without a section heading above them) look like the h3 cards. */
.card h2.card-title { margin: 20px 0 8px; font-family: var(--sub); font-size: 1.17rem; font-weight: 400; line-height: 1.3; letter-spacing: 0; }
@media (max-width: 820px) { .grid-3 > .card:has(.card-index) h2.card-title { margin: 0 0 4px; font-size: 1.05rem; } }

/* ---------- 13. Footer ---------- */
.site-footer { position: relative; border-top: 0; background: linear-gradient(to bottom, var(--bg), #000); padding-bottom: calc(28px + var(--safe-b)); }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--axia); opacity: .45; }
.footer-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.footer-seal { width: 52px; height: auto; opacity: .9; }
.footer-grid h4 { font-family: var(--display); font-size: .68rem; letter-spacing: .3em; text-transform: uppercase; color: var(--silver); }
.footer-grid a { padding: 4px 0; }
@media (max-width: 820px) {
  /* Brand on its own row, the three link groups side by side: half the scroll of a single column. */
  .site-footer { padding-top: 46px; }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 14px; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .footer-grid h4 { margin-bottom: 8px; }
  .footer-grid a { font-size: .9rem; margin: 6px 0; }
  .footer-bottom { margin-top: 28px; }
}

/* ---------- 14. Page transitions (Chrome, Edge, Safari 18.2+; others navigate normally) ---------- */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: vt-out .32s ease both; }
::view-transition-new(root) { animation: vt-in .6s var(--ease-out) both; }
::view-transition-group(book-cover) { animation-duration: .7s; animation-timing-function: var(--ease-out); }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Layout by width ---------- */
@media (min-width: 900px) {
  .hero-wordmark { width: min(72vw, 780px); }
  .hero-actions .btn { min-width: 220px; }
  .book-layout { grid-template-columns: auto minmax(0, 36rem); justify-content: center; align-items: center; column-gap: clamp(44px, 6vw, 100px); text-align: left; }
  .act .cover-frame { height: min(66svh, 620px); }
  .book-copy p { margin-inline: 0; }
  .book-copy .hero-actions { justify-content: flex-start; }
  .cinema .arch-door { width: 290px; }
  /* Axia: the art stands to the right, the words to the left */
  .axia-art { left: auto; width: min(58vw, 100svh); }
  .axia-art img { object-fit: contain; object-position: 50% 50%; }
  .axia-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, #000 0%, transparent 28%, transparent 78%, #000 100%); }
  .act-axia .act-shade { background: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent 20%, transparent 80%, rgba(0, 0, 0, .7)); }
  .axia-layout { justify-items: start; text-align: left; align-content: center; }
  .cinema .axia-layout > * { align-self: center; max-width: 34rem; }
  .axia-layout p { margin-inline: 0; }
  p.axia-q { padding-bottom: 0; }
  .axia-final { justify-items: start; }
  .way { grid-template-columns: 230px 1fr auto; column-gap: 36px; }
  .way-name { grid-column: 1; align-self: start; padding-top: 12px; }
}
@media (max-width: 899px) {
  .hero-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .guest-strip .btn, .axia-final .btn { width: 100%; }
  .home-account-preview .hero-actions, .closing .hero-actions { width: 100%; }
}
@media (max-width: 820px) {
  /* Records become a swipeable rail; native scroll-snap does the physics. */
  .record-rail { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); scrollbar-width: none; }
  .record-rail::-webkit-scrollbar { display: none; }
  .record-rail > * { flex: 0 0 76%; scroll-snap-align: start; }
  .record-facts { grid-template-columns: 1fr; }
  .record-facts > div { border-right: 0; margin-right: 0; padding: 18px 0; border-bottom: 1px solid var(--line); }
  .desk-list { grid-template-columns: 1fr; }
  .desk, .desk + .desk { padding: 20px 0; border-left: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 580px) {
  :root { --header-h: 64px; }
  .brand-wordmark { height: 19px; }
  .btn { padding: 0 20px; letter-spacing: .17em; }
  .hero-status { font-size: .74rem; }
  .feature-row > span { font-size: .8rem; max-width: 42%; }
  .feature-row:has(.row-icon) { grid-template-columns: 26px 1fr; }
  .feature-row:has(.row-icon) > span { grid-column: 2; text-align: left; max-width: none; margin-top: -6px; }
  .reader-back { font-size: 0; padding: 8px 10px 8px 0; }
  .reader-back span { font-size: 1.1rem; }
}
@media (max-height: 640px) and (max-width: 899px) {
  .hero-sub { display: none; }
  .act .cover-frame { height: 34svh; }
}

/* ---------- 15. Reduced motion: stills, no pinning, everything visible ---------- */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .reveal { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .axia-line { animation: axia-drift 14s linear infinite; }
  body[data-scene] main::before { animation: page-scene-in 2.2s var(--ease-out) both; }
}
