/* Eravel — identity tokens. See BRAND.md */
:root {
  /* Eravel identity tokens — from Soulforge-Universe/art/identity/eravel-brand-system/v2-selected-tree */
  --night-950: #121110;  /* charcoal deep */
  --night-900: #1b1a18;  /* charcoal — main surface (owner: elegant charcoal, not navy) */
  --night-800: #262421;  /* charcoal raised */
  --night-700: #33302c;
  --gold-500: #efbd6b;   /* sun bright — accent */
  --gold-400: #f3cc8a;
  --gold-600: #b98c45;
  --gold-faint: rgba(239, 189, 107, .16);
  --ivory-100: #e6dcc4;  /* cream — text (owner: cream, not white) */
  --ivory-300: #c7bda6;
  --ivory-500: #8f9aa0;  /* ash-ish */
  --echo: rgba(46, 194, 241, .10);
  --ink: #2ec2f1;        /* passage bright — the thread */
  --paper: #ebe6da;

  --f-display: "Aref Ruqaa", "Amiri", serif;
  --f-latin: "Newsreader", Georgia, serif;
  --f-read: "Amiri", "Noto Naskh Arabic", serif;
  --f-ui: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif;

  --gutter: clamp(16px, 5vw, 48px);
  --measure: 34rem;
  --radius: 2px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  background: var(--night-900);
  color: var(--ivory-100);
  font-family: var(--f-ui);
  font-size: 1rem;
  line-height: 1.8;

}
img, svg { max-width: 100%; display: block; }
a { color: var(--gold-500); text-decoration-thickness: 1px; text-underline-offset: .35em; }
a:hover { color: var(--ivory-100); }
:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem var(--gutter);
  background: linear-gradient(to bottom, rgba(18,17,16,.85), rgba(18,17,16,0));
  transition: background .4s;
}
.site-header.is-solid { background: rgba(27,26,24,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--gold-faint); }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ivory-100); }
.brand img { height: 26px; width: auto; }
.brand span { font-family: var(--f-display); font-size: 1.35rem; line-height: 1; }
.brand .wm { height: 30px; }
.nav { display: flex; align-items: center; gap: 1.4rem; font-size: .9rem; }
.nav a { color: var(--ivory-300); text-decoration: none; }
.nav a:hover { color: var(--gold-400); }
.nav .nav-links { display: none; gap: 1.4rem; }
@media (min-width: 820px) { .nav .nav-links { display: flex; } }

.lang-switch { display: flex; border: 1px solid var(--gold-faint); font-size: .78rem; }
.lang-switch a, .lang-switch span { padding: .2rem .6rem; text-decoration: none; }
.lang-switch [aria-current] { background: var(--gold-faint); color: var(--gold-400); }
.lang-switch .soon { color: var(--ivory-500); cursor: not-allowed; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .85rem 1.8rem; min-height: 48px;
  font-family: var(--f-ui); font-size: .95rem; letter-spacing: .02em;
  color: var(--night-950); background: var(--gold-500);
  border: 1px solid var(--gold-500); border-radius: var(--radius);
  text-decoration: none; cursor: pointer; transition: background .25s, color .25s;
}
.btn:hover { background: var(--gold-400); color: var(--night-950); }
.btn--ghost { background: transparent; color: var(--gold-400); }
.btn--ghost:hover { background: var(--gold-faint); color: var(--ivory-100); }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: grid; place-items: center; text-align: center;
  padding: 6rem var(--gutter) 4rem; isolation: isolate; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 45% at 50% 38%, rgba(46,194,241,.07), transparent 70%),
    radial-gradient(ellipse 90% 60% at 50% 110%, var(--echo), transparent 70%),
    var(--night-950);
}
.hero__ripples { position: absolute; inset: auto 0 0 0; height: 26%; z-index: -1; opacity: .18; }
.hero__ripples path { fill: none; stroke: var(--ink); vector-effect: non-scaling-stroke; }
@media (max-width: 600px) { .hero { min-height: 92svh; padding-block: 5rem 3rem; } }
.hero__inner { max-width: 44rem; }
.hero__tree { width: min(78vw, 520px); height: auto; margin: 0 auto 1.2rem; }
.eyebrow { font-size: .8rem; letter-spacing: .3em; color: var(--gold-500); text-transform: uppercase; margin: 0 0 .6rem; }
.hero h1 {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(4.2rem, 17vw, 9rem); line-height: 1.05; margin: 0;
  color: var(--ivory-100);
  text-shadow: 0 0 60px rgba(46,194,241,.12);
}
.hero__latin { font-family: var(--f-latin); font-weight: 600; letter-spacing: .42em; font-size: .85rem; color: var(--ivory-500); margin: .4rem 0 2rem; direction: ltr; }
.hero__book { font-family: var(--f-read); font-size: 1.15rem; color: var(--gold-400); margin: 0 0 2.2rem; }
.hero__book span { color: var(--ivory-500); }
.hero__line {
  font-family: var(--f-read); font-size: clamp(1.35rem, 4.4vw, 1.9rem); line-height: 1.7;
  margin: 0 auto 2.4rem; max-width: 30rem; color: var(--ivory-100);
}
.hero__line cite { display: block; font-style: normal; font-family: var(--f-ui); font-size: .8rem; color: var(--ivory-500); margin-top: .6rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }
.scroll-cue { position: absolute; bottom: 1.4rem; left: 50%; translate: -50% 0; width: 1px; height: 44px; background: linear-gradient(var(--gold-500), transparent); }

/* ---------- sections ---------- */
.section { padding: clamp(4.5rem, 12vw, 8rem) var(--gutter); }
.section--alt { background: var(--night-950); }
.wrap { max-width: 68rem; margin: 0 auto; }
.section-head { text-align: center; margin-bottom: 3rem; }
.section-head h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(2.2rem, 7vw, 3.3rem); margin: 0; line-height: 1.3; }
.ornament { display: block; width: 120px; height: 14px; margin: 1rem auto 0; }
.ornament path, .ornament circle { stroke: var(--gold-600); fill: none; }
.ornament circle { fill: var(--gold-500); stroke: none; }

.prose { max-width: var(--measure); margin: 0 auto; font-family: var(--f-read); font-size: 1.22rem; line-height: 2.05; color: var(--ivory-300); }
.prose p { margin: 0 0 1.3em; }
.prose .lead { font-size: 1.4rem; color: var(--ivory-100); }
.prose .question { text-align: center; font-size: 1.5rem; color: var(--gold-400); margin: 2.2rem 0; }

/* world lexicon */
.lexicon { display: grid; gap: 1px; background: var(--gold-faint); border: 1px solid var(--gold-faint); margin-top: 3.5rem; }
@media (min-width: 700px) { .lexicon { grid-template-columns: repeat(3, 1fr); } }
.lexicon div { background: var(--night-900); padding: 1.8rem 1.6rem; }
.section--alt .lexicon div { background: var(--night-950); }
.lexicon dt { font-family: var(--f-display); font-size: 1.6rem; color: var(--gold-400); margin-bottom: .4rem; }
.lexicon dd { margin: 0; font-family: var(--f-read); font-size: 1.08rem; line-height: 1.9; color: var(--ivory-300); }

/* anchors triad */
.anchors { display: flex; justify-content: center; gap: clamp(1.5rem, 7vw, 4rem); margin: 2.5rem 0 0; text-align: center; font-family: var(--f-display); font-size: 1.5rem; }
.anchors span { position: relative; padding-top: 1.4rem; }
.anchors span::before { content: ""; position: absolute; top: 0; left: 50%; translate: -50% 0; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-500); }
.anchors span.dim { color: var(--ivory-500); }
.anchors span.dim::before { background: transparent; border: 1px solid var(--gold-600); }

/* quotes */
.quotes { display: grid; gap: 1.5rem; }
@media (min-width: 760px) { .quotes { grid-template-columns: repeat(2, 1fr); } }
.quote {
  margin: 0; padding: 2.2rem 2rem 1.8rem; position: relative;
  border: 1px solid var(--gold-faint);
  background: linear-gradient(160deg, rgba(198,168,105,.05), transparent 60%);
}
.quote::before { content: "«"; position: absolute; top: -.1rem; right: 1.2rem; font-family: var(--f-read); font-size: 3.4rem; line-height: 1; color: var(--gold-600); opacity: .6; }
.quote p { margin: 0; font-family: var(--f-read); font-size: 1.35rem; line-height: 1.9; color: var(--ivory-100); }
.quote footer { margin-top: 1rem; font-size: .82rem; color: var(--ivory-500); }
.quote--wide { grid-column: 1 / -1; text-align: center; border: 0; background: none; padding-block: 3rem; }
.quote--wide::before { display: none; }
.quote--wide p { font-size: clamp(1.45rem, 4vw, 1.9rem); }

/* read teaser */
.read-teaser { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 860px) { .read-teaser { grid-template-columns: 1fr 1.2fr; } }
.chapter-card { border: 1px solid var(--gold-faint); padding: 2.4rem 2rem; text-align: center; background: var(--night-900); }
.chapter-card .num { font-family: var(--f-display); font-size: 4rem; color: var(--gold-500); line-height: 1; }
.chapter-card h3 { font-family: var(--f-display); font-weight: 400; font-size: 2rem; margin: .6rem 0; }
.chapter-card .meta { font-size: .85rem; color: var(--ivory-500); margin-bottom: 1.8rem; }
.excerpt { font-family: var(--f-read); font-size: 1.2rem; line-height: 2; color: var(--ivory-300); margin: 0; position: relative; max-height: 17rem; overflow: hidden; }
.excerpt::after { content: ""; position: absolute; inset: auto 0 0 0; height: 7rem; background: linear-gradient(transparent, var(--night-950)); }
.excerpt p { margin: 0 0 1em; }

/* books */
.books { display: grid; gap: 1.2rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .books { grid-template-columns: 1.6fr repeat(4, 1fr); } }
.book { border: 1px solid var(--gold-faint); padding: 1.6rem 1.2rem; display: flex; flex-direction: column; justify-content: flex-end; min-height: 13rem; position: relative; }
.book .vol { font-family: var(--f-ui); font-size: .875rem; color: var(--gold-500); }
.book h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.5rem; margin: .2rem 0 .4rem; }
.book p { margin: 0; font-size: .85rem; color: var(--ivory-500); }
.book--current { grid-column: 1 / -1; min-height: 20rem; padding: 2rem; background:
  radial-gradient(ellipse at 50% 20%, rgba(46,194,241,.10), transparent 60%), var(--night-800); border-color: rgba(239,189,107,.4); }
@media (min-width: 900px) { .book--current { grid-column: auto; } }
.book--current img { display: none; }
.book--current h3 { font-size: 2.2rem; color: var(--ivory-100); }
.book--current p { font-size: .92rem; color: var(--ivory-300); }
.book--locked { min-height: 8rem; color: var(--ivory-500); background: none; border-width: 0 0 1px; }
.book--locked h3 { color: var(--ivory-500); }
.status { display: inline-block; margin-top: 1rem; font-size: .75rem; letter-spacing: .08em; padding: .15rem .6rem; border: 1px solid var(--gold-faint); color: var(--gold-400); align-self: flex-start; }

/* waitlist */
.waitlist { max-width: 36rem; margin: 0 auto; text-align: center; }
.waitlist p.lede { font-family: var(--f-read); font-size: 1.2rem; color: var(--ivory-300); margin: 0 0 2rem; }
.form { display: flex; flex-direction: column; gap: .8rem; }
@media (min-width: 560px) { .form { flex-direction: row; } }
.form input[type=email] {
  flex: 1; min-height: 50px; padding: .8rem 1rem;
  background: var(--night-900); color: var(--ivory-100);
  border: 1px solid var(--gold-600); border-radius: var(--radius);
  font: inherit; direction: ltr; text-align: right;
}
.form input::placeholder { color: var(--ivory-500); }
.form input:focus { outline: none; border-color: var(--gold-500); }
.form-note { font-size: .82rem; color: var(--ivory-500); margin-top: 1rem; min-height: 1.5em; }
.form-note.ok { color: var(--gold-400); }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }

/* footer */
.site-footer { padding: 3.5rem var(--gutter) 2.5rem; border-top: 1px solid var(--gold-faint); background: var(--night-950); font-size: .85rem; color: var(--ivory-500); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.site-footer a { color: var(--ivory-300); text-decoration: none; }

/* reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 1s ease, transform 1s ease; }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ======================= reader ======================= */
.reader-body { background: var(--night-900); }
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 30; background: transparent; }
.progress span { display: block; height: 100%; width: 0; background: var(--gold-500); margin-inline-start: 0; }
.reader-bar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .7rem var(--gutter); background: rgba(27,26,24,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--gold-faint); font-size: .85rem; }
.reader-bar .crumb { color: var(--ivory-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-tools { display: flex; gap: .3rem; }
.reader-tools button { min-width: 44px; min-height: 44px; background: transparent; color: var(--ivory-300); border: 1px solid var(--gold-600); font: inherit; cursor: pointer; }
.reader-tools button:hover { color: var(--gold-400); border-color: var(--gold-600); }

.chapter-open { text-align: center; padding: clamp(4rem, 14vw, 8rem) var(--gutter) 2rem; }
.chapter-open img { width: min(70vw, 280px); margin: 0 auto 1.2rem; }
.chapter-open .book-name { font-family: var(--f-read); color: var(--gold-500); font-size: 1rem; margin: 0; }
.chapter-open .chapter-no { font-family: var(--f-ui); font-size: .875rem; letter-spacing: 0; color: var(--ivory-500); margin: 1.6rem 0 .4rem; }
.chapter-open h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(2.6rem, 10vw, 4.4rem); margin: 0; line-height: 1.3; }

.chapter-text {
  max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 1rem var(--gutter) 5rem;
  font-family: var(--f-read); font-size: var(--read-size, 1.375rem); line-height: 2; color: var(--ivory-100);
  text-align: start; hyphens: none;
}
.chapter-text p { margin: 0; text-indent: 1.6em; }
.chapter-text p.first { text-indent: 0; }
.chapter-text p.first::first-line { color: var(--gold-400); }
.chapter-text p.solo { text-indent: 0; text-align: center; margin: 1.1em 0; color: var(--ivory-100); }
.chapter-text strong { font-weight: 400; color: var(--gold-400); }
.scene-break { display: block; width: 120px; height: 20px; margin: 3.2rem auto; }
.scene-break path { stroke: var(--gold-600); fill: none; }
.scene-break circle { fill: var(--gold-500); }
.chapter-end { text-align: center; padding: 0 var(--gutter) 6rem; }
.chapter-end img { height: 34px; width: auto; margin: 0 auto 1.6rem; opacity: .85; }
.chapter-end p { font-family: var(--f-read); color: var(--ivory-300); font-size: 1.15rem; margin: 0 0 1.8rem; }
.chapter-end .cta { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }
.reader-body.light { --night-900: #e6dcc4; --night-950: #dbd0b8; --ivory-100: #071019; --ivory-300: #2b3238; --ivory-500: #5f6b72; --gold-400: #6f4c1c; --gold-500: #6f4c1c; --gold-600: #a58a5a; --gold-faint: rgba(111,76,28,.18); --ink: #0c617c; color-scheme: light; }
.reader-body.light .reader-bar { background: rgba(230,220,196,.95); }
.reader-body.light .wm-dark, .wm-light { display: none; } .reader-body.light .wm-light { display: block; }
.reader-body.light .tree-dark { display: none; } .tree-light { display: none; } .reader-body.light .tree-light { display: block; }
