/* speedrun.guru — precision timing sheet
   Design system: tokens, reset, base typography */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Tokens ---------- */
:root {
  /* Surfaces — cool off-white, deliberately not cream */
  --paper: oklch(0.982 0.003 250);
  --paper-2: oklch(0.958 0.004 250);
  --paper-3: oklch(0.938 0.005 250);

  /* Ink */
  --ink: oklch(0.24 0.014 262);
  --ink-soft: oklch(0.46 0.012 262);
  --ink-faint: oklch(0.60 0.010 262);

  /* Rules — measurement marks */
  --line: oklch(0.885 0.005 255);
  --line-strong: oklch(0.80 0.007 255);

  /* Signal accent — the against-the-clock red */
  --accent: oklch(0.605 0.216 27);
  --accent-deep: oklch(0.515 0.196 27);
  --accent-tint: oklch(0.955 0.028 30);

  /* Finish-line dark band */
  --night: oklch(0.205 0.014 264);
  --night-2: oklch(0.262 0.014 264);
  --night-line: oklch(0.36 0.012 264);
  --on-night: oklch(0.955 0.004 250);
  --on-night-soft: oklch(0.74 0.010 262);

  /* Type */
  --sans: "Archivo", ui-sans-serif, system-ui, sans-serif;
  /* display = Archivo at its expanded width (wdth 125), set via font-stretch */
  --display: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, "SFMono-Regular", monospace;

  /* Fluid type scale (~1.28 ratio) */
  --step--2: clamp(0.69rem, 0.67rem + 0.10vw, 0.75rem);
  --step--1: clamp(0.80rem, 0.77rem + 0.14vw, 0.875rem);
  --step-0:  clamp(1.02rem, 0.99rem + 0.18vw, 1.15rem);
  --step-1:  clamp(1.24rem, 1.16rem + 0.40vw, 1.5rem);
  --step-2:  clamp(1.55rem, 1.40rem + 0.75vw, 2.1rem);
  --step-3:  clamp(1.95rem, 1.66rem + 1.45vw, 3.0rem);
  --step-4:  clamp(2.05rem, 0.70rem + 5.9vw, 5.25rem);

  /* Spacing rhythm */
  --gutter: clamp(1.25rem, 0.9rem + 1.6vw, 2.25rem);
  --section-y: clamp(4.5rem, 3rem + 7vw, 9rem);
  --maxw: 78rem;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.7s;

  /* z-scale */
  --z-nav: 100;
}

/* ---------- Base ---------- */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.62;
  font-feature-settings: "kern", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 125%;
  line-height: 1.03;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: var(--ink);
}

p { text-wrap: pretty; }

::selection {
  background: var(--accent);
  color: var(--paper);
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ---------- Layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  transform: translateY(-140%);
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-size: var(--step--1);
  z-index: 1000;
  transition: transform 0.2s var(--ease-out);
}
.skip-link:focus {
  transform: translateY(0);
}

/* ---------- Reveal system (JS-enhanced, degrades to visible) ---------- */
[data-reveal] {
  transition:
    opacity var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
  transition-delay: var(--d, 0s);
}
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
}
html.js [data-reveal].in {
  opacity: 1;
  transform: none;
}

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


/* speedrun.guru — landing page sections */

/* ============ Top bar ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: color-mix(in oklch, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out);
}
.topbar[data-stuck="true"] {
  border-bottom-color: var(--line);
  background: color-mix(in oklch, var(--paper) 92%, transparent);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-weight: 600;
  font-size: var(--step--1);
  letter-spacing: 0.01em;
  color: var(--ink);
}
.brand__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent) 70%, transparent);
  animation: pulse 2.6s var(--ease-out) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent) 55%, transparent); }
  70% { box-shadow: 0 0 0 7px color-mix(in oklch, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .brand__dot { animation: none; }
}
.brand__tld { color: var(--accent); }

/* ============ Buttons ============ */
.btn {
  --btn-bg: var(--accent-deep);
  --btn-fg: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: var(--step-0);
  letter-spacing: -0.01em;
  border-radius: 6px;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out),
    background 0.25s var(--ease-out);
  box-shadow: 0 1px 2px oklch(0.2 0.08 27 / 0.18);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px oklch(0.5 0.2 27 / 0.28);
}
.btn:active {
  transform: translateY(0);
}
.btn__arrow {
  transition: transform 0.25s var(--ease-out);
}
.btn:hover .btn__arrow {
  transform: translateX(4px);
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line-strong);
  box-shadow: none;
  font-size: var(--step--1);
}
.btn--ghost:hover {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  box-shadow: none;
  transform: translateY(-2px);
  border-color: var(--ink);
}
.btn--night {
  --btn-bg: var(--accent);
  --btn-fg: oklch(0.12 0.02 27);
  font-weight: 700;
  padding: 1rem 1.6rem;
}
@media (prefers-reduced-motion: reduce) {
  .btn:hover, .btn--ghost:hover { transform: none; }
  .btn:hover .btn__arrow { transform: none; }
}

/* ============ Hero ============ */
.hero {
  position: relative;
  padding-top: clamp(3rem, 2rem + 5vw, 6rem);
  padding-bottom: var(--section-y);
  overflow: hidden;
}
/* faint timing-sheet ruling */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: 6.25rem 100%;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 12%, black 70%, transparent);
  mask-image: linear-gradient(to bottom, transparent, black 12%, black 70%, transparent);
  opacity: 0.5;
  pointer-events: none;
}
.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.5rem, 2rem + 4vw, 4.5rem);
  align-items: center;
}
.hero__copy,
.hero__panel {
  min-width: 0;
}
@media (min-width: 60rem) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }
}

.hero__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.55rem;
  font-family: var(--mono);
  font-size: var(--step--2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}
.hero__kicker > span:last-child {
  flex: 1 1 auto;
  min-width: 0;
}
.hero__kicker span:first-child {
  color: var(--accent-deep);
}
.hero h1 {
  font-size: var(--step-4);
  margin-bottom: 1.4rem;
  overflow-wrap: break-word;
}
.hero h1 .em {
  color: var(--accent-deep);
}
.hero__lede {
  max-width: 34ch;
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 2.2rem;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}
.hero__cta-note {
  font-size: var(--step--1);
  color: var(--ink-faint);
}
.hero__cta-note b {
  color: var(--ink);
  font-weight: 600;
}

/* ---- Splits panel (signature instrument) ---- */
.splits {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  box-shadow:
    0 1px 0 oklch(1 0 0 / 0.6) inset,
    0 24px 50px -30px oklch(0.3 0.03 262 / 0.45);
  overflow: hidden;
  font-family: var(--mono);
}
.splits__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.splits__title {
  font-size: var(--step--2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
}
.splits__live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--step--2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-deep);
}
.splits__live::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.4s steps(1, end) infinite;
}
@keyframes blink { 50% { opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) {
  .splits__live::before { animation: none; }
}

.splits__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line);
}
.splits__n {
  color: var(--accent-deep);
  font-weight: 600;
  font-size: var(--step--1);
}
.splits__label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.splits__label b {
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--step-0);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.splits__label small {
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.splits__time {
  font-size: var(--step--1);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.splits__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem 1.15rem;
  background: var(--paper-2);
}
.splits__foot-label {
  font-size: var(--step--2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
}
.splits__timer {
  font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.splits__timer .ms { color: var(--accent-deep); }
.splits__caption {
  margin-top: 0.85rem;
  font-family: var(--sans);
  font-size: var(--step--2);
  color: var(--ink-faint);
  text-align: right;
}

/* ============ Section shell ============ */
.section {
  padding-block: var(--section-y);
  border-top: 1px solid var(--line);
}
.section__head {
  max-width: 46rem;
  margin-bottom: clamp(2.5rem, 2rem + 2vw, 3.75rem);
}
.section__head h2 {
  font-size: var(--step-3);
  margin-bottom: 1rem;
}
.section__head p {
  font-size: var(--step-1);
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 40ch;
}

/* ============ What we do — two modes ============ */
.modes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
@media (min-width: 52rem) {
  .modes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.mode {
  padding: clamp(1.75rem, 1.3rem + 1.5vw, 2.75rem) 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.mode + .mode {
  border-top: 1px solid var(--line);
}
@media (min-width: 52rem) {
  .mode {
    padding-inline: clamp(1.75rem, 1rem + 3vw, 3.25rem);
  }
  .mode:first-child { padding-left: 0; }
  .mode:last-child { padding-right: 0; }
  .mode + .mode {
    border-top: none;
    border-left: 1px solid var(--line);
  }
}
.mode__tag {
  font-family: var(--mono);
  font-size: var(--step--2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
}
.mode h3 {
  font-family: var(--sans);
  font-stretch: 100%;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: var(--step-2);
}
.mode p {
  color: var(--ink-soft);
  max-width: 42ch;
}
.mode__meta {
  margin-top: auto;
  padding-top: 0.5rem;
  font-family: var(--mono);
  font-size: var(--step--2);
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

/* ============ The route ============ */
.route {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  counter-reset: step;
}
@media (min-width: 56rem) {
  .route { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.route__step {
  position: relative;
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem) 0 1.5rem;
}
@media (min-width: 56rem) {
  .route__step {
    padding: 2.75rem clamp(1.25rem, 0.5rem + 2vw, 2.5rem) 0;
  }
  .route__step:first-child { padding-left: 0; }
}
/* the route line */
.route__step::before {
  content: "";
  position: absolute;
  background: var(--line-strong);
}
.route__step::before {
  left: 0;
  top: 0;
  width: 100%;
  height: 2px;
}
@media (max-width: 55.99rem) {
  .route__step + .route__step { border-top: 1px solid var(--line); }
  .route__step::before { display: none; }
}
.route__marker {
  position: absolute;
  top: -6px;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--accent);
}
@media (max-width: 55.99rem) { .route__marker { display: none; } }
.route__n {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent-deep);
  margin-bottom: 0.9rem;
}
.route__step h3 {
  font-family: var(--sans);
  font-stretch: 100%;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: var(--step-2);
  margin-bottom: 0.7rem;
}
.route__step p {
  color: var(--ink-soft);
  max-width: 34ch;
}

/* ============ Why us — stance ============ */
.stance {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 48rem) {
  .stance { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.stance__item {
  padding: clamp(1.5rem, 1.1rem + 1.5vw, 2.4rem) 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
}
@media (min-width: 48rem) {
  .stance__item {
    padding-inline: clamp(1.5rem, 0.5rem + 3vw, 3rem);
  }
  .stance__item:nth-child(odd) { padding-left: 0; border-right: 1px solid var(--line); }
  .stance__item:nth-child(even) { padding-right: 0; }
  .stance__item--wide {
    grid-column: 1 / -1;
    padding-inline: 0;
  }
  .stance__item--wide:nth-child(odd) {
    border-right: none;
  }
}
.stance__item--wide .stance__body span {
  display: block;
  max-width: 62ch;
}
.stance__tick {
  flex: none;
  margin-top: 0.5rem;
  width: 1.4rem;
  height: 1.4rem;
  color: var(--accent-deep);
}
.stance__body strong {
  display: block;
  font-family: var(--sans);
  font-size: var(--step-1);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 0.4rem;
  line-height: 1.25;
}
.stance__body span {
  color: var(--ink-soft);
  font-size: var(--step-0);
}

/* ============ Finish line CTA ============ */
.finish {
  position: relative;
  background: var(--night);
  color: var(--on-night);
  overflow: hidden;
}
/* checkered finish strip */
.finish__flag {
  height: 14px;
  background-image:
    linear-gradient(45deg, var(--night-2) 25%, transparent 25%),
    linear-gradient(-45deg, var(--night-2) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--night-2) 75%),
    linear-gradient(-45deg, transparent 75%, var(--night-2) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  border-bottom: 1px solid var(--night-line);
  opacity: 0.9;
}
.finish__inner {
  padding-block: clamp(4.5rem, 3rem + 7vw, 8rem);
  display: grid;
  gap: 2.2rem;
  justify-items: start;
}
.finish__inner h2 {
  color: var(--on-night);
  font-size: var(--step-3);
  max-width: 18ch;
}
.finish__inner h2 .em { color: var(--accent); }
.finish__lede {
  color: var(--on-night-soft);
  font-size: var(--step-1);
  line-height: 1.5;
  max-width: 44ch;
}
.finish__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
}
.finish__addr {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--on-night-soft);
  letter-spacing: 0.01em;
}
.finish__addr b { color: var(--on-night); font-weight: 500; }
.finish::after {
  content: "";
  position: absolute;
  right: -12%;
  top: 50%;
  width: 42rem;
  height: 42rem;
  transform: translateY(-50%);
  background: radial-gradient(closest-side, color-mix(in oklch, var(--accent) 22%, transparent), transparent);
  pointer-events: none;
  opacity: 0.55;
}

/* ============ Footer ============ */
.foot {
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
}
.foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: var(--step--2);
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}
.foot__addr {
  color: var(--ink-soft);
}

/* stagger helper for hero load */
html.js .hero [data-reveal] { --dur: 0.85s; }
