/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand: Energetic orange — athletic, dynamic, motivating */
  --c-primary: #ea580c;
  --c-primary-dark: #c2410c;
  --c-primary-light: #ffedd5;
  --c-primary-subtle: #fff7ed;
  --c-primary-glow: rgba(234, 88, 12, 0.08);

  /* Surfaces */
  --c-bg: #f8fafb;
  --c-surface: #ffffff;
  --c-surface-raised: #f4f6f8;
  --c-text: #111827;
  --c-text-secondary: #374151;
  --c-text-muted: #6b7280;
  --c-border: #e2e8f0;
  --c-border-strong: #cbd5e1;

  /* Semantic */
  --c-green: #059669;
  --c-yellow: #d97706;
  --c-orange: #ea580c;
  --c-red: #dc2626;

  /* Feature card icon backgrounds */
  --c-icon-orange: #fff7ed;
  --c-icon-blue: #eff6ff;
  --c-icon-green: #f0fdf4;
  --c-icon-amber: #fffbeb;

  /* System */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 12px -1px rgba(0,0,0,0.06), 0 2px 6px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 24px -4px rgba(0,0,0,0.08), 0 4px 8px -4px rgba(0,0,0,0.03);
  --max-w: 980px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Layout ===== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

/* ===== Header ===== */
.site-header {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--c-border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-logo {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--c-text);
  text-decoration: none;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-logo::before {
  content: '';
  width: 28px;
  height: 28px;
  background: url('/favicon.svg') center/contain no-repeat;
  border-radius: 0;
  flex-shrink: 0;
}
.site-nav { display: flex; gap: 0.25rem; align-items: center; }
.site-nav a {
  color: var(--c-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-xs);
  transition: color 0.15s, background 0.15s;
}
.site-nav a:hover {
  color: var(--c-text);
  background: var(--c-surface-raised);
}
.site-nav a[aria-current="page"] {
  color: var(--c-primary-dark);
  background: var(--c-primary-light);
  font-weight: 600;
}

/* Hamburger (mobile) */
.nav-toggle { display: none; }
.nav-toggle-label {
  display: none;
  cursor: pointer;
  width: 32px;
  height: 24px;
  position: relative;
  z-index: 110;
}
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--c-text);
  border-radius: 2px;
  position: absolute;
  transition: all 0.3s;
}
.nav-toggle-label span { top: 50%; transform: translateY(-50%); }
.nav-toggle-label span::before { content: ''; top: -8px; }
.nav-toggle-label span::after { content: ''; top: 8px; }
.nav-toggle:checked + .nav-toggle-label span { background: transparent; }
.nav-toggle:checked + .nav-toggle-label span::before { top: 0; transform: rotate(45deg); background: var(--c-text); }
.nav-toggle:checked + .nav-toggle-label span::after { top: 0; transform: rotate(-45deg); background: var(--c-text); }

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 4rem 2rem 3.5rem;
  background: linear-gradient(160deg, #fff7ed 0%, #f8fafb 40%, #fef3c7 100%);
  margin: 0 -1.5rem;
  padding-left: 2rem;
  padding-right: 2rem;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(234, 88, 12, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.04) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 1rem;
  color: var(--c-text);
  letter-spacing: -0.035em;
  position: relative;
}
.hero p {
  color: var(--c-text-secondary);
  font-size: 1.125rem;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
  position: relative;
}
.last-updated {
  display: block;
  color: var(--c-text-muted);
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

/* Trust badges */
.trust-badges {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.badge-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--c-surface);
  color: var(--c-text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s, box-shadow 0.2s;
}
.badge-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.badge-icon { font-size: 1rem; }

/* Feature cards grid */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.feature-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--c-text);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}
.feature-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-primary-dark));
  opacity: 0;
  transition: opacity 0.2s;
}
.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--c-primary);
  box-shadow: var(--shadow-lg);
}
.feature-card:hover::after { opacity: 1; }
.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--c-icon-orange);
}
.feature-card:nth-child(1) .feature-icon { background: var(--c-icon-orange); }
.feature-card:nth-child(2) .feature-icon { background: var(--c-icon-blue); }
.feature-card:nth-child(3) .feature-icon { background: var(--c-icon-green); }
.feature-card:nth-child(4) .feature-icon { background: var(--c-icon-amber); }
.feature-card h3 {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.375rem;
  letter-spacing: -0.015em;
}
.feature-card p {
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  line-height: 1.55;
}

/* ===== Card ===== */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 2.5rem;
}
.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
  letter-spacing: -0.02em;
}
.card-subtitle {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  margin-bottom: 1.25rem;
}

/* ===== Calculator Mode Tabs ===== */
.calc-mode-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.calc-mode-tab {
  flex: 1;
  padding: 0.625rem 1rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-xs);
  background: var(--c-surface);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font);
  color: var(--c-text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.calc-mode-tab:hover {
  border-color: var(--c-border-strong);
  color: var(--c-text-secondary);
}
.calc-mode-tab.active {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: white;
  border-color: var(--c-primary);
  font-weight: 600;
}

/* ===== Form Elements ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.125rem;
}
.form-group { display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; }
.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-group input,
.form-group select {
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-xs);
  font-size: 1rem;
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  height: 44px;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-glow);
  background: #fff;
}

/* Input with unit selector */
.input-with-select {
  display: flex;
  gap: 0;
}
.input-with-select input {
  flex: 1;
  border-radius: var(--radius-xs) 0 0 var(--radius-xs);
  border-right: none;
  min-width: 0;
}
.input-with-select select {
  width: auto;
  min-width: 80px;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  border-left: 1px solid var(--c-border);
  background: var(--c-surface-raised);
  font-size: 0.875rem;
}

/* Time inputs (HH:MM:SS) */
.time-inputs {
  display: flex;
  align-items: center;
  gap: 0;
}
.time-inputs input {
  width: 60px;
  text-align: center;
  border-radius: 0;
  border-right: none;
  padding: 0.625rem 0.5rem;
  border: 1.5px solid var(--c-border);
  font-size: 1rem;
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  height: 44px;
}
.time-inputs input:first-child { border-radius: var(--radius-xs) 0 0 var(--radius-xs); }
.time-inputs input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-glow);
  background: #fff;
  position: relative;
  z-index: 1;
}
.time-inputs select {
  height: 44px;
  border: 1.5px solid var(--c-border);
  border-left: 1px solid var(--c-border);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  background: var(--c-surface-raised);
  font-size: 0.875rem;
  font-family: var(--font);
  color: var(--c-text);
  padding: 0 0.625rem;
  cursor: pointer;
}
.time-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 44px;
  background: var(--c-surface-raised);
  border-top: 1.5px solid var(--c-border);
  border-bottom: 1.5px solid var(--c-border);
  font-weight: 600;
  color: var(--c-text-muted);
  font-size: 1.125rem;
  flex-shrink: 0;
}

/* Button row */
.btn-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
  height: 44px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: white;
  box-shadow: 0 2px 4px rgba(234, 88, 12, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--c-primary-dark), #9a3412);
  box-shadow: 0 4px 8px rgba(234, 88, 12, 0.3);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(234, 88, 12, 0.2);
}
.btn-outline {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  color: var(--c-text-secondary);
}
.btn-outline:hover {
  background: var(--c-surface-raised);
  border-color: var(--c-border-strong);
  transform: translateY(-1px);
}

/* ===== Results Panel ===== */
.results-panel {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-border);
}
.results-panel h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.015em;
}
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}
.result-card {
  background: var(--c-surface-raised);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}
.result-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-muted);
  margin-bottom: 0.375rem;
}
.result-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-primary-dark);
}

/* ===== Results Table ===== */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.results-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
}
.results-table th,
.results-table td {
  padding: 0.625rem 0.875rem;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.875rem;
}
.results-table th {
  font-weight: 600;
  color: var(--c-text-muted);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--c-surface-raised);
}
.results-table th:first-child { border-radius: var(--radius-xs) 0 0 0; }
.results-table th:last-child { border-radius: 0 var(--radius-xs) 0 0; }
.results-table tr:hover td { background: rgba(234, 88, 12, 0.02); }
.results-table tr.row-highlight td { background: rgba(234, 88, 12, 0.08); font-weight: 600; }
.results-table tr.split-finish td { font-weight: 700; border-top: 2px solid var(--c-primary); }

/* ===== Pace Chart Table ===== */
.pace-chart-table { font-variant-numeric: tabular-nums; }
.pace-chart-table td:first-child { font-weight: 600; }
.pace-chart-table tr { cursor: pointer; }

/* ===== Splits Tabs ===== */
.splits-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.split-tab {
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-xs);
  background: var(--c-surface);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font);
  color: var(--c-text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.split-tab:hover {
  border-color: var(--c-border-strong);
  color: var(--c-text-secondary);
}
.split-tab.active {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: white;
  border-color: var(--c-primary);
  font-weight: 600;
}

/* Split summary */
.split-summary {
  background: var(--c-primary-subtle);
  border: 1px solid var(--c-primary-light);
  border-radius: var(--radius-xs);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--c-text);
  margin-bottom: 1rem;
}

/* ===== FAQ Section ===== */
.faq-section {
  margin: 3rem 0 2rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-xs);
}
.faq-section h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.faq-item { border-bottom: 1px solid var(--c-border); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 1rem 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--c-text);
  transition: color 0.15s;
}
.faq-q:hover { color: var(--c-primary-dark); }
.faq-q::after { content: '+'; font-size: 1.25rem; color: var(--c-text-muted); font-weight: 300; transition: transform 0.2s, color 0.15s; }
.faq-item.open .faq-q::after { content: '\2212'; color: var(--c-primary); }
.faq-a {
  display: none;
  padding: 0 0 1.25rem;
  color: var(--c-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}
.faq-item.open .faq-a { display: block; }

/* ===== Sections ===== */
.section { margin: 2.5rem 0; }
.section h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 1.125rem;
  letter-spacing: -0.02em;
}

/* SEO Content */
.content-section {
  margin: 2.5rem 0 1.5rem;
  line-height: 1.75;
}
.content-section h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 0.875rem;
  letter-spacing: -0.02em;
}
.content-section h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 1.75rem 0 0.625rem;
}
.content-section p {
  margin-bottom: 0.875rem;
  color: var(--c-text);
}
.content-section ul {
  padding-left: 1.375rem;
  margin-bottom: 0.875rem;
}
.content-section li {
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
}

/* ===== Disclaimer ===== */
.disclaimer {
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  padding: 1.375rem;
  background: var(--c-surface-raised);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  margin-top: 2.5rem;
  text-align: center;
  line-height: 1.6;
}

/* ===== Footer ===== */
.site-footer {
  background: linear-gradient(180deg, #1a1f2e, #111827);
  color: rgba(255,255,255,0.65);
  padding: 3.5rem 0 1.5rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem;
}
.footer-col h4 {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  margin-bottom: 0.875rem;
}
.footer-col a {
  display: block;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.25rem 0;
  transition: color 0.15s;
}
.footer-col a:hover { color: #ffffff; }
.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-toggle-label { display: block; }
  .site-nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--c-surface);
    flex-direction: column;
    padding: 4rem 2rem 2rem;
    gap: 0.25rem;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transition: right 0.3s ease;
    z-index: 105;
  }
  .nav-toggle:checked ~ .site-nav { right: 0; }
  .site-nav a {
    font-size: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--c-border);
    border-radius: 0;
    width: 100%;
  }
  .site-nav a:hover { background: transparent; }
  .site-nav a[aria-current="page"] { background: transparent; }
  .hero h1 { font-size: 1.875rem; }
  .hero { padding: 3rem 1.25rem 2.5rem; margin: 0 -1.25rem; }
  .feature-cards { grid-template-columns: 1fr; }
  .container { padding: 0 1.25rem; }
  .calc-mode-tabs { flex-direction: column; }
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .trust-badges { gap: 0.5rem; }
  .badge-item { font-size: 0.75rem; padding: 0.375rem 0.625rem; }
  .results-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .results-grid { grid-template-columns: 1fr; }
}

/* ===== Print ===== */
@media print {
  .site-header, .site-footer, .btn, .btn-row { display: none; }
  .card { border: none; box-shadow: none; padding: 0; }
  body { background: white; }
}
