/* Crazy Traffic Car Race 3D website. Colours come from the game's UI palette (docs/UI_GUIDE.md). */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --raised: #eef0f4;
  --line: #dde1e8;
  --text: #11141a;
  --muted: #4f5866;
  --accent: #c80500;
  --accent-ink: #ffffff;
  --coin: #a86a00;
  --ok: #15803d;
  --hero: linear-gradient(160deg, #0b0d12 0%, #1a0f12 60%, #3a0806 100%);
  --hero-text: #f2f4f8;
  --hero-muted: #c3c9d4;
  --radius: 14px;
  --max: 1080px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --surface: #12151c;
    --raised: #161a22;
    --line: #2b3342;
    --text: #f2f4f8;
    --muted: #9aa3b2;
    --accent: #ff3b30;
    --accent-ink: #0b0d12;
    --coin: #ffb020;
    --ok: #22c55e;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--coin);
  outline-offset: 2px;
  border-radius: 6px;
}
h1, h2, h3 { line-height: 1.2; }
h2 { font-size: 1.35rem; margin: 40px 0 10px; }
h3 { font-size: 1.05rem; margin: 22px 0 6px; }
code { font-size: 0.92em; background: var(--raised); padding: 1px 5px; border-radius: 5px; }

.skip { position: absolute; left: -9999px; top: 8px; }
.skip:focus { left: 16px; z-index: 10; background: var(--surface); padding: 8px 12px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }

/* Header */
.site-header { background: #0b0d12; color: #f2f4f8; border-bottom: 3px solid #e10600; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 800; letter-spacing: 0.2px; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a { color: #c3c9d4; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: 0.95rem; }
.site-nav a:hover { color: #fff; background: #161a22; }
.site-nav a[aria-current="page"] { color: #fff; background: #2b3342; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 12px;
  font-weight: 700; text-decoration: none; border: 2px solid transparent;
}
.btn-primary { background: #e10600; color: #fff; }
.btn-primary:hover { background: #ff1a12; }
.btn-ghost { border-color: currentColor; color: inherit; }
.btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 0; }

/* Hero */
.hero { background: var(--hero); color: var(--hero-text); padding: 56px 0 64px; }
.hero .wrap { display: grid; gap: 32px; align-items: center; grid-template-columns: 1.05fr 1fr; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: 0 0 12px; letter-spacing: -0.5px; }
.hero p { color: var(--hero-muted); font-size: 1.1rem; margin: 0; max-width: 34em; }
.hero .eyebrow { color: #ffb020; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; font-size: 0.8rem; margin-bottom: 10px; }
.hero-shots { display: grid; gap: 12px; }
.hero-shots img { border-radius: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); border: 1px solid #2b3342; }
.hero-shots img:nth-child(2) { width: 82%; justify-self: end; margin-top: -40px; }

/* Sections */
section { padding: 48px 0; }
.section-title { font-size: 1.7rem; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 24px; max-width: 42em; }

.features { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin: 0 0 6px; }
.card p { margin: 0; color: var(--muted); }
.card .tag { display: inline-block; font-size: 0.75rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }

.strip { display: grid; gap: 14px; grid-auto-flow: column; grid-auto-columns: minmax(300px, 1fr); overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.strip figure { margin: 0; scroll-snap-align: start; }
.strip img { border-radius: 10px; border: 1px solid var(--line); }
.strip figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }

.cta { background: var(--raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.cta .btn-row { justify-content: center; }
.note { color: var(--muted); font-size: 0.9rem; }

/* Documents */
.doc { padding-top: 40px; padding-bottom: 64px; }
.doc h1 { font-size: clamp(1.8rem, 4vw, 2.3rem); margin: 0 0 6px; }
.doc .meta { color: var(--muted); margin: 0 0 24px; }
.doc li { margin: 4px 0; }
.summary { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 18px; }
.summary ul { margin: 6px 0 0; padding-left: 20px; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; margin: 20px 0; }
.toc ol { margin: 6px 0 0; padding-left: 22px; columns: 2; column-gap: 24px; }

table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.95rem; background: var(--surface); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { background: var(--raised); color: var(--muted); font-weight: 700; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 4px 0 10px 44px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 800;
  display: grid; place-items: center; font-size: 0.9rem;
}

details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; }
summary { cursor: pointer; padding: 14px 16px; font-weight: 600; min-height: 48px; }
details > div { padding: 0 16px 14px; color: var(--muted); }
details > div p { margin: 6px 0; }

.contact-box { text-align: center; padding: 28px 20px; }
.contact-box p { color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 0.9rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 12px; }
.site-footer a { color: var(--text); }

/* Phones */
@media (max-width: 820px) {
  .hero { padding: 36px 0 44px; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-shots img:nth-child(2) { width: 75%; margin-top: -28px; }
  .features { grid-template-columns: 1fr; }
  .toc ol { columns: 1; }
  .strip { grid-auto-columns: 82%; }
}
@media (max-width: 600px) {
  .site-nav a { padding: 8px 8px; font-size: 0.9rem; }
  .btn-row .btn { flex: 1 1 100%; }
  /* Wide tables become stacked cards */
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack thead { position: absolute; left: -9999px; }
  table.stack { background: none; }
  table.stack tr { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin: 0 0 10px; padding: 6px 0; }
  table.stack td { border: 0; padding: 4px 14px; }
  table.stack td::before { content: attr(data-label); display: block; font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
}
