:root {
  --accent:        #0ea5e9;
  --accent-2:      #6366f1;
  --accent-glow:   rgba(14, 165, 233, 0.15);
  --bg:            #ffffff;
  --bg-soft:       #f8fafc;
  --surface:       #ffffff;
  --surface2:      rgba(148, 163, 184, 0.08);
  --surface3:      rgba(148, 163, 184, 0.04);
  --text:          #0f172a;
  --text2:         #334155;
  --text3:         #64748b;
  --border:        #e2e8f0;
  --radius:        14px;
  --radius-sm:     8px;
  --shadow-sm:     0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md:     0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg:     0 24px 60px rgba(15, 23, 42, .10);
}

[data-theme="dark"] {
  --bg:        #0b1120;
  --bg-soft:   #0f172a;
  --surface:   #1e293b;
  --surface2:  rgba(148, 163, 184, 0.10);
  --surface3:  rgba(148, 163, 184, 0.05);
  --text:      #f1f5f9;
  --text2:     #cbd5e1;
  --text3:     #94a3b8;
  --border:    #334155;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ─────────────────────────────────────────────────────────── */
.tn-header {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 32px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  position: sticky; top: 0; z-index: 50;
}
.tn-header-actions { display: flex; align-items: center; gap: 12px; }
[data-theme="dark"] .tn-header { background: rgba(11, 17, 32, 0.85); }

.tn-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 18px; text-decoration: none; color: var(--text);
  letter-spacing: -0.01em;
}
.tn-brand-mark { width: 28px; height: 28px; border-radius: 7px; display: block; }

.tn-nav { display: flex; gap: 28px; }
.tn-nav-link {
  text-decoration: none; color: var(--text2);
  font-weight: 500; font-size: 14px;
  padding: 6px 0; border-bottom: 2px solid transparent;
  transition: color .14s, border-color .14s;
}
.tn-nav-link:hover { color: var(--text); }
.tn-nav-link.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Main / footer ──────────────────────────────────────────────────── */
.tn-main { max-width: 1200px; margin: 0 auto; padding: 0; }
.tn-footer {
  text-align: center; padding: 40px 24px;
  color: var(--text3); border-top: 1px solid var(--border);
  margin-top: 80px; font-size: 13px;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.tn-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px;
  border-radius: 10px; background: var(--accent); color: #fff;
  text-decoration: none; font-weight: 600; font-size: 14.5px;
  transition: opacity .14s, transform .14s, box-shadow .14s;
  box-shadow: 0 6px 16px var(--accent-glow);
}
.tn-btn:hover { opacity: .95; transform: translateY(-1px); box-shadow: 0 12px 24px var(--accent-glow); }
.tn-btn-light { background: rgba(255, 255, 255, 0.18); backdrop-filter: blur(6px); }

/* ── Eyebrow / typography helpers ───────────────────────────────────── */
.tn-eyebrow {
  display: inline-block;
  font-size: 11.5px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-glow); padding: 5px 11px; border-radius: 99px;
  margin-bottom: 18px;
}

/* ── Hero ───────────────────────────────────────────────────────────── */
.tn-hero {
  padding: 80px 32px 100px;
  background:
    radial-gradient(ellipse at top right, rgba(14,165,233,.08), transparent 60%),
    radial-gradient(ellipse at bottom left, rgba(99,102,241,.06), transparent 60%);
}
.tn-hero-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr; gap: 48px; align-items: center;
}
@media (min-width: 1024px) {
  .tn-hero-inner { grid-template-columns: 1.4fr 1fr; }
}
.tn-hero-text h1 {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 700; line-height: 1.1; letter-spacing: -0.02em;
  margin: 0 0 24px;
}
.tn-hero-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.tn-hero-desc { font-size: 17px; color: var(--text2); max-width: 560px; margin: 0 0 32px; }

.tn-hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.tn-hero-card-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text3);
}
.tn-hero-countdown {
  display: flex; align-items: baseline; justify-content: center; gap: 10px;
  margin: 14px 0 18px;
}
.tn-hero-countdown-num {
  font-size: 88px; font-weight: 800; letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1;
}
.tn-hero-countdown-unit { font-size: 16px; color: var(--text3); font-weight: 500; }
.tn-hero-card-meta {
  font-size: 13.5px; color: var(--text2);
  border-top: 1px solid var(--border); padding-top: 16px; line-height: 1.8;
}

/* ── Sections ───────────────────────────────────────────────────────── */
.tn-section { padding: 80px 32px; max-width: 1200px; margin: 0 auto; }
.tn-section-head { text-align: center; margin-bottom: 56px; }
.tn-section-head h2 {
  font-size: 36px; font-weight: 700; letter-spacing: -0.01em;
  margin: 0; max-width: 720px; margin: 0 auto;
}

/* ── Pillars ────────────────────────────────────────────────────────── */
.tn-pillars {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.tn-pillar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.tn-pillar:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.tn-pillar-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-glow); color: var(--accent);
  border-radius: 12px; font-size: 22px;
  margin-bottom: 18px;
}
.tn-pillar h3 { font-size: 17px; font-weight: 600; margin: 0 0 10px; }
.tn-pillar p  { color: var(--text2); font-size: 14.5px; margin: 0; line-height: 1.6; }
.tn-pillar-soon { opacity: 0.72; }
.tn-pillar-soon .tn-pillar-icon { background: rgba(245, 158, 11, .15); color: #d97706; }

/* ── Methodology ────────────────────────────────────────────────────── */
.tn-section-method { background: var(--bg-soft); max-width: none; }
.tn-method-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid; gap: 48px; align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) { .tn-method-grid { grid-template-columns: 1.2fr 1fr; } }
.tn-method-text h2 {
  font-size: 32px; font-weight: 700; letter-spacing: -0.01em;
  margin: 0 0 24px;
}
.tn-method-text p { color: var(--text2); margin: 0 0 16px; }
.tn-method-formula {
  background: #0f172a; color: #e2e8f0;
  border-radius: var(--radius); padding: 28px;
  display: flex; flex-direction: column; gap: 14px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13.5px;
}
.tn-method-formula code {
  background: rgba(255, 255, 255, .04);
  padding: 12px 14px; border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

/* ── CTA card ───────────────────────────────────────────────────────── */
.tn-cta-card {
  margin: 80px 32px 0;
  max-width: 1136px; margin-left: auto; margin-right: auto;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff; border-radius: var(--radius);
  padding: 56px 48px; text-align: center;
  box-shadow: var(--shadow-lg);
}
.tn-cta-card h2 {
  font-size: 30px; font-weight: 700; letter-spacing: -0.01em;
  margin: 0 0 14px; color: #fff;
}
.tn-cta-card p {
  font-size: 16px; max-width: 580px; margin: 0 auto 28px;
  color: rgba(255, 255, 255, 0.9);
}

/* ── Trainer pages (forms + simulation) ────────────────────────────── */
.tn-trainer { max-width: 800px; margin: 32px auto; padding: 0 32px; }
.tn-trainer h1 { font-size: 28px; font-weight: 700; margin: 0 0 24px; letter-spacing: -0.01em; }

/* Step indicator (1 → 2 → 3 → 4 wizard) */
.tn-stepper {
  list-style: none; padding: 0; margin: 0 0 32px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  background: var(--surface2); border-radius: var(--radius); padding: 8px;
}
.tn-step a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 8px;
  text-decoration: none; color: var(--text2);
  font-size: 13px; font-weight: 500;
  transition: background .14s, color .14s;
}
.tn-step a:hover { background: var(--surface); color: var(--text); }
.tn-step.is-active a { background: var(--accent); color: #fff; box-shadow: 0 4px 12px var(--accent-glow); }
.tn-step.is-done a { color: var(--text3); }
.tn-step.is-done .tn-step-num::before { content: "✓ "; color: #16a34a; }
.tn-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); color: var(--text2);
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.tn-step.is-active .tn-step-num { background: rgba(255,255,255,0.25); color: #fff; }
.tn-step-icon { font-size: 14px; }
.tn-step-label { font-weight: 600; }
@media (max-width: 720px) {
  .tn-stepper { grid-template-columns: repeat(2, 1fr); }
  .tn-step-label { display: none; }
}

.tn-physio-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 24px;
}
.tn-physio-card h3 { margin: 0 0 16px; font-size: 14px; color: var(--text2);
                     letter-spacing: 0.5px; font-weight: 600; }
.tn-physio-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.tn-physio-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px; background: var(--surface2); border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.tn-physio-item-missing { border-left-color: var(--text3); opacity: 0.7; }
.tn-physio-label { font-size: 11px; text-transform: uppercase;
                   letter-spacing: 1px; color: var(--text3); font-weight: 600; }
.tn-physio-value { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.tn-physio-source { font-size: 11px; color: var(--text3); line-height: 1.4; }
.tn-physio-note { margin: 16px 0 0; font-size: 12.5px; color: var(--text3); }
.tn-physio-note code { background: var(--surface2); padding: 2px 6px; border-radius: 4px; font-size: 11.5px; }

/* Tabs (used inside physio cards for the discipline curves) */
.tn-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.tn-tab {
  padding: 10px 16px; border: 0; background: transparent; cursor: pointer;
  font: 600 14px 'Inter', -apple-system, sans-serif;
  color: var(--text2);
  border-bottom: 2px solid transparent;
  transition: color .14s, border-color .14s;
  margin-bottom: -1px;
}
.tn-tab:hover { color: var(--text); }
.tn-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tn-tab-pane { display: none; }
.tn-tab-pane.is-active { display: block; }

/* Editable variant: same card frame, big bold input replaces the value. */
.tn-physio-edit { transition: border-left-color .14s, box-shadow .14s; }
.tn-physio-edit:focus-within {
  border-left-color: var(--accent-2);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.tn-physio-input {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 2px 0 0;
  font: 600 18px/1 'Inter', -apple-system, sans-serif;
  letter-spacing: -0.01em;
  color: var(--text);
  width: 100%;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.tn-physio-input:hover { cursor: pointer; }
.tn-physio-input:focus { color: var(--accent); }
/* Subtle hint that the cards are editable: dotted underline on hover. */
.tn-physio-edit:hover .tn-physio-input { border-bottom: 1px dashed var(--text3); }
.tn-physio-edit:focus-within .tn-physio-input { border-bottom: 1px solid var(--accent); }
/* Number input spinners off — the dashed underline is enough affordance. */
.tn-physio-input[type="number"]::-webkit-inner-spin-button,
.tn-physio-input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tn-physio-input[type="number"] { -moz-appearance: textfield; }
/* Native select arrow visible (it's the only affordance for the select). */
.tn-physio-input[name="sex"] { padding-right: 14px; }

.tn-autofill {
  background: var(--accent-glow); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px;
  display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  font-size: 13.5px; color: var(--text2);
}
.tn-btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px;
  background: var(--accent); color: #fff; border: 0;
  text-decoration: none; font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: opacity .12s;
}
.tn-btn-secondary:hover { opacity: 0.9; }
.tn-warning {
  background: rgba(245, 158, 11, .12); color: #b45309;
  padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px;
}
.tn-saved-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.tn-btn-next { padding: 10px 18px; font-size: 14px; box-shadow: 0 4px 12px var(--accent-glow); }
.tn-saved {
  background: rgba(22,163,74,.12); color: #15803d; padding: 10px 14px;
  border-radius: 8px; font-size: 14px; font-weight: 500;
  display: inline-block;
}
.tn-trainer-next-hint {
  text-align: right; margin-top: 20px; color: var(--text3); font-size: 14px;
}
.tn-trainer-next-hint a { color: var(--accent); font-weight: 600; text-decoration: none; }
.tn-trainer-next-hint a:hover { text-decoration: underline; }
.tn-form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.tn-form-intro { color: var(--text2); margin: 0 0 20px; font-size: 14.5px; }
.tn-h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); margin: 24px 0 12px; }
.tn-grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.tn-field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.tn-field-wide { grid-column: 1 / -1; }
.tn-field span { color: var(--text2); font-weight: 500; }
.tn-field small { color: var(--text3); font-size: 11.5px; margin-top: 2px; }
.tn-field input, .tn-field select {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: var(--bg); color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.tn-field input:focus, .tn-field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.tn-radio-group {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px;
  display: flex; gap: 24px; flex-wrap: wrap; margin: 0 0 16px;
}
.tn-radio-group legend { font-size: 12px; padding: 0 6px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; }
.tn-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.tn-radio input { width: 16px; height: 16px; accent-color: var(--accent); }
.tn-form .tn-btn { margin-top: 20px; }

/* Simulation result cards */
.tn-sim-title { font-size: 22px; margin: 0 0 16px; color: var(--accent); }
.tn-sim-total {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-radius: var(--radius);
  padding: 24px 28px; margin-bottom: 16px;
  display: flex; align-items: baseline; gap: 16px;
}
.tn-sim-total-label { font-size: 13px; opacity: 0.85; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; }
.tn-sim-total-value { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; }
.tn-sim-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.tn-sim-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.tn-sim-card h3 { font-size: 16px; margin: 0 0 14px; color: var(--accent); font-weight: 600; }
.tn-sim-card dl { margin: 0; display: grid; gap: 10px; }
.tn-sim-card dt { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); margin-top: 4px; }
.tn-sim-card dd { margin: 0; font-size: 17px; font-weight: 600; }
.tn-sim-card dd small { color: var(--text3); font-size: 12px; font-weight: 400; margin-left: 6px; }
.tn-empty h3 { color: var(--text); }
.tn-empty ul { text-align: left; max-width: 360px; margin: 12px auto; padding-left: 20px; }
.tn-empty a { color: var(--accent); }

/* ── Features page ──────────────────────────────────────────────────── */
.tn-features { padding: 32px; max-width: 1280px; margin: 0 auto; }
.tn-features h1 { font-size: 32px; margin: 0 0 24px; }
.tn-iron-frame {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.tn-empty {
  color: var(--text3); padding: 64px 24px; text-align: center;
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.tn-empty code { background: var(--surface2); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
