/* =========================================================================
   Modern Triathlon — run · bike · cocktails
   A spoof endurance brand. Elegant, sports-minded design system.
   No framework. Plain CSS with custom properties.
   ========================================================================= */

/* ------------------------------- Tokens -------------------------------- */
:root {
  color-scheme: dark;

  /* Brand palette */
  --navy-900: #070b16;
  --navy-800: #0b1020;
  --navy-700: #111a30;
  --navy-600: #1a2540;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --ink: #eef2f8;
  --muted: #9aa6bd;
  --faint: #6b7894;

  /* Discipline accents */
  --run: #ff5a5f;     /* energy / coral red   */
  --bike: #28d0c8;    /* motion / teal        */
  --cocktail: #f5b942;/* reward / warm gold   */

  --gold: #f5b942;
  --gold-soft: #ffd987;

  /* Effects */
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.75);
  --ring: 0 0 0 1px var(--line);

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bebas Neue", "Archivo Black", var(--font-sans);

  --maxw: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ----------------------------- Base reset ------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--navy-900);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient background glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 12% 8%, rgba(255, 90, 95, 0.12), transparent 60%),
    radial-gradient(55% 50% at 88% 12%, rgba(40, 208, 200, 0.12), transparent 60%),
    radial-gradient(70% 60% at 50% 110%, rgba(245, 185, 66, 0.14), transparent 60%),
    var(--navy-900);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--gold-soft);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--gold);
}

h1,
h2,
h3 {
  line-height: 1.05;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1rem;
}

::selection {
  background: var(--gold);
  color: var(--navy-900);
}

/* ------------------------------ Layout --------------------------------- */
.wrap {
  width: min(100% - 2.5rem, var(--maxw));
  margin-inline: auto;
}

.section {
  padding: clamp(3.5rem, 8vw, 7rem) 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: linear-gradient(90deg, var(--run), var(--cocktail));
  border-radius: 2px;
}

.section-title {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.lead {
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.18rem);
  max-width: 60ch;
}

/* ------------------------------ Header --------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 22, 0.72);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
}

.brand b {
  font-weight: 800;
}

.brand span {
  color: var(--gold);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 42px;
  height: 42px;
  cursor: pointer;
  color: var(--ink);
}

.nav-toggle svg {
  width: 26px;
  height: 26px;
  margin: auto;
}

/* --------------------------- Buttons ----------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #ffcf6e);
  color: var(--navy-900);
  box-shadow: 0 14px 34px -14px rgba(245, 185, 66, 0.7);
}

.btn-primary:hover {
  color: var(--navy-900);
  transform: translateY(-2px);
  box-shadow: 0 20px 44px -14px rgba(245, 185, 66, 0.85);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--gold);
  transform: translateY(-2px);
}

/* ------------------------------- Hero ---------------------------------- */
.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem);
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-soft);
  background: rgba(245, 185, 66, 0.1);
  border: 1px solid rgba(245, 185, 66, 0.28);
  border-radius: 999px;
  margin-bottom: 1.6rem;
}

.hero h1 {
  font-size: clamp(2.6rem, 9vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}

.hero h1 .grad {
  background: linear-gradient(100deg, var(--run) 0%, var(--bike) 50%, var(--cocktail) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  color: var(--muted);
  font-size: clamp(1.05rem, 2.6vw, 1.4rem);
  max-width: 46ch;
  margin: 0 auto 2rem;
}

.hero-cta {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ----------------- Central progression: run → bike → cocktail ---------- */
.progression {
  margin-top: clamp(2.5rem, 7vw, 4.5rem);
}

.flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: clamp(0.5rem, 2vw, 1.5rem);
}

.leg {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(1.5rem, 3vw, 2.4rem) clamp(1rem, 2vw, 1.6rem);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.leg::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--leg-color);
}

.leg::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  top: -90px;
  border-radius: 50%;
  background: var(--leg-color);
  opacity: 0.16;
  filter: blur(34px);
}

.leg--run {
  --leg-color: var(--run);
}

.leg--bike {
  --leg-color: var(--bike);
}

.leg--cocktail {
  --leg-color: var(--cocktail);
}

.leg-icon {
  width: clamp(56px, 11vw, 84px);
  height: clamp(56px, 11vw, 84px);
  color: var(--leg-color);
  margin-bottom: 1rem;
  position: relative;
}

.leg-num {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--faint);
  text-transform: uppercase;
}

.leg h3 {
  font-size: clamp(1.3rem, 3.4vw, 1.7rem);
  font-weight: 800;
  margin: 0.35rem 0 0.4rem;
}

.leg p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.leg-meta {
  margin-top: 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--leg-color);
}

.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
}

.flow-arrow svg {
  width: 34px;
  height: 34px;
}

/* Animated dash on the connecting arrow */
.flow-arrow .dash {
  stroke-dasharray: 4 6;
  animation: flow 1.4s linear infinite;
}

@keyframes flow {
  to {
    stroke-dashoffset: -20;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-arrow .dash {
    animation: none;
  }
}

/* --------------------------- Stats strip ------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: clamp(2rem, 5vw, 3rem);
}

.stat {
  text-align: center;
  padding: 1.4rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.stat-num {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--gold), var(--gold-soft));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ----------------- Challenge & reward (body + mind) -------------------- */
.split {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.2rem, 3vw, 2rem);
  margin-top: 2.5rem;
}

.panel {
  position: relative;
  padding: clamp(1.6rem, 3.5vw, 2.4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
}

.panel h3 {
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.panel h3 svg {
  width: 30px;
  height: 30px;
  flex: none;
}

.panel--challenge h3 svg {
  color: var(--run);
}

.panel--reward h3 svg {
  color: var(--bike);
}

.panel p {
  color: var(--muted);
  margin-bottom: 0;
}

.benefits {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.benefit {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.benefit svg {
  width: 30px;
  height: 30px;
  color: var(--gold);
  margin-bottom: 0.8rem;
}

.benefit h4 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.benefit p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ------------------------------ Rules ---------------------------------- */
.rules {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  padding: clamp(1.6rem, 4vw, 2.6rem);
  margin-top: 2.5rem;
  display: grid;
  gap: 1.1rem;
}

.rule {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.rules .rule:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.rule-num {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-weight: 800;
  color: var(--navy-900);
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
}

.rule h4 {
  margin: 0.2rem 0 0.25rem;
  font-size: 1.05rem;
}

.rule p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ------------------------------- CTA ----------------------------------- */
.cta-band {
  text-align: center;
  border: 1px solid rgba(245, 185, 66, 0.3);
  border-radius: var(--radius);
  padding: clamp(2.4rem, 6vw, 4rem);
  background:
    radial-gradient(80% 120% at 50% 0%, rgba(245, 185, 66, 0.16), transparent 70%),
    rgba(255, 255, 255, 0.02);
}

.cta-band h2 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 900;
}

.cta-band p {
  color: var(--muted);
  max-width: 50ch;
  margin: 0 auto 1.8rem;
}

/* ------------------------------ Footer --------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0;
  margin-top: 2rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-inner p {
  margin: 0;
  color: var(--faint);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.disclaimer {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--faint);
}

/* --------------------------- About page -------------------------------- */
.page-hero {
  padding: clamp(3rem, 7vw, 5rem) 0 clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 900;
}

.prose {
  max-width: 70ch;
  margin-inline: auto;
}

.prose h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: 2.2rem;
}

.prose p {
  color: var(--muted);
}

.prose ul {
  color: var(--muted);
  padding-left: 1.2rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.callout {
  border-left: 3px solid var(--gold);
  background: rgba(245, 185, 66, 0.07);
  padding: 1rem 1.3rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
  margin: 1.5rem 0;
}

/* --------------------------- Reveal anim ------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ----------------------------- Responsive ------------------------------ */
@media (max-width: 860px) {
  .flow {
    grid-template-columns: 1fr;
  }

  .flow-arrow {
    transform: rotate(90deg);
    padding: 0.3rem 0;
  }

  .split,
  .benefits {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--navy-800);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 0;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  }

  .nav-links.open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li {
    border-top: 1px solid var(--line);
  }

  .nav-links a {
    display: block;
    padding: 0.9rem 1.25rem;
  }

  .nav-links .btn {
    margin: 0.6rem 1.25rem;
  }

  .stats {
    grid-template-columns: 1fr;
  }
}
