/*
 * The landing page — a real web page, not the game.
 *
 * This is the document Google reads and a stranger lands on. Every word here is
 * real, selectable, copyable text in the served HTML. Nothing is baked into an
 * image, and nothing is torn out on mount — an earlier build shipped this prose
 * for crawlers and destroyed it the moment React booted, which is cloaking, and
 * it is exactly what gets a site penalised.
 *
 * The game lives at #play and mounts on demand. This page never gets deleted; it
 * is only hidden while you are playing.
 */

:root {
  --ink: #e9deba;
  --ink-dim: #a99d78;
  --ink-faint: #7a7058;
  --amber: #d9a94a;
  --amber-hot: #f0c46a;
  --red: #9a3b2a;
  --bg: #0d0c08;
  --bg-2: #14120c;
  --panel: #1a1710;
  --line: #3a3527;
  --max: 1180px;
}

* { box-sizing: border-box; }

/*
 * NOTE: no `overflow` on html/body here, deliberately.
 *
 * Setting overflow (even overflow-x: hidden, which forces overflow-y to auto)
 * turns the document into a scroll container and BREAKS `position: sticky` on
 * every descendant — the header scrolled straight off the top and measured at
 * viewportTop -1200. Horizontal overflow is prevented by design instead
 * (max-width on media, no fixed widths).
 */
html.landing-mode,
html.landing-mode body {
  height: auto;
  touch-action: auto;
  -webkit-user-select: text;
  user-select: text;
  scroll-behavior: smooth;
}

#landing {
  background: var(--bg);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  line-height: 1.7;
  font-size: 16px;
  overflow-x: clip; /* safe here — not on html/body, so sticky still works */
}
#landing[hidden] { display: none; }
#landing img { max-width: 100%; }

#landing .wrap { max-width: var(--max); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }

/* ── header — big mark at rest, condensed and PERSISTENT once you scroll ── */
#landing header.site {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 12, 8, 0.94);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
#landing header.site .wrap {
  display: flex; align-items: center; gap: 1rem;
  height: 132px; transition: height 0.25s ease;
}
/* The mark is the WIDE wordmark (3:1), so it's sized by WIDTH — a horizontal
   lockup capped by height is what made it read small before. Cropped to its
   artwork in PATH_Vietnam_Wordmark_Tight.png: the source had 274px of empty
   space above the letters and 368px below, so any height rule was sizing air. */
#landing header.site img.mark {
  width: clamp(240px, 26vw, 340px); height: auto; transition: width 0.25s ease;
}
/* Scrolled: the header stays with you, it just gets out of the way. */
html.scrolled #landing header.site .wrap { height: 72px; }
html.scrolled #landing header.site img.mark { width: 176px; }

#landing nav.site { margin-left: auto; display: flex; gap: clamp(0.5rem, 2vw, 1.5rem); align-items: center; }
#landing nav.site a { color: var(--ink-dim); text-decoration: none; font-size: 0.8rem; letter-spacing: 1px; text-transform: uppercase; }
#landing nav.site a:hover { color: var(--amber); }
#landing nav.site a.cta { color: #1a1408; background: var(--amber); padding: 0.55rem 1rem; border-radius: 4px; font-weight: bold; }
#landing nav.site a.cta:hover { background: var(--amber-hot); }
@media (max-width: 820px) {
  #landing nav.site a.hide-sm { display: none; }
  #landing header.site .wrap { height: 84px; }
  #landing header.site img.mark { width: min(52vw, 220px); }
}

/* ── hero ─────────────────────────────────────────────────────────────── */
#landing .hero { position: relative; min-height: min(78vh, 720px); display: flex; align-items: center; overflow: hidden; }
#landing .hero-art { position: absolute; inset: 0; z-index: 0; }
#landing .hero-art img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 1.6s ease-in-out;
}
#landing .hero-art img.on { opacity: 1; }
#landing .hero-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(13,12,8,0.96) 0%, rgba(13,12,8,0.82) 45%, rgba(13,12,8,0.55) 100%);
}
#landing .hero .wrap { position: relative; z-index: 1; padding-top: 3rem; padding-bottom: 3rem; }
/* The hero copy runs to the same measure as the sections below it, so the page
   reads as one column of text all the way down instead of a narrow hero and then
   a wide everything-else (owner: "could be wider, matching the rest of the text
   / images as you scroll down.. it would feel less crammed"). */
#landing .hero-copy { max-width: 78ch; }
#landing .hero .lede { max-width: 78ch; }
#landing .hero p { max-width: 78ch; }
#landing h1 {
  font-size: clamp(2rem, 5.2vw, 3.4rem); line-height: 1.08; margin: 0 0 0.6rem;
  color: #f4ecd2; letter-spacing: -0.5px;
}
#landing .tagline {
  color: var(--amber); font-weight: bold; letter-spacing: 3px; font-size: clamp(0.8rem, 2vw, 1rem);
  margin: 0 0 1.4rem; text-transform: uppercase;
}
#landing .lede { font-size: clamp(1rem, 1.6vw, 1.12rem); color: var(--ink); margin: 0 0 1.2rem; }
#landing .hero p { color: var(--ink-dim); }
#landing .btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
#landing a.btn {
  display: inline-block; text-decoration: none; padding: 0.9rem 1.5rem; border-radius: 5px;
  font-weight: bold; letter-spacing: 1px; font-size: 0.95rem;
}
#landing a.btn-primary { background: var(--amber); color: #1a1408; }
#landing a.btn-primary:hover { background: var(--amber-hot); }
#landing a.btn-ghost { border: 1px solid var(--line); color: var(--ink-dim); }
#landing a.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }
#landing .hero-meta { margin-top: 1.6rem; font-size: 0.78rem; color: var(--ink-faint); }

/* ── sections ─────────────────────────────────────────────────────────── */
#landing section { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--line); }
#landing section:nth-of-type(even) { background: var(--bg-2); }
#landing .eyebrow {
  color: var(--red); font-size: 0.7rem; letter-spacing: 0.25em; text-transform: uppercase;
  margin: 0 0 0.6rem; font-weight: bold;
}
#landing h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin: 0 0 1rem; color: #f4ecd2; line-height: 1.2; }
#landing h3 { font-size: 0.95rem; margin: 0 0 0.4rem; color: var(--amber); letter-spacing: 0.5px; }
#landing p { margin: 0 0 1rem; max-width: 72ch; }
#landing ul.plain { padding-left: 1.1rem; margin: 0 0 1rem; max-width: 72ch; }
#landing ul.plain li { margin-bottom: 0.5rem; color: var(--ink-dim); }
#landing ul.plain li b { color: var(--ink); }

/* text left, artwork right */
#landing .split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
#landing .split-art { text-align: center; }
#landing .split-art img { width: 100%; height: auto; border-radius: 8px; }
#landing .split-art.cutout img { border-radius: 0; filter: drop-shadow(0 18px 40px rgba(0,0,0,0.6)); }
#landing .split-art figcaption { margin-top: 0.7rem; font-size: 0.76rem; color: var(--ink-faint); }
@media (max-width: 880px) { #landing .split { grid-template-columns: 1fr; } }

/* the six feature cards */
#landing .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; margin-top: 2.4rem; }
#landing .card { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 1.2rem; }
#landing .card p { color: var(--ink-dim); font-size: 0.87rem; margin: 0; }

/* Six cards in a four-column grid leaves two dead cells on the last row. The
   call to action lives THERE rather than hanging under the grid (owner's mockup)
   — it fills the hole and it's beside the last thing you read. Spanning 2 keeps
   it in that gap at four columns; at narrower counts it simply wraps. */
#landing .cta-cell {
  grid-column: span 2;
  display: flex; align-items: center; justify-content: center;
  min-height: 100%;
}
#landing .cta-cell a.btn { text-align: center; }
@media (max-width: 560px) { #landing .cta-cell { grid-column: span 1; } }

/* ── the screens gallery ──────────────────────────────────────────────── */
#landing .shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; margin-top: 2rem; }
#landing figure.shot { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; cursor: zoom-in; transition: border-color 0.15s ease, transform 0.15s ease; }
#landing figure.shot:hover { border-color: var(--amber); transform: translateY(-2px); }
#landing figure.shot img { display: block; width: 100%; height: auto; }
#landing figure.shot figcaption { padding: 0.7rem 0.9rem; font-size: 0.82rem; color: var(--ink-dim); border-top: 1px solid var(--line); }

/* the image viewer */
#viewer {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(8, 7, 5, 0.96); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; flex-direction: column; padding: 3vh 4vw;
}
#viewer[open] { display: flex; }
#viewer img { max-width: 100%; max-height: 78vh; border: 1px solid var(--line); border-radius: 6px; }
#viewer .cap { margin-top: 1rem; color: var(--ink); font-size: 0.9rem; text-align: center; max-width: 70ch; }
#viewer .count { margin-top: 0.4rem; color: var(--ink-faint); font-size: 0.76rem; letter-spacing: 2px; }
#viewer button {
  position: absolute; background: rgba(26, 23, 16, 0.9); color: var(--amber);
  border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
  font: bold 24px ui-monospace, monospace; width: 52px; height: 52px;
}
#viewer button:hover { color: #fff6df; border-color: var(--amber); }
#viewer .prev { left: max(1rem, 3vw); }
#viewer .next { right: max(1rem, 3vw); }
#viewer .close { top: max(1rem, 3vh); right: max(1rem, 3vw); font-size: 20px; }

/* ── back to top ──────────────────────────────────────────────────────── */
#to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--amber); color: #1a1408; border: none; cursor: pointer;
  font: bold 22px ui-monospace, monospace; line-height: 1;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease, background 0.15s ease;
}
#to-top:hover { background: var(--amber-hot); }
html.scrolled #to-top { opacity: 1; pointer-events: auto; }
html.playing #to-top { display: none; }

/* ── footer — full bleed, edge to edge ────────────────────────────────── */
#landing footer.site { border-top: 1px solid var(--line); padding: clamp(2.5rem, 5vw, 4rem) 0 0; background: var(--bg); }
#landing footer.site .wrap { max-width: none; padding-left: clamp(1.5rem, 5vw, 4rem); padding-right: clamp(1.5rem, 5vw, 4rem); }
/* the emblem sits left; the credit cards block right, 2 x 2 */
#landing .credit-split { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
#landing .credit-mark { text-align: center; }
#landing .credit-mark img { width: min(100%, 340px); height: auto; }
#landing .credit-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
@media (max-width: 880px) {
  #landing .credit-split { grid-template-columns: 1fr; }
  #landing .credit-cards { grid-template-columns: 1fr; }
}
#landing footer.site a { color: var(--amber); }
#landing footer.site p, #landing footer.site li { font-size: 0.84rem; color: var(--ink-faint); }
/* the colophon bar runs the entire width of the page */
#landing .colophon {
  margin-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--line);
  background: #0a0906; padding: 1.5rem clamp(1.5rem, 5vw, 4rem);
  font-size: 0.78rem; color: var(--ink-faint); text-align: center;
}
#landing .colophon a { color: var(--amber); }

/* the studio, above the credit cards */
#landing .studio { max-width: 78ch; margin: 0 auto clamp(2.5rem, 5vw, 4rem); text-align: left; }
#landing .studio h3 { font-size: 1.3rem; color: #f4ecd2; letter-spacing: 1px; margin: 0 0 0.2rem; }
#landing .studio .studio-sub { color: var(--amber); font-size: 0.72rem; letter-spacing: 0.28em; text-transform: uppercase; margin: 0 0 1.2rem; font-weight: bold; }
#landing .studio p { max-width: none; font-size: 0.9rem; color: var(--ink-dim); }
#landing .studio .links { margin-top: 1.3rem; display: flex; gap: 1.4rem; flex-wrap: wrap; font-size: 0.84rem; }

/* ── the game, mounted on demand ──────────────────────────────────────── */
#root { display: none; }
html.playing, html.playing body { height: 100%; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; }
html.playing #root { display: block; position: absolute; inset: 0; }
html.playing #landing { display: none; }
