/* ============================================================
   APEX — Adaptive Performance Ecosystem for eXcellence
   ============================================================ */

:root {
  --bg: #07090f;
  --bg-2: #0d111c;
  --bg-3: #131826;
  --panel: #181f30;
  --line: #232a3d;
  --line-soft: #2e3852;
  --text: #eef1f8;
  --text-dim: #8d97ad;
  --text-soft: #c7cee0;

  --accent: #2ee68f;       /* APEX primary — performance green */
  --accent-2: #4cc9ff;     /* data cyan */
  --accent-3: #ff6b6b;     /* intensity coral */
  --accent-4: #c794ff;     /* recovery purple */
  --accent-5: #ffd166;     /* threshold amber */

  --swim: #4cc9ff;
  --bike: #2ee68f;
  --run:  #ff8a4c;

  --danger: #ff5d6c;
  --ok: #2ee68f;
  --warn: #ffd166;

  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #6df3ad; }

code, .mono {
  font-family: "JetBrains Mono", "SF Mono", Consolas, Monaco, monospace;
  font-size: 0.92em;
}

h1, h2, h3 { letter-spacing: -0.01em; }
h2 { font-size: 1.85rem; margin: 0 0 .5rem; }
h3 { font-size: 1.1rem; margin: 0 0 .4rem; color: var(--text); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: rgba(7, 9, 15, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.7rem; }
.logo-mark {
  width: 38px; height: 38px;
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.logo-mark svg { width: 100%; height: 100%; }
.brand-title { font-weight: 800; letter-spacing: 0.18em; font-size: 1.1rem; }
.brand-sub   { font-size: 0.74rem; color: var(--text-dim); letter-spacing: 0.05em; }

.site-nav {
  display: flex;
  gap: 0.2rem;
  flex-wrap: wrap;
}
.site-nav a {
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
}
.site-nav a:hover { color: var(--text); background: var(--bg-3); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: 5rem 1.5rem 4rem;
  overflow: hidden;
}
.hero-inner { max-width: 880px; margin: 0 auto; position: relative; z-index: 2; }
.sport-pills { display: flex; gap: 0.4rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--bg-3);
}
.pill-swim { color: var(--swim); border-color: rgba(76, 201, 255, 0.35); }
.pill-bike { color: var(--bike); border-color: rgba(46, 230, 143, 0.35); }
.pill-run  { color: var(--run);  border-color: rgba(255, 138, 76, 0.35); }

.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  line-height: 1.1;
  margin: 0 0 1.1rem;
  font-weight: 800;
}
.hl {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { font-size: 1.15rem; color: var(--text-soft); max-width: 720px; }
.hero-meta { margin-top: 1.4rem; color: var(--text-dim); font-size: 0.9rem; }
.hero-cta { margin-top: 2rem; display: flex; gap: 0.7rem; flex-wrap: wrap; }

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(46, 230, 143, 0.10), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(76, 201, 255, 0.10), transparent 55%),
    radial-gradient(circle at 60% 20%, rgba(255, 138, 76, 0.06), transparent 50%);
  pointer-events: none;
}

/* ============================================================
   BUTTONS / CHIPS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--bg-3);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6df3ad);
  color: #07090f;
  border-color: transparent;
  font-weight: 700;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.88rem; }

.chip {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(46, 230, 143, 0.08);
  border: 1px solid rgba(46, 230, 143, 0.3);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

/* ============================================================
   SECTION SHELL
   ============================================================ */
.section {
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--line);
}
.section.alt { background: var(--bg-2); }
.section-head { max-width: 880px; margin: 0 auto 2rem; }
.section-head p { color: var(--text-soft); max-width: 720px; }

/* ============================================================
   01 · PROBLEM
   ============================================================ */
.problem-stage {
  max-width: 1080px; margin: 0 auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem;
}
.problem-controls { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.toggle-btn {
  background: var(--bg-3); color: var(--text-dim);
  border: 1px solid var(--line-soft);
  padding: 0.55rem 1rem; border-radius: 8px;
  cursor: pointer; font: inherit;
}
.toggle-btn.active {
  background: linear-gradient(135deg, var(--accent), #6df3ad);
  color: #07090f; border-color: transparent; font-weight: 700;
}
.problem-svg {
  width: 100%; height: auto;
  background: var(--bg); border-radius: 8px; border: 1px solid var(--line);
}
.problem-caption { margin-top: 1rem; color: var(--text-soft); font-size: 0.95rem; }

/* ============================================================
   02 · SENSORS
   ============================================================ */
.sensor-stage {
  max-width: 1180px; margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.5rem;
}
@media (max-width: 960px) { .sensor-stage { grid-template-columns: 1fr; } }
.athlete-figure {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.sensor-svg { width: 100%; max-height: 620px; }
.sensor-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem;
}
.sensor-panel h3 { color: var(--accent); }
.sensor-tags { margin-top: 0.7rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.sensor-tag {
  font-size: 0.72rem; padding: 0.2rem 0.55rem;
  border-radius: 999px; background: var(--bg-3);
  border: 1px solid var(--line-soft); color: var(--text-dim);
}

.sensor-dot { cursor: pointer; transition: all 0.15s ease; }
.sensor-dot:hover { filter: drop-shadow(0 0 8px var(--accent)); }
.sensor-dot.active circle { fill: var(--accent); }
.sensor-dot.active text { fill: #07090f; }

/* ============================================================
   03 · STACK
   ============================================================ */
.stack-stage {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem;
}
@media (max-width: 960px) { .stack-stage { grid-template-columns: 1fr; } }
.stack {
  display: flex; flex-direction: column; gap: 0.5rem;
}
.stack-layer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
.stack-layer:hover, .stack-layer.active {
  border-left-color: var(--accent);
  transform: translateX(4px);
  background: #1e2638;
}
.stack-layer[data-layer="action"]    { border-top: 2px solid var(--accent); }
.stack-layer[data-layer="coaching"]  { border-top: 2px solid var(--accent-4); }
.stack-layer[data-layer="analytics"] { border-top: 2px solid var(--accent-2); }
.stack-layer[data-layer="ingest"]    { border-top: 2px solid var(--accent-5); }
.stack-layer[data-layer="sensors"]   { border-top: 2px solid var(--accent-3); }

.layer-label {
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dim);
}
.layer-title { font-size: 1.1rem; font-weight: 700; margin: 0.2rem 0; }
.layer-services { font-size: 0.85rem; color: var(--text-dim); }

.stack-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem;
  align-self: start;
}
.stack-panel h3 { color: var(--accent); }

/* ============================================================
   04 · ZONES
   ============================================================ */
.zones-stage {
  max-width: 1180px; margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
}
@media (max-width: 800px) { .zones-stage { grid-template-columns: 1fr; } }

.zones-inputs {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: 1.1rem;
}
.zones-inputs label, .enviro-inputs label, .race-inputs label {
  display: flex; flex-direction: column; gap: 0.35rem;
  font-size: 0.85rem; color: var(--text-dim);
}
.zones-inputs input[type=range],
.enviro-inputs input[type=range],
.race-inputs input[type=range] {
  accent-color: var(--accent);
  width: 100%;
}
.z-val {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
}

.zones-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 960px) { .zones-grid { grid-template-columns: 1fr; } }
.zone-table {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.zone-table-head {
  background: var(--bg-3); padding: 0.7rem 1rem;
  font-weight: 700; font-size: 0.92rem;
  border-bottom: 1px solid var(--line);
}
.zone-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.86rem;
  border-bottom: 1px solid var(--line);
}
.zone-row:last-child { border-bottom: none; }
.zone-id {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem; padding: 0.2rem 0.4rem;
  border-radius: 4px; text-align: center;
  font-weight: 700;
}
.zone-z1 { background: rgba(76, 201, 255, 0.18); color: var(--swim); }
.zone-z2 { background: rgba(46, 230, 143, 0.18); color: var(--bike); }
.zone-z3 { background: rgba(199, 148, 255, 0.18); color: var(--accent-4); }
.zone-z4 { background: rgba(255, 209, 102, 0.20); color: var(--warn); }
.zone-z5 { background: rgba(255, 138, 76, 0.20); color: var(--run); }
.zone-z6 { background: rgba(255, 93, 108, 0.20); color: var(--danger); }
.zone-z7 { background: rgba(255, 93, 108, 0.35); color: #ffb3ba; }
.zone-name { color: var(--text); }
.zone-range { font-family: "JetBrains Mono", monospace; color: var(--text-dim); font-size: 0.8rem; }

/* ============================================================
   05 · WORKOUT
   ============================================================ */
.workout-stage {
  max-width: 1180px; margin: 0 auto;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.5rem;
}
@media (max-width: 960px) { .workout-stage { grid-template-columns: 1fr; } }

.workout-controls {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.9rem;
}
.workout-controls label {
  display: flex; flex-direction: column; gap: 0.3rem;
  font-size: 0.82rem; color: var(--text-dim);
}
.workout-controls select, .workout-controls input {
  background: var(--bg-3); border: 1px solid var(--line-soft); color: var(--text);
  padding: 0.55rem 0.7rem; border-radius: 6px; font: inherit;
}
.workout-controls select:focus, .workout-controls input:focus {
  outline: none; border-color: var(--accent);
}
.workout-actions { display: flex; gap: 0.4rem; margin-top: 0.5rem; flex-wrap: wrap; }

.workout-display {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.metric-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
}
@media (max-width: 720px) { .metric-cards { grid-template-columns: repeat(2, 1fr); } }
.metric-card {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 10px;
  padding: 0.8rem 1rem;
}
.metric-card.power   { border-top-color: var(--accent); }
.metric-card.hr      { border-top-color: var(--accent-3); }
.metric-card.cadence { border-top-color: var(--accent-2); }
.metric-card.tss     { border-top-color: var(--accent-5); }
.metric-label {
  font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dim);
}
.metric-value {
  font-size: 1.9rem; font-weight: 800;
  font-family: "JetBrains Mono", monospace;
  line-height: 1.1;
  margin: 0.2rem 0;
}
.metric-unit {
  font-size: 0.95rem; color: var(--text-dim);
  margin-left: 0.3rem; font-weight: 500;
}
.metric-sub { font-size: 0.78rem; color: var(--text-dim); }

.wk-chart {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.wk-interval {
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.92rem;
  color: var(--accent);
  background: var(--bg-3);
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--line);
}

/* ============================================================
   06 · ENVIRO
   ============================================================ */
.enviro-stage {
  max-width: 1180px; margin: 0 auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1.5rem;
}
@media (max-width: 800px) { .enviro-stage { grid-template-columns: 1fr; } }

.enviro-inputs {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.enviro-inputs input[type=number] {
  background: var(--bg-3); border: 1px solid var(--line-soft); color: var(--text);
  padding: 0.55rem 0.7rem; border-radius: 6px; font: inherit;
}

.enviro-display {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem;
}
.enviro-result {
  background: var(--bg-3);
  border-radius: 8px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--accent);
}
.enviro-result-label {
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dim);
}
.enviro-result-value {
  font-size: 2.4rem; font-weight: 800;
  font-family: "JetBrains Mono", monospace;
  color: var(--accent);
  margin: 0.3rem 0;
}
.enviro-delta { color: var(--text-soft); font-size: 0.9rem; }
.enviro-delta.up   { color: var(--danger); }
.enviro-delta.down { color: var(--ok); }

.enviro-breakdown {
  display: flex; flex-direction: column; gap: 0.5rem;
  margin-top: 0.6rem;
}
.enviro-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-3);
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  font-size: 0.88rem;
  border-left: 3px solid var(--line-soft);
}
.enviro-row.up   { border-left-color: var(--danger); }
.enviro-row.down { border-left-color: var(--ok); }
.enviro-row .right { font-family: "JetBrains Mono", monospace; color: var(--accent); }
.enviro-footnote {
  margin-top: 1rem;
  font-size: 0.8rem; color: var(--text-dim); font-style: italic;
}

/* ============================================================
   07 · PERIODIZATION
   ============================================================ */
.period-stage {
  max-width: 1180px; margin: 0 auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem;
}
.period-tabs {
  display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.ptab {
  background: var(--bg-3); color: var(--text-dim);
  border: 1px solid var(--line-soft);
  padding: 0.5rem 0.9rem; border-radius: 8px; cursor: pointer; font: inherit;
}
.ptab.active {
  background: linear-gradient(135deg, var(--accent), #6df3ad);
  color: #07090f; border-color: transparent; font-weight: 700;
}
.period-svg {
  width: 100%; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px;
  margin-bottom: 1rem;
}
.period-detail {
  background: var(--bg-3); border-radius: 8px;
  padding: 1rem; font-size: 0.9rem;
  border-left: 3px solid var(--accent);
  color: var(--text-soft);
}
.period-detail strong { color: var(--text); }

/* ============================================================
   08 · AI LOOP
   ============================================================ */
.ai-stage {
  max-width: 1180px; margin: 0 auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1.25rem;
}
.ai-loop {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; flex-wrap: wrap;
}
.ai-node {
  flex: 1; min-width: 140px;
  background: var(--bg-3);
  border: 2px solid var(--line-soft);
  border-radius: 10px;
  padding: 1rem 0.7rem;
  text-align: center;
  transition: all 0.2s ease;
}
.ai-node.active {
  border-color: var(--accent);
  background: rgba(46, 230, 143, 0.08);
  box-shadow: 0 0 18px rgba(46, 230, 143, 0.35);
}
.node-icon { font-size: 1.8rem; }
.node-label { font-size: 0.85rem; margin-top: 0.3rem; color: var(--text-soft); }
.ai-arrow { color: var(--text-dim); font-size: 1.2rem; }

.ai-controls { display: flex; gap: 0.4rem; }

.ai-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}
.ai-day {
  background: var(--bg-3);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 0.7rem 0.5rem;
  text-align: center;
  font-size: 0.78rem;
  min-height: 100px;
  display: flex; flex-direction: column; gap: 0.2rem;
}
.ai-day.active { border-color: var(--accent); box-shadow: 0 0 10px rgba(46,230,143,0.3); }
.ai-day .day-name { font-weight: 700; color: var(--text); }
.ai-day .day-sport { font-size: 1.3rem; }
.ai-day .day-session { color: var(--text-dim); font-size: 0.72rem; }
.ai-day .day-tss {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent);
  font-weight: 700;
  margin-top: auto;
}

.ai-log {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.83rem;
  max-height: 220px;
  overflow-y: auto;
}
.ai-log .line { padding: 0.25rem 0; border-bottom: 1px dashed var(--line); }
.ai-log .line:last-child { border-bottom: none; }
.ai-log .tag {
  display: inline-block;
  font-size: 0.7rem; padding: 0.1rem 0.4rem;
  border-radius: 3px; margin-right: 0.5rem; font-weight: 700;
}
.tag-plan    { background: rgba(199, 148, 255, 0.2); color: var(--accent-4); }
.tag-execute { background: rgba(76, 201, 255, 0.2);  color: var(--accent-2); }
.tag-ingest  { background: rgba(255, 209, 102, 0.2); color: var(--warn); }
.tag-analyze { background: rgba(255, 138, 76, 0.2);  color: var(--run); }
.tag-adapt   { background: rgba(46, 230, 143, 0.2);  color: var(--accent); }

.log-empty { color: var(--text-dim); font-style: italic; }

/* ============================================================
   09 · PLATFORM TABLE
   ============================================================ */
.cap-toggles {
  max-width: 1180px; margin: 0 auto 1rem;
  display: flex; gap: 0.4rem; flex-wrap: wrap;
}
.cap-btn {
  background: var(--bg-3);
  border: 1px solid var(--line-soft);
  color: var(--text-dim);
  padding: 0.4rem 0.8rem; border-radius: 999px;
  cursor: pointer; font: inherit; font-size: 0.83rem;
}
.cap-btn.active {
  background: rgba(46, 230, 143, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}
.platform-table {
  max-width: 1180px; margin: 0 auto; width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.platform-table th, .platform-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.platform-table th {
  background: var(--bg-3); font-size: 0.82rem;
  color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase;
}
.platform-table tbody tr:last-child td { border-bottom: none; }
.platform-table tbody tr.apex-row { background: rgba(46, 230, 143, 0.07); }
.platform-table tbody tr.apex-row td:first-child {
  color: var(--accent); font-weight: 800;
}
.cell-mark { font-size: 1.15rem; }
.cell-mark.yes  { color: var(--ok); }
.cell-mark.partial { color: var(--warn); }
.cell-mark.no   { color: var(--text-dim); }

.cap-col.hidden { display: none; }

/* ============================================================
   10 · RACE FORECASTER
   ============================================================ */
.race-stage {
  max-width: 1180px; margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
}
@media (max-width: 800px) { .race-stage { grid-template-columns: 1fr; } }
.race-inputs {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.85rem;
}
.race-inputs input, .race-inputs select {
  background: var(--bg-3); border: 1px solid var(--line-soft); color: var(--text);
  padding: 0.5rem 0.7rem; border-radius: 6px; font: inherit;
}
.race-inputs input:focus, .race-inputs select:focus {
  outline: none; border-color: var(--accent);
}

.race-result {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem;
}
.race-splits {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; margin-bottom: 1rem;
}
@media (max-width: 720px) { .race-splits { grid-template-columns: repeat(2, 1fr); } }
.split-card {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.85rem 1rem;
  border-top: 3px solid var(--accent);
}
.split-card.swim  { border-top-color: var(--swim); }
.split-card.bike  { border-top-color: var(--bike); }
.split-card.run   { border-top-color: var(--run); }
.split-card.total { border-top-color: var(--accent-5); }
.split-label {
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-dim);
}
.split-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.5rem; font-weight: 800; margin: 0.15rem 0;
}
.split-sub { font-size: 0.78rem; color: var(--text-dim); }

.race-strategy {
  background: var(--bg-3); border-radius: 8px; padding: 1rem;
  border-left: 3px solid var(--accent-2); margin-bottom: 1rem;
}
.race-strategy h4 { margin: 0 0 0.5rem; color: var(--accent-2); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; }
.race-strategy ul { margin: 0; padding-left: 1.2rem; color: var(--text-soft); font-size: 0.9rem; }
.race-strategy li { margin-bottom: 0.35rem; }

.race-fuel {
  background: var(--bg-3); border-radius: 8px; padding: 1rem;
  border-left: 3px solid var(--accent-5);
}
.race-fuel h4 { margin: 0 0 0.5rem; color: var(--accent-5); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; }
.race-fuel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
@media (max-width: 540px) { .race-fuel-grid { grid-template-columns: 1fr; } }
.fuel-item { font-size: 0.88rem; color: var(--text-soft); }
.fuel-item strong { color: var(--text); display: block; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  padding: 2rem 1.5rem;
  color: var(--text-dim);
  font-size: 0.88rem;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex; justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-meta { max-width: 520px; text-align: right; }
@media (max-width: 720px) { .footer-meta { text-align: left; } }

/* ============================================================
   PULSES
   ============================================================ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}
.pulse { animation: pulse 1.4s ease-in-out infinite; }
