/* ─────────────────────────────────────────────────────────────
   damble · shared editorial light system
   Token foundation + cross-page components.
   Loaded by index, games, autos (list + each car), umfragen,
   leaderboard, disg.
   ───────────────────────────────────────────────────────────── */

:root{
  /* Surfaces, warm and tinted toward the amber brand (no pure white) */
  --bg-page:        oklch(0.98 0.006 75);
  --bg-surface:     oklch(0.965 0.010 70);
  --bg-tint:        oklch(0.95 0.014 68);
  --bg-quiet:       oklch(0.93 0.018 65);

  /* Ink, warm charcoal (no pure black) */
  --ink:            oklch(0.22 0.012 60);
  --ink-soft:       oklch(0.34 0.012 60);
  --ash:            oklch(0.55 0.014 60);
  --fade:           oklch(0.72 0.010 60);

  /* Rules, just tinted ink at low opacity */
  --rule:           oklch(0.22 0.012 60 / 0.08);
  --rule-strong:    oklch(0.22 0.012 60 / 0.16);
  --rule-soft:      oklch(0.22 0.012 60 / 0.04);

  /* Signature amber, the only saturated color used ≤10% of any surface */
  --amber:          oklch(0.74 0.155 62);
  --amber-deep:     oklch(0.58 0.150 50);
  --amber-pale:     oklch(0.92 0.050 70);
  --amber-glow:     oklch(0.74 0.155 62 / 0.18);

  /* Reserved accents, used only for state, not decoration */
  --jade:           oklch(0.55 0.080 175);
  --ruby:           oklch(0.50 0.160 28);

  /* Type */
  --font-display:   'Fraunces', 'Times New Roman', serif;
  --font-body:      'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono:      'JetBrains Mono', ui-monospace, monospace;

  /* Spacing rhythm, varied on purpose */
  --r-1: 4px;
  --r-2: 8px;
  --r-3: 14px;
  --r-4: 22px;
  --r-5: 36px;
  --r-6: 58px;
  --r-7: 92px;
  --r-8: 148px;

  /* Motion, exponential ease-out only */
  --ease:           cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft:      cubic-bezier(0.33, 1, 0.68, 1);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg-page); color: var(--ink); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { font-family: var(--font-body); font-weight: 300; font-size: 16px; line-height: 1.55; letter-spacing: -0.005em; overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
::selection { background: var(--amber); color: var(--bg-page); }

/* ── Top rail ─────────────────────────────────────── */
.rail{
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  padding: 16px clamp(20px, 4vw, 36px);
  background: color-mix(in oklch, var(--bg-page) 86%, transparent);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid var(--rule-soft);
}
.rail__mark{
  font-family: var(--font-display); font-style: italic; font-weight: 300;
  font-size: 22px; letter-spacing: -0.02em; color: var(--ink);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}
.rail__mark::after{ content: '.'; color: var(--amber); font-style: normal; }
.rail__nav{
  display: flex; gap: 28px; justify-content: center;
  font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ash); font-weight: 500;
}
.rail__nav a{
  position: relative; padding: 6px 0;
  transition: color .25s var(--ease);
}
.rail__nav a:hover, .rail__nav a.is-active{ color: var(--ink); }
.rail__nav a::after{
  content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 1px;
  background: var(--amber);
  transition: width .35s var(--ease);
}
.rail__nav a:hover::after, .rail__nav a.is-active::after{ width: 100%; }

.rail__cta{
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 16px 9px 14px; border: 1px solid var(--rule-strong); border-radius: 999px;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; color: var(--ink);
  transition: border-color .3s var(--ease), background .3s var(--ease), color .3s var(--ease);
}
.rail__cta:hover{ background: var(--ink); color: var(--bg-page); border-color: var(--ink); }
.rail__cta__dot{ width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }

.rail__back{
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 16px 9px 12px; border: 1px solid var(--rule-strong); border-radius: 999px;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; color: var(--ash);
  transition: color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.rail__back:hover{ color: var(--ink); border-color: var(--ink); transform: translateX(-2px); }
.rail__back__arrow{
  width: 20px; height: 20px; border-radius: 50%; background: var(--bg-tint);
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px;
}

/* ── Layout helpers ───────────────────────────────── */
.wrap{ max-width: 1320px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 36px); }
.wrap--narrow{ max-width: 920px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 36px); }

.crumb{
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--ash); display: inline-flex; align-items: center; gap: 14px;
}
.crumb::before{ content: ''; width: 28px; height: 1px; background: var(--ink); display: inline-block; }

/* Display headlines */
.display{
  font-family: var(--font-display); font-style: italic; font-weight: 300;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  line-height: 0.88; letter-spacing: -0.045em; color: var(--ink);
}
.display em{ font-style: italic; }
.display .dot{ color: var(--amber); font-style: normal; }
.display--xl{ font-size: clamp(72px, 13vw, 200px); }
.display--lg{ font-size: clamp(56px, 9vw, 132px); }
.display--md{ font-size: clamp(40px, 6vw, 84px); line-height: 0.96; }
.display--sm{ font-size: clamp(28px, 3.4vw, 48px); line-height: 1.0; }

.lede{
  max-width: 60ch; font-size: 17px; line-height: 1.6; color: var(--ink-soft); font-weight: 300;
}

/* Buttons */
.btn{
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 22px 14px 26px;
  font-family: var(--font-body); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600;
  border-radius: 999px; border: 1px solid transparent;
  transition: transform .35s var(--ease), background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn:active{ transform: scale(0.985); }

.btn--primary{
  background: var(--ink); color: var(--bg-page);
}
.btn--primary:hover{ background: color-mix(in oklch, var(--ink) 88%, var(--amber)); }

.btn--accent{
  background: var(--amber); color: var(--ink);
}
.btn--accent:hover{ background: var(--amber-deep); color: var(--bg-page); }

.btn--ghost{
  background: transparent; color: var(--ink); border-color: var(--rule-strong);
}
.btn--ghost:hover{ border-color: var(--ink); }

.btn__arrow{
  width: 26px; height: 26px; border-radius: 50%; background: var(--bg-page); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
  transition: transform .35s var(--ease);
}
.btn--accent .btn__arrow{ background: var(--ink); color: var(--bg-page); }
.btn--ghost .btn__arrow{ background: var(--bg-tint); color: var(--ink); }
.btn:hover .btn__arrow{ transform: translateX(3px); }

/* Mini link with trailing arrow */
.linkout{
  display: inline-flex; align-items: center; gap: 10px; color: var(--ink);
  font-size: 13px; font-weight: 500; padding-bottom: 4px;
  border-bottom: 1px solid var(--ink); width: fit-content;
  transition: gap .3s var(--ease);
}
.linkout:hover{ gap: 14px; }

/* Tags / chips */
.chip{
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 500;
  padding: 5px 10px; border-radius: 999px; color: var(--ash);
  border: 1px solid var(--rule-strong); background: transparent;
}
.chip--solid{ background: var(--ink); color: var(--bg-page); border-color: var(--ink); }
.chip--accent{ background: var(--amber); color: var(--ink); border-color: var(--amber); }
.chip--dot::before{
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); display: inline-block;
}

/* Numbers (tabular) */
.num{ font-variant-numeric: tabular-nums; }

/* Live pulse dot, used for status */
.pulse{
  width: 7px; height: 7px; border-radius: 50%; background: var(--amber); display: inline-block;
  box-shadow: 0 0 0 0 color-mix(in oklch, var(--amber) 60%, transparent);
  animation: pulse 1.8s var(--ease-soft) infinite;
}
@keyframes pulse{
  0%   { box-shadow: 0 0 0 0 color-mix(in oklch, var(--amber) 60%, transparent); }
  80%, 100% { box-shadow: 0 0 0 10px color-mix(in oklch, var(--amber) 0%, transparent); }
}

/* Section padding rhythm */
.section{ padding: var(--r-8) 0; }
.section--snug{ padding: var(--r-7) 0; }
.section--air{ padding: var(--r-8) 0 calc(var(--r-8) + var(--r-5)); }

/* Footer (shared) */
.foot{
  border-top: 1px solid var(--rule);
  background: var(--bg-page);
  padding: var(--r-7) 0 var(--r-5);
}
.foot__inner{
  max-width: 1320px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 36px);
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: var(--r-5);
}
.foot__mark{
  font-family: var(--font-display); font-style: italic; font-weight: 300;
  font-size: clamp(56px, 9vw, 132px); letter-spacing: -0.045em; line-height: 0.86;
  font-variation-settings: 'opsz' 144, 'SOFT' 100; color: var(--ink);
}
.foot__mark::after{ content: '.'; color: var(--amber); font-style: normal; }
.foot__meta{
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ash); text-align: right;
}
.foot__meta div + div{ margin-top: 6px; }

/* Subtle paper grain on every page */
.paper{
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  opacity: 0.12; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.12'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

/* Reveal-on-scroll utility */
.reveal{ opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in{ opacity: 1; transform: translateY(0); }

/* Responsive baselines */
@media (max-width: 800px){
  .rail{ padding: 14px 18px; }
  .rail__nav{ display: none; }
  .foot__inner{ grid-template-columns: 1fr; }
  .foot__meta{ text-align: left; }
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal{ opacity: 1; transform: none; }
}
