/* IRO affiliate site — tokens mirror src/theme/theme.ts exactly. */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --text: #111111;
  --text-muted: #767676;
  --hairline: #E8E8E4;
  --accent: #8E1B2D;
  --accent-muted: #7D2830;
  --swim: #7A9CC6;
  --bike: #C6A77A;
  --run: #A67A9C;
  --inverse-bg: #111111;
  --inverse-text: #FFFFFF;
  --inverse-muted: #9A9A9A;
  --inverse-hairline: #3A3A3A;

  --font: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;

  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 40px;
  --sp-xxl: 64px;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-pill: 999px;

  --container: 760px;
}

* { box-sizing: border-box; }

html { scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 22px;
}

.wrap-wide {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- eyebrow / labels ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 0 0 var(--sp-sm);
}

/* ---------- nav ---------- */

.site-nav {
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-nav .wrap-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.2px;
  color: var(--text);
}

.brand img { width: 26px; height: 26px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
}

.nav-links a:not(.btn) {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}

.nav-links a:not(.btn):hover { color: var(--accent); text-decoration: none; }

.nav-back {
  color: var(--text-muted) !important;
  font-family: var(--mono);
  font-size: 12px !important;
  letter-spacing: 0.3px;
  padding-right: var(--sp-md);
  border-right: 1px solid var(--hairline);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 4px 0;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 22px;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-weight: 600;
  font-size: 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 180ms ease-out, background 180ms ease-out;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { opacity: 0.88; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--hairline);
}
.btn-secondary:hover { border-color: var(--text); }

.btn-small {
  height: 36px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: var(--r-sm);
}

.btn-block { width: 100%; }

/* ---------- hero ---------- */

.hero {
  padding: var(--sp-xxl) 0 var(--sp-xl);
}

.hero h1 {
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: -1px;
  font-weight: 700;
  margin: 0 0 var(--sp-md);
}

.hero .lede {
  font-size: 19px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 0 var(--sp-lg);
}

.hero-ctas {
  display: flex;
  gap: var(--sp-md);
  flex-wrap: wrap;
}

/* ---------- sections ---------- */

section { padding: var(--sp-xxl) 0; }
section.tight { padding: var(--sp-xl) 0; }

.section-head { max-width: 620px; margin-bottom: var(--sp-xl); }

h2 {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.5px;
  font-weight: 700;
  margin: 0 0 var(--sp-sm);
}

h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin: 0 0 var(--sp-sm);
}

p { margin: 0 0 var(--sp-md); }

.section-head p { color: var(--text-muted); margin: 0; }

hr.hairline {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: var(--sp-xl) 0;
}

/* ---------- cards / grid ---------- */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-lg);
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
}

.card h3 { margin-bottom: var(--sp-xs); }
.card p { color: var(--text-muted); margin: 0; font-size: 15px; line-height: 1.5; }

/* ---------- tier table ---------- */

.tiers {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.tiers th, .tiers td {
  text-align: left;
  padding: var(--sp-md);
  border-bottom: 1px solid var(--hairline);
  font-size: 15px;
}

.tiers thead th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  background: var(--bg);
}

.tiers tbody tr:last-child td { border-bottom: none; }

.tiers td.tier-name { font-weight: 600; }
.tiers td.tier-rate { font-family: var(--mono); font-weight: 500; color: var(--accent); }

@media (max-width: 640px) {
  .tiers { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ---------- economics callout ---------- */

.callout {
  background: var(--inverse-bg);
  color: var(--inverse-text);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
}

.callout .eyebrow { color: var(--inverse-muted); }
.callout p { color: var(--inverse-muted); }
.callout p:last-child { margin: 0; }
.callout strong { color: var(--inverse-text); }

.math-line {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--inverse-text);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--inverse-hairline);
  border-radius: var(--r-sm);
  padding: var(--sp-md);
  margin: var(--sp-md) 0;
  overflow-x: auto;
}

/* ---------- FAQ ---------- */

.faq-item {
  border-bottom: 1px solid var(--hairline);
  padding: var(--sp-lg) 0;
}
.faq-item:first-child { padding-top: 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { margin-bottom: var(--sp-xs); }
.faq-item p { color: var(--text-muted); margin: 0; }

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  text-align: center;
}
.cta-band h2 { margin-bottom: var(--sp-sm); }
.cta-band p { color: var(--text-muted); margin-bottom: var(--sp-lg); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: var(--sp-xl) 0 var(--sp-xxl);
  margin-top: var(--sp-xl);
}

.site-footer .wrap-wide {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--sp-lg);
}

.footer-links { display: flex; gap: var(--sp-lg); flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); font-size: 14px; }
.footer-links a:hover { color: var(--text); }

.footer-note { color: var(--text-muted); font-size: 13px; max-width: 520px; line-height: 1.6; margin: var(--sp-md) 0 0; }

/* ---------- waitlist capture ---------- */

.waitlist-form {
  display: flex;
  gap: var(--sp-sm);
  max-width: 460px;
  margin-bottom: var(--sp-sm);
}

.waitlist-form[hidden] {
  display: none;
}

.waitlist-form input[type="email"] {
  flex: 1;
  min-width: 0;
  height: 52px;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: 0 16px;
}

.waitlist-form input[type="email"]:focus {
  outline: none;
  border-color: var(--text);
}

.waitlist-form .btn {
  height: 52px;
  flex-shrink: 0;
}

.waitlist-status,
.form-status {
  font-size: 14px;
  min-height: 20px;
  margin: 0;
}

.waitlist-status.ok,
.form-status.ok { color: var(--accent); }
.waitlist-status.err,
.form-status.err { color: var(--text-muted); }

.waitlist-success {
  align-items: flex-start;
  text-align: left;
  padding: 0;
}

.waitlist-success .checkmark {
  margin: 0 0 var(--sp-md);
}

.waitlist-count {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  margin: var(--sp-md) 0 0;
}

.honeypot-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 520px) {
  .waitlist-form { flex-direction: column; }
  .waitlist-form .btn { width: 100%; }
}

/* ---------- forms ---------- */

.field { margin-bottom: var(--sp-md); }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--sp-xs);
}
.field .hint { font-size: 13px; color: var(--text-muted); margin-top: var(--sp-xs); }

.field input, .field textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}

.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--text);
}

.field textarea { resize: vertical; min-height: 100px; }

.form-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
}

.form-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: var(--sp-md);
}

.form-card--done {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

.apply-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-lg) 0;
  animation: apply-success-in 0.45s ease forwards;
}

.apply-success[hidden] {
  display: none;
}

.apply-success-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 var(--sp-sm);
}

.apply-success-body {
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
  max-width: 28ch;
}

.checkmark {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--sp-lg);
}

.checkmark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.checkmark-circle {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: checkmark-circle 0.55s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: checkmark-check 0.35s 0.4s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

@keyframes checkmark-circle {
  to { stroke-dashoffset: 0; }
}

@keyframes checkmark-check {
  to { stroke-dashoffset: 0; }
}

@keyframes apply-success-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- copy blocks (kit page) ---------- */

.copy-block {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: var(--sp-md) var(--sp-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  margin-bottom: var(--sp-md);
}

.copy-block code {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
}

.copy-block .copy-btn {
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}
.copy-block .copy-btn:hover { border-color: var(--text); }
.copy-block .copy-btn.copied { color: var(--accent); border-color: var(--accent); }

.kit-list { padding-left: 20px; margin: 0 0 var(--sp-md); color: var(--text-muted); }
.kit-list li { margin-bottom: var(--sp-xs); line-height: 1.5; }

.rule-list { list-style: none; padding: 0; margin: 0; }
.rule-list li {
  padding: var(--sp-md) 0;
  border-bottom: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: var(--sp-md);
}
.rule-list li:last-child { border-bottom: none; }
.rule-list .rule-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 2px;
}

/* ---------- legal / terms page ---------- */

.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--sp-xxl) 22px var(--sp-xxl);
}

.legal .eyebrow { margin-bottom: var(--sp-sm); }
.legal h1 { font-size: 32px; letter-spacing: -0.5px; margin: 0 0 var(--sp-xs); }
.legal .version { color: var(--text-muted); font-size: 14px; margin-bottom: var(--sp-xl); }

.legal h2 {
  font-size: 21px;
  margin-top: var(--sp-xxl);
  margin-bottom: var(--sp-md);
  padding-top: var(--sp-lg);
  border-top: 1px solid var(--hairline);
}
.legal h2:first-of-type { border-top: none; padding-top: 0; margin-top: var(--sp-xl); }

.legal p, .legal li { font-size: 16px; line-height: 1.7; color: var(--text); }
.legal ul, .legal ol { padding-left: 22px; margin: 0 0 var(--sp-md); }
.legal li { margin-bottom: var(--sp-sm); }
.legal strong { font-weight: 600; }

.legal .callout-note {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  padding: var(--sp-md) var(--sp-lg);
  margin-bottom: var(--sp-xl);
  font-size: 15px;
  color: var(--text-muted);
}

.legal .toc {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-xl);
  columns: 2;
  column-gap: var(--sp-lg);
}
.legal .toc a {
  display: block;
  font-size: 14px;
  color: var(--text);
  padding: 4px 0;
  break-inside: avoid;
}
.legal .toc a:hover { color: var(--accent); }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr; }
  .legal .toc { columns: 1; }
}

@media (max-width: 640px) {
  .hero h1 { font-size: 32px; }
  .hero .lede { font-size: 17px; }
  h2 { font-size: 24px; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--hairline);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--sp-md) 22px var(--sp-lg);
    gap: var(--sp-md);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links .btn { width: 100%; }
  .rule-list li { grid-template-columns: 1fr; gap: var(--sp-xs); }
  .callout, .form-card, .cta-band { padding: var(--sp-lg); }
  .copy-block { flex-direction: column; align-items: flex-start; }
}
