/* Dragstrip Online — site styles. Colours follow the game (D-072): brand red for actions, warm white text. */
@font-face {
  font-family: 'Dragline';
  src: url('fonts/dragline.otf') format('opentype');
  font-display: swap;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('fonts/chakra-petch-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('fonts/chakra-petch-latin-ext-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('fonts/chakra-petch-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('fonts/chakra-petch-latin-ext-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #0e0b1c;
  --bg-2: #161229;
  --panel: #1d1835;
  --line: #322a55;
  --text: #f3ece0;
  --muted: #b2a9c6;
  --brand: #ee3a1c;
  --brand-hi: #ff6a2b;
  --gold: #ffc23d;
  --pixel: 'Dragline', ui-monospace, monospace;
  --body: 'Chakra Petch', system-ui, sans-serif;
  --wrap: 1180px;
  --gutter: 20px;
  color-scheme: dark;
}
/* The pixel font has Latin only: Cyrillic and CJK pages draw headings in the system font, bold. */
:root:lang(ru), :root:lang(zh), :root:lang(ja), :root:lang(ko) { --pixel: system-ui, sans-serif; }
:lang(ru) :is(.btn, .top-nav a, .hero-tag, .title, .feature h3, .lang summary),
:lang(zh) :is(.btn, .top-nav a, .hero-tag, .title, .feature h3, .lang summary),
:lang(ja) :is(.btn, .top-nav a, .hero-tag, .title, .feature h3, .lang summary),
:lang(ko) :is(.btn, .top-nav a, .hero-tag, .title, .feature h3, .lang summary) { font-weight: 700; letter-spacing: 0; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 18px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--gold); }
a:hover { color: #fff; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--gold); color: #000; padding: 8px 12px; }
.skip:focus { left: 8px; }

/* Buttons: pixel font, hard edges and a stepped shadow like the in-game buttons. */
.btn {
  display: inline-block;
  font: 30px/1 var(--pixel);
  text-decoration: none;
  color: #fff;
  padding: 14px 24px 12px;
  border: 3px solid #000;
  box-shadow: 0 4px 0 #000;
  transition: transform .08s, box-shadow .08s, background .15s;
}
.btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 6px 0 #000; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.btn-main { background: var(--brand); }
.btn-main:hover { background: var(--brand-hi); }
.btn-ghost { background: rgba(14, 11, 28, .7); border-color: var(--text); box-shadow: 0 4px 0 rgba(0, 0, 0, .6); }
.btn-ghost:hover { background: var(--panel); }
.btn-small { font-size: 20px; padding: 9px 14px 7px; border-width: 2px; box-shadow: 0 3px 0 #000; background: var(--brand); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(14, 11, 28, .88);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 24px; height: 64px; }
.top-logo img { width: 150px; }
.top-nav { display: flex; gap: 22px; margin-left: auto; }
.top-nav a { font: 20px/1 var(--pixel); color: var(--text); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.top-nav a:hover { border-color: var(--brand); color: #fff; }

/* Language menu: a native disclosure, no JS. */
.lang { position: relative; }
.lang summary { list-style: none; cursor: pointer; font: 20px/1 var(--pixel); color: var(--text); padding: 6px 4px; border-bottom: 2px solid transparent; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover, .lang[open] summary { border-color: var(--brand); color: #fff; }
.lang ul { position: absolute; right: 0; top: calc(100% + 10px); margin: 0; padding: 6px 0; list-style: none; min-width: 180px;
  background: var(--panel); border: 2px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.lang a { display: block; padding: 6px 16px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 16px; }
.lang a:hover { background: var(--line); color: #fff; }
.lang a[aria-current] { color: var(--gold); }
.foot-langs { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; font-size: 15px; }

/*
 * Hero: a silent loop from the game (assets/hero, 960x540 = the game's 480x270 pixels doubled) over its first frame.
 * The poster is the LCP image; site.js adds the video after load (phones: a lighter 320x540 cut of the same loop,
 * with its own poster), never with reduced motion or data saving. The hero grows with wide screens so the 16:9 loop
 * keeps the cars and some sky; framed low so the cars sit above the bottom fade. Pixelated: the pixel art stays sharp.
 */
.hero {
  position: relative;
  min-height: min(88vh, max(860px, 42vw));
  display: flex;
  align-items: flex-start;
  overflow: hidden;
  isolation: isolate;
}
.hero-art, .hero-art img, .hero-video { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-art, .hero-video { z-index: -2; }
.hero-art img, .hero-video { object-fit: cover; object-position: 50% 80%; image-rendering: pixelated; }
.hero-video { opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.hero-video.is-playing { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .hero-video { display: none; } }
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 60% 48% at 50% 34%, rgba(10, 7, 22, .72), rgba(10, 7, 22, 0) 100%),
    linear-gradient(180deg, rgba(14, 11, 28, .62) 0%, rgba(14, 11, 28, .24) 48%, rgba(14, 11, 28, 0) 64%, rgba(14, 11, 28, 0) 92%, rgba(14, 11, 28, .85) 100%);
}
.hero-body { position: relative; padding-top: clamp(28px, 6vh, 72px); padding-bottom: 220px; text-align: center; }
.hero-logo { margin: 0 auto; max-width: 820px; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .55)); }
.hero-tag {
  font: 40px/1.15 var(--pixel);
  margin: 12px 0 10px;
  text-shadow: 0 3px 0 #000;
}
.hero-lead { max-width: 640px; margin: 0 auto; font-size: 19px; font-weight: 600; text-shadow: 0 1px 0 #000, 0 2px 8px #000, 0 0 18px rgba(0, 0, 0, .8); }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 18px; margin: 26px 0 14px; }
.hero-note { display: inline-block; margin: 0; padding: 4px 12px; background: rgba(10, 7, 22, .75); font-weight: 600; font-size: 16px; }

/* Numbers strip */
.stats { background: var(--bg-2); border-block: 2px solid var(--line); }
.stats-row { list-style: none; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.stats-row li { padding: 20px 8px 16px; }
.stats-row li + li { border-left: 2px solid var(--line); }
.stats-row b { display: block; font: 50px/1 'Dragline', var(--pixel); color: var(--gold); }
.stats-row span { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 14px; font-weight: 600; }

/* Sections */
.block { padding: 80px 0 24px; }
.title { font: 50px/1.1 var(--pixel); margin: 0 0 18px; }
.title::before { content: ''; display: inline-block; width: .5em; height: .5em; background: var(--brand); margin-right: .35em; vertical-align: .08em; }
.intro { color: var(--muted); max-width: 720px; margin: 0 0 36px; }

.video { border: 3px solid #000; box-shadow: 0 0 0 2px var(--line), 0 18px 50px rgba(0, 0, 0, .5); background: #000; }
.video video { width: 100%; aspect-ratio: 16 / 9; }
.trailer { margin: 0 0 36px; }
.trailer figcaption { margin-top: 10px; color: var(--muted); font-weight: 600; }

.feature { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 40px; align-items: center; margin-bottom: 48px; }
.feature:nth-of-type(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 560px); }
.feature:nth-of-type(even) img { order: 2; }
.feature img { width: 100%; border: 3px solid #000; box-shadow: 0 0 0 2px var(--line); image-rendering: auto; }
.feature h3 { font: 40px/1.1 var(--pixel); margin: 0 0 10px; color: var(--gold); }
.feature p { margin: 0; color: var(--text); }

.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.shot { display: block; border: 3px solid #000; box-shadow: 0 0 0 2px var(--line); transition: box-shadow .15s; }
.shot:hover, .shot:focus-visible { box-shadow: 0 0 0 2px var(--brand); outline: none; }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.join { padding-bottom: 80px; }
.join-body { text-align: center; }
.join .intro { margin: 0 auto 8px; }
.social { list-style: none; display: flex; justify-content: center; gap: 14px; padding: 0; margin: 24px 0 0; }
.social a { display: grid; place-items: center; width: 52px; height: 52px; background: var(--panel); border: 2px solid var(--line); color: var(--text); }
.social a:hover { background: var(--brand); border-color: #000; color: #fff; }
.social svg { width: 24px; height: 24px; fill: currentColor; }

.foot { border-top: 2px solid var(--line); background: var(--bg-2); color: var(--muted); font-size: 15px; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; padding-block: 22px; }
.foot p { margin: 0; }

/* Lightbox */
.lightbox { padding: 0; border: 3px solid #000; background: #000; max-width: min(96vw, 1920px); max-height: 94vh; }
.lightbox::backdrop { background: rgba(5, 4, 12, .9); }
.lightbox img { max-height: calc(94vh - 6px); width: auto; }
.lightbox-close {
  position: absolute; top: 8px; right: 8px;
  width: 44px; height: 44px; border: 2px solid #000;
  background: var(--brand); color: #fff; font: 32px/1 var(--pixel); cursor: pointer;
}

/* Press kit page */
.press-head { padding: 56px 0 8px; }
.press-head .title { font-size: 60px; }
.facts { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 48px; align-items: start; }
.facts dl { margin: 0; background: var(--panel); border: 2px solid var(--line); padding: 20px 22px; }
.facts dt { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }
.facts dd { margin: 2px 0 14px; }
.facts dd:last-child { margin-bottom: 0; }
.prose h3 { font: 30px/1.15 var(--pixel); color: var(--gold); margin: 28px 0 8px; }
.prose h3:first-child { margin-top: 0; }
.prose p, .prose ul { margin: 0 0 12px; }
.prose li { margin-bottom: 4px; }
.downloads { display: flex; flex-wrap: wrap; gap: 14px 18px; margin: 8px 0 0; }

/* Devlog: post cards (home page and /devlog/) and the post page. */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card { display: flex; flex-direction: column; height: 100%; background: var(--panel); border: 2px solid var(--line); color: var(--text); text-decoration: none; transition: border-color .15s, transform .08s; }
.card:hover, .card:focus-visible { border-color: var(--brand); color: var(--text); transform: translateY(-2px); outline: none; }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 2px solid var(--line); }
.card-body { padding: 14px 18px 18px; }
.card time { color: var(--muted); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.card h3 { font: 30px/1.1 var(--pixel); color: var(--gold); margin: 6px 0 8px; }
.card p { margin: 0; font-size: 16px; color: var(--muted); }
.more { margin: 28px 0 0; }

.post { padding: 40px 0 72px; }
.post-wrap { max-width: 860px; }
.post-back { margin: 0 0 24px; font-weight: 600; }
.post-title { font: 56px/1.05 var(--pixel); margin: 0 0 8px; }
.post-meta { color: var(--muted); font-weight: 600; margin: 0 0 24px; }
.post-cover, .post-body img { width: 100%; border: 3px solid #000; box-shadow: 0 0 0 2px var(--line); }
.post-cover { margin-bottom: 32px; }
.post-body h2 { font: 36px/1.15 var(--pixel); color: var(--gold); margin: 36px 0 10px; }
.post-body p, .post-body ul, .post-body ol { margin: 0 0 16px; }
.post-body li { margin-bottom: 6px; }
.post-body figure { margin: 24px 0; }
.post-body figcaption { margin-top: 8px; color: var(--muted); font-size: 15px; font-weight: 600; }
.post-end { margin: 48px 0 0; padding: 22px 24px; background: var(--panel); border: 2px solid var(--line); text-align: center; }
.post-end p { margin: 0; }
.post-end .cta { margin: 16px 0 0; }
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin: 28px 0 0; font-weight: 600; }
.post-nav a:only-child.next { margin-left: auto; }

@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .post-title { font-size: 44px; }
  body { font-size: 17px; }
  .top-nav { display: none; }
  .top-row .lang { margin-left: auto; }
  .hero { min-height: 0; }
  .hero-body { padding-bottom: 150px; }
  .hero-tag { font-size: 30px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stats-row li:nth-child(3) { border-left: 0; }
  .stats-row li:nth-child(n + 3) { border-top: 2px solid var(--line); }
  .feature, .feature:nth-of-type(even) { grid-template-columns: 1fr; gap: 16px; }
  .feature:nth-of-type(even) img { order: 0; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .facts { grid-template-columns: 1fr; gap: 28px; }
  .block { padding-top: 60px; }
}
@media (max-width: 520px) {
  :root { --gutter: 16px; }
  .btn { font-size: 20px; }
  .hero-tag { font-size: 30px; }

  .title, .press-head .title { font-size: 40px; }
  .feature h3 { font-size: 30px; }
  .cta .btn { width: 100%; text-align: center; }
  .gallery { grid-template-columns: 1fr; }
  .stats-row b { font-size: 40px; }
  .cards { grid-template-columns: 1fr; }
  .post-title { font-size: 38px; }
  .post-body h2 { font-size: 30px; }
}
