/* The website around the game: home, about, credits, privacy, legal.
   The game's own palette (U-01): warm near-black, coral, DM Sans; Garamond for the story voice. */

/* León's \b mark (P-19, build.mjs marks()): each piece of a line is kept whole, so the line breaks between pieces first. */
t-seg { display: inline-block; }

@font-face { font-family: 'DM Sans'; font-weight: 100 1000; font-display: swap; src: url(fonts/dmsans.woff2) format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-weight: 400 600; font-display: swap; src: url(fonts/ebgaramond.woff2) format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-style: italic; font-weight: 400 600; font-display: swap; src: url(fonts/ebgaramond-italic.woff2) format('woff2'); }

:root {
  --bg: #191a19;
  --bg-2: #202120;
  --raised: #272827;
  --line: #3a3b39;
  --ink: #ecebe6;
  --ink-dim: #b5b3ab;
  --ink-faint: #85837c;
  --accent: #eb947c;
  --accent-ink: #1d1410;
  --gold: #d9b878;
  --radius: 14px;
  --wrap: min(1120px, calc(100vw - 32px));
  --serif: 'EB Garamond', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #f3b29f; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: var(--wrap); margin: 0 auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 16px; }

/* ---- header ---- */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.top .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -0.2px; font-size: 18px; }
/* The UNTOLD wordmark (U-194): /img/untold.svg as a mask, painted in the A1 gold, as in the game's menus. */
.brand-logo { display: inline-block; height: 26px; aspect-ratio: 1952.5 / 388;
  background: linear-gradient(180deg, #fff6da 0%, #f0d58c 38%, #c8963f 62%, #8a5a22 100%);
  -webkit-mask: url(/img/untold.svg) center / contain no-repeat; mask: url(/img/untold.svg) center / contain no-repeat; }
.brand:hover .brand-logo { filter: brightness(1.18); }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a { color: var(--ink-dim); text-decoration: none; font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
/* Home's hover line, on every page's nav bar (U-181, León 2026-10-16); the current page keeps it drawn. */
.nav a:not(.btn) { position: relative; padding: 4px 0; }
.nav a:not(.btn)::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease; }
.nav a:not(.btn):hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav .btn-primary, .nav .btn-primary:hover { color: var(--accent-ink); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 999px;
  font: 600 16px/1 var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 28px rgba(235, 148, 124, 0.28); }
.btn-primary:hover { background: #f2a892; color: var(--accent-ink); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink-faint); color: var(--ink); }
.btn-small { padding: 9px 16px; font-size: 14px; }
.btn-big { padding: 17px 34px; font-size: 19px; }

/* ---- home: hero ---- */
.hero { position: relative; overflow: hidden; padding: 72px 0 88px; }
.hero::before {
  content: ''; position: absolute; inset: -20% -10% auto; height: 120%;
  background: radial-gradient(60% 50% at 70% 40%, rgba(235, 148, 124, 0.16), transparent 70%),
              radial-gradient(40% 40% at 15% 20%, rgba(120, 150, 210, 0.10), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.kicker { font: 600 13px/1 var(--sans); letter-spacing: 2.4px; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; }
.hero h1 { font: 600 clamp(40px, 6vw, 68px)/1.02 var(--sans); letter-spacing: -1.6px; margin: 0 0 18px; }
.hero h1 em { font: italic 500 1.04em/1 var(--serif); letter-spacing: -0.5px; color: var(--gold); }
.lede { font-size: clamp(18px, 2vw, 21px); color: var(--ink-dim); max-width: 34em; margin: 0 0 30px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cta-note { color: var(--ink-faint); font-size: 14px; margin-top: 14px; }

.fan { position: relative; height: 440px; }
.fan img {
  position: absolute; width: 230px; aspect-ratio: 488 / 680; border-radius: 12px; left: 50%; top: 50%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
  transform-origin: 50% 120%; transition: transform 300ms ease;
}
.fan img:nth-child(1) { transform: translate(-50%, -50%) rotate(-21deg) translateX(-34px); }
.fan img:nth-child(2) { transform: translate(-50%, -50%) rotate(-7deg) translateX(-10px); }
.fan img:nth-child(3) { transform: translate(-50%, -50%) rotate(7deg) translateX(10px); }
.fan img:nth-child(4) { transform: translate(-50%, -50%) rotate(21deg) translateX(34px); }
.fan:hover img:nth-child(1) { transform: translate(-50%, -50%) rotate(-25deg) translateX(-60px); }
.fan:hover img:nth-child(4) { transform: translate(-50%, -50%) rotate(25deg) translateX(60px); }

/* ---- sections ---- */
section { padding: 72px 0; scroll-margin-top: 64px; }
h2[id] { scroll-margin-top: 84px; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2 { font: 600 clamp(28px, 3.4vw, 40px)/1.1 var(--sans); letter-spacing: -0.8px; margin: 0 0 12px; }
.section-lede { color: var(--ink-dim); max-width: 40em; margin: 0 0 36px; font-size: 18px; }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.mode {
  position: relative; display: flex; flex-direction: column; min-height: 420px; border-radius: var(--radius); overflow: hidden;
  background: var(--raised); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: transform 180ms ease, border-color 180ms ease;
}
.mode:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); color: var(--ink); }
.mode-art { height: 230px; background-size: cover; background-position: center; position: relative; }
.mode-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 40%, var(--raised)); }
.mode-body { padding: 4px 26px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.mode h3 { font: 600 26px/1.15 var(--sans); margin: 0; letter-spacing: -0.4px; }
.mode p { margin: 0; color: var(--ink-dim); }
.mode .tag { align-self: flex-start; font: 600 12px/1 var(--sans); letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent); padding: 7px 10px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 999px; }
.mode .go { margin-top: auto; font-weight: 600; color: var(--accent); }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pillar { padding: 26px; border-radius: var(--radius); background: var(--raised); border: 1px solid var(--line); }
.pillar h3 { margin: 0 0 8px; font: 600 20px/1.2 var(--sans); }
.pillar p { margin: 0; color: var(--ink-dim); font-size: 16px; }
.pillar .num { font: italic 500 34px/1 var(--serif); color: var(--gold); margin-bottom: 14px; display: block; }

.quote { font: italic 400 clamp(24px, 3vw, 34px)/1.35 var(--serif); color: var(--ink); max-width: 30em; margin: 0 auto; text-align: center; }
.quote cite { display: block; font: 400 15px/1.4 var(--sans); color: var(--ink-faint); margin-top: 16px; font-style: normal; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.card-box { padding: 30px; border-radius: var(--radius); background: var(--raised); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.card-box h3 { margin: 0; font: 600 22px/1.2 var(--sans); }
.card-box p { margin: 0; color: var(--ink-dim); }
.card-box .row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 6px; }

/* ---- prose pages ---- */
.page-head { padding: 64px 0 18px; }
.page-head h1 { font: 600 clamp(34px, 5vw, 52px)/1.05 var(--sans); letter-spacing: -1.2px; margin: 0 0 10px; }
.page-head p { color: var(--ink-dim); font-size: 19px; margin: 0; max-width: 38em; }
.prose { padding: 24px 0 80px; max-width: 760px; }
.prose h2 { font-size: 26px; margin: 44px 0 10px; letter-spacing: -0.4px; }
.prose h3 { font-size: 19px; margin: 28px 0 6px; }
.prose p, .prose li { color: var(--ink-dim); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 4px 0; }
.prose .note { padding: 16px 20px; border-left: 3px solid var(--accent); background: var(--raised); border-radius: 0 10px 10px 0; color: var(--ink-dim); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 12px 0 8px; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-dim); }
.prose th { color: var(--ink); font-weight: 600; }
.draft { display: inline-block; font: 600 11px/1 var(--sans); letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent-ink); background: var(--gold); padding: 5px 8px; border-radius: 6px; vertical-align: middle; }

/* ---- chapter lists (campaign, challenges) ---- */
.howto-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 8px 0 36px; color: var(--ink-dim); font-size: 15px; }
.howto-strip strong { color: var(--ink); }
.list-head { margin: 36px 0 18px; font-size: 26px; }
.chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; padding-bottom: 72px; }
.chapter { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--raised); border: 1px solid var(--line); }
.chapter-art { height: 170px; background: var(--bg-2) center / cover no-repeat; }
.chapter-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.chapter-body h3 { margin: 0; font: 600 20px/1.2 var(--sans); }
.chapter-body p { margin: 0; color: var(--ink-dim); font-size: 15px; }
.chapter-body .btn { align-self: flex-start; margin-top: auto; }
.chapter-kicker { font: 600 12px/1 var(--sans) !important; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent) !important; }
.chapter-meta { font-size: 14px !important; color: var(--ink-faint) !important; padding-bottom: 8px; }
.chapter.later { opacity: 0.55; }
.chapter.later .chapter-art { filter: grayscale(0.8); }
.chapter-soon { margin-top: auto; font-size: 14px; color: var(--ink-faint); font-style: italic; }

/* ---- feedback form ---- */
.fb { display: grid; gap: 18px; max-width: 640px; }
.fb-kind { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--ink-dim); }
.fb-kind legend { color: var(--ink); font-weight: 600; margin-bottom: 8px; }
.fb-field { display: grid; gap: 8px; color: var(--ink); font-weight: 600; }
.fb-opt { color: var(--ink-faint); font-weight: 400; }
.fb textarea, .fb input:not([type=radio]) { width: 100%; font: 400 16px/1.5 var(--sans); color: var(--ink); background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.fb textarea:focus, .fb input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fb-status { color: var(--ink-dim); margin-left: 10px; }
.fb-context, .fb-note { color: var(--ink-faint); font-size: 14px; }

/* ---- footer ---- */
.foot { border-top: 1px solid var(--line); padding: 44px 0 36px; color: var(--ink-faint); font-size: 14px; }
/* Links | the tagline and who makes it | links (León, 2026-10-19: the tagline centred between the two columns). */
.foot .wrap { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 32px; align-items: center; }
.split { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.foot h4 { color: var(--ink); margin: 0 0 10px; font: 600 14px/1 var(--sans); letter-spacing: 0.4px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; justify-items: center; text-align: center; }
.foot .about-col { text-align: center; }
.foot .about-col p { margin: 0; }
.foot .foot-tagline { font: 700 20px/1.3 var(--cinzel, var(--sans)); letter-spacing: 0.04em; color: var(--gold, var(--ink)); margin-bottom: 10px; }
.foot a { color: var(--ink-dim); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot .fine { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 22px; line-height: 1.55; }

/* ---- small screens ---- */
@media (max-width: 860px) {
  .hero { padding: 40px 0 56px; }
  .hero .wrap, .modes, .split, .pillars, .howto-strip { grid-template-columns: 1fr; }
  .fan { height: 290px; order: -1; margin-bottom: 18px; margin: 0 auto; width: 100%; max-width: 340px; }
  .fan img { width: 116px; transform-origin: 50% 50%; }
  .fan img:nth-child(1) { transform: translate(-50%, -50%) rotate(-16deg) translateX(-50px); }
  .fan img:nth-child(2) { transform: translate(-50%, -50%) rotate(-5deg) translateX(-17px); }
  .fan img:nth-child(3) { transform: translate(-50%, -50%) rotate(5deg) translateX(17px); }
  .fan img:nth-child(4) { transform: translate(-50%, -50%) rotate(16deg) translateX(50px); }
  .kicker { letter-spacing: 1.6px; }
  .nav a:not(.btn) { display: none; }
  .foot .wrap { grid-template-columns: 1fr 1fr; }
  .foot .about-col { grid-column: 1 / -1; order: -1; }
  section { padding: 52px 0; }
  .mode { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---- the brand's A1 look on every page (U-166 round ten; León, 2026-10-16: "All pages should have this look now") ----
   Cinzel and Cinzel Decorative in gold over the deep blue T2 texture, which drifts behind the page, as on the game's
   menu (50_ENGINE/web/style.css). Body text stays DM Sans: Cinzel has capitals only. */
@font-face { font-family: 'Cinzel'; font-weight: 400 900; font-display: swap; src: url(/fonts/cinzel.woff2) format('woff2'); }
@font-face { font-family: 'Cinzel Decorative'; font-weight: 900; font-display: swap; src: url(/fonts/cinzel-decorative-900.woff2) format('woff2'); }
:root {
  --bg: #070b14;
  --bg-2: rgba(9, 14, 26, 0.72);
  --raised: rgba(14, 21, 36, 0.82);
  --line: rgba(232, 196, 106, 0.16);
  --ink: #ece6d8;
  --ink-dim: #b7bcc6;
  --ink-faint: #848c99;
  --accent: #e8c46a;
  --accent-ink: #0b0f18;
  --gold: #e8c46a;
  --cinzel: 'Cinzel', Georgia, serif;
  --display: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
  --gold-fill: linear-gradient(180deg, #fff6da 0%, #f0d58c 40%, #c8963f 66%, #8a5a22 100%);
}
body { background: var(--bg); }
a:hover { color: #fff3cf; }

/* T2: two layers of the same noise slid past each other; the upper one breathes. Still for reduced motion. */
.t2 { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.t2 svg { position: absolute; left: -18%; top: -18%; width: 136%; height: 136%; will-change: transform, opacity; }
.t2 .l1 { animation: t2-drift1 28s ease-in-out infinite alternate; }
.t2 .l2 { mix-blend-mode: screen; animation: t2-drift2 38s ease-in-out infinite alternate, t2-breathe 11s ease-in-out infinite alternate; }
.t2 .shade { position: absolute; inset: 0; background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(6, 9, 16, 0.35), rgba(6, 9, 16, 0.88)); }
@keyframes t2-drift1 { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-10%, 7%, 0) scale(1.1); } }
@keyframes t2-drift2 { from { transform: translate3d(0, 0, 0) scale(1.06) rotate(0deg); } to { transform: translate3d(9%, -8%, 0) scale(1.15) rotate(4deg); } }
@keyframes t2-breathe { from { opacity: 0.35; } to { opacity: 0.75; } }
@media (prefers-reduced-motion: reduce) { .t2 svg { animation: none; } }

.top { background: rgba(7, 11, 20, 0.72); border-bottom-color: var(--line); }
.brand { font-family: var(--cinzel); font-weight: 700; letter-spacing: 0.08em; color: #f3e3b5; }
.brand:hover { color: var(--gold); }
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: #f3e3b5; }

.btn { border-radius: 3px; font: 700 15px/1 var(--cinzel); letter-spacing: 0.14em; text-transform: uppercase; }
.btn-primary { background: linear-gradient(180deg, #f6dc94, var(--gold) 55%, #c8963f); color: var(--accent-ink); box-shadow: 0 8px 26px rgba(232, 196, 106, 0.22); }
.btn-primary:hover { background: linear-gradient(180deg, #fff0c2, #f0d58c 55%, #d6a64f); color: var(--accent-ink); }
.btn-ghost { border-color: rgba(232, 196, 106, 0.4); color: #f3e3b5; }
.btn-ghost:hover { border-color: var(--gold); color: #fff3cf; }
.btn-small { font-size: 13px; }
.btn-big { font-size: 17px; }
.nav .btn-primary { background: transparent; color: var(--gold); border-color: var(--gold); box-shadow: none; }
.nav .btn-primary:hover { background: var(--gold); color: var(--accent-ink); }

.page-head h1, .hero h1 {
  font: 900 clamp(36px, 5vw, 58px)/1.1 var(--display); letter-spacing: 0.01em;
  background: var(--gold-fill); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #2a1808);
}
.kicker { font-family: var(--cinzel); font-weight: 700; letter-spacing: 0.32em; color: var(--gold); }
/* The standard page head (León, 2026-10-19): the page's name small over the big title, with room between them. */
.page-head .kicker { font-size: 14px; line-height: 1; color: var(--gold); margin: 0 0 22px; }
h2, .prose h2 { font-family: var(--cinzel); font-weight: 700; letter-spacing: 0.03em; color: #f0d58c; }
.prose h3, .mode h3, .pillar h3, .card-box h3, .chapter-body h3 { font-family: var(--cinzel); font-weight: 700; letter-spacing: 0.02em; color: #f3e3b5; }
.pillar .num { font: 700 30px/1 var(--display); color: var(--gold); }
.mode .tag, .mode .go, .chapter-kicker { color: var(--gold) !important; }
.mode:hover { border-color: rgba(232, 196, 106, 0.6); box-shadow: 0 0 26px rgba(232, 196, 106, 0.15); }
.mode-art::after { background: linear-gradient(to bottom, transparent 40%, rgba(14, 21, 36, 1)); }
.mode, .pillar, .card-box, .chapter { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.section-alt { background: var(--bg-2); }
.prose .note { border-left-color: var(--gold); }
.foot { background: rgba(7, 11, 20, 0.6); }
.foot h4 { font-family: var(--cinzel); color: #f3e3b5; letter-spacing: 0.1em; }
.draft { background: var(--gold); }
