/* 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.
 */

:root {
  --ink: #0b1020;
  --ink-deep: #070b16;
  --panel: #131a2e;
  --panel-edge: rgba(255, 255, 255, 0.1);
  --text: #eef1f8;
  --text-dim: #c3cadb;        /* 9.4:1 on --ink */
  --gold: #f0b440;            /* 9.6:1 on --ink */
  --gold-bright: #ffd27a;
  --focus: #7fd4ff;
  --max: 1180px;
  --radius: 16px;
}

* { 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: 50;
  background: var(--gold);
  color: #17120a;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  text-decoration: none;
}
.skip-to-content:focus { left: 1rem; top: 1rem; }

/* ---------- 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;
  transition: transform 150ms ease, background 150ms ease;
}
.button-primary:hover { background: var(--gold-bright); transform: translateY(-1px); }

.skip-intro {
  position: absolute;
  z-index: 2;
  right: clamp(1rem, 3vw, 2rem);
  top: clamp(1rem, 3vw, 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 {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) clamp(1.25rem, 4vw, 2rem);
}

main h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }

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

.overview p, .mystery p { font-size: 1.08rem; max-width: 56ch; color: var(--text-dim); }
.overview strong, .mystery strong { color: var(--text); }

.faction-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  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.25rem;
  text-align: center;
}
.faction-list img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; }
.faction-list h3 { font-size: 1.05rem; margin: 0.75rem 0 0.35rem; }
.faction-list p { font-size: 0.92rem; color: var(--text-dim); margin: 0; }

/* ---------- the two destinations ---------- */

.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);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.card-link:hover {
  transform: translateY(-3px);
  border-color: rgba(240, 180, 64, 0.55);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.card-art { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; }

.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 {
  border-top: 1px solid var(--panel-edge);
  padding: 2.5rem clamp(1.25rem, 4vw, 2rem) 3rem;
  max-width: var(--max);
  margin: 0 auto;
  color: var(--text-dim);
}
.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; }
