/* The Triathlon Lab · website styles
   Energy Lab palette, nearly monochrome: Lava and Warm White, with Energy Lab
   Yellow (#DFFF00) as the one signal colour, on dark surfaces only. Chakra Petch headlines, JetBrains Mono labels, Inter text.
   Brand guide: brandkit/triathlon-lab/brand-guidelines.html */

:root {
  --black: #15130F;
  --ink: #15130F;
  --white: #F4EEE2;
  --paper: #F4EEE2;
  --accent: #DFFF00;
  --graphite: #24211C;

  --font-display: 'Chakra Petch', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --track-display: -0.005em;
  --track-body: 0;
  --track-meta: 0.16em;

  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 48px);
  --section: clamp(72px, 10vw, 140px);
  --radius: 6px;
  --radius-pill: 3px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: var(--track-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul, figure, blockquote { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--white); color: var(--ink); padding: 8px 12px; border-radius: 6px; }

/* ---------- Surfaces ---------- */
.dark  { background: var(--black); color: var(--white); --muted: rgba(255,255,255,.62); --line: rgba(255,255,255,.14); --card: rgba(255,255,255,.045); }
.paper { background: var(--paper); color: var(--ink);   --muted: rgba(17,17,17,.62);    --line: rgba(17,17,17,.14);    --card: #FFFFFF; }
.grain { position: relative; isolation: isolate; }
.grain::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .14; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.dark.grain::after { mix-blend-mode: screen; opacity: .1; filter: invert(1); }

/* ---------- Type ---------- */
.kicker, .meta, .pill, .tier-flag, .result, .week figcaption, .field label, .nav-toggle {
  font-size: 11px; font-weight: 700; letter-spacing: var(--track-meta); text-transform: uppercase;
}
.kicker { color: var(--muted); margin-bottom: 18px; }
.h2 {
  font-size: clamp(36px, 5.6vw, 76px); font-weight: 400; letter-spacing: var(--track-display); line-height: .94;
  max-width: 15ch; text-wrap: balance;
}
.h2 b { font-weight: 800; }
.h2.big { font-size: clamp(44px, 6.6vw, 92px); }
.accent, .word em {
  font-family: var(--font-display); font-style: italic; font-weight: 400; letter-spacing: -0.03em; font-size: 1.1em; color: var(--accent);
}
h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.lede { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.4; color: var(--muted); max-width: 46ch; }
.section-sub { color: var(--muted); max-width: 52ch; margin-top: 22px; font-size: 18px; }
.fine { font-size: 14px; color: var(--muted); }
.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 24px; border-radius: var(--radius-pill); border: 1px solid transparent;
  font: inherit; font-size: 16px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-accent:hover { background: #EBFF55; }
.btn-ghost { border-color: var(--line); color: inherit; }
.btn-ghost:hover { border-color: currentColor; }
.btn-sm { padding: 11px 16px; font-size: 14px; }
.btn-block { width: 100%; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(21,19,15,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.wordmark { font-size: 20px; font-weight: 800; letter-spacing: -0.05em; }
.wordmark span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 15px; font-weight: 500; }
.nav-links a:not(.btn) { color: rgba(255,255,255,.72); transition: color .15s; }
.nav-links a:not(.btn):hover { color: var(--white); }
.nav-toggle { display: none; background: none; color: var(--white); border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius-pill); padding: 10px 14px; cursor: pointer; font-family: inherit; }

/* ---------- Hero ---------- */
.hero {
  padding: 26px 0 clamp(56px, 8vw, 110px);
  background:
    radial-gradient(ellipse 60% 45% at 78% 100%, rgba(223,255,0,.06), transparent 70%),
    radial-gradient(ellipse 70% 50% at 20% 0%, rgba(255,255,255,.07), transparent 70%),
    var(--black);
}
.meta { display: grid; grid-template-columns: 1fr auto 1fr; color: var(--muted); white-space: nowrap; }
.meta > :last-child { text-align: right; }
.hero-title { margin-top: clamp(48px, 8vw, 104px); }
.hero-title .lead { display: block; font-size: clamp(22px, 3vw, 40px); font-weight: 800; letter-spacing: var(--track-display); line-height: 1; }
.hero-title .word {
  display: block; margin-top: .06em;
  font-size: clamp(60px, 15.4vw, 214px); font-weight: 800; letter-spacing: -0.065em; line-height: .86; white-space: nowrap;
}
.hero-title .word em { font-size: 1.04em; letter-spacing: -0.045em; }
.hero-grid { display: grid; grid-template-columns: 1fr minmax(0, 460px); gap: clamp(32px, 6vw, 88px); align-items: start; margin-top: clamp(36px, 5vw, 64px); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 16px; }

/* Sample week card */
.week { background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: 20px 22px 18px; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.week figcaption { display: flex; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid rgba(17,17,17,.14); }
.week li { display: grid; grid-template-columns: 38px 10px 1fr auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(17,17,17,.08); font-size: 15px; }
.week li b { font-size: 11px; letter-spacing: var(--track-meta); text-transform: uppercase; color: rgba(17,17,17,.55); }
.week li i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.week li i.d-rest { background: transparent; border: 1.5px solid rgba(17,17,17,.35); }
.week li i.d-bike { border-radius: 2px; }
.week li i.d-run { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.week li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.week li em { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }
.week-note { display: flex; gap: 9px; align-items: baseline; margin-top: 14px; font-size: 13.5px; line-height: 1.3; color: rgba(17,17,17,.7); }
.week-note .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: translateY(-1px); }

/* ---------- Sections ---------- */
.section { padding: var(--section) 0; }
.section .h2 + .cards-3, .section .h2 + .rules, .section .h2 + .steps, .section .h2 + .quotes, .section-sub + .tiers { margin-top: clamp(40px, 5vw, 68px); }

.cards-3, .quotes, .tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card, .quote, .tier { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.card .num { display: block; font-family: var(--font-display); font-style: italic; font-size: 34px; line-height: 1; margin-bottom: 40px; color: var(--muted); }
.card p, .rules p, .steps p { color: var(--muted); margin-top: 12px; font-size: 16px; }

/* Method */
.rules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); }
.rules article { padding: 28px 24px 8px 0; }
.rules article + article { padding-left: 24px; border-left: 1px solid var(--line); }
.pill { display: inline-block; padding: 7px 10px; border-radius: var(--radius-pill); background: var(--white); color: var(--ink); margin-bottom: 44px; }

/* Process */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; counter-reset: step; }
.steps li { border-top: 2px solid var(--ink); padding-top: 22px; }
.badge { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--paper); font-weight: 800; font-size: 17px; margin-bottom: 36px; }

/* Tiers */
.tier { position: relative; display: flex; flex-direction: column; padding: 32px 28px 28px; }
.tier-for { color: var(--muted); margin-top: 8px; font-size: 16px; min-height: 2.9em; }
.price { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 22px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.price strong { font-size: 52px; font-weight: 800; letter-spacing: -0.06em; line-height: 1; }
.price span { color: var(--muted); font-size: 15px; }
.tier ul { flex: 1; margin-bottom: 28px; }
.tier li { position: relative; padding: 7px 0 7px 22px; font-size: 16px; }
.tier li::before { content: ''; position: absolute; left: 0; top: .95em; width: 10px; height: 2px; background: var(--accent); }
.tier.is-featured { background: var(--paper); color: var(--ink); --muted: rgba(17,17,17,.62); --line: rgba(17,17,17,.14); border-color: var(--paper); }
.tier-flag { position: absolute; top: 18px; right: 18px; padding: 6px 9px; border-radius: var(--radius-pill); background: var(--ink); color: var(--paper); }
.tier-flag.is-line { background: transparent; color: inherit; border: 1px solid var(--line); }
.tiers + .fine { margin-top: 28px; }

/* Quotes */
.quote { display: flex; flex-direction: column; }
.result { align-self: flex-start; padding: 7px 10px; border-radius: var(--radius-pill); background: var(--ink); color: var(--paper); }
.quote blockquote { flex: 1; margin: 26px 0 30px; font-family: var(--font-display); font-size: 25px; line-height: 1.16; letter-spacing: -0.015em; }
.quote figcaption { font-size: 14px; color: var(--muted); }
.quote figcaption b { color: var(--ink); }

/* Mission */
.mission { background: var(--graphite); color: var(--white); --muted: rgba(244,238,226,.7); padding: clamp(56px, 7vw, 96px) 0; }
.mission-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 88px); align-items: end; }
.mission .h2 em { font-family: var(--font-display); font-style: italic; font-weight: 400; letter-spacing: -0.03em; font-size: 1.1em; }
.mission p:not(.kicker) { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.4; max-width: 46ch; }
.mission p + p { margin-top: 16px; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.portrait {
  aspect-ratio: 4 / 5; border-radius: var(--radius); display: grid; place-items: center; text-align: center;
  background: radial-gradient(ellipse 70% 20% at 50% 88%, rgba(244,243,236,.5), transparent 70%), #151515;
  color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: var(--track-meta); text-transform: uppercase;
}
/* Photo is zoomed and shifted so the subject sits in the middle of the frame. */
.portrait { position: relative; overflow: hidden; }
.portrait img { position: absolute; left: 0; top: -27%; width: 132%; max-width: none; height: auto; }
.bio + .bio { margin-top: 16px; }
.bio:last-of-type { margin-bottom: 32px; }
.bio { margin-top: 26px; font-size: 19px; line-height: 1.45; color: rgba(255,255,255,.82); max-width: 50ch; }
.creds { margin: 26px 0 32px; border-top: 1px solid var(--line); max-width: 50ch; }
.creds li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600; }

/* FAQ */
.faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.faq-list { border-top: 2px solid var(--ink); }
details { border-bottom: 1px solid var(--line); }
summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 0; cursor: pointer; list-style: none; font-size: 21px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.15; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; flex: none; font-weight: 400; font-size: 28px; line-height: .7; transition: transform .2s ease; }
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 44px 24px 0; color: var(--muted); max-width: 60ch; }

/* Apply */
.apply { background: radial-gradient(ellipse 60% 50% at 0% 100%, rgba(223,255,0,.05), transparent 70%), var(--black); }
.apply-grid { display: grid; grid-template-columns: 1fr minmax(0, 520px); gap: clamp(32px, 6vw, 88px); align-items: start; }
.apply .lede { margin-top: 26px; }
.form { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: clamp(22px, 3vw, 34px); }
.field { grid-column: 1 / -1; display: grid; gap: 7px; }
.field.half { grid-column: span 2; }
.field label { color: rgba(17,17,17,.62); }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 14px; border: 1px solid rgba(17,17,17,.2); border-radius: var(--radius-pill);
  background: #FFFFFF; color: var(--ink); font: inherit; font-size: 16px; letter-spacing: -0.01em;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.field [aria-invalid="true"] { border-color: #C0281A; }
.form .btn, .form-status { grid-column: 1 / -1; }
.form-status { font-size: 14.5px; font-weight: 600; min-height: 1.4em; }
.form-status.is-error { color: #C0281A; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 34px 0; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.footer .wordmark { color: var(--white); }
.footer nav { display: flex; flex-wrap: wrap; gap: 22px; }
.footer nav a:hover { color: var(--white); }

/* ---------- Legal pages ---------- */
.legal .wrap { max-width: 760px; }
.legal h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; margin-top: 48px; }
.legal p, .legal ul { margin-top: 14px; color: var(--muted); max-width: 64ch; }
.legal ul { padding-left: 20px; list-style: disc; }
.legal li + li { margin-top: 8px; }
.legal a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Draft markers ---------- */
.draft [data-ph] { outline: 1.5px dashed var(--accent); outline-offset: 5px; border-radius: 4px; }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .rules, .steps { grid-template-columns: repeat(2, 1fr); }
  .rules article:nth-child(3) { padding-left: 0; border-left: 0; }
  .rules article:nth-child(n+3) { border-top: 1px solid var(--line); }
  .rules article { padding-bottom: 32px; }
  .tiers, .quotes { grid-template-columns: 1fr; max-width: 560px; }
  .tier-for { min-height: 0; }
  .hero-grid, .about, .faq, .apply-grid, .mission-grid { grid-template-columns: 1fr; }
  .hero-grid { align-items: start; }
  .week { max-width: 520px; }
  .portrait { max-width: 380px; width: 100%; margin-inline: auto; }
}
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 22px; background: var(--black); border-bottom: 1px solid rgba(255,255,255,.1);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a:not(.btn) { padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.1); font-size: 17px; }
  .nav-links .btn { margin-top: 18px; padding: 15px; font-size: 16px; }
  .cards-3 { grid-template-columns: 1fr; }
  .card .num { margin-bottom: 22px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .meta > :nth-child(2) { display: none; }
  .meta { grid-template-columns: 1fr 1fr; }
  .rules, .steps { grid-template-columns: 1fr; }
  .rules article + article { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .pill, .badge { margin-bottom: 22px; }
  .field.half { grid-column: 1 / -1; }
  .cta-row .btn { flex: 1 1 100%; }
  summary { font-size: 19px; }
  details p { padding-right: 0; }
  .week { padding: 16px 16px 14px; }
  .week li { font-size: 14px; gap: 8px; grid-template-columns: 34px 10px 1fr auto; }
}

/* ---------- The Triathlon Lab type and details ---------- */
.h2, h3, .hero-title, .price strong, summary, .btn, .badge, .legal h2 { font-family: var(--font-display); }
.h2 { font-weight: 500; text-transform: uppercase; line-height: 1; max-width: 19ch; }
.h2 b { font-weight: 700; }
h3, summary, .legal h2 { font-weight: 700; letter-spacing: 0; }
.accent, .word em, .mission .h2 em {
  font-family: var(--font-display); font-style: normal; font-weight: 700; font-size: 1em; letter-spacing: 0; color: var(--accent);
}
.kicker, .meta, .pill, .tier-flag, .result, .week figcaption, .field label, .nav-toggle, .week li b {
  font-family: var(--font-mono); font-weight: 500;
}
.kicker { display: flex; align-items: center; gap: 9px; }
.kicker::before { content: ''; width: 10px; height: 2px; background: var(--accent); }
.wordmark { display: block; line-height: 0; }
.wordmark img { height: 30px; width: auto; display: block; }
.footer .wordmark img { height: 24px; }
.hero-title .lead { text-transform: uppercase; font-weight: 700; letter-spacing: 0; }
.hero-title .word { font-size: clamp(42px, 10.6vw, 136px); font-weight: 700; text-transform: uppercase; letter-spacing: -0.01em; line-height: .92; }
.hero-title .word em { font-size: 1em; letter-spacing: -0.01em; }
.price strong { font-weight: 700; letter-spacing: -0.01em; }
.btn { font-weight: 700; letter-spacing: .02em; text-transform: uppercase; font-size: 15px; }
.btn-sm { font-size: 13px; }
.card .num { font-family: var(--font-mono); font-style: normal; font-size: 20px; }
.quote blockquote { font-family: var(--font-body); font-size: 19px; line-height: 1.42; font-weight: 500; letter-spacing: 0; }
.mission { border-top: 1px solid rgba(244,238,226,.12); border-bottom: 1px solid rgba(244,238,226,.12); }
.week li em, .price strong { font-variant-numeric: tabular-nums; }

/* Energy Lab Yellow disappears on light surfaces, so light areas use Lava for accents. */
.paper .kicker::before, .tier.is-featured li::before, .week-note .dot { background: var(--ink); }
.paper .btn-accent, .tier.is-featured .btn-accent, .form .btn-accent { background: var(--ink); color: var(--accent); }
.paper .btn-accent:hover, .tier.is-featured .btn-accent:hover, .form .btn-accent:hover { background: #2B2822; }
.paper :focus-visible, .form :focus-visible, .tier.is-featured :focus-visible { outline-color: var(--ink); }
.draft [data-ph] { outline-color: #E2572B; }
