/* SuperTrucker Platform — Base + Components */

@import url('./tokens.css');

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01' on, 'ss02' on;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
a { color: var(--ink); text-decoration: none; }
input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--highway); outline-offset: 2px; border-radius: var(--r-sm); }

/* ---------- Type ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 44px; line-height: 1.05; letter-spacing: -0.025em; font-weight: 400; }
h2 { font-size: 28px; line-height: 1.15; letter-spacing: -0.018em; }
h3 { font-size: 19px; line-height: 1.25; }
h4 { font-size: 15px; line-height: 1.3; font-weight: 600; font-family: var(--font-body); letter-spacing: 0.01em; }
.eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.mono { font-family: var(--font-mono); font-feature-settings: 'zero' on; }
.muted { color: var(--ink-muted); }

/* ---------- Wordmark ---------- */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink);
  position: relative;
}
.wordmark .super {
  font-style: italic;
  font-weight: 400;
}
.wordmark .trucker {
  font-weight: 600;
}
.wordmark .stripe {
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 3px;
  background: var(--highway);
  border-radius: 1px;
}
.wordmark.sm { font-size: 18px; }
.wordmark.md { font-size: 24px; }
.wordmark.lg { font-size: 56px; }
.wordmark.xl { font-size: 88px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 10px 16px;
  border-radius: var(--r-md);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.005em;
  transition: transform 0.08s ease, background 0.12s ease, box-shadow 0.12s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--highway);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--highway-deep);
}
.btn-primary:hover { background: #FFC229; }
.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--hairline-strong);
}
.btn-secondary:hover { background: var(--paper-2); }
.btn-ghost { color: var(--ink-soft); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); }
.btn-dark {
  background: var(--asphalt);
  color: var(--asphalt-ink);
}
.btn-dark:hover { background: var(--asphalt-2); }
.btn-lg { padding: 14px 22px; font-size: 15px; }
.btn-xl { padding: 18px 26px; font-size: 17px; }
.btn-block { width: 100%; }
.btn .arrow { transition: transform 0.12s ease; }
.btn:hover .arrow { transform: translateX(2px); }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}
.input {
  padding: 12px 14px;
  background: var(--bone);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  font-size: 15px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  width: 100%;
}
.input:focus {
  outline: none;
  border-color: var(--highway);
  box-shadow: 0 0 0 3px var(--highway-glow);
}

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.card.elevated { box-shadow: var(--shadow-2); background: var(--bone); }
.card.bone { background: var(--bone); }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  background: var(--paper-2);
  color: var(--ink-soft);
}
.pill .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-muted);
}
.pill.amber { background: var(--highway-glow); color: var(--rust); }
.pill.amber .dot { background: var(--highway); }
.pill.pine { background: var(--pine-glow); color: var(--pine); }
.pill.pine .dot { background: var(--pine); }
.pill.signal { background: var(--signal-glow); color: var(--signal); }
.pill.signal .dot { background: var(--signal); }

/* ---------- HOS clock — the centerpiece component ---------- */
.hos-clock {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}
.hos-row {
  display: grid;
  grid-template-columns: 100px 1fr 64px;
  align-items: center;
  gap: var(--s-3);
}
.hos-row .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}
.hos-bar {
  height: 10px;
  background: var(--paper-2);
  border-radius: var(--r-pill);
  overflow: hidden;
  position: relative;
}
.hos-bar > span {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--pine);
  transition: width 0.4s ease;
}
.hos-bar.warn > span  { background: var(--highway); }
.hos-bar.danger > span { background: var(--signal); }
.hos-time {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- Layout helpers ---------- */
.stack { display: flex; flex-direction: column; }
.row { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.gap-5 { gap: var(--s-5); }
.gap-6 { gap: var(--s-6); }
.grow { flex: 1; }

/* ---------- Hairline divider ---------- */
.hr { height: 1px; background: var(--hairline); border: 0; margin: 0; }

/* ---------- Subtle ruled background ---------- */
.ruled {
  background-image:
    linear-gradient(var(--paper-line) 1px, transparent 1px);
  background-size: 100% 32px;
}

/* ---------- Demo tour bar ---------- */
.tour-bar {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--asphalt);
  color: var(--asphalt-ink);
  padding: 6px 6px 6px 14px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(31, 26, 20, 0.22), 0 1px 0 rgba(31, 26, 20, 0.4);
  max-width: calc(100vw - 24px);
}
.tour-bar .tour-home {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(250, 246, 237, 0.08);
  color: var(--asphalt-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.tour-bar .tour-home:hover { background: rgba(250, 246, 237, 0.18); }
.tour-bar .tour-pos {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--highway);
  white-space: nowrap;
}
.tour-bar .tour-pos .nm {
  color: var(--asphalt-ink);
  font-family: var(--font-body);
  letter-spacing: 0;
  font-weight: 500;
  font-size: 13px;
}
.tour-bar .dots {
  display: inline-flex; gap: 4px; align-items: center;
}
.tour-bar .dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(250, 246, 237, 0.22);
}
.tour-bar .dots i.on { background: var(--highway); }
.tour-bar .tour-nav { display: flex; gap: 4px; }
.tour-bar .tour-nav a, .tour-bar .tour-nav span {
  padding: 7px 12px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500;
  background: rgba(250, 246, 237, 0.08);
  color: var(--asphalt-ink);
  display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap;
  transition: background 0.12s ease;
}
.tour-bar .tour-nav a:hover { background: rgba(250, 246, 237, 0.18); }
.tour-bar .tour-nav .primary {
  background: var(--highway); color: var(--ink);
}
.tour-bar .tour-nav .primary:hover { background: #FFC229; }
.tour-bar .tour-nav .disabled {
  opacity: 0.35; cursor: not-allowed;
}
.tour-bar .tour-play {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(250, 246, 237, 0.08);
  color: var(--asphalt-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px;
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s ease, transform 0.08s ease;
}
.tour-bar .tour-play:hover { background: rgba(250, 246, 237, 0.2); }
.tour-bar .tour-play:active { transform: scale(0.94); }
.tour-bar .tour-play.is-playing {
  background: var(--highway);
  color: var(--ink);
}
.tour-bar .tour-progress {
  position: absolute;
  left: 14px; right: 14px;
  bottom: 4px;
  height: 2px;
  background: rgba(250, 246, 237, 0.12);
  border-radius: 1px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.tour-bar.playing .tour-progress { opacity: 1; }
.tour-bar .tour-progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--highway);
  border-radius: 1px;
}
@media (max-width: 720px) {
  .tour-bar {
    left: 8px; right: 8px; transform: none; bottom: 8px;
    padding: 6px 6px 6px 10px; gap: 6px;
    flex-wrap: wrap; justify-content: center;
  }
  .tour-bar .tour-pos .nm { display: none; }
  .tour-bar .tour-nav a, .tour-bar .tour-nav span { padding: 6px 10px; font-size: 11px; }
}

/* ================================================================
   THEME VARIABLE OVERRIDES — shared across all pages
   Default (no theme set or theme="sophisticated") uses :root in tokens.css.
   ================================================================ */

/* ---------- ANIME / CYBERPUNK-LITE ---------- */
[data-theme="anime"] {
  --bone:         #0F0E2E;
  --paper:        #1A1942;
  --paper-2:      #2A2658;
  --paper-line:   rgba(184, 199, 255, 0.14);
  --ink:          #E8F4FF;
  --ink-soft:     #B8C7FF;
  --ink-muted:    #7A86B8;
  --ink-faint:    #4A5488;
  --highway:      #F5B301;
  --highway-deep: #C48A00;
  --highway-glow: rgba(245, 179, 1, 0.28);
  --rust:         #FF2D95;
  --pine:         #00E5FF;
  --pine-soft:    #67F0FF;
  --pine-glow:    rgba(0, 229, 255, 0.22);
  --signal:       #FF2D95;
  --signal-glow:  rgba(255, 45, 149, 0.22);
  --asphalt:      #050516;
  --asphalt-ink:  #E8F4FF;
  --hairline:        rgba(232, 244, 255, 0.14);
  --hairline-strong: rgba(232, 244, 255, 0.28);
  --font-display: 'Orbitron', 'Fraunces', serif;
  --font-body:    'Inter', 'IBM Plex Sans', sans-serif;
}
/* Anime: wordmark gets neon glow */
[data-theme="anime"] .wordmark {
  text-shadow: 0 0 16px rgba(245, 179, 1, 0.55), 0 0 2px #fff;
  letter-spacing: 0.02em;
}
[data-theme="anime"] .wordmark .super { font-style: normal; font-weight: 900; }
[data-theme="anime"] .wordmark .trucker { font-weight: 900; }
[data-theme="anime"] .wordmark .stripe {
  background: linear-gradient(90deg, var(--highway), var(--rust), var(--pine));
  height: 3px;
  box-shadow: 0 0 10px currentColor;
}
[data-theme="anime"] h1,
[data-theme="anime"] h2 {
  font-weight: 700;
  letter-spacing: -0.01em;
}
[data-theme="anime"] h1 .amber,
[data-theme="anime"] h2 .amber {
  font-style: normal;
  background: linear-gradient(135deg, #F5B301 0%, #FF2D95 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(255, 45, 149, 0.4));
}
[data-theme="anime"] .btn-primary {
  background: linear-gradient(135deg, #F5B301 0%, #FF2D95 100%);
  color: #0F0E2E;
  box-shadow: 0 0 20px rgba(255, 45, 149, 0.35), inset 0 -2px 0 rgba(0,0,0,0.2);
  font-weight: 600;
}
[data-theme="anime"] .btn-primary:hover { filter: brightness(1.1); }

/* ---------- CLASSIC TRUCKSTOP / AMERICANA ---------- */
[data-theme="truckstop"] {
  --bone:         #F5E8C7;
  --paper:        #ECE0BC;
  --paper-2:      #E2D2A4;
  --paper-line:   #D6C38A;
  --ink:          #1F1812;
  --ink-soft:     #5A4A38;
  --ink-muted:    #8B7758;
  --ink-faint:    #B8A685;
  --highway:      #B89539;
  --highway-deep: #8E7128;
  --highway-glow: rgba(184, 149, 57, 0.22);
  --rust:         #B92531;
  --pine:         #1F4A2F;
  --pine-soft:    #3F6F4F;
  --pine-glow:    rgba(31, 74, 47, 0.18);
  --signal:       #B92531;
  --signal-glow:  rgba(185, 37, 49, 0.18);
  --asphalt:      #0E1A2E;
  --asphalt-ink:  #F5E8C7;
  --hairline:        rgba(31, 24, 18, 0.18);
  --hairline-strong: rgba(31, 24, 18, 0.35);
  --font-display: 'Bungee Inline', 'Alfa Slab One', 'Fraunces', serif;
  --font-body:    'Roboto Slab', 'IBM Plex Sans', sans-serif;
}
[data-theme="truckstop"] h1,
[data-theme="truckstop"] h2 {
  font-family: 'Alfa Slab One', 'Roboto Slab', serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.08;
}
[data-theme="truckstop"] h1 .amber,
[data-theme="truckstop"] h2 .amber {
  font-style: normal;
  color: var(--rust);
  text-shadow: 2px 2px 0 var(--highway);
  font-family: 'Alfa Slab One', serif;
}
[data-theme="truckstop"] .wordmark {
  font-family: 'Bungee Inline', serif;
  letter-spacing: 0;
  background: linear-gradient(180deg, #FAF6ED 0%, #B89539 50%, #8E7128 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(185, 37, 49, 0.3));
}
[data-theme="truckstop"] .wordmark .super,
[data-theme="truckstop"] .wordmark .trucker {
  font-style: normal; font-weight: 400;
  text-shadow: none;
}
[data-theme="truckstop"] .wordmark .stripe {
  background: repeating-linear-gradient(90deg, #B92531 0 10px, #B89539 10px 20px, #B92531 20px 30px);
  height: 3px;
  bottom: -6px;
  box-shadow: 0 2px 0 rgba(31, 24, 18, 0.4);
}
[data-theme="truckstop"] .btn-primary {
  background: var(--highway);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--rust), inset 0 -2px 0 var(--highway-deep);
  font-family: 'Alfa Slab One', serif;
  letter-spacing: 0.04em;
  font-weight: 400;
}
[data-theme="truckstop"] .btn-primary:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--rust), inset 0 -2px 0 var(--highway-deep); }

/* ---------- SODASHOP — 1950s soda-fountain / low-vision / LEP-friendly ---------- */
[data-theme="sodashop"] {
  --bone:         #FFF8F4;
  --paper:        #FFEEF5;
  --paper-2:      #FFE0EC;
  --paper-line:   #FBC8DA;
  --ink:          #1A0F12;
  --ink-soft:     #3A2128;
  --ink-muted:    #6E4A56;
  --ink-faint:    #B88AA0;
  --highway:      #FF6BB5;
  --highway-deep: #D6479A;
  --highway-glow: rgba(255, 107, 181, 0.22);
  --rust:         #E53935;
  --pine:         #2FA56B;
  --pine-soft:    #6BCB99;
  --pine-glow:    rgba(47, 165, 107, 0.18);
  --signal:       #E53935;
  --signal-glow:  rgba(229, 57, 53, 0.18);
  --asphalt:      #2D1820;
  --asphalt-ink:  #FFF8F4;
  --hairline:        rgba(26, 15, 18, 0.15);
  --hairline-strong: rgba(26, 15, 18, 0.30);
  --font-display: 'Fredoka', 'Atkinson Hyperlegible', sans-serif;
  --font-body:    'Atkinson Hyperlegible', 'Open Sans', system-ui, sans-serif;
  --r-sm:   6px;
  --r-md:  12px;
  --r-lg:  18px;
}
[data-theme="sodashop"] body, [data-theme="sodashop"] {
  font-size: 18px;
  line-height: 1.6;
  letter-spacing: 0.005em;
}
[data-theme="sodashop"] h1 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 56px;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
[data-theme="sodashop"] h2 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: -0.005em;
}
[data-theme="sodashop"] h3 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 24px;
}
[data-theme="sodashop"] h1 .amber,
[data-theme="sodashop"] h2 .amber {
  font-style: normal;
  color: var(--highway);
  font-weight: 600;
}
[data-theme="sodashop"] .wordmark {
  font-family: 'Fredoka', sans-serif;
  letter-spacing: 0.02em;
  font-weight: 600;
}
[data-theme="sodashop"] .wordmark .super,
[data-theme="sodashop"] .wordmark .trucker {
  font-style: normal;
  font-weight: 600;
}
[data-theme="sodashop"] .wordmark .super { color: var(--ink); }
[data-theme="sodashop"] .wordmark .trucker { color: var(--highway); }
[data-theme="sodashop"] .wordmark .stripe {
  background: var(--highway);
  height: 5px;
  bottom: -6px;
  border-radius: 3px;
  box-shadow: 0 3px 0 rgba(255, 107, 181, 0.25);
}
[data-theme="sodashop"] .btn-primary {
  background: var(--highway);
  color: #fff;
  box-shadow: 0 4px 0 var(--highway-deep), 0 6px 20px rgba(255, 107, 181, 0.3);
  font-size: 18px;
  font-weight: 600;
  font-family: 'Fredoka', sans-serif;
  letter-spacing: 0.01em;
  padding: 16px 26px;
  border-radius: 999px;
  min-height: 56px;
  min-width: 56px;
}
[data-theme="sodashop"] .btn-primary:hover { transform: translateY(-1px); background: #FF7EC0; box-shadow: 0 5px 0 var(--highway-deep), 0 8px 24px rgba(255, 107, 181, 0.4); }
[data-theme="sodashop"] .btn-primary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--highway-deep); }
[data-theme="sodashop"] .btn, [data-theme="sodashop"] .btn-secondary, [data-theme="sodashop"] .btn-ghost, [data-theme="sodashop"] .btn-dark {
  font-family: 'Fredoka', sans-serif; font-weight: 500;
  min-height: 48px; border-radius: 999px; padding: 12px 22px;
  font-size: 16px;
}
[data-theme="sodashop"] .input {
  font-size: 20px; font-family: 'Atkinson Hyperlegible', sans-serif;
  padding: 16px 18px; border-radius: 14px;
  border-width: 2px;
  min-height: 56px;
}
[data-theme="sodashop"] .input:focus {
  border-color: var(--highway);
  box-shadow: 0 0 0 4px var(--highway-glow);
}
[data-theme="sodashop"] .field label { font-size: 16px; font-weight: 600; color: var(--ink); }
[data-theme="sodashop"] .pill { font-size: 14px; padding: 8px 14px; border-radius: 999px; }
[data-theme="sodashop"] .card, [data-theme="sodashop"] .type-card { border-radius: 18px; border-width: 2px; }

/* Sodashop checkered-floor footer detail — subtle, not busy */
[data-theme="sodashop"] body {
  background:
    var(--bone);
}
[data-theme="sodashop"] .hero::before {
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 107, 181, 0.07) 0px, rgba(255, 107, 181, 0.07) 8px, transparent 8px, transparent 16px);
  opacity: 1;
}
