/* ==========================================================================
   Frontline Running — Global Stylesheet
   Design language: Boston Athletic Association authority
                     + Runna bento-app polish
                     + brand colors (blue / red / black / white)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900&family=Archivo+Expanded:wght@700;800;900&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Color tokens */
  --black: #0A0C0E;
  --surface: #14181D;
  --surface-raised: #1B2027;
  --white: #F4F4F1;
  --white-dim: #E7E7E1;
  --canvas: #EDEFF2;
  --blue: #0064B1;
  --blue-dark: #003973;
  --blue-bright: #4FA8E8;
  --red: #E3183D;
  --red-bright: #FF5D72;
  --steel: #8B939B;
  --steel-dark: #565D64;
  --line: #262B31;
  --line-light: #DCDCD6;

  /* Type */
  --font-display: 'Archivo Expanded', 'Archivo', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;

  /* Layout */
  --max: 1240px;
  --gutter: 32px;
  --radius: 12px;
  --radius-lg: 24px;
}

@media (max-width: 640px) {
  :root { --gutter: 20px; --radius-lg: 18px; }
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, picture { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; transition: color 200ms ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Base ---- */
body {
  background: var(--canvas);
  color: var(--black);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.008em;
  line-height: 1.06;
  color: var(--black);
}

p { max-width: 62ch; }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.on-dark, .pillar-dark { color: var(--white); }
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4,
.pillar-dark h1, .pillar-dark h2, .pillar-dark h3 { color: var(--white); }
.on-dark p, .on-dark .muted, .pillar-dark .pillar-lede { color: var(--steel); }

/* ---- Finish-line stripe (recurring brand accent) ---- */
.finish-stripe {
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--blue) 0%, var(--blue) 32%,
    var(--white) 46%, var(--white) 54%,
    var(--red) 68%, var(--red) 100%
  );
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
  white-space: nowrap;
}

.btn-blue { background: var(--blue); color: var(--white); }
.btn-blue:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(0, 100, 177, 0.28); background: var(--blue-dark); }

.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(227, 24, 61, 0.28); background: #ff3652; }

.btn-outline-dark { background: transparent; border-color: rgba(255, 255, 255, 0.35); color: var(--white); }
.btn-outline-dark:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.6); }

.btn-outline-light { background: transparent; border-color: var(--black); color: var(--black); }
.btn-outline-light:hover { transform: translateY(-2px); background: var(--black); color: var(--white); }

/* ---- Header / Nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--black);
  border-bottom: 1px solid var(--line);
}
/* The frosted-glass blur is desktop-only. On phones a backdrop-filter makes the header the
   "containing block" for the fixed pop-out menu, squashing the menu to the header's height. */
@media (min-width: 1101px) {
  .site-header {
    background: rgba(10, 12, 14, 0.92);
    backdrop-filter: blur(10px);
  }
}

.nav { display: flex; align-items: center; justify-content: space-between; height: 80px; }
.brand { display: flex; align-items: center; }
.brand-logo { height: 34px; width: auto; display: block; transition: transform 300ms cubic-bezier(0.22, 0.61, 0.36, 1); }
.brand:hover .brand-logo { transform: scale(1.05); }

.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a {
  color: var(--white-dim);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  padding: 8px 0;
  transition: color 200ms ease;
}
.nav-links a:hover { color: var(--white); }
.nav-links a.active { color: var(--white); }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--blue-bright);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 280ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.nav-cta { display: flex; align-items: center; gap: 1.5rem; }
.nav-utility-link {
  color: var(--white-dim);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.nav-utility-link { transition: color 200ms ease; }
.nav-utility-link:hover { color: var(--white); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 32px;
  height: 24px;
  position: relative;
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--white);
  transition: transform 200ms ease, opacity 200ms ease, top 200ms ease;
}
.nav-toggle span:nth-child(1) { top: 4px; }
.nav-toggle span:nth-child(2) { top: 11px; }
.nav-toggle span:nth-child(3) { top: 18px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 11px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 11px; transform: rotate(-45deg); }

.mobile-drawer {
  display: none;
  position: fixed;
  inset: 80px 0 0 0;
  background: var(--black);
  z-index: 99;
  padding: 2rem var(--gutter);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mobile-drawer[data-open="true"] { display: block; }
.mobile-drawer .nav-links { flex-direction: column; align-items: flex-start; gap: 1.75rem; }
.mobile-drawer .nav-links a { font-size: 1.2rem; }
.mobile-drawer .nav-cta { margin-top: 2rem; }

@media (max-width: 1100px) {
  .site-header .nav > .nav-links { display: none; }
  .site-header .nav > .nav-cta { display: none; }
  .nav-toggle { display: block; }
}

/* ---- Sections ---- */
.section { padding-block: 88px; }
@media (max-width: 640px) { .section { padding-block: 56px; } }

.section-head { max-width: 640px; margin-bottom: 2.75rem; }
.section-head h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 0.9rem; }
.section-head p { font-size: 1.02rem; color: var(--steel-dark); }
.on-dark .section-head p { color: var(--steel); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--black);
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 2px;
  flex-shrink: 0;
}
.on-dark .eyebrow, .pillar-dark .eyebrow, .hero .eyebrow {
  color: var(--blue-bright);
}
.on-dark .eyebrow::before, .pillar-dark .eyebrow::before, .hero .eyebrow::before {
  background: var(--blue-bright);
}

/* ---- Hero (bento card) ---- */
.hero {
  max-width: var(--max);
  margin: 28px auto 0;
  background:
    radial-gradient(circle at 12% 15%, rgba(0, 100, 177, 0.26), transparent 42%),
    radial-gradient(circle at 88% 20%, rgba(227, 24, 61, 0.20), transparent 48%),
    var(--black);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--white);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 4rem;
  align-items: center;
  padding-block: 72px;
  min-height: 560px;
}
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 4rem); margin-bottom: 1.6rem; color: var(--white); }
.hero-lede { font-size: 1.1rem; color: var(--steel); margin-bottom: 2.25rem; max-width: 46ch; }
.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; }

.brand-motto {
  color: var(--blue-bright);
  font-weight: 700;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; padding-block: 48px; min-height: unset; }
}

/* ---- Results teaser panel (homepage) ---- */
.results-teaser-body { padding: 28px 20px; }
.results-teaser-body p { color: var(--steel); font-size: 0.98rem; margin-bottom: 1.5rem; }
.results-teaser-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue-bright);
}

/* ---- Live ticker / teaser panel shell ---- */
.ticker-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.ticker-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.ticker-panel-head h3 {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--white-dim);
}
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue-bright);
}
.live-dot::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--blue-bright);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.ticker-viewport {
  height: 340px;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
}
.ticker-track { display: flex; flex-direction: column; animation: scroll-up 14s linear infinite; }
.ticker-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.ticker-row .bib { color: var(--steel); font-weight: 600; }
.ticker-row .name { color: var(--white); }
.ticker-row .time { font-family: var(--font-display); font-weight: 700; color: var(--blue-bright); }
@keyframes scroll-up { 0% { transform: translateY(0); } 100% { transform: translateY(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* ---- Stat bar (bento row) ---- */
.stat-bar { padding-block: 56px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat-cell {
  padding: 32px var(--gutter);
  background: var(--white);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-lg);
  text-align: center;
}
.stat-cell:nth-child(1) .stat-num { color: var(--blue); }
.stat-cell:nth-child(2) .stat-num { color: var(--red); }
.stat-cell:nth-child(3) .stat-num { color: var(--blue-dark); }
.stat-num { font-family: var(--font-display); font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1; }
.stat-label {
  margin-top: 0.7rem;
  color: var(--steel-dark);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
@media (max-width: 700px) { .stat-grid { grid-template-columns: 1fr; } }

/* ---- Split pillars (bento pair) ---- */
.pillars {
  max-width: var(--max);
  margin: 24px auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.pillar { padding: 56px 48px; border-radius: var(--radius-lg); }
.pillar h2 { font-size: clamp(1.7rem, 2.6vw, 2.2rem); margin-bottom: 1rem; }
.pillar-lede { margin-bottom: 2rem; font-size: 1.02rem; }

.pillar-light {
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--line-light);
}
.pillar-light .pillar-lede { color: #4A5058; }

.pillar-dark {
  background:
    radial-gradient(circle at 85% 15%, rgba(0, 100, 177, 0.28), transparent 45%),
    var(--black);
  border: 1px solid var(--line);
}

.pillar-list { border-top: 1px solid var(--line-light); margin-bottom: 2.5rem; }
.pillar-dark .pillar-list { border-top-color: var(--line); }
.pillar-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line-light);
  display: flex;
  gap: 14px;
  font-size: 0.98rem;
}
.pillar-dark .pillar-list li { border-bottom-color: var(--line); }
.pillar-list li .mark { color: var(--blue-bright); font-weight: 700; }
.pillar-light .pillar-list li .mark { color: var(--red); }

@media (max-width: 900px) { .pillars { grid-template-columns: 1fr; } }

/* ---- Feature grid (bento row) ---- */
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.feature-grid--3 { grid-template-columns: repeat(3, 1fr); }

.feature-card {
  background: linear-gradient(180deg, rgba(0, 100, 177, 0.04), transparent 65%), var(--white);
  padding: 40px;
  border: 1px solid var(--line-light);
  border-top: 4px solid var(--red);
  border-radius: var(--radius-lg);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.feature-card:nth-child(even) {
  background: linear-gradient(180deg, rgba(227, 24, 61, 0.04), transparent 65%), var(--white);
  border-top-color: var(--blue);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(10, 12, 14, 0.10); }
.feature-card--blue { border-top-color: var(--blue) !important; }
.feature-card--red { border-top-color: var(--red) !important; }
.on-dark .feature-card { background: var(--surface-raised); border-color: var(--line); }

.feature-card h3 { font-size: 1.2rem; margin-bottom: 0.75rem; }
.feature-card p { font-size: 0.98rem; color: #4A5058; }
.on-dark .feature-card p { color: var(--steel); }

@media (max-width: 700px) { .feature-grid { grid-template-columns: 1fr; } }

/* ---- Process timeline (bento row) ---- */
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.process-grid--3 { grid-template-columns: repeat(3, 1fr); }
.process-step {
  padding: 32px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}
.process-num { font-family: var(--font-display); font-size: 2.2rem; color: var(--blue-bright); margin-bottom: 0.9rem; }
.process-step:nth-child(even) .process-num { color: var(--red-bright); }
.process-step h4 { font-size: 1.05rem; margin-bottom: 0.6rem; color: var(--white); text-transform: uppercase; letter-spacing: 0.02em; }
.process-step p { font-size: 0.92rem; color: var(--steel); }

@media (max-width: 900px) { .process-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .process-grid { grid-template-columns: 1fr; } }

/* ---- Coaching tier grid (bento row) ---- */
.level-toggle {
  display: inline-flex;
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2.5rem;
}
.level-toggle button {
  background: var(--white);
  border: none;
  border-right: 1px solid var(--line-light);
  padding: 12px 20px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: var(--black);
}
.level-toggle button:last-child { border-right: none; }
.level-toggle button[aria-pressed="true"] { background: var(--black); color: var(--white); }

.tier-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.tier-card {
  background: linear-gradient(180deg, rgba(0, 100, 177, 0.04), transparent 55%), var(--white);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid var(--line-light);
  border-top: 4px solid var(--blue);
  border-radius: var(--radius-lg);
}
.tier-card:nth-child(2) {
  background: linear-gradient(180deg, rgba(227, 24, 61, 0.04), transparent 55%), var(--white);
  border-top-color: var(--red);
}
.tier-card h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.tier-best-for { font-size: 0.85rem; color: var(--steel-dark); margin-bottom: 1.1rem; }
.tier-lede { font-size: 0.96rem; color: #4A5058; }

.tier-dynamic-note {
  font-size: 0.9rem;
  color: var(--black);
  background: rgba(0, 100, 177, 0.1);
  border-left: 3px solid var(--blue);
  padding: 12px 14px;
  margin: 1.4rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.tier-cta { margin-top: auto; padding-top: 0.5rem; }

.tier-badge {
  position: absolute;
  top: 24px; right: 24px;
  background: var(--blue);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: var(--radius);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.tier-badge.is-recommended { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) { .tier-grid { grid-template-columns: 1fr; } }

/* ---- Forms ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.field label { display: block; font-size: 0.88rem; font-weight: 700; margin-bottom: 0.5rem; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 0.98rem;
}
.on-dark .field input, .on-dark .field select, .on-dark .field textarea {
  background: var(--surface);
  border-color: var(--line);
  color: var(--white);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--black); }
.on-dark .field input:focus, .on-dark .field select:focus, .on-dark .field textarea:focus { border-color: var(--blue-bright); }
.field textarea { resize: vertical; min-height: 120px; }

.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.field-error { display: none; color: var(--red); font-size: 0.85rem; margin-top: 0.4rem; }
.field.has-error .field-error { display: block; }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.checkbox-pill {
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.on-dark .checkbox-pill { border-color: var(--line); }
.checkbox-pill input { accent-color: var(--blue); }

.checkbox-group.has-error .checkbox-pill { border-color: var(--red); }
.checkbox-group-error { display: none; color: var(--red); font-size: 0.85rem; margin-top: 0.6rem; }
.checkbox-group.has-error + .checkbox-group-error,
.checkbox-group.has-error ~ .checkbox-group-error { display: block; }

.form-success {
  display: none;
  border: 1px solid var(--blue);
  background: rgba(0, 100, 177, 0.06);
  padding: 20px;
  border-radius: var(--radius-lg);
  margin-top: 1.5rem;
}
.form-success[data-visible="true"] { display: block; }
.form-success h4 { font-size: 1.05rem; margin-bottom: 0.4rem; }

.form-error {
  display: none;
  border: 1px solid var(--red);
  background: rgba(227, 24, 61, 0.06);
  padding: 20px;
  border-radius: var(--radius-lg);
  margin-top: 1.5rem;
}
.form-error[data-visible="true"] { display: block; }
.form-error h4 { font-size: 1.05rem; margin-bottom: 0.4rem; }

/* ---- Accordion (FAQ) ---- */
.accordion-item { border-bottom: 1px solid var(--line-light); }
.on-dark .accordion-item { border-bottom: 1px solid var(--line); }
.accordion-trigger {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.02rem;
  cursor: pointer;
}
.accordion-icon { flex-shrink: 0; width: 20px; height: 20px; position: relative; }
.accordion-icon::before, .accordion-icon::after {
  content: '';
  position: absolute;
  background: currentColor;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.accordion-icon::before { width: 14px; height: 2px; }
.accordion-icon::after { width: 2px; height: 14px; transition: transform 200ms ease; }
.accordion-trigger[aria-expanded="true"] .accordion-icon::after { transform: translate(-50%, -50%) rotate(90deg); }

.accordion-panel { max-height: 0; overflow: hidden; transition: max-height 240ms ease; }
.accordion-panel-inner { padding-bottom: 22px; font-size: 0.98rem; color: var(--steel-dark); }
.on-dark .accordion-panel-inner { color: var(--steel); }

/* ---- Boundary list (Contact page) ---- */
.boundary-list { border-top: 1px solid var(--line); }
.boundary-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.boundary-row dt { font-weight: 700; color: var(--white); }
.boundary-row dd { margin: 0; color: var(--steel); font-size: 0.98rem; }
@media (max-width: 640px) { .boundary-row { grid-template-columns: 1fr; gap: 0.4rem; } }

/* ---- Results page ---- */
.results-controls { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin-bottom: 2rem; }
.results-controls .field { flex: 1; min-width: 220px; margin-bottom: 0; }

.results-status {
  border: 1px solid var(--line-light);
  border-left: 4px solid var(--steel-dark);
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}
.results-status h4 { font-size: 1rem; margin-bottom: 0.4rem; }
.results-status p { font-size: 0.95rem; color: #4A5058; margin: 0; }
.results-status[data-state="error"] { border-left-color: var(--red); }
.results-status[data-state="loading"] { border-left-color: var(--blue); }
.results-status[data-state="empty"] { border-left-color: var(--steel-dark); }

.results-table-wrap { overflow: auto; border: 1px solid var(--line-light); border-radius: var(--radius-lg); }
table.results-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 560px; }
.results-table th, .results-table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line-light); white-space: nowrap; }
.results-table th { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--steel-dark); background: var(--white); }
.results-table tbody tr:last-child td { border-bottom: none; }
.results-table td.time { font-family: var(--font-display); font-weight: 700; color: var(--blue); }

.setup-note { border: 1px dashed var(--line); border-radius: var(--radius-lg); padding: 24px; margin-top: 3rem; }
.on-dark .setup-note { border-color: var(--line); }
.setup-note h4 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--blue-bright); }
.setup-note ol { padding-left: 1.25rem; list-style: decimal; }
.setup-note li { margin-bottom: 0.6rem; font-size: 0.92rem; color: var(--steel); }
.setup-note code { background: var(--surface-raised); padding: 2px 6px; border-radius: 4px; font-size: 0.88em; color: var(--blue-bright); }

/* ---- CTA bands / any full on-dark section (bento card) ---- */
.on-dark.section {
  max-width: var(--max);
  margin: 24px auto;
  background:
    radial-gradient(circle at 85% 20%, rgba(0, 100, 177, 0.24), transparent 45%),
    radial-gradient(circle at 10% 85%, rgba(227, 24, 61, 0.16), transparent 48%),
    var(--black);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

/* ---- Footer ---- */
.site-footer { background: var(--black); color: var(--steel); padding-block: 64px 32px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
}
.footer-brand .footer-logo { height: 40px; width: auto; display: block; margin-bottom: 1rem; }
.footer-brand p { font-size: 0.95rem; }
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--white-dim);
  margin-bottom: 1rem;
}
.footer-col ul li { margin-bottom: 0.65rem; }
.footer-col a { display: inline-block; transition: color 200ms ease, transform 200ms ease; }
.footer-col a:hover { color: var(--blue-bright); transform: translateX(4px); }
.footer-bottom { padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: 0.85rem; }

@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---- Auth cards (client & member portals) ---- */
.auth-shell {
  display: flex;
  justify-content: center;
  padding-block: 24px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border: 1px solid var(--line-light);
  border-top: 4px solid var(--blue);
  border-radius: var(--radius-lg);
  padding: 44px;
  flex-direction: column;
}
.on-dark .auth-card {
  background: var(--surface-raised);
  border-color: var(--line);
}
.auth-card h2 { font-size: 1.5rem; margin-bottom: 0.6rem; }
.auth-card .auth-lede { color: var(--steel-dark); font-size: 0.95rem; margin-bottom: 1.75rem; }
.on-dark .auth-card .auth-lede { color: var(--steel); }
.auth-card .field { margin-bottom: 1.25rem; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 0.5rem; }

.auth-error {
  display: none;
  color: var(--red);
  font-size: 0.88rem;
  margin-top: 1rem;
  font-weight: 600;
}
.auth-error[data-visible="true"] { display: block; }

/* ---- Portal header (post-login) ---- */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.portal-header h2 { margin-bottom: 0.4rem; }
.portal-header p { color: var(--steel-dark); font-size: 0.98rem; margin: 0; }
.on-dark .portal-header p { color: var(--steel); }

/* ---- Two-column tier grid (Members page) ---- */
.tier-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 700px) { .tier-grid--2 { grid-template-columns: 1fr; } }

.plan-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}
.plan-tag--open { background: var(--line-light); color: var(--steel-dark); }
.plan-tag--paid { background: var(--blue); color: var(--white); }

/* ---- Data tables shared by client/member portals (invoices, quotes, results) ---- */
.data-table-block { margin-bottom: 2.5rem; }
.data-table-block h3 { font-size: 1.1rem; margin-bottom: 1rem; }

/* ---- Next race widget (homepage) ---- */
.next-race-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  background: var(--white);
  border: 1px solid var(--line-light);
  border-top: 4px solid var(--blue);
  border-radius: var(--radius-lg);
  padding: 32px 40px;
}
.next-race-info h3 { font-size: 1.4rem; margin-bottom: 0.4rem; }
.next-race-meta { color: var(--steel-dark); font-size: 0.98rem; }
.next-race-meta span + span::before { content: '\2022'; margin: 0 8px; color: var(--line-light); }

/* ---- Event grid (Events page, Partnerships page) ---- */
.event-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.event-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--line-light);
  border-top: 4px solid var(--red);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.event-card:nth-child(even) { border-top-color: var(--blue); }
.event-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(10, 12, 14, 0.10); }
.event-date {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--steel-dark);
  margin-bottom: 0.75rem;
}
.event-card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.event-loc { color: #4A5058; font-size: 0.95rem; margin-bottom: 0.5rem; }
.event-distances { color: var(--steel-dark); font-size: 0.88rem; margin-bottom: 1.25rem; }
.event-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue);
}

@media (max-width: 700px) {
  .event-grid { grid-template-columns: 1fr; }
  .next-race-card { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   Micro-interactions & motion
   ========================================================================== */

/* ---- Card "lift": scale up, rise, and deepen the shadow on hover ---- */
.feature-card, .tier-card, .event-card, .stat-cell, .next-race-card {
  box-shadow: 0 2px 8px rgba(10, 12, 14, 0.05);
}
.feature-card, .tier-card, .event-card, .stat-cell, .next-race-card,
.process-step, .ticker-panel {
  position: relative;
  transition: transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 320ms ease,
              border-color 320ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .feature-card:hover, .tier-card:hover, .event-card:hover,
  .stat-cell:hover, .next-race-card:hover {
    transform: translateY(-6px) scale(1.04);
    box-shadow: 0 32px 64px rgba(10, 12, 14, 0.20), 0 8px 18px rgba(10, 12, 14, 0.10);
    z-index: 3;
  }
  .process-step:hover, .ticker-panel:hover {
    transform: translateY(-6px) scale(1.04);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(79, 168, 232, 0.45);
    z-index: 3;
  }
}

/* ---- Buttons: lift (already above) + press + a soft sheen sweep ---- */
.btn { position: relative; overflow: hidden; }
.btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: none;
  transition-duration: 80ms;
}
.btn-blue::after, .btn-red::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 600ms ease;
}
.btn-blue:hover::after, .btn-red:hover::after { transform: translateX(120%); }

/* ---- Smaller interactive elements ---- */
.accordion-trigger { transition: color 200ms ease; }
.accordion-trigger:hover { color: var(--blue); }
.on-dark .accordion-trigger:hover { color: var(--blue-bright); }

.level-toggle button { transition: background-color 200ms ease, color 200ms ease; }
.level-toggle button:not([aria-pressed="true"]):hover { background: var(--canvas); }

.checkbox-pill { transition: border-color 200ms ease, background-color 200ms ease; }
.checkbox-pill:hover { border-color: var(--blue); background: rgba(0, 100, 177, 0.05); }

.field input, .field select, .field textarea {
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  box-shadow: 0 0 0 3px rgba(0, 100, 177, 0.15);
}

.results-table tbody tr { transition: background-color 200ms ease; }
.results-table tbody tr:hover { background: rgba(0, 100, 177, 0.05); }

/* ---- Entrance animation (added by main.js; only active when JS is running) ---- */
.js .reveal {
  opacity: 0;
  transform: translateY(var(--reveal-distance, 28px));
  transition: opacity 800ms cubic-bezier(0.22, 0.61, 0.36, 1) var(--reveal-delay, 0ms),
              transform 800ms cubic-bezier(0.22, 0.61, 0.36, 1) var(--reveal-delay, 0ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---- Floating partner logo ---- */
@keyframes float-drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.partner-logo-wrap { display: flex; justify-content: center; }
.partner-logo {
  width: 100%;
  max-width: 380px;
  height: auto;
  border-radius: 50%;
  background: #fff;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.5));
  animation: float-drift 7s ease-in-out infinite;
}
.hero-grid--compact { min-height: 0; padding-block: 72px; }
@media (max-width: 900px) {
  .partner-logo { max-width: 260px; }
}
