/* fartOLa Phase 1 prototype styles */

:root {
  --bg: oklch(0.98 0.005 90);
  --bg-elev: oklch(1 0 0);
  --bg-sunken: oklch(0.96 0.006 90);
  --fg: oklch(0.22 0.01 240);
  --fg-muted: oklch(0.50 0.01 240);
  --fg-faint: oklch(0.68 0.01 240);
  --border: oklch(0.90 0.005 90);
  --border-strong: oklch(0.82 0.005 90);

  /* Accent — forest green (orienteering map vibe). Tweakable. */
  --accent: oklch(0.50 0.08 145);
  --accent-fg: oklch(0.98 0.005 90);
  --accent-soft: oklch(0.94 0.03 145);
  --accent-strong: oklch(0.42 0.09 145);

  /* Status — locked by brief */
  --ok: oklch(0.55 0.13 145);
  --ok-soft: oklch(0.94 0.05 145);
  --mp: oklch(0.70 0.15 75);
  --mp-soft: oklch(0.95 0.06 80);
  --dnf: oklch(0.55 0.18 25);
  --dnf-soft: oklch(0.94 0.05 25);
  --pend: oklch(0.70 0.005 240);
  --pend-soft: oklch(0.94 0.005 240);

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 30, 0.04), 0 0 0 1px rgba(20, 20, 30, 0.04);
  --shadow-md: 0 4px 12px rgba(20, 20, 30, 0.06), 0 0 0 1px rgba(20, 20, 30, 0.04);
  --shadow-lg: 0 12px 40px rgba(20, 20, 30, 0.12), 0 0 0 1px rgba(20, 20, 30, 0.04);

  --font-ui: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

.font-plex {
  --font-ui: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}
.font-geist {
  --font-ui: "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
}
.font-source {
  --font-ui: "Source Sans 3", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}
.font-atkinson {
  --font-ui: "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

:root {
  --hit: 44px;
}

/* High-contrast (bright sun) */
.contrast-high {
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --bg-sunken: #f1f1f1;
  --fg: #000000;
  --fg-muted: #1f1f1f;
  --fg-faint: #3a3a3a;
  --border: #000000;
  --border-strong: #000000;
  --accent: #00541e;
  --accent-fg: #ffffff;
  --accent-soft: #d8eedd;
  --accent-strong: #003912;
  --ok: #005f1a;
  --mp: #8a4a00;
  --dnf: #8a0010;
  --shadow-sm: 0 0 0 1px #000;
  --shadow-md: 0 0 0 1.5px #000;
  --shadow-lg: 0 0 0 2px #000;
}

/* Accent variants */
.accent-blue {
  --accent: oklch(0.50 0.10 245);
  --accent-soft: oklch(0.94 0.03 245);
  --accent-strong: oklch(0.42 0.11 245);
}
.accent-magenta {
  --accent: oklch(0.50 0.13 330);
  --accent-soft: oklch(0.94 0.03 330);
  --accent-strong: oklch(0.42 0.14 330);
}
.accent-charcoal {
  --accent: oklch(0.30 0.01 240);
  --accent-soft: oklch(0.92 0.005 240);
  --accent-strong: oklch(0.20 0.01 240);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1, "zero" 1; }
.tnum { font-feature-settings: "tnum" 1; }

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.sidebar {
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 4px;
}
.sidebar .brand {
  padding: 8px 12px 20px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand-mark {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  transform: translateY(6px);
  flex-shrink: 0;
}
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-name {
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
}
.brand-tag {
  font-size: 11px; color: var(--fg-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-left: 6px;
}

.nav-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  padding: 16px 12px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--fg-muted);
  border: 0; background: transparent;
  text-align: left; width: 100%;
  min-height: var(--hit);
  font-size: 14px;
  position: relative;
}
.nav-item:hover { background: var(--bg-sunken); color: var(--fg); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 500;
}
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 2px; background: var(--accent);
}
.nav-item .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent);
}
.nav-item .badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--fg-muted);
}

.sidebar-footer {
  margin-top: auto;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--fg-faint);
  border-top: 1px solid var(--border);
}
.station-card {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  display: grid; gap: 4px;
}
.station-card .row { display: flex; justify-content: space-between; gap: 8px; }

.main {
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 0 24px;
  display: flex; align-items: center; gap: 16px;
  flex-shrink: 0;
}
.topbar .crumb {
  font-size: 14px; color: var(--fg-muted);
}
.topbar .crumb strong { color: var(--fg); font-weight: 600; }
.topbar .spacer { flex: 1; }
.clock {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--fg);
  padding: 6px 10px;
  background: var(--bg-sunken);
  border-radius: 6px;
}

.content { padding: 24px; flex: 1; overflow: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 16px;
  height: var(--hit);
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.06s ease, background 0.12s, border 0.12s;
}
.btn:hover { background: var(--bg-sunken); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.btn.primary:hover { background: var(--accent-strong); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg-sunken); }
.btn.danger { color: var(--dnf); border-color: var(--dnf); background: var(--bg-elev); }
.btn.lg { height: 56px; padding: 0 24px; font-size: 16px; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; }

/* ---------- Inputs ---------- */
.field { display: grid; gap: 6px; }
.field label {
  font-size: 13px; color: var(--fg-muted); font-weight: 500;
}
.input, .select {
  height: var(--hit);
  padding: 0 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 16px;
  width: 100%;
}
.input:focus, .select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

/* ---------- Status pills ---------- */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.mp { background: var(--mp-soft); color: oklch(0.45 0.12 70); }
.status.dnf { background: var(--dnf-soft); color: var(--dnf); }
.status.pend { background: var(--pend-soft); color: var(--fg-muted); }
.status::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.contrast-high .status { border: 1.5px solid currentColor; }

/* ---------- Card ---------- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-body { padding: 18px; }

/* ---------- Modal ---------- */
.modal-scrim {
  position: fixed; inset: 0;
  background: rgba(20, 20, 30, 0.32);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 50;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--bg-elev);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-head {
  padding: 18px 22px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.modal-body { padding: 22px; overflow: auto; }
.modal-foot {
  padding: 16px 22px;
  display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
}

/* ---------- Misc ---------- */
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.muted { color: var(--fg-muted); }
.faint { color: var(--fg-faint); }
.h0 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 4px; }
.h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.h2 { font-size: 16px; font-weight: 600; margin: 0; }
.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 5px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg-muted);
}

/* live pulse */
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  animation: pulseDot 1.6s ease-in-out infinite;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent);
}

/* flash when a new card is read */
@keyframes flashIn {
  0% { background: var(--accent-soft); }
  100% { background: transparent; }
}
.flash { animation: flashIn 1.6s ease-out; }
