/* portal.css — the landing portal at `/` (q-portal-landing-page).
 *
 * Deliberately standalone: the MMORPG page at /world/ keeps tg-styles.css + scrollytelling.css,
 * and nothing here is loaded there. The portal is plain HTML/CSS/vanilla JS — no React, no build
 * step, no new runtime dependency (AD-261).
 *
 * Palette follows docs/art/art-direction-bible.md §3 and §15: deep twilight blues and violet,
 * warm lantern gold as the single accent, Cloud-iridescence reserved for the Cloud itself.
 * Contrast: every text/background pair below is at or above WCAG AA for its size — the section
 * art sits behind a scrim tuned so body text on it stays ≥ 4.5:1.
 *
 * 2026-09-18 visual pass (owner: "clean but bland"): key art behind each section as a lazily
 * loaded <img> under a scrim, glassy panels, gold/violet glows, and a slim top bar that links the
 * two destinations from anywhere on the page.
 */

:root {
  --ink: #0b1020;
  --ink-deep: #070b16;
  --panel: rgba(19, 26, 46, 0.82);
  --panel-solid: #131a2e;
  --panel-edge: rgba(255, 255, 255, 0.12);
  --text: #eef1f8;
  --text-dim: #c3cadb;        /* 9.4:1 on --ink */
  --gold: #f0b440;            /* 9.6:1 on --ink */
  --gold-bright: #ffd27a;
  --violet: #7a5cff;
  --focus: #7fd4ff;
  --max: 1180px;
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.portal {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 800; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
a { color: var(--gold-bright); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-to-content {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 90;
  background: var(--gold);
  color: #17120a;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  text-decoration: none;
}
.skip-to-content:focus { left: 1rem; top: 1rem; }

/* ---------- top bar: the destinations, reachable from anywhere ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem clamp(0.9rem, 3vw, 1.6rem);
  background: linear-gradient(to bottom, rgba(7, 11, 22, 0.82), rgba(7, 11, 22, 0.55));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.topbar .brand {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.topbar .brand strong { color: var(--gold); font-weight: 700; }
.topbar nav { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav a {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(11, 16, 32, 0.55);
  transition: border-color 150ms ease, background 150ms ease;
  white-space: nowrap;
}
.topbar nav a:hover { border-color: var(--gold); background: rgba(240, 180, 64, 0.12); }
.topbar nav a.is-primary { background: var(--gold); color: #17120a; border-color: var(--gold); font-weight: 700; }
.topbar nav a.is-primary:hover { background: var(--gold-bright); }

/* Three destinations do not fit beside the wordmark on a phone. Rather than let the fixed bar wrap
   to two rows (it then covers the heading it scrolled to), keep ONE row: drop the " game" suffix,
   tighten the pills, and let the row scroll sideways if a very narrow screen still needs it. */
@media (max-width: 560px) {
  .topbar { gap: 0.6rem; }
  .topbar .brand { font-size: 0.7rem; letter-spacing: 0.12em; }
  .topbar nav {
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    gap: 0.35rem;
    scrollbar-width: none;
  }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a { font-size: 0.68rem; letter-spacing: 0.04em; padding: 0.4rem 0.6rem; }
  .topbar nav .nav-long { display: none; }
  /* flex-end + overflow would clip the FIRST pill with no way to scroll back to it; start-aligned,
     the row still sits right (the nav shrinks to its content) but overflows to the scrollable side. */
  .topbar nav { justify-content: flex-start; }
}
@media (max-width: 380px) {
  .topbar .brand { letter-spacing: 0.06em; }
  .topbar nav a { padding: 0.38rem 0.5rem; letter-spacing: 0.02em; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.5rem, 4vw, 4rem);
  overflow: hidden;
  background: var(--ink-deep);
}

.hero-media { position: absolute; inset: 0; z-index: 0; }

.hero-poster,
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The video fades in over the poster once it can actually play, so a slow decode never
   shows a black box where the artwork was. */
.hero-video { opacity: 0; transition: opacity 600ms ease; }
.hero-video.is-visible { opacity: 1; }

/* Scrim: carries the WCAG AA contrast for the title over whatever frame is underneath. */
.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(7, 11, 22, 0.94) 0%, rgba(7, 11, 22, 0.72) 38%, rgba(7, 11, 22, 0.28) 70%, rgba(7, 11, 22, 0.45) 100%),
    radial-gradient(120% 80% at 50% 90%, rgba(7, 11, 22, 0.75) 0%, rgba(7, 11, 22, 0) 70%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  margin: 0 auto;
  text-align: center;
  padding-bottom: clamp(2rem, 6vh, 5rem);
}

.eyebrow {
  font-family: 'Space Mono', ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--gold);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.75rem, 9vw, 5.5rem);
  margin-bottom: 0.4em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6);
}

.hero-sub {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--text);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
}

.button-primary {
  display: inline-block;
  background: var(--gold);
  color: #17120a;
  font-weight: 700;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(240, 180, 64, 0.25);
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.button-primary:hover { background: var(--gold-bright); transform: translateY(-1px); box-shadow: 0 10px 36px rgba(240, 180, 64, 0.38); }

.skip-intro {
  position: absolute;
  z-index: 2;
  right: clamp(1rem, 3vw, 2rem);
  top: calc(clamp(1rem, 3vw, 2rem) + 3.2rem);
  background: rgba(7, 11, 22, 0.7);
  color: var(--text);
  border: 1px solid var(--panel-edge);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.skip-intro:hover { background: rgba(7, 11, 22, 0.9); }

/* ---------- sections ---------- */

main { display: block; }

main section {
  position: relative;
  overflow: hidden;
  padding: clamp(3.5rem, 9vw, 7rem) clamp(1.25rem, 4vw, 2rem);
}
main section > .inner { position: relative; z-index: 1; max-width: var(--max); margin: 0 auto; }

/* Section art: a lazily loaded <img> pinned behind the content, under a scrim. The scrim is the
   contrast guarantee — the art is allowed to be busy because the text never sits on it directly. */
.section-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.section-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
}
.section-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, var(--ink) 0%, rgba(11, 16, 32, 0.78) 18%, rgba(11, 16, 32, 0.78) 82%, var(--ink) 100%),
    radial-gradient(90% 70% at 50% 50%, rgba(11, 16, 32, 0.15) 0%, rgba(11, 16, 32, 0.6) 100%);
}
.section-bg.is-soft::after {
  background:
    linear-gradient(to bottom, var(--ink) 0%, rgba(11, 16, 32, 0.88) 15%, rgba(11, 16, 32, 0.88) 85%, var(--ink) 100%);
}

/* Ambient glows for sections that carry no art. */
.glow-gold, .glow-violet { position: absolute; z-index: 0; border-radius: 50%; filter: blur(80px); pointer-events: none; opacity: 0.55; }
.glow-gold { width: 46vw; height: 46vw; max-width: 640px; max-height: 640px; background: rgba(240, 180, 64, 0.22); left: -10vw; top: -8vw; }
.glow-violet { width: 52vw; height: 52vw; max-width: 720px; max-height: 720px; background: rgba(122, 92, 255, 0.22); right: -14vw; bottom: -14vw; }

main h2 { font-size: clamp(1.7rem, 3.8vw, 2.6rem); }

.section-sub { color: var(--text-dim); margin-top: -0.4em; }

.overview .inner, .mystery .inner { max-width: 52rem; }
.overview p, .mystery p { font-size: clamp(1.08rem, 1.6vw, 1.2rem); color: var(--text-dim); }
.overview strong, .mystery strong { color: var(--text); }
.overview .lead, .mystery .lead { color: var(--text); }

.glass {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.overview .glass, .mystery .glass { padding: clamp(1.4rem, 3vw, 2.4rem); }

.faction-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.faction-list li {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  padding: 1.35rem 1.1rem;
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 160ms ease, border-color 160ms ease;
}
.faction-list li:hover { transform: translateY(-3px); border-color: rgba(240, 180, 64, 0.45); }
.faction-list img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px rgba(240, 180, 64, 0.35), 0 10px 30px rgba(0, 0, 0, 0.45);
}
.faction-list h3 { font-size: 1.05rem; margin: 0.85rem 0 0.35rem; }
.faction-list p { font-size: 0.92rem; color: var(--text-dim); margin: 0; }

/* ---------- the destinations (one card per game) ---------- */

.cards {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-top: 2rem;
  align-items: stretch;
}

/* Equal weight is a requirement, not a preference: same column width, same art ratio, same
   type scale, same treatment on hover and focus. Neither destination is the "real" one. */
.card { display: flex; }

.card-link {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--panel-solid);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.card-link:hover {
  transform: translateY(-4px);
  border-color: rgba(240, 180, 64, 0.6);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(240, 180, 64, 0.25), 0 0 60px rgba(240, 180, 64, 0.16);
}

.card-art { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; transition: transform 500ms ease; }
.card-link:hover .card-art { transform: scale(1.03); }

.card-body { display: block; padding: 1.4rem 1.5rem 1.6rem; }

.card-kicker {
  display: block;
  font-family: 'Space Mono', ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--gold);
  margin-bottom: 0.6rem;
}
.card-title { display: block; font-size: 1.35rem; font-weight: 800; margin-bottom: 0.5rem; }
.card-pitch { display: block; color: var(--text-dim); margin-bottom: 1rem; }

.card-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.1rem; }
.card-meta .platform,
.card-meta .status {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--panel-edge);
  color: var(--text-dim);
}
.card-meta .platform { color: var(--text); border-color: rgba(255, 255, 255, 0.24); }

.card-cta {
  display: inline-block;
  font-weight: 700;
  color: var(--gold-bright);
}
.card-link:hover .card-cta { text-decoration: underline; }

.cards-aside { margin-top: 1.5rem; color: var(--text-dim); font-size: 0.95rem; }

/* ---------- footer ---------- */

.portal-footer {
  position: relative;
  border-top: 1px solid var(--panel-edge);
  padding: 2.5rem clamp(1.25rem, 4vw, 2rem) 3rem;
  color: var(--text-dim);
}
.portal-footer .inner { max-width: var(--max); margin: 0 auto; }
.portal-footer nav { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; margin-bottom: 1rem; }
.portal-footer a { color: var(--text); text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.25); }
.portal-footer a:hover { color: var(--gold-bright); border-color: currentColor; }
.portal-footer .small { font-size: 0.85rem; margin: 1rem 0 0; }

/* Fixed top bar: anchored headings must not land under it. */
main section h2, .hero, #choose { scroll-margin-top: 4rem; }
