/* Mohabbat wagaira.. v2: the night-sea world. Tokens first, then layout, then pages. */
@font-face { font-family: "Gelasio"; src: url("/fonts/gelasio-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Gelasio"; src: url("/fonts/gelasio-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Gelasio"; src: url("/fonts/gelasio-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Gelasio"; src: url("/fonts/gelasio-latin-700-italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ink-0: #071012; --ink-1: #0b1416; --ink-2: #12201f; --ink-3: #1b2c2c;
  --moon: #efe6d2; --moon-2: #c9c0ad; --slate: #93a6a8;
  --amber: #e0a458; --amber-hi: #edb873; --on-amber: #1a1206;
  --line: rgba(239, 230, 210, 0.16);
  --page-bg: rgba(9, 17, 18, 0.88); --page-fg: var(--moon); --page-2: var(--moon-2); --page-line: rgba(239, 230, 210, 0.14);
  --serif: "Gelasio", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}
[data-theme="chiraag"] {
  --page-bg: #ece1c9; --page-fg: #1f1b14; --page-2: #4b4436; --page-line: rgba(31, 27, 20, 0.16);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 7rem; }
body {
  margin: 0; background: var(--ink-1); color: var(--moon);
  font: 400 1.0625rem/1.6 var(--sans); text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
::selection { background: var(--amber); color: var(--on-amber); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 3px; }
html { scrollbar-color: var(--ink-3) var(--ink-0); }
input, textarea { caret-color: var(--amber); }
code { font-family: ui-monospace, Menlo, monospace; font-size: 0.9em; color: var(--amber-hi); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
p { margin: 0 0 1em; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 50; background: var(--amber); color: var(--on-amber); padding: 0.6rem 1rem; border-radius: 6px; }
.skip:focus { top: 1rem; }

/* ---------- the world behind everything ---------- */
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; display: block; }
.scene-still { position: fixed; inset: 0; z-index: 0; display: none;
  background:
    radial-gradient(circle at 74% 26%, #f3ead6 0 1.6vmin, rgba(243, 234, 214, 0.18) 1.7vmin, transparent 18vmin),
    linear-gradient(180deg, #050a0b 0%, #13201f 52%, #0a1314 53%, #071012 100%); }
.no-webgl #scene { display: none; }
.no-webgl .scene-still, html:not(.has-webgl):not(.js) .scene-still { display: block; }
.scene-shade { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(5, 10, 11, 0.62) 0%, rgba(5, 10, 11, 0.18) 48%, transparent 70%); }
[data-page="reader"] .scene-shade, [data-page="journal"] .scene-shade, [data-page="plain"] .scene-shade {
  background: radial-gradient(ellipse 60% 90% at 50% 50%, rgba(5, 10, 11, 0.72), rgba(5, 10, 11, 0.25) 75%); }
main, .site-foot, .masthead { position: relative; z-index: 2; }
body.on-star { cursor: pointer; }

/* ---------- masthead ---------- */
.masthead { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 1.5rem;
  padding: 0.9rem var(--pad); transition: background-color 0.5s var(--ease), box-shadow 0.5s var(--ease); }
.masthead.is-solid { background: rgba(7, 16, 18, 0.96); box-shadow: 0 1px 0 var(--line); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-family: var(--serif); font-size: 1.05rem; letter-spacing: 0.01em; margin-right: auto; }
.brand svg { width: 1.6rem; height: 1.6rem; color: var(--amber); }
.nav { display: flex; gap: 1.4rem; }
.nav a { text-decoration: none; color: var(--moon-2); font-size: 0.98rem; }
.nav a:hover { color: var(--moon); text-decoration: underline; }
.tools { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--moon-2); cursor: pointer; transition: color 0.3s, border-color 0.3s, background-color 0.3s; }
.icon-btn svg { width: 1.2rem; height: 1.2rem; }
.icon-btn:hover { color: var(--moon); border-color: rgba(239, 230, 210, 0.4); }
.icon-btn[aria-pressed="true"] { color: var(--on-amber); background: var(--amber); border-color: var(--amber); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 3rem; padding: 0.75rem 1.35rem; border-radius: 999px;
  font: 600 1rem/1.2 var(--sans); text-decoration: none; letter-spacing: 0.005em; cursor: pointer; border: 1px solid transparent;
  transition: background-color 0.35s var(--ease), transform 0.35s var(--ease), box-shadow 0.35s var(--ease), color 0.35s; }
.btn svg { width: 1.15rem; height: 1.15rem; transition: transform 0.35s var(--ease); }
.btn-primary { background: var(--amber); color: var(--on-amber); box-shadow: 0 12px 28px -14px rgba(0, 0, 0, 0.85); }
.btn-primary:hover { background: var(--amber-hi); transform: translateY(-1px); box-shadow: 0 16px 32px -14px rgba(0, 0, 0, 0.9); }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-ghost { border-color: rgba(239, 230, 210, 0.35); color: var(--moon); background: rgba(7, 16, 18, 0.35); }
.btn-ghost:hover { border-color: var(--moon); }
.btn-small { min-height: 2.5rem; padding: 0.5rem 1rem; font-size: 0.92rem; background: transparent; color: var(--amber-hi); border-color: rgba(224, 164, 88, 0.55); }
.btn-small:hover { background: var(--amber); color: var(--on-amber); }
.link-quiet { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--moon); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(239, 230, 210, 0.35); }
.link-quiet svg { width: 1.05rem; height: 1.05rem; }
.link-quiet:hover { text-decoration-color: var(--amber); }
.fine { font-size: 0.9rem; color: var(--slate); }
.section-lede { color: var(--moon-2); font-size: 1.15rem; max-width: 34rem; }

/* ---------- home ---------- */
.hero { min-height: 100svh; display: grid; align-content: end; padding: 7rem var(--pad) clamp(3rem, 9vh, 6rem); position: relative; }
.hero-copy { max-width: 40rem; }
.hero h1 { font-size: clamp(3.2rem, 8.4vw, 6rem); line-height: 0.98; margin-bottom: 1.1rem; }
.hero h1 span { display: block; }
.hero h1 em { display: block; font-style: italic; font-weight: 700; color: var(--moon); padding-left: 0.08em; }
.byline { font-family: var(--sans); font-size: 0.95rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--moon-2); margin-bottom: 1.6rem; }
.hook { font-family: var(--serif); font-size: clamp(1.25rem, 2.2vw, 1.55rem); line-height: 1.5; color: var(--moon); margin-bottom: 2rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; margin-bottom: 1rem; }
.scroll-cue { position: absolute; right: var(--pad); bottom: clamp(3rem, 9vh, 6rem); width: 1.6rem; height: 2.6rem; border: 1px solid var(--line); border-radius: 999px; }
.scroll-cue span { position: absolute; left: 50%; top: 0.5rem; width: 3px; height: 0.55rem; margin-left: -1.5px; border-radius: 3px; background: var(--moon-2); }

.interlude { min-height: 95svh; display: grid; align-content: center; justify-items: start; padding: 6rem var(--pad); }
.interlude blockquote { margin: 0 0 1.6rem; font-family: var(--serif); font-size: clamp(1.7rem, 4.2vw, 3.2rem); line-height: 1.35; max-width: 22ch; }
.interlude blockquote p { margin: 0; }
.interlude blockquote p + p { padding-left: 1.2em; }
.interlude-src { color: var(--moon-2); }
.interlude-src a { color: var(--amber-hi); }

.doors { min-height: 100svh; padding: 8rem var(--pad) 6rem; display: grid; align-content: center; gap: 3rem; }
.doors h2, .free h2, .sitaare h2, .kitaab h2, .journal-teaser h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.door-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 4rem); max-width: 72rem; }
.door-row li { border-top: 1px solid var(--line); padding-top: 1.4rem; }
.door-row h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-style: italic; margin-bottom: 0.5rem; color: var(--amber-hi); }
.door-row p { color: var(--moon-2); }
.door-row blockquote { margin: 1.2rem 0 0; font-family: var(--serif); font-size: 1.2rem; line-height: 1.5; color: var(--moon); }
.doors > .btn { justify-self: start; }

.free { padding: 8rem var(--pad) 6rem; min-height: 100svh; }
.free h2 { margin-bottom: 0.8rem; }
.free-list { list-style: none; margin: 3rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.25rem, 3vw, 2.5rem); max-width: 72rem; }
.free-item { display: grid; gap: 0.35rem; text-decoration: none; }
.free-item img { aspect-ratio: 2 / 3; object-fit: cover; width: 100%; border-radius: 6px; margin-bottom: 0.9rem;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9); filter: saturate(0.9) brightness(0.88); transition: filter 0.6s var(--ease), transform 0.6s var(--ease); }
.free-item:hover img, .free-item:focus-visible img { filter: saturate(1) brightness(1); transform: translateY(-4px); }
.free-meta { font-size: 0.88rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate); }
.free-title { font-family: var(--serif); font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.15; }
.free-note { color: var(--moon-2); font-size: 0.95rem; }
.free-go { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.4rem; color: var(--amber-hi); font-weight: 600; }
.free-go svg { width: 1.05rem; height: 1.05rem; transition: transform 0.35s var(--ease); }
.free-item:hover .free-go svg { transform: translateX(3px); }

.sitaare { min-height: 135svh; padding: 8rem var(--pad) 5rem; display: grid; grid-template-rows: auto 1fr auto; }
.sitaare-copy { max-width: 30rem; }
.sitaare-copy p { color: var(--moon-2); font-size: 1.1rem; }
.hint { font-size: 0.95rem !important; color: var(--slate) !important; }
.star-list { list-style: none; margin: 0; padding: 0; grid-row: 3; columns: 2 15rem; column-gap: 2.5rem; max-width: 40rem; counter-reset: none; }
.star-list li { break-inside: avoid; }
.star-list a { display: grid; grid-template-columns: 2.2rem 1fr auto; gap: 0.6rem; align-items: baseline; padding: 0.42rem 0; text-decoration: none; border-bottom: 1px solid rgba(239, 230, 210, 0.08); color: var(--moon-2); }
.star-n { font-variant-numeric: tabular-nums; font-size: 0.85rem; color: var(--slate); }
.star-t { font-family: var(--serif); font-size: 1.02rem; }
.star-s { font-size: 0.8rem; color: var(--slate); }
.is-free .star-t, .is-free .star-n { color: var(--moon); }
.is-free .star-s { color: var(--amber-hi); }
.star-list a:hover, .star-list a.is-hot { color: var(--moon); border-bottom-color: rgba(224, 164, 88, 0.6); }
.star-tip { position: fixed; z-index: 30; transform: translate(-50%, calc(-100% - 18px)); pointer-events: none; display: grid; gap: 0.1rem; text-align: center;
  padding: 0.6rem 0.9rem; border-radius: 10px; background: rgba(7, 16, 18, 0.94); box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--line); min-width: 10rem; }
.tip-n { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate); }
.tip-t { font-family: var(--serif); font-size: 1.2rem; }
.tip-s { font-size: 0.8rem; color: var(--amber-hi); }

.kitaab { min-height: 110svh; padding: 8rem var(--pad) 6rem; display: grid; align-content: center; }
.kitaab-copy { max-width: 34rem; }
.kitaab-copy h2 { margin-bottom: 1.2rem; }
.kitaab-copy > p { font-size: 1.15rem; color: var(--moon-2); }
.kitaab-copy > p[lang] { font-family: var(--serif); font-size: 1.4rem; color: var(--moon); }
.kitaab-cover { width: min(15rem, 60vw); border-radius: 4px; margin: 1.6rem 0; box-shadow: 0 40px 70px -30px rgba(0, 0, 0, 0.95); }
@media (min-width: 900px) { .has-webgl .kitaab-cover { display: none; } }
.stores { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; margin-top: 1.6rem; }
.store-status { flex-basis: 100%; margin: 0 0 0.4rem; color: var(--moon-2); max-width: 32rem; }
.store-status strong { color: var(--moon); font-weight: 600; }
.price { flex-basis: 100%; color: var(--moon-2); margin: 0; }

.journal-teaser { padding: 6rem var(--pad); }
.essay-list { list-style: none; margin: 2.4rem 0; padding: 0; max-width: 52rem; }
.essay-list li { border-top: 1px solid var(--line); }
.essay-list a { display: grid; gap: 0.3rem; padding: 1.3rem 0; text-decoration: none; }
.essay-t { font-family: var(--serif); font-size: clamp(1.3rem, 2.2vw, 1.7rem); line-height: 1.25; }
.essay-d { color: var(--moon-2); max-width: 44rem; }
.essay-list a:hover .essay-t { text-decoration: underline; text-decoration-color: var(--amber); }

.care { margin: 0 var(--pad) 5rem; padding: clamp(1.5rem, 4vw, 2.5rem); max-width: 46rem; border-radius: 14px; background: rgba(7, 16, 18, 0.86); box-shadow: 0 0 0 1px var(--line); }
.care h2 { font-size: 1.6rem; margin-bottom: 0.8rem; }
.care-body { color: var(--moon-2); }
.care-body p { margin-bottom: 0.5rem; }
.care-body p:last-child { margin-bottom: 0; }

/* ---------- reader ---------- */
[data-page="reader"] .masthead { background: rgba(7, 16, 18, 0.92); box-shadow: 0 1px 0 var(--line); }
.reader-bar { position: fixed; z-index: 19; left: 0; right: 0; top: 4.3rem; display: flex; align-items: center; gap: 1.5rem; padding: 0.45rem var(--pad);
  background: rgba(7, 16, 18, 0.95); font-size: 0.9rem; }
.reader-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(239, 230, 210, 0.08); }
.reader-progress span { display: block; height: 100%; background: var(--amber); transform-origin: 0 50%; transform: scaleX(0); }
.reader-where { margin: 0; color: var(--slate); font-variant-numeric: tabular-nums; }
.door-nav { display: flex; gap: 1.2rem; margin-left: auto; }
.door-nav a { text-decoration: none; color: var(--moon-2); padding: 0.2rem 0; border-bottom: 1px solid transparent; }
.door-nav a[aria-current] { color: var(--moon); border-bottom-color: var(--amber); }

.chapter-open { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; padding: 9rem var(--pad) 4rem; max-width: 78rem; margin: 0 auto; }
.opener { width: 100%; max-width: 26rem; justify-self: end; border-radius: 6px; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.95); }
.ch-num { font-size: 0.9rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate); }
.chapter-open h1 { font-size: clamp(2.8rem, 6.5vw, 5.4rem); margin-bottom: 1.6rem; }
.content-note { max-width: 32rem; padding: 1rem 1.2rem; margin-bottom: 1.8rem; border-radius: 12px; background: rgba(7, 16, 18, 0.7); box-shadow: 0 0 0 1px var(--line); color: var(--moon-2); font-size: 0.98rem; }
.content-note p { margin: 0; }
.content-note strong { color: var(--moon); }

.ghazal { padding: 4rem var(--pad) 6rem; max-width: 60rem; margin: 0 auto; }
.ghazal > h2, .matlab > h2, .afsana > h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-style: italic; color: var(--amber-hi); margin: 0 auto 2rem; }
.matlab > h2, .afsana > h2 { max-width: 44rem; }
.sher { min-height: 58svh; display: grid; align-content: center; font-family: var(--serif); font-size: clamp(1.6rem, 3.6vw, 2.7rem); line-height: 1.42; }
.sher p { margin: 0; max-width: 26ch; }
.sher .c2 { padding-left: 1.4em; margin-top: 0.3em; }

.matlab, .afsana { padding: 3rem var(--pad) 4rem; }
.page { max-width: 44rem; margin: 0 auto; padding: clamp(1.5rem, 5vw, 3.5rem); border-radius: 14px; background: var(--page-bg); color: var(--page-fg);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9); font-family: var(--serif); font-size: clamp(1.08rem, 1.4vw, 1.2rem); line-height: 1.78; }
.page p { margin: 0 0 1.05em; }
.page .verse { margin: 2.6rem 0 1.4rem; padding: 1.4rem 0 0; border-top: 1px solid var(--page-line); font-size: 1.3em; line-height: 1.5; font-style: italic; }
.page .verse:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.page .verse p { margin: 0; }
.page .note { margin: 2rem 0 2.2rem; padding: 1rem 0 0.2rem 1.4rem; border-top: 1px solid rgba(224, 164, 88, 0.5); }
[data-theme="chiraag"] .page .note { border-top-color: rgba(138, 79, 16, 0.55); }
.page .note p:last-child { margin-bottom: 0; }
.page .lbl { font-family: var(--sans); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.16em; color: var(--amber); margin-bottom: 0.4rem; }
[data-theme="chiraag"] .page .lbl { color: #8a4f10; }
.page .dial { padding-left: 1.2em; }
.page .story-art { margin: 2.2rem calc(clamp(1.5rem, 5vw, 3.5rem) * -0.5); }
.page .story-art img { width: 100%; border-radius: 8px; }
.page .story-art figcaption { font-family: var(--sans); font-size: 0.85rem; color: var(--page-2); margin-top: 0.6rem; }
.page .last { margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid var(--page-line); font-style: italic; color: var(--page-2); }
.page .attr { font-style: normal; font-family: var(--sans); letter-spacing: 0.18em; font-size: 0.85rem; color: var(--page-fg); }

.chapter-end { max-width: 44rem; margin: 0 auto; padding: 5rem var(--pad) 6rem; display: grid; justify-items: start; gap: 1.2rem; }
.end-mark { font-family: var(--serif); font-style: italic; font-size: 1.4rem; color: var(--moon-2); margin: 0; }
.chapter-end h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.end-links { color: var(--slate); margin: 0; }
.end-links a { color: var(--moon-2); }
.sealed-list { list-style: none; margin: 0.8rem 0; padding: 0; columns: 2 13rem; column-gap: 2rem; width: 100%; font-family: var(--serif); color: var(--moon-2); }
.sealed-list li { padding: 0.25rem 0; break-inside: avoid; }
.sealed-list span { display: inline-block; width: 2rem; font-family: var(--sans); font-size: 0.82rem; color: var(--slate); font-variant-numeric: tabular-nums; }
[data-page="reader"] .care { margin: 0 auto 5rem; }

/* ---------- journal + plain pages ---------- */
.journal-index, .plain-page { max-width: 52rem; margin: 0 auto; padding: 9rem var(--pad) 5rem; }
.journal-index h1, .plain-page h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); margin-bottom: 1rem; }
.plain-page h2 { font-size: 1.5rem; margin: 2.2rem 0 0.6rem; }
.plain-page p { color: var(--moon-2); max-width: 40rem; }
.essay { max-width: 46rem; margin: 0 auto; padding: 9rem var(--pad) 5rem; }
.essay-head { margin-bottom: 2rem; }
.essay-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 0.4rem 0 1rem; }
.essay-head p { color: var(--slate); font-size: 0.92rem; margin: 0.2rem 0; }
.essay-body { padding: clamp(1.5rem, 5vw, 3.2rem); border-radius: 14px; background: var(--page-bg); color: var(--page-fg); font-family: var(--serif); font-size: 1.15rem; line-height: 1.75; box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9); }
.essay-body h2 { font-size: 1.6rem; margin: 2.2rem 0 0.8rem; }
.essay-body blockquote { margin: 2rem 0; padding: 1.2rem 0; border-top: 1px solid var(--page-line); border-bottom: 1px solid var(--page-line); font-size: 1.35em; line-height: 1.5; }
.essay-body blockquote p { margin: 0; }
.essay-body figure { margin: 2rem 0; }
.essay-body figcaption, .essay-body cite { display: block; font-family: var(--sans); font-style: normal; font-size: 0.9rem; color: var(--page-2); margin-top: 0.6rem; }
.essay-end { margin-top: 3rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; }
.essay-end p { flex-basis: 100%; font-family: var(--serif); font-size: 1.3rem; margin: 0; }

/* ---------- footer ---------- */
.site-foot { padding: 3rem var(--pad) 4rem; background: linear-gradient(180deg, transparent, rgba(5, 10, 11, 0.9) 40%); }
.foot-inner { max-width: 72rem; display: grid; gap: 0.8rem; border-top: 1px solid var(--line); padding-top: 2rem; }
.foot-title { font-family: var(--serif); font-size: 1.15rem; margin: 0; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; }
.site-foot nav a { color: var(--moon-2); }

/* ---------- entrances: visible by default, JS adds the motion ---------- */
.can-reveal [data-reveal]:not(.is-in), .can-reveal .sher:not(.is-in) { opacity: 0; transform: translateY(18px); filter: blur(3px); }
[data-reveal], .sher { transition: opacity 1.4s var(--ease), transform 1.4s var(--ease), filter 1.4s var(--ease); }
.door-row li:nth-child(2) { transition-delay: 0.12s; }
.door-row li:nth-child(3) { transition-delay: 0.24s; }
.free-list li:nth-child(2) { transition-delay: 0.1s; }
.free-list li:nth-child(3) { transition-delay: 0.2s; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .nav { display: none; }
  .door-row, .free-list { grid-template-columns: 1fr; }
  .free-list { max-width: 26rem; }
  .chapter-open { grid-template-columns: 1fr; padding-top: 8.5rem; }
  .opener { justify-self: start; max-width: 15rem; }
  .scene-shade { background: linear-gradient(180deg, rgba(5, 10, 11, 0.15) 0%, rgba(5, 10, 11, 0.55) 60%, rgba(5, 10, 11, 0.7) 100%); }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .brand span { display: none; }
  .masthead { gap: 0.75rem; }
  .btn-small { padding: 0.45rem 0.85rem; }
  .reader-bar { gap: 0.8rem; }
  .door-nav { gap: 0.8rem; font-size: 0.85rem; }
  .sher { min-height: 48svh; }
  .scroll-cue { display: none; }
}
@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; }
}
.chapter-end.is-final { margin-bottom: 4rem; padding: clamp(1.75rem, 5vw, 3.5rem); border-radius: 14px; background: rgba(7, 16, 18, 0.9); box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9); }
[data-page="reader"] .masthead { background: var(--ink-0); }


/* ---------- store chooser (plain version; the 3D world draws its own) ---------- */
.store-where { flex-basis: 100%; margin: 0.2rem 0 0; color: var(--moon-2); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--amber-hi); text-decoration: underline; text-underline-offset: 0.22em; cursor: pointer; }
.store-markets { flex-basis: 100%; list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.store-markets[hidden] { display: none; }
.store-markets button { font: 400 0.95rem/1.2 var(--sans); color: var(--moon); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 0.45rem 0.85rem; cursor: pointer; }
.store-markets button[aria-pressed="true"] { border-color: var(--amber); color: var(--amber-hi); }
.store-fine { flex-basis: 100%; margin: 0.2rem 0 0; font-size: 0.88rem; color: var(--slate); }

/* ---------- world mode: the three.js canvas is the whole visible page ----------
   The HTML stays in the document, unseen, for screen readers, keyboard focus and search.
   position:fixed keeps a focused hidden link from scrolling the page. */
#world-scroll { display: none; }
.world-status { position: fixed; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
.world-pending main, .world-pending .masthead, .world-pending .site-foot, .world-pending .skip,
.world main, .world .masthead, .world .site-foot, .world .skip {
  position: fixed !important; top: 0; left: 0; width: 1px !important; height: 1px !important; overflow: hidden !important;
  clip-path: inset(50%); white-space: nowrap; margin: 0 !important; padding: 0 !important; opacity: 0; pointer-events: none;
}
html:not(.world) .scene-still { display: block; } /* plain version and no-WebGL: a still moon over the sea */
.world-pending .scene-shade, .world .scene-shade, .world .scene-still { display: none; }
.world-pending .scene-still { display: block; }
.world #world-scroll { display: block; position: relative; z-index: 0; width: 1px; pointer-events: none; }
.world #scene { touch-action: pan-y; }
.world body.is-pointing, .world body.is-pointing #scene { cursor: pointer; }
.world-snap { position: absolute; left: 0; width: 1px; height: 1px; scroll-snap-align: start; }
html.world { scroll-snap-type: y proximity; scroll-behavior: auto; }


/* ---------- menu, footer and read-aloud in the plain version ---------- */
.menu-btn { width: auto; padding: 0 0.9rem; display: inline-flex; gap: 0.35rem; }
.menu-btn span { font: 600 0.9rem/1 var(--sans); }
.site-menu { position: fixed; top: 4.4rem; right: var(--pad); z-index: 30; width: min(22rem, calc(100vw - 2rem)); padding: 1.2rem 1.4rem;
  border-radius: 14px; background: rgba(7, 16, 18, 0.97); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--line); }
.site-menu[hidden] { display: none; }
.site-menu ul { list-style: none; margin: 0; padding: 0; }
.menu-places a { display: block; padding: 0.45rem 0; text-decoration: none; font: 400 1.15rem/1.3 var(--serif); color: var(--moon); }
.menu-places a span { display: block; font: 400 0.85rem/1.4 var(--sans); color: var(--slate); }
.menu-places a:hover { color: var(--amber-hi); }
.menu-settings { display: grid; gap: 0.4rem; margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.menu-settings button { width: 100%; text-align: left; font: 400 0.95rem var(--sans); color: var(--moon-2); background: none; border: 0; padding: 0.35rem 0; cursor: pointer; }
.menu-settings button::after { content: "Off"; float: right; color: var(--slate); }
.menu-settings button[aria-pressed="true"]::after { content: "On"; color: var(--amber-hi); }
.social { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.4rem 0; padding: 0; }
.social[hidden] { display: none; }
.social a { width: 2.6rem; height: 2.6rem; border-radius: 999px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--moon); }
.social a:hover { border-color: var(--amber); color: var(--amber-hi); }
.social svg { width: 1.15rem; height: 1.15rem; }
.credits { color: var(--moon-2); font-size: 0.92rem; max-width: 52rem; margin: 0; }
.legal a { color: var(--moon-2); }
.voice-btn { margin: 0 0 1.5rem; }
html:not(.world) [data-ghazal-voice], html:not(.world) .masthead [data-sound], html:not(.world) .menu-settings [data-setting] { display: none; }
