@charset "UTF-8";
/* ARS 2.0 — Arctic Racing Society.
   Visuaalinen maailma: ajanottotaulu. Hiusviivat, taulukkonumerot ja
   tilatiedot kuten radan live timing -naytossa. Ladataan community.css:n
   jalkeen, joten tama kerros maarittaa uuden ilmeen. */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('/assets/fonts/archivo-latin-ext.woff2') format('woff2');
  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: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('/assets/fonts/archivo-latin.woff2') format('woff2');
  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;
}

:root {
  color-scheme: dark;
  --night: #050b12;
  --board: #0a141e;
  --board-lift: #0e1a26;
  --rule: #16242f;
  --rule-strong: #22384a;
  --snow: #e9f2f9;
  --frost: #90a8ba;
  --frost-dim: #687e8f;
  --ars: #27b6f0;
  --ars-ink: #04131d;
  --ars-deep: #0d5f8e;
  --open: #19d98c;
  --driven: #ff5a63;
  --wait: #ffb020;

  /* community.css:n vanhat muuttujat osoitetaan uuteen palettiin. */
  --bg: var(--night);
  --panel: var(--board);
  --line: var(--rule);
  --text: var(--snow);
  --muted: var(--frost);
  --blue: var(--ars);
  --green: var(--open);
  --radius: 4px;

  --shell: 1320px;
  --gutter: clamp(20px, 4vw, 44px);
  --display: 'Archivo', 'Segoe UI', system-ui, sans-serif;
}

body {
  background: var(--night);
  color: var(--snow);
  font-family: var(--display);
  font-size: 15px;
  font-variation-settings: 'wdth' 100, 'wght' 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Selaimen omat pinnat kuuluvat myos ilmeeseen. */
::selection { background: var(--ars); color: var(--ars-ink); }
* { scrollbar-color: var(--rule-strong) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 0; }
::-webkit-scrollbar-track { background: transparent; }
input, textarea, select { caret-color: var(--ars); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--ars);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3, h4 {
  font-variation-settings: 'wdth' 116, 'wght' 800;
  letter-spacing: -0.03em;
  line-height: 1.04;
  text-wrap: balance;
  color: var(--snow);
}
h1 { font-size: clamp(2.75rem, 6vw, 5rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 2.2vw, 1.9rem); font-weight: 800; }
h3 { font-size: 1.125rem; font-weight: 700; font-variation-settings: 'wdth' 110, 'wght' 700; }
h4 { font-size: 0.9375rem; font-weight: 700; font-variation-settings: 'wdth' 108, 'wght' 700; }
p { color: var(--frost); }

.wrap { max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }

/* --- Numerot ovat dataa: aina taulukkoleveydella. --- */
.board-value, .series-data dd, .rank-row small, .rank-row b,
.odo-value, time, td, th { font-variant-numeric: tabular-nums; }

/* --- Ylapalkki --- */
header {
  height: auto;
  min-height: 72px;
  gap: clamp(16px, 3vw, 40px);
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--night) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
}
.brand small { color: var(--frost-dim); letter-spacing: 2.4px; font-size: 8.5px; }
nav { gap: clamp(14px, 1.9vw, 28px); }
nav a {
  padding: 26px 0;
  font-size: 13.5px;
  font-variation-settings: 'wdth' 104, 'wght' 550;
  color: var(--frost);
  transition: color 0.15s;
}
nav a:hover { color: var(--snow); }
nav a.active { color: var(--snow); }
nav a.active:after { bottom: 0; height: 2px; background: var(--ars); }
.tagline { display: none; }
.member-menu { color: var(--frost); font-size: 12.5px; }

/* --- Painikkeet ja linkit --- */
.button, button {
  border-radius: 3px;
  border: 1px solid var(--rule-strong);
  background: transparent;
  color: var(--snow);
  font-size: 13.5px;
  font-variation-settings: 'wdth' 104, 'wght' 600;
  padding: 11px 18px;
  box-shadow: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.button:hover, button:hover { filter: none; transform: none; background: var(--board-lift); border-color: var(--ars-deep); }
.primary, .button.primary {
  background: var(--ars);
  border-color: var(--ars);
  color: var(--ars-ink);
  font-variation-settings: 'wdth' 106, 'wght' 700;
  box-shadow: none;
}
.primary:hover, .button.primary:hover { background: #4ac6f6; border-color: #4ac6f6; color: var(--ars-ink); }
.ghost { background: transparent; border-color: var(--rule-strong); }
.small { padding: 8px 13px; font-size: 12.5px; }
.text-link, .section-head a {
  color: var(--ars);
  font-size: 13px;
  font-variation-settings: 'wdth' 104, 'wght' 600;
  border-bottom: 1px solid transparent;
}
.text-link:hover, .section-head a:hover { border-bottom-color: var(--ars); }

/* --- Hero: yksi vahva hetki --- */
.home-hero {
  position: relative;
  isolation: isolate;
  min-height: min(76vh, 620px);
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.home-hero:before, .home-hero:after { content: none; }
.hero-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(5, 11, 18, 0.72) 0%, rgba(5, 11, 18, 0.1) 38%, rgba(5, 11, 18, 0.93) 100%),
    linear-gradient(90deg, rgba(5, 11, 18, 0.9) 0%, rgba(5, 11, 18, 0.25) 62%, transparent 100%);
}
.home-hero .wrap { width: 100%; padding-block: clamp(44px, 7vw, 92px) clamp(36px, 5vw, 64px); }
.home-hero .hero-copy { max-width: 42rem; }
.home-hero h1 {
  margin: 0;
  font-size: clamp(2.75rem, 6.4vw, 5.25rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  font-variation-settings: 'wdth' 118, 'wght' 800;
}
.home-hero .hero-lede {
  margin-top: 20px;
  max-width: 46ch;
  font-size: clamp(1rem, 1.25vw, 1.1875rem);
  line-height: 1.55;
  color: #c3d4e1;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero-actions .button { padding: 13px 22px; }

/* --- Tilanauha: palvelimen totuus yhdella rivilla --- */
.status-band { border-bottom: 1px solid var(--rule); background: var(--board); }
.status-band .wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0;
}
.status-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 22px 0 22px 26px;
  margin-left: -1px;
  border-left: 1px solid var(--rule);
  min-width: 0;
}
.status-cell:first-child { padding-left: 0; border-left: 0; margin-left: 0; }
.band-label { font-size: 12px; color: var(--frost-dim); }
.board-value {
  font-size: clamp(1.0625rem, 1.5vw, 1.375rem);
  font-variation-settings: 'wdth' 112, 'wght' 700;
  letter-spacing: -0.02em;
  color: var(--snow);
  overflow-wrap: anywhere;
}
.board-value.accent { color: var(--ars); }
.status-note { font-size: 12.5px; color: var(--frost); }
.status-cell .button { align-self: flex-start; margin-top: 4px; }

/* --- Osiot --- */
.home-main { padding-bottom: clamp(48px, 7vw, 96px); }
.section { padding-top: clamp(44px, 6vw, 80px); padding-bottom: 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-strong);
  margin-bottom: 0;
}
.section-head h2 { margin: 0; }
.section-head p { font-size: 13px; margin-top: 6px; max-width: 52ch; }

/* --- Sarjat ajanottorivein --- */
.series-rows { list-style: none; margin: 0; padding: 0; }
.series-row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1.25fr) minmax(0, 1.4fr) auto;
  align-items: center;
  gap: clamp(16px, 2vw, 30px);
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
  transition: background-color 0.15s;
}
.series-row:hover { background: #09131c; }
.series-thumb {
  width: 148px;
  height: 92px;
  object-fit: cover;
  border-radius: 3px;
  background: var(--board-lift);
  border: 1px solid var(--rule);
}
.series-thumb.placeholder { display: grid; place-items: center; color: var(--frost-dim); font-size: 11px; }
.series-id h3 { margin: 0 0 6px; font-size: clamp(1.1875rem, 1.9vw, 1.5rem); font-variation-settings: 'wdth' 114, 'wght' 800; }
.series-cars { font-size: 12.5px; color: var(--frost); line-height: 1.5; margin: 0; }
.series-cars .series-game-logo {
  display: block;
  position: static;
  width: auto;
  height: 16px;
  margin: 0 0 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
.series-cars .series-game-logo img { width: auto; height: 16px; object-fit: contain; opacity: 0.85; }

.evo-thumb { background: #0b1622; }
.evo-thumb img { width: 68%; height: auto; opacity: 0.9; }
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 10px 2px 1px;
  border-radius: 50%;
  vertical-align: middle;
  background: var(--open);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--open) 20%, transparent);
}
.status-cell .text-link { align-self: flex-start; margin-top: 2px; }

/* Muiden sivujen vanhat kortit tasoitetaan samaan maailmaan. */
.series-card { background: var(--board); border: 1px solid var(--rule); border-radius: 3px; box-shadow: none; }
.series-card:before { opacity: 0.55; }
.series-data { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; margin: 0; }
.series-data div { min-width: 0; }
.series-data dt { font-size: 11.5px; color: var(--frost-dim); }
.series-data dd {
  margin: 3px 0 0;
  font-size: 14px;
  font-variation-settings: 'wdth' 108, 'wght' 650;
  color: var(--snow);
  overflow-wrap: anywhere;
}
.series-go { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 4px 11px 4px 9px;
  font-size: 11.5px;
  font-variation-settings: 'wdth' 104, 'wght' 600;
  color: var(--frost);
  white-space: nowrap;
}
.chip:before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-open { color: var(--open); border-color: color-mix(in srgb, var(--open) 42%, var(--rule)); }
.chip-live { color: var(--driven); border-color: color-mix(in srgb, var(--driven) 42%, var(--rule)); }
.chip-wait { color: var(--wait); border-color: color-mix(in srgb, var(--wait) 40%, var(--rule)); }

/* --- Tulostaulu: kolme saraketta, ei kolmea laatikkoa --- */
.standings-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: clamp(40px, 5vw, 72px);
  border-top: 1px solid var(--rule-strong);
}
.standings-col { padding: 26px 26px 10px; border-left: 1px solid var(--rule); margin-left: -1px; min-width: 0; }
.standings-col:first-child { padding-left: 0; border-left: 0; margin-left: 0; }
.standings-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--rule);
}
.standings-col h3 { margin: 0; }
.rank-row, .home-competition-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--snow);
  transition: color 0.15s;
}
.rank-row:first-of-type, .home-competition-result:first-of-type { border-top: 0; }
.rank-row:hover { color: var(--ars); }
.rank-row b {
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  min-width: 24px;
  padding: 1px 0;
  text-align: center;
  font-size: 11.5px;
  font-variation-settings: 'wdth' 100, 'wght' 650;
  color: var(--frost);
}
.rank-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row small { color: var(--frost-dim); font-size: 11.5px; }
.home-competition-result { justify-content: space-between; }
.home-competition-result strong { display: block; font-size: 13px; font-variation-settings: 'wdth' 106, 'wght' 650; }
.home-competition-result small { color: var(--frost-dim); font-size: 11.5px; }
.empty { padding: 18px 0; color: var(--frost-dim); font-size: 13px; }

/* --- Kutsu: tasainen, ei korttia --- */
.join-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: clamp(44px, 6vw, 80px);
  padding-top: 30px;
  border-top: 1px solid var(--rule-strong);
}
.join-note h2 { margin-bottom: 8px; }
.join-note p { max-width: 48ch; font-size: 14px; }
.join-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- Alatunniste --- */
footer { border-top: 1px solid var(--rule); margin-top: 0; padding: 30px 0 38px; color: var(--frost-dim); font-size: 12px; letter-spacing: 0; }
.footer-inner { gap: 20px; }
.footer-inner a { color: var(--frost); }
.footer-inner a:hover { color: var(--snow); }

/* --- Yksi orkestroitu hetki sivun avautuessa --- */
@media (prefers-reduced-motion: no-preference) {
  .home-hero .hero-copy > * { animation: ars-rise 0.72s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
  .home-hero h1 { animation-delay: 0.04s; }
  .home-hero .hero-lede { animation-delay: 0.12s; }
  .home-hero .hero-actions { animation-delay: 0.2s; }
  /* Lähtee näkyvästä tilasta: teksti on luettavissa, vaikka animaatio ei ehtisi ajaa. */
  @keyframes ars-rise { from { transform: translateY(14px); } }
}

/* Uusi navigaatio mahtuu yhdelle riville 1200 px:iin asti myös kirjautuneena
   (Manager, nimi, Telemetria); race-results.css rivittäisi sen jo 1250 px:ssä. */
@media (min-width: 1201px) {
  #site > header { flex-wrap: nowrap; min-height: 72px; padding-top: 0; padding-bottom: 0; }
  #site > header nav { order: 0; width: auto; justify-content: center; overflow: visible; }
}
@media (max-width: 1200px) {
  #site > header { flex-wrap: wrap; gap: 4px 16px; padding: 10px var(--gutter) 0; }
  #site > header nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 22px;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, #000 85%, transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  #site > header nav::-webkit-scrollbar { display: none; }
  #site > header nav a { padding: 10px 0 12px; white-space: nowrap; }
  .header-actions { margin-left: auto; }
}

@media (max-width: 1150px) {
  .series-row { grid-template-columns: 124px minmax(0, 1fr) auto; row-gap: 14px; }
  .series-thumb { width: 124px; height: 78px; }
  .series-data { grid-column: 2 / -1; }
  .standings-board { grid-template-columns: 1fr; }
  .standings-col { padding: 22px 0 10px; border-left: 0; margin-left: 0; border-top: 1px solid var(--rule); }
  .standings-col:first-child { border-top: 0; }
}

@media (max-width: 760px) {
  #site > header nav { gap: 18px; }
  #site > header nav a { font-size: 12.5px; }
  .home-hero { min-height: 72vh; }
  .home-hero .wrap { padding-block: 40px 32px; }
  .hero-lede { font-size: 0.9375rem; }
  .hero-actions .button { flex: 1 1 auto; justify-content: center; }
  .status-band .wrap { grid-template-columns: 1fr; }
  .status-cell { padding: 16px 0; border-left: 0; margin-left: 0; border-top: 1px solid var(--rule); }
  .status-cell:first-child { border-top: 0; padding-top: 20px; }
  .series-row { grid-template-columns: 96px minmax(0, 1fr); padding: 18px 0; }
  .series-thumb { width: 96px; height: 64px; }
  .series-data { grid-column: 1 / -1; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 0.9fr); gap: 0 12px; }
  .series-go { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
  .join-note { display: block; }
  .join-actions { margin-top: 20px; }
  .footer-inner { justify-content: flex-start; text-align: left; }
}
