/* The front page (src/landing.js, public/landing.js). It loads tokens.css, ranks.css and ladder.css, not the game's
   bundle, so it sets its own base. One accent: brand gold in the hero, then the color of whoever leads the real game
   on screen (--accent, animated as a registered color). The map, the rank cards, the badges and each tour part's own
   color are game art; everything else takes its color from a token. Not part of styles.css (src/assets.js UI_CSS). */
@property --accent { syntax: '<color>'; inherits: true; initial-value: #d9b25b; }

:root { --lp-w: 1180px; --lp-top: 64px; transition: --accent 800ms var(--ease); }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--lp-top) + var(--space-8)); }
:root.reduce-motion { scroll-behavior: auto; transition: none; }
body.landing { margin: 0; background: var(--bg); color: var(--text); font: var(--fs-lg)/1.6 var(--font-ui); -webkit-font-smoothing: antialiased; }
.landing a { color: inherit; }
.landing :is(a, button) { cursor: pointer; }
.landing :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Section glows reach past their sections and fade; at the page's edge they are cut, so it never scrolls sideways. */
.landing main { overflow-x: clip; }
.wrap { width: min(var(--lp-w), 100% - 32px); margin-inline: auto; }
.landing h1, .landing h2, .landing h3 { text-wrap: balance; }

.landing .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 var(--space-11, 22px);
  border: 0; border-radius: var(--radius); font: 600 var(--fs-lg) var(--font-ui); text-decoration: none;
  transition: background var(--dur) var(--ease), translate var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease); }
.landing .btn.gold { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), 0 6px 18px color-mix(in srgb, var(--accent) 22%, transparent); }
.landing .btn.gold:hover { background: color-mix(in srgb, var(--accent) 82%, var(--white)); }
.landing .btn.gold:active { translate: 0 1px; box-shadow: inset 0 1px 0 rgb(255 255 255 / .2); }
.landing .btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.landing .btn.quiet { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.landing .btn.quiet:hover { box-shadow: inset 0 0 0 1px var(--text-3); }
.link { color: var(--text); text-decoration-color: var(--border-strong); text-underline-offset: 4px; }
.link:hover { text-decoration-color: var(--text); }
.cta .link, .lp-top .link { display: inline-flex; align-items: center; min-height: 44px; }

/* The bar: tall over the hero, a compact plate once the hero has scrolled away. */
.lp-top { position: sticky; top: 0; z-index: 20; transition: background var(--dur-slow) var(--ease), box-shadow var(--dur-slow) var(--ease); }
.lp-top .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); min-height: 72px; transition: min-height var(--dur-slow) var(--ease); }
.lp-top.compact { background: color-mix(in srgb, var(--bg) 86%, transparent); box-shadow: 0 1px 0 var(--border); backdrop-filter: blur(10px); }
.lp-top.compact .wrap { min-height: var(--lp-top); }
.brand { display: flex; align-items: center; gap: var(--space-5); text-decoration: none; }
.brand svg { width: 30px; height: 23px; }
.brand b { font: 700 var(--fs-xl) var(--font-display); letter-spacing: .2em; color: var(--brand); }
.lp-top nav { display: flex; align-items: center; gap: var(--space-10); font-size: var(--fs-base); }
.lp-top nav .btn { min-height: 44px; padding: 0 var(--space-9); font-size: var(--fs-base); }

/* Headings are the game's stencilled voice: Barlow Condensed in capitals, as the season and the game titles are. */
.landing h1, .landing h2 { margin: 0; font-family: var(--font-head); font-weight: 700; text-transform: uppercase; letter-spacing: .01em; }
.landing h1 { font-size: clamp(48px, 6.4vw, 92px); line-height: .9; }
.landing h2 { font-size: clamp(34px, 4.2vw, 60px); line-height: .95; }
.landing h3 { margin: 0; font: 700 var(--fs-3xl)/1 var(--font-head); letter-spacing: .03em; text-transform: uppercase; }
.eyebrow { margin: 0 0 var(--space-7); font: 700 var(--fs-sm) var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.sub { max-width: 40em; margin: var(--space-8) 0 0; color: var(--text-2); }

/* Sections are set apart by light, not lines: a faint cloud of the accent under fine grain behind each, fading out. */
.hero, .turn, .tour, .close { position: relative; isolation: isolate; }
:is(.hero, .tour, .close)::before { content: ''; position: absolute; inset: -60px -10vw; z-index: -1; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(40% 50% at 70% 40%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 100%);
  background-size: 180px 180px, auto;
  -webkit-mask-image: radial-gradient(closest-side, black 40%, transparent); mask-image: radial-gradient(closest-side, black 40%, transparent); }
.tour::before { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(36% 40% at 25% 30%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 100%),
    radial-gradient(30% 36% at 80% 70%, color-mix(in srgb, var(--accent-2, var(--accent)) 8%, transparent), transparent 100%); background-size: 180px 180px, auto, auto; }

/* ---------- the hero: the promise beside a real game ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--space-24); align-items: center; min-height: min(80dvh, 780px); padding: var(--space-16) 0 var(--space-24); }
.lede { max-width: 28em; margin: var(--space-10) 0 var(--space-14); font-size: var(--fs-xl); color: var(--text-2); }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6) var(--space-11, 22px); }
.figures { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-12); margin: var(--space-16) 0 0; padding: 0; list-style: none; font-size: var(--fs-base); color: var(--text-2); }
.figures li { display: grid; gap: var(--space-1); }
.figures b { font: 700 var(--fs-5xl)/1 var(--font-head); color: var(--text); font-variant-numeric: tabular-nums; }
/* The map, tilted a little toward the reader, with two pieces of the world around it pinned to its corners. */
.hero-shot { position: relative; margin: 0; perspective: 1400px; }
.hero-shot img { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); transform: rotateY(-8deg) rotateX(3deg);
  box-shadow: 0 40px 80px rgb(0 0 0 / .55), 0 0 0 1px rgb(255 255 255 / .06), 0 0 120px color-mix(in srgb, var(--accent) 18%, transparent);
  transition: transform 900ms var(--ease); }
.hero-shot:hover img { transform: rotateY(-3deg) rotateX(1deg); }
.hero-tag { position: absolute; display: grid; gap: 2px; padding: var(--space-5) var(--space-8); border-radius: var(--radius); box-shadow: 0 16px 32px rgb(0 0 0 / .5); }
.hero-tag b { font: 700 var(--fs-2xl)/1 var(--font-head); letter-spacing: .04em; text-transform: uppercase; }
.hero-tag small { font: 600 var(--fs-xs) var(--font-ui); letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.tag-rank { left: -28px; top: 14%; min-width: 170px; border: 1px solid var(--rank-edge); background: var(--rank-texture, none), var(--rank-base); color: var(--rank-ink); }
.tag-wanted { right: -18px; bottom: 10%; border: 2px solid var(--wanted); background: #1a0606; color: #fecaca; text-align: center; rotate: 4deg; }
.tag-wanted b { font-size: var(--fs-4xl); color: #f87171; }
:root:not(.reduce-motion) .hero-tag { animation: tag-float 6s var(--ease-in-out) infinite alternate; }
:root:not(.reduce-motion) .tag-wanted { animation-delay: -3s; }
@keyframes tag-float { to { translate: 0 -10px; } }

/* ---------- one turn: the four orders beside a real game ---------- */
.scene-canvas.mapwrap { height: auto; min-height: 0; border: 0; border-radius: 0; cursor: default; background: transparent; box-shadow: none; }
.scene-canvas .terrain { position: absolute; left: 0; top: 0; pointer-events: none; }
.scene-canvas .overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scene-canvas .map-render-status { display: none; }
.turn { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--space-24); align-items: center; padding: var(--space-24) 0; }
.orders { display: grid; gap: var(--space-4); margin-top: var(--space-14); }
/* Each order is a button in its kind's map color: its name, and its rule while it is the one shown. */
.order { --kind: var(--text-2); position: relative; display: grid; gap: var(--space-3); padding: var(--space-7) var(--space-9); border: 0; border-radius: var(--radius);
  background: transparent; color: var(--text-2); font: inherit; text-align: left; box-shadow: inset 3px 0 0 color-mix(in srgb, var(--kind) 35%, transparent);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease); }
.order b { font: 700 var(--fs-2xl)/1 var(--font-head); letter-spacing: .04em; text-transform: uppercase; color: color-mix(in srgb, var(--kind) 75%, var(--text-2)); }
.order span { display: none; font-size: var(--fs-base); line-height: 1.5; }
.order:hover { background: color-mix(in srgb, var(--kind) 6%, transparent); color: var(--text); }
.order.on { background: radial-gradient(380px circle at var(--lx, 20%) var(--ly, 0%), color-mix(in srgb, var(--kind) 16%, transparent), transparent 70%), color-mix(in srgb, var(--kind) 7%, var(--surface));
  box-shadow: inset 3px 0 0 var(--kind), 0 18px 40px rgb(0 0 0 / .35); color: var(--text); }
.order.on b { color: var(--kind); }
.order.on span { display: block; }
.order.k-move { --kind: #7fbf8e; }
.order.k-attack { --kind: #d1606b; }
.order.k-defend { --kind: #7aa6d8; }
.order.k-dev { --kind: #e0b350; }
.turn-stage { display: grid; gap: var(--space-5); }
.scene-map { position: relative; aspect-ratio: 1755 / 1095; overflow: hidden; border-radius: var(--radius-lg); background: var(--sea-deep);
  box-shadow: 0 30px 70px rgb(0 0 0 / .5), 0 0 0 1px rgb(255 255 255 / .06); }
.scene-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 600ms var(--ease); }
.scene-canvas { position: absolute; inset: 0; opacity: 0; transition: opacity 600ms var(--ease); }
.turn.live .scene-canvas { opacity: 1; }
.turn.live .scene-poster { opacity: 0; }
.scene-turn { position: absolute; left: var(--space-8); bottom: var(--space-8); margin: 0; padding: var(--space-3) var(--space-6); border-radius: var(--radius);
  background: rgb(7 10 18 / .78); color: var(--text-2); font: 600 var(--fs-md) var(--font-ui); font-variant-numeric: tabular-nums; }
.scene-turn:empty { display: none; }
.scene-turn b { color: var(--accent); }
.turn-note { margin: 0; font-size: var(--fs-md); color: var(--text-3); }

/* ---------- the tour: the rest of the site, each part in its own color ---------- */
.tour { padding: var(--space-24) 0; }
.tour-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-8); margin-top: var(--space-16); }
/* A part of the site: its art lit from above in its color and from wherever the pointer is, then its name and a line. */
.feat { position: relative; isolation: isolate; overflow: hidden; display: grid; align-content: end; gap: var(--space-5); min-height: 300px; padding: var(--space-10);
  border-radius: var(--radius-lg); color: var(--text);
  background:
    radial-gradient(340px circle at var(--lx, 50%) var(--ly, 0%), color-mix(in srgb, var(--feat) 12%, transparent), transparent 70%),
    radial-gradient(90% 70% at 50% -10%, color-mix(in srgb, var(--feat) 24%, transparent), transparent 70%),
    linear-gradient(180deg, var(--surface), var(--bg-elev));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--feat) 20%, transparent), inset 0 1px 0 color-mix(in srgb, var(--feat) 40%, transparent);
  transition: transform var(--dur-slow) var(--ease-spring), box-shadow var(--dur-slow) var(--ease); }
.feat:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--feat) 45%, transparent), inset 0 1px 0 color-mix(in srgb, var(--feat) 70%, transparent), 0 24px 50px rgb(0 0 0 / .4); }
.feat h3 { color: color-mix(in srgb, var(--feat) 55%, var(--white)); }
.feat p { margin: 0; color: var(--text-2); font-size: var(--fs-base); line-height: 1.5; }
.feat-art { display: grid; place-items: center; min-height: 130px; margin-bottom: auto; }
.feat-art > img { filter: drop-shadow(0 8px 18px rgb(0 0 0 / .5)) drop-shadow(0 0 22px color-mix(in srgb, var(--feat) 40%, transparent)); transition: transform 600ms var(--ease-spring); }
.feat:hover .feat-art > img { transform: scale(1.08) rotate(-4deg); }
/* Ranked: the Ladder fills the top of a tall part. */
.feat-ranked { grid-row: span 2; align-content: stretch; grid-template-rows: minmax(0, 1fr) auto auto; }
.landing-ladder { min-height: 360px; }
.ladder-fallback { columns: 2; margin: 0; padding-left: 1.2em; color: var(--text-2); }
.landing-ladder.ladder .ladder-fallback { display: none; }
/* Bounties: a stamped poster figure. */
.wanted { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-6) var(--space-12); border: 2px solid var(--wanted); border-radius: 4px;
  background: repeating-linear-gradient(135deg, rgb(239 68 68 / .06) 0 6px, transparent 6px 12px); rotate: -4deg; transition: rotate 500ms var(--ease-spring); }
.feat:hover .wanted { rotate: 0deg; }
.wanted small { font: 800 var(--fs-md) var(--font-ui); letter-spacing: .3em; text-transform: uppercase; color: #fecaca; }
.wanted b { font: 800 var(--fs-6xl)/1 var(--font-head); color: #f87171; font-variant-numeric: tabular-nums; }
.wanted i { font: 600 var(--fs-xs) var(--font-ui); font-style: normal; letter-spacing: .14em; text-transform: uppercase; color: #fca5a5; }
/* The Atlas: a slice of a real map, fading into the part. */
.feat-map { align-self: stretch; margin: calc(var(--space-10) * -1) calc(var(--space-10) * -1) auto; min-height: 170px;
  background: url('/landing/map.webp') 62% 40% / 180% auto no-repeat; opacity: .75;
  -webkit-mask-image: linear-gradient(black 40%, transparent); mask-image: linear-gradient(black 40%, transparent); transition: background-position 1.2s var(--ease); }
.feat:hover .feat-map { background-position: 55% 45%; }
/* The casino: a board of rank tiles with the Emperor's crown among them. */
.gems { display: grid; grid-template-columns: repeat(5, 30px); gap: 5px; rotate: -6deg; }
.gems i { aspect-ratio: 1; border-radius: 6px; border: 1px solid var(--rank-edge); background: var(--rank-texture, none), var(--rank-base); box-shadow: 0 0 10px var(--rank-glow); }
.gems i.crown { background: var(--crown-art) center / 80% no-repeat, var(--rank-base); }
:root:not(.reduce-motion) .feat:hover .gems i { animation: gem-pop 600ms var(--ease-spring) both; animation-delay: calc(var(--n, 0) * 30ms); }
@keyframes gem-pop { 40% { scale: 1.18; } }
/* Collect and trade: a row of real badges, wide. */
.feat-collect { grid-column: 1 / -1; min-height: 0; }
.feat-art.badges { display: flex; justify-content: center; gap: var(--space-6); }
.feat-art.badges img:nth-child(odd) { translate: 0 8px; }

/* ---------- the close ---------- */
.close { display: grid; justify-items: center; padding: var(--space-24) 0 calc(var(--space-24) * 1.5); text-align: center; }
.close .sub { margin-bottom: var(--space-14); }

footer { padding: var(--space-14) 0 var(--space-20, 40px); border-top: 1px solid var(--border); font-size: var(--fs-base); color: var(--text-3); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-6); }
footer p { margin: 0; max-width: 60em; }
footer a { color: var(--text-2); }

/* Tablets and phones: one column; the parts of the tour stack in pairs, then one by one. */
@media (max-width: 980px) {
  .hero, .turn { grid-template-columns: minmax(0, 1fr); gap: var(--space-16); min-height: 0; padding: var(--space-12) 0 var(--space-20, 40px); }
  .hero-shot img { transform: none; }
  .tag-rank { left: 8px; } .tag-wanted { right: 8px; }
  .tour-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feat-ranked { grid-row: auto; grid-column: 1 / -1; }
  .feat-collect { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .lp-top nav .signin { display: none; }
  .lede { font-size: var(--fs-lg); }
  .tour-grid { grid-template-columns: minmax(0, 1fr); }
  .feat-art.badges img { width: 52px; height: 52px; }
  .ladder-fallback { columns: 2; }
}
:root.reduce-motion :is(.order, .scene-canvas, .scene-poster, .hero-shot img, .feat, .feat-art > img, .wanted, .feat-map) { transition: none; }
