/*
 * Realmgate landing page. The visual language is the game's own desktop UI
 * (src/ui): its colour tokens, Cinzel for titles and Inter for reading, the gold
 * primary button (flat face, top sheen, bronze edge), the navy panel with a gold
 * top light, the window frame and the diamond-and-rule section header.
 */
@font-face { font-family: 'Cinzel'; src: url('/landing/fonts/Cinzel-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Cinzel'; src: url('/landing/fonts/Cinzel-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/landing/fonts/Inter-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/landing/fonts/Inter-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }

:root {
  /* src/ui/tokens.ts */
  --navy-950: #050B1A; --navy-900: #081329; --navy-850: #0B1A36; --navy-800: #0F2244; --navy-700: #142C57;
  --blue-bright: #5DB6FF;
  --gold: #E8BE62; --gold-bright: #FFE29C; --gold-line: rgba(232, 190, 98, 0.55); --gold-hair: rgba(232, 190, 98, 0.22);
  --text: #F5EEDC; --muted: #A3B5CE; --dim: #6F84A5;
  --success: #52D17F; --danger: #E8584F;
  --edge: rgba(129, 160, 214, 0.32); --hair: rgba(129, 160, 214, 0.18);
  --display: 'Cinzel', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --page: 1280px;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--navy-950); color: var(--text); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 14px; background: var(--gold); color: var(--navy-950); font-weight: 600; }
.skip:focus { left: 8px; }

/* -------------------------------------------- the game's primary button */
.btn { position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; text-decoration: none; white-space: nowrap; border-radius: 6px; border: 1px solid; font-family: var(--sans); font-weight: 600; font-size: 14px; letter-spacing: .02em; padding: 9px 18px; transition: transform .1s ease, background-color .1s ease; }
.btn::before { content: ''; position: absolute; inset: 0 0 50% 0; z-index: -1; opacity: .55; }
.btn-primary { color: #3A2405; background: #D8962B; border-color: #7A4E12; box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.btn-primary::before { background: #FFD978; }
.btn-primary:hover { background: #FFE8A6; transform: translateY(-1px); }
.btn-primary:hover::before { background: #FFE8A6; }
.btn-primary:active { transform: translateY(1px); box-shadow: none; }
.btn-lg { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: .04em; padding: 0 30px; min-height: 52px; }

/* ----------------------------------------------------------------- bar */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; height: 64px; padding: 0 var(--gutter); background: var(--navy-950); border-bottom: 1px solid var(--gold-hair); }
.lockup { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-bright); }
.lockup img { width: 26px; height: auto; }
.lockup-small { font-size: 15px; }
.lockup-small img { width: 22px; }
.bar-links { display: flex; gap: 28px; margin-left: auto; }
.bar-links a, .foot nav a { text-decoration: none; font-size: 14px; font-weight: 600; color: var(--muted); }
.bar-links a:hover, .foot nav a:hover { color: var(--gold-bright); }

/* ---------------------------------------------- screenshots and their frame */
/* The game's window frame: a hairline gold edge with corner studs. */
.shot { position: relative; padding: 6px; background: var(--navy-900); border: 1px solid var(--gold-line); }
.shot::before, .shot::after { content: ''; position: absolute; width: 9px; height: 9px; background: var(--gold); z-index: 1; }
.shot::before { top: -5px; left: -5px; }
.shot::after { bottom: -5px; right: -5px; }
.shot > img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; opacity: 0; transition: opacity .3s ease; }
.shot.is-loaded > img { opacity: 1; }
/* Until the capture exists, the frame holds a placeholder in the same proportions. */
.shot-empty { position: absolute; inset: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; color: var(--dim); font-size: 14px; font-weight: 600; letter-spacing: .04em; background:
  repeating-linear-gradient(135deg, rgba(129, 160, 214, .045) 0 1px, transparent 1px 14px), var(--navy-850); }
.shot-empty img { width: 40px; opacity: .55; filter: grayscale(.3); }
.shot-empty code { display: none; font: 500 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--gold); }
.dev .shot-empty code { display: block; }
.shot.is-loaded .shot-empty { display: none; }
/* Concept art is labelled as such, in the game's own plaque style. */
.concept-tag { display: none; position: absolute; left: 14px; bottom: 14px; z-index: 2; padding: 4px 9px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-bright); background: rgba(5, 11, 26, .86); border: 1px solid var(--gold-line); border-radius: 3px; }
.shot.is-loaded .concept-tag { display: block; }

/* ---------------------------------------------------------------- hero */
.hero { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); align-items: center; gap: clamp(28px, 4vw, 64px); min-height: min(calc(100svh - 64px), 820px); padding: clamp(40px, 6vw, 80px) 0 clamp(40px, 6vw, 80px) var(--gutter); }
.hero-copy { max-width: 520px; }
.label { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.hero h1 { margin-top: 18px; font-family: var(--display); font-weight: 700; font-size: clamp(32px, 3.4vw, 50px); line-height: 1.1; letter-spacing: .01em; color: var(--text); }
.hero h1 span { display: block; color: var(--gold-bright); }
.lede { margin-top: 20px; font-size: 18px; line-height: 1.6; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 32px; }
.quiet-link { font-weight: 600; font-size: 15px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--gold-hair); padding-bottom: 2px; }
.quiet-link:hover { color: var(--gold-bright); border-color: var(--gold); }
.facts { display: flex; flex-wrap: wrap; margin: 36px 0 0; padding: 18px 0 0; list-style: none; border-top: 1px solid var(--hair); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facts li + li::before { content: ''; display: inline-block; width: 1px; height: 12px; margin: 0 14px; vertical-align: -1px; background: var(--edge); }
/* The screenshot runs off the right edge of the page. */
.shot-hero { border-right: 0; padding-right: 0; }
.shot-hero::after { display: none; }
.shot-hero .shot-empty { right: 0; }

/* ------------------------------------------------- section header (game) */
.rule-head { display: flex; align-items: center; gap: 12px; font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.rule-head::before { content: ''; flex: none; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); }
.rule-head::after { content: ''; flex: 1; height: 1px; background: var(--gold-hair); }

/* ------------------------------------------------------------ chapters */
.reign { max-width: var(--page); margin: 0 auto; padding: clamp(64px, 9vw, 120px) var(--gutter) 0; }
.reign-head { display: grid; grid-template-columns: 1fr; gap: 18px; max-width: 760px; }
.reign-head p { font-size: 19px; line-height: 1.6; color: var(--muted); }
.chapter { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 72px); align-items: center; margin-top: clamp(56px, 8vw, 110px); }
.chapter-flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.chapter-flip .shot { order: 2; }
.chapter-copy { max-width: 470px; }
.numeral { font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.numeral::after { content: ''; display: block; width: 36px; height: 1px; margin-top: 12px; background: var(--gold-line); }
.chapter h3 { margin-top: 16px; font-family: var(--display); font-weight: 700; font-size: clamp(25px, 2.4vw, 34px); line-height: 1.15; color: var(--text); }
.chapter-copy > p:not(.numeral) { margin-top: 14px; font-size: 16.5px; color: var(--muted); }
.chapter-copy .note { font-size: 14px; color: var(--dim); }

/* Figures from the rules, set like the game's stat rows. */
.tally { display: grid; gap: 0; margin-top: 26px; border-top: 1px solid var(--hair); }
.tally div { display: flex; align-items: baseline; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--hair); }
.tally dt { min-width: 92px; font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.tally dd { font-size: 15px; color: var(--muted); }

/* The matchup table, styled like the game's DataTable. */
.matchups { width: 100%; margin-top: 20px; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; border: 1px solid var(--hair); }
.matchups caption { caption-side: bottom; padding-top: 8px; text-align: left; font-size: 12.5px; color: var(--dim); }
.matchups thead th { padding: 8px 10px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: right; background: rgba(5, 12, 28, .85); border-bottom: 1px solid var(--gold-hair); }
.matchups tbody th { padding: 8px 10px; text-align: left; font-weight: 600; color: var(--text); }
.matchups td { padding: 8px 10px; text-align: right; color: var(--muted); }
.matchups tbody tr + tr { border-top: 1px solid var(--hair); }
.matchups td.hi { color: var(--success); font-weight: 600; }
.matchups td.lo { color: var(--danger); }

/* ----------------------------------------------------------------- free */
.free, .faq { max-width: var(--page); margin: 0 auto; padding: clamp(80px, 10vw, 130px) var(--gutter) 0; }
.free-body { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 72px); margin-top: 32px; align-items: start; }
.statement { max-width: 560px; font-family: var(--display); font-weight: 700; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.25; color: var(--text); }
.earned { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--hair); }
.earned li { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--hair); color: var(--muted); font-size: 15.5px; }
.earned strong { color: var(--text); font-weight: 600; }
.icons { display: flex; align-items: center; gap: 4px; }
.icons img { width: 24px; height: 24px; object-fit: contain; }

/* ------------------------------------------------------------------ faq */
.faq-list { max-width: 820px; margin-top: 24px; border-top: 1px solid var(--hair); }
.faq details { border-bottom: 1px solid var(--hair); }
.faq summary { display: flex; justify-content: space-between; gap: 20px; padding: 20px 0; cursor: pointer; list-style: none; font-weight: 600; font-size: 17px; color: var(--text); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex: none; font-weight: 400; font-size: 22px; line-height: 1; color: var(--gold); }
.faq details[open] summary::after { content: '−'; }
.faq summary:hover { color: var(--gold-bright); }
.faq details p { padding: 0 0 22px; max-width: 680px; color: var(--muted); }

/* -------------------------------------------------------------- closing */
.closing { max-width: var(--page); margin: clamp(80px, 10vw, 130px) auto 0; padding: clamp(40px, 5vw, 56px) var(--gutter); display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'title action' 'line action'; column-gap: 32px; align-items: center; border-top: 1px solid var(--gold-hair); }
.closing h2 { grid-area: title; font-family: var(--display); font-weight: 700; font-size: clamp(28px, 3vw, 40px); color: var(--text); }
.closing p { grid-area: line; margin-top: 6px; color: var(--muted); font-size: 17px; }
.closing .btn { grid-area: action; }

/* --------------------------------------------------------------- footer */
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 32px; margin-top: clamp(40px, 6vw, 72px); padding: 26px var(--gutter); background: var(--navy-900); border-top: 1px solid var(--hair); }
.foot nav { display: flex; flex-wrap: wrap; gap: 22px; }
.foot p { width: 100%; font-size: 12.5px; color: var(--dim); }
.foot p + p { margin-top: -10px; }

/* ----------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .bar-links { display: none; }
  .bar .btn { margin-left: auto; }
  .hero { grid-template-columns: 1fr; padding-right: var(--gutter); min-height: 0; }
  .hero-copy { max-width: 620px; }
  .shot-hero { border-right: 1px solid var(--gold-line); padding-right: 6px; }
  .shot-hero::after { display: block; }
  .shot-hero .shot-empty { right: 6px; }
  .chapter, .chapter-flip, .free-body { grid-template-columns: 1fr; }
  .chapter-flip .shot { order: 0; }
  .chapter-copy { max-width: 620px; }
}
@media (max-width: 560px) {
  .lockup { font-size: 15px; letter-spacing: .05em; }
  .lockup img { width: 22px; }
  .bar { gap: 12px; }
  .lede { font-size: 16.5px; }
  .actions .btn { width: 100%; }
  .facts { flex-direction: column; gap: 6px; }
  .facts li + li::before { display: none; }
  .closing { grid-template-columns: 1fr; grid-template-areas: 'title' 'line' 'action'; row-gap: 20px; }
  .closing .btn { width: 100%; }
  .earned li { grid-template-columns: 1fr; gap: 8px; }
  .matchups { font-size: 13px; }
  .matchups thead th, .matchups td, .matchups tbody th { padding: 7px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .shot > img { transition: none; }
}
