/* RWF site — dark athletic. Consumes shared tokens from /design/tokens.css. */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--lime); color: #0a0b0d; }

a { color: inherit; }
img, canvas { display: block; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

section[id], header[id] { scroll-margin-top: 72px; }

/* ---------- type ---------- */
.kicker {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 18px;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -.02em;
  line-height: 1.02;
  margin-bottom: 22px;
}
.lede {
  color: var(--muted);
  max-width: 660px;
  font-size: 1.08rem;
  margin-bottom: 60px;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 11, 13, .72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700;
  letter-spacing: .06em; text-decoration: none; color: var(--text);
}
.nav-brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.nav-brand-sub { font-family: var(--font-mono); font-weight: 400; font-size: 11px; letter-spacing: .12em; color: var(--faint); text-transform: lowercase; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  transition: color var(--ease);
}
.nav-links a:hover { color: var(--lime); }
.nav-cta { padding: 7px 16px; font-size: 12px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  overflow: hidden;
}
.hero-canvas { position: absolute; inset: 0; z-index: 0; }
.hero-canvas canvas { width: 100%; height: 100%; }
.hero-scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(10,11,13,.88) 0%, rgba(10,11,13,.55) 38%, rgba(10,11,13,0) 66%);
}
.hero-inner { position: relative; z-index: 2; pointer-events: none; padding-top: 90px; padding-bottom: 90px; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  font-weight: 700; text-transform: uppercase;
  letter-spacing: -.025em; line-height: .98;
  margin: 16px 0 22px; max-width: 14ch;
}
.hero-sub { color: var(--muted); max-width: 46ch; font-size: 1.08rem; margin-bottom: 36px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-ctas a { pointer-events: auto; text-decoration: none; display: inline-block; }
.hero-rep { position: absolute; right: 34px; bottom: 30px; z-index: 2; text-align: right; pointer-events: none; }
.hero-rep-label {
  display: block; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
.hero-rep-count {
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(2.1rem, 4vw, 3rem); line-height: 1;
  color: var(--lime); text-shadow: 0 0 26px var(--lime-glow);
}
.hero-hint {
  position: absolute; left: 34px; bottom: 30px; z-index: 2; pointer-events: none;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--faint);
}

/* ---------- sections ---------- */
.section { padding: 128px 0; border-top: 1px solid var(--line); }

/* steps */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step { padding: 28px 24px; }
.step-num { font-family: var(--font-mono); font-size: 13px; font-weight: 600; letter-spacing: .18em; color: var(--lime); }
.step h3 { font-size: 1.02rem; text-transform: uppercase; letter-spacing: .03em; margin: 16px 0 10px; }
.step p { color: var(--muted); font-size: .95rem; }

/* ---------- handicap ---------- */
.handicap-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 20px; align-items: stretch; }
.h-panel { padding: 32px 30px; }
.field-label {
  display: block; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
input[type="range"] { width: 100%; accent-color: var(--lime); height: 30px; cursor: pointer; }
.tier-scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 4px; }
.tier-scale span {
  text-align: center; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
  padding: 7px 4px; border: 1px solid transparent; border-radius: var(--radius-sm);
  transition: all var(--ease);
}
.tier-scale span.active { color: var(--lime); border-color: var(--line-bright); background: var(--surface-2); }
.tier-blurb { color: var(--muted); font-size: .92rem; margin-top: 12px; min-height: 1.5em; }
input[type="number"] {
  width: 160px; background: var(--surface-2); border: 1px solid var(--line-bright);
  color: var(--text); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 1.05rem; padding: 10px 14px;
}
input[type="number"]:focus, input[type="range"]:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.score-row { display: flex; align-items: baseline; gap: 18px; margin: 30px 0 22px; }
.mult-chip {
  font-family: var(--font-mono); font-size: .95rem;
  border: 1px solid var(--line-bright); border-radius: var(--pill);
  padding: 6px 14px; color: var(--text); background: var(--surface-2);
}
.score-big {
  font-family: var(--font-mono); font-weight: 700; line-height: 1;
  font-size: clamp(2.8rem, 6vw, 4rem); color: var(--lime);
  text-shadow: 0 0 30px var(--lime-glow);
}
.score-unit { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.bar-row { display: grid; grid-template-columns: 76px 1fr 64px; align-items: center; gap: 12px; margin-bottom: 12px; }
.bar-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.bar { height: 10px; border-radius: var(--pill); background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--muted); border-radius: var(--pill); transition: width 280ms cubic-bezier(.2,.7,.2,1); }
.bar--lime i, .bar > i.bar-fill-lime { background: var(--lime); box-shadow: 0 0 12px var(--lime-glow); }
.bar-val { font-family: var(--font-mono); font-size: .9rem; color: var(--muted); text-align: right; }

.h-example { padding: 32px 30px; display: flex; flex-direction: column; }
.h-example h3 { font-size: 1.15rem; text-transform: uppercase; letter-spacing: .03em; }
.h-example-sub { color: var(--muted); font-size: .95rem; margin: 8px 0 6px; }
.duel-row { padding: 18px 0 14px; border-bottom: 1px solid var(--line); }
.duel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.duel-name { font-weight: 700; letter-spacing: .02em; }
.duel-math { font-family: var(--font-mono); font-size: .85rem; color: var(--faint); margin-bottom: 10px; }
.duel-score-line { display: grid; grid-template-columns: 1fr 64px; align-items: center; gap: 12px; }
.bar--flat i { transition: width 600ms cubic-bezier(.2,.7,.2,1); }
.duel-score { font-family: var(--font-mono); font-size: 1.3rem; color: var(--muted); text-align: right; }
.duel-score--win { color: var(--lime); font-weight: 700; }
.rwf-tag--lime { color: var(--lime); border-color: var(--lime-dim); }
.verdict { margin-top: 22px; font-weight: 700; color: var(--lime); letter-spacing: .01em; }
.footnote { margin-top: 12px; color: var(--faint); font-size: .85rem; }

/* ---------- connections ---------- */
.graph-wrap { position: relative; height: 540px; overflow: hidden; }
#graphCanvas { position: absolute; inset: 0; }
#graphCanvas canvas { width: 100%; height: 100%; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 20px; }
.legend li {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; color: var(--muted);
}
.swatch { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.swatch--ring { border: 2px solid var(--lime); background: transparent; box-shadow: 0 0 8px var(--lime-glow); }

/* ---------- verification ---------- */
.v-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.v-card { padding: 28px 26px; }
.v-card .rwf-tag { margin-bottom: 16px; }
.v-card h3 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 10px; }
.v-card p { color: var(--muted); font-size: .95rem; }
.privacy-banner {
  margin-top: 56px; padding: 34px 32px; text-align: center;
  border: 1px solid var(--lime-dim); border-radius: var(--radius);
  background: var(--lime-glow);
}
.privacy-line {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.3rem, 3vw, 1.9rem); text-transform: uppercase;
  letter-spacing: -.01em; color: var(--lime);
}
.privacy-sub { color: var(--muted); margin-top: 10px; font-size: .98rem; }

/* ---------- features ---------- */
.f-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.f-card { padding: 26px 24px; }
.f-card h3 { font-size: 1.02rem; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 10px; }
.f-card h3::before { content: ""; display: block; width: 22px; height: 2px; background: var(--lime); margin-bottom: 16px; border-radius: 2px; }
.f-card p { color: var(--muted); font-size: .95rem; }

/* ---------- roadmap ---------- */
.timeline { list-style: none; position: relative; max-width: 780px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--line-bright); }
.timeline li { position: relative; padding: 0 0 52px 46px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 5px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--faint);
}
.timeline li.now::before { border-color: var(--lime); background: var(--lime); box-shadow: 0 0 14px var(--lime); }
.phase-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.phase-when { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.timeline h3 { font-size: 1.15rem; text-transform: uppercase; letter-spacing: .02em; margin-bottom: 8px; }
.timeline p { color: var(--muted); max-width: 60ch; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 60px 0 0; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 40px 60px; justify-content: space-between; align-items: flex-start; padding-bottom: 48px; }
.footer-word { font-family: var(--font-display); font-weight: 700; font-size: 2rem; letter-spacing: .04em; }
.footer-tag { color: var(--muted); font-size: .92rem; margin-top: 6px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; font-size: .92rem; color: var(--muted); }
.footer-col a { color: var(--muted); text-decoration: none; transition: color var(--ease); }
.footer-col a:hover { color: var(--lime); }
.footer-head { font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.footer-base { border-top: 1px solid var(--line); padding: 20px 28px; }
.footer-base p { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .handicap-grid { grid-template-columns: 1fr; }
  .v-grid, .f-grid { grid-template-columns: repeat(2, 1fr); }
  .graph-wrap { height: 460px; }
}
@media (max-width: 760px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .section { padding: 92px 0; }
  .hero-rep { right: 22px; bottom: 22px; }
  .hero-hint { left: 22px; bottom: 22px; }
}
@media (max-width: 620px) {
  .steps, .v-grid, .f-grid { grid-template-columns: 1fr; }
  .graph-wrap { height: 420px; }
  .bar-row { grid-template-columns: 64px 1fr 52px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; }
  .bar i, .bar--flat i { transition: none; }
}

/* ---------- AI guide widget (launcher + chat panel) ---------- */
.guide-launcher {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid var(--lime-dim);
  background: var(--lime); color: #0a0b0d;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 26px rgba(198, 243, 46, .28);
  transition: transform var(--ease), box-shadow var(--ease);
}
.guide-launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(198, 243, 46, .38); }
.guide-launcher:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.guide-launcher .glyph { display: block; }
.guide-launcher .glyph-close { display: none; }
.guide-launcher[aria-expanded="true"] .glyph-dumbbell { display: none; }
.guide-launcher[aria-expanded="true"] .glyph-close { display: block; }

/* pulse ring — runs until first open (class .pulse removed in JS) */
.guide-launcher.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--lime);
  animation: guide-pulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes guide-pulse {
  0%   { transform: scale(1);    opacity: .85; }
  70%  { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

.guide-panel {
  position: fixed; right: 22px; bottom: 92px; z-index: 91;
  width: 360px; height: 520px; max-height: calc(100svh - 122px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 18px 54px rgba(0, 0, 0, .55);
  opacity: 0; transform: translateY(12px) scale(.98);
  visibility: hidden; pointer-events: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease), visibility 0s 200ms;
}
.guide-panel.open {
  opacity: 1; transform: none;
  visibility: visible; pointer-events: auto;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}

.guide-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.guide-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--lime); box-shadow: 0 0 9px var(--lime);
  animation: guide-blink 2.4s ease-in-out infinite;
}
@keyframes guide-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.guide-title {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--text);
}
.guide-title b { color: var(--lime); font-weight: 600; }
.guide-close {
  margin-left: auto;
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: color var(--ease), border-color var(--ease);
}
.guide-close:hover { color: var(--text); border-color: var(--line-bright); }
.guide-close:focus-visible { outline: 2px solid var(--lime); outline-offset: 1px; }

.guide-msgs {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: var(--line-bright) transparent;
}
.msg {
  max-width: 84%; padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: .92rem; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: break-word;
}
.msg--user {
  align-self: flex-end;
  background: var(--lime); color: #0a0b0d;
  border-bottom-right-radius: 4px;
}
.msg--bot {
  align-self: flex-start;
  background: var(--surface-2); border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.msg--loading { display: flex; gap: 5px; padding: 15px 13px; }
.msg--loading i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  animation: guide-bounce 1.15s ease-in-out infinite;
}
.msg--loading i:nth-child(2) { animation-delay: .15s; }
.msg--loading i:nth-child(3) { animation-delay: .3s; }
@keyframes guide-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30%           { transform: translateY(-6px); opacity: 1; }
}
.msg--error {
  align-self: stretch; max-width: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: transparent; border: 1px solid var(--coral);
  color: var(--coral); font-size: .85rem;
}
.guide-retry {
  flex: none;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--coral); background: transparent;
  border: 1px solid var(--coral); border-radius: var(--pill);
  padding: 5px 12px; cursor: pointer;
  transition: background var(--ease), color var(--ease);
}
.guide-retry:hover { background: var(--coral); color: #0a0b0d; }
.guide-retry:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }

.guide-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 12px; }
.guide-chips[hidden] { display: none; } /* .guide-chips sets display:flex — must override */
.guide-chip {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--line-bright); border-radius: var(--pill);
  padding: 7px 12px; cursor: pointer;
  transition: color var(--ease), border-color var(--ease);
}
.guide-chip:hover { color: var(--lime); border-color: var(--lime-dim); }
.guide-chip:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

.guide-form {
  display: flex; gap: 10px; padding: 12px 14px;
  border-top: 1px solid var(--line); background: var(--surface-2);
}
.guide-input {
  flex: 1; min-width: 0;
  background: var(--bg); border: 1px solid var(--line-bright);
  color: var(--text); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .92rem;
  padding: 10px 12px;
}
.guide-input::placeholder { color: var(--faint); }
.guide-input:focus { outline: 2px solid var(--lime); outline-offset: 1px; }
.guide-send {
  flex: none; width: 42px; border-radius: var(--radius-sm);
  background: var(--lime); border: none; color: #0a0b0d;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: filter var(--ease);
}
.guide-send:hover { filter: brightness(1.08); }
.guide-send:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.guide-send:disabled { opacity: .45; cursor: default; }

/* mobile: full-width bottom sheet */
@media (max-width: 620px) {
  .guide-launcher { right: 16px; bottom: 16px; }
  .guide-panel {
    left: 0; right: 0; bottom: 0; width: auto;
    height: min(78svh, 560px); max-height: none;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: none;
    transform: translateY(24px);
  }
}

/* reduced motion: no pulse ring, no bounce, no blink, no slide */
@media (prefers-reduced-motion: reduce) {
  .guide-launcher.pulse::after { animation: none; content: none; }
  .guide-dot { animation: none; }
  .msg--loading i { animation: none; opacity: .7; }
  .guide-panel { transition: none; }
  .guide-launcher, .guide-launcher:hover { transform: none; }
}

/* guide widget polish */
.msg--in { animation: guide-msg-in 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes guide-msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg--bot p { margin: 0 0 6px; }
.msg--bot p:last-child { margin-bottom: 0; }
.msg--bot code { font-family: var(--font-mono, monospace); font-size: 0.92em; background: rgba(198, 243, 46, 0.08); border: 1px solid rgba(198, 243, 46, 0.18); border-radius: 5px; padding: 0 4px; }
.guide-thinking { font-size: 11px; color: var(--muted, #9aa0a8); margin-left: 8px; letter-spacing: 0.04em; }
@media (prefers-reduced-motion: reduce) {
  .msg--in { animation: none; }
}
