/* ============================================================
   RUNKEEPAI — dark-cinematic tech studio
   Type: Clash Display (display) · Satoshi (body) · JetBrains Mono (telemetry)
   Brand gradient (sampled from RUNKEEPAI-BANNER.png, exact):
   #00EFF0 → #4080F0 → #8040F0 → #D000F0
   ============================================================ */

@font-face {
  font-family: 'Clash Display';
  src: url('/assets/fonts/ClashDisplay-Variable.woff2') format('woff2');
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url('/assets/fonts/Satoshi-Variable.woff2') format('woff2');
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/JetBrainsMono-Variable.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* surfaces — near-black with violet chroma, never #000 */
  --bg: oklch(14% 0.022 295);
  --bg-elevated: oklch(18% 0.025 295);
  --line: oklch(30% 0.03 295 / 0.5);
  --text: oklch(96% 0.008 280);
  --muted: oklch(70% 0.025 285);
  --faint: oklch(52% 0.03 290);
  /* brand stops — exact from the banner */
  --cyan: #00EFF0;
  --azure: #4080F0;
  --violet: #8040F0;
  --magenta: #D000F0;
  --grad: linear-gradient(118deg, var(--cyan) 0%, var(--azure) 36%, var(--violet) 66%, var(--magenta) 100%);
  /* fluid type scale (≈utopia, 360→1440) */
  --step-0: clamp(1rem, 0.96rem + 0.2vi, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.45vi, 1.5rem);
  --step-2: clamp(1.5rem, 1.32rem + 0.8vi, 2.1rem);
  --step-3: clamp(2rem, 1.6rem + 1.8vi, 3.3rem);
  --step-4: clamp(2.6rem, 1.9rem + 3.2vi, 5rem);
  --step-5: clamp(3.4rem, 2.2rem + 5.4vi, 7.4rem);
  --space: clamp(1.25rem, 4vi, 3rem);
  --pad-x: clamp(1.25rem, 5vi, 5rem);
  --radius: clamp(16px, 2vw, 26px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Satoshi', system-ui, -apple-system, sans-serif;
  font-weight: 420;
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  font-weight: 450;
}

h1, h2, h3 { font-family: 'Clash Display', 'Satoshi', sans-serif; font-weight: 560; line-height: 1.02; letter-spacing: -0.015em; }

a { color: inherit; text-decoration: none; }
::selection { background: var(--violet); color: #fff; }

.skip-link {
  position: fixed; top: -100px; left: 16px; z-index: 200;
  background: var(--bg-elevated); padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 16px; }

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

/* gradient text */
.grad-text, .wordmark em {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: normal;
}

/* ============ GRAIN ============ */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.055;
  mix-blend-mode: overlay;
}

/* ============ NAV ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--pad-x);
  transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: oklch(14% 0.022 295 / 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom-color: var(--line);
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand img { display: block; }
.wordmark { font-family: 'Clash Display', sans-serif; font-weight: 590; font-size: 1.25rem; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: clamp(1.2rem, 3vw, 2.6rem); }
.nav-links a {
  font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); transition: color 0.25s;
}
.nav-links a:hover { color: var(--text); }

/* ============ HERO ============ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px var(--pad-x) 90px;
  overflow: clip;
}
.hero-field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-glow { position: absolute; z-index: 0; pointer-events: none; filter: none; }
.hero-glow--cyan {
  top: -28%; left: -18%; width: 75vw; height: 75vw; max-width: 1000px; max-height: 1000px;
  background: radial-gradient(circle, oklch(75% 0.13 210 / 0.17) 0%, transparent 62%);
}
.hero-glow--magenta {
  bottom: -35%; right: -20%; width: 85vw; height: 85vw; max-width: 1150px; max-height: 1150px;
  background: radial-gradient(circle, oklch(55% 0.25 320 / 0.16) 0%, transparent 62%);
}
.hero-inner { position: relative; z-index: 2; max-width: 1200px; }
.eyebrow { color: var(--cyan); margin-bottom: clamp(1.2rem, 3vh, 2.2rem); }
.hero-h1 {
  font-size: var(--step-5);
  font-weight: 590;
  letter-spacing: -0.025em;
  line-height: 0.98;
  text-wrap: balance;
}
.h1-line { display: block; }
.h1-line--grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-bottom: 0.08em; /* keep descender of 'p' inside the clip box */
}
.hero-sub {
  max-width: 560px; color: var(--muted);
  margin-top: clamp(1.4rem, 3.5vh, 2.4rem);
  font-size: var(--step-1); line-height: 1.55; font-weight: 400;
}
.hero-ctas { display: flex; gap: 14px; margin-top: clamp(1.6rem, 4vh, 2.8rem); flex-wrap: wrap; }

.hero-telemetry {
  position: absolute; left: var(--pad-x); right: var(--pad-x); bottom: 26px; z-index: 2;
  display: flex; gap: clamp(1.2rem, 4vw, 3.5rem); flex-wrap: wrap;
  color: var(--faint); letter-spacing: 0.14em; font-size: 0.66rem;
}
.hero-telemetry span { display: inline-flex; align-items: center; gap: 8px; }
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan); display: inline-block;
  box-shadow: 0 0 10px var(--cyan);
  animation: pulse 2.4s ease-in-out infinite;
}
.dot--grad { background: var(--magenta); box-shadow: 0 0 8px var(--magenta); animation: none; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: 0.35 } }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.9em 1.9em; border-radius: 100px;
  font-family: 'Satoshi', sans-serif; font-weight: 560; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s, background 0.3s;
  will-change: transform;
}
.btn--grad {
  background: var(--grad); color: oklch(12% 0.02 295);
  box-shadow: 0 4px 28px oklch(60% 0.2 300 / 0.35);
}
.btn--grad:hover { box-shadow: 0 6px 40px oklch(65% 0.22 300 / 0.55); }
.btn--ghost { border-color: var(--line); color: var(--text); background: oklch(20% 0.03 295 / 0.4); }
.btn--ghost:hover { border-color: var(--violet); }
.btn--film { background: none; border: none; color: var(--muted); font-weight: 500; padding: 0.9em 0.4em; }
.btn--film:hover { color: var(--cyan); }
.btn--big { font-size: var(--step-1); padding: 1em 2.2em; }

/* ============ MARQUEE ============ */
.marquee {
  overflow: clip; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: clamp(1rem, 2.5vh, 1.8rem) 0;
  background: var(--bg-elevated);
}
.marquee-track { display: flex; width: max-content; will-change: transform; }
.marquee-set {
  display: flex; align-items: center; gap: 2.2rem; padding-right: 2.2rem;
  font-family: 'Clash Display', sans-serif; font-size: var(--step-3); font-weight: 540;
  white-space: nowrap; letter-spacing: -0.01em;
}
.marquee-set b { font-weight: 540; }
.marquee-set span {
  color: transparent;
  -webkit-text-stroke: 1px oklch(60% 0.05 290 / 0.8);
}
.marquee-set i { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ============ SECTIONS ============ */
section { padding: clamp(5rem, 12vh, 9rem) var(--pad-x); position: relative; }
.label { color: var(--faint); margin-bottom: 1.6rem; letter-spacing: 0.2em; }
.section-h { font-size: var(--step-4); margin-bottom: clamp(2.5rem, 6vh, 4.5rem); letter-spacing: -0.02em; }

/* ============ MANIFESTO ============ */
.manifesto { max-width: 1150px; }
.manifesto-line {
  font-size: var(--step-4);
  font-weight: 480;
  letter-spacing: -0.02em;
  line-height: 1.08;
}
.manifesto-line .dim { color: var(--faint); }
.manifesto-copy {
  max-width: 600px; color: var(--muted); margin-top: 2.2rem;
  font-size: var(--step-1); line-height: 1.6; font-weight: 400;
}

/* ============ BENTO ============ */
.bento {
  display: grid; gap: clamp(0.8rem, 1.5vw, 1.3rem);
  grid-template-columns: repeat(12, 1fr);
}
.tile {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 2.5vw, 2.4rem);
  position: relative; overflow: clip;
  transition: border-color 0.4s, transform 0.4s;
}
.tile:hover { border-color: oklch(55% 0.12 300 / 0.55); }
.tile h3 { font-size: var(--step-3); margin-bottom: 0.7rem; }
.tile p { color: var(--muted); font-size: 1rem; max-width: 46ch; }
.tile-kicker { font-size: 0.72rem !important; letter-spacing: 0.18em; color: var(--faint); font-family: 'JetBrains Mono', monospace !important; font-weight: 500; margin-bottom: 1.2rem !important; }
.tile--build { grid-column: span 7; }
.tile--build::after {
  content: ''; position: absolute; top: -40%; right: -25%; width: 70%; height: 120%;
  background: radial-gradient(circle, oklch(70% 0.15 210 / 0.1) 0%, transparent 65%);
  pointer-events: none;
}
.tile--run { grid-column: span 5; }
.tile--run::after {
  content: ''; position: absolute; bottom: -40%; left: -20%; width: 80%; height: 110%;
  background: radial-gradient(circle, oklch(55% 0.22 320 / 0.1) 0%, transparent 65%);
  pointer-events: none;
}
.tile--fleet { grid-column: span 4; }
.tile--ops { grid-column: span 4; }
.tile--speed { grid-column: span 4; }
.tile-list { list-style: none; margin-top: 1.4rem; display: grid; gap: 0.45rem; color: var(--muted); font-size: 0.74rem; }
.tile-list li::before { content: '— '; color: var(--violet); }
.run-stats { display: grid; gap: 0.6rem; margin-top: 1.4rem; color: var(--faint); font-size: 0.7rem; }
.run-stats b { color: var(--cyan); font-weight: 600; margin-left: 0.5em; }

.roster { width: 100%; border-collapse: collapse; font-size: 0.68rem; letter-spacing: 0.04em; }
.roster td { padding: 0.55rem 0.3rem; border-top: 1px solid var(--line); color: var(--muted); }
.roster tr:first-child td { border-top: none; }
.roster td:last-child { text-align: right; }
.t-human { color: var(--cyan); }
.t-ai { color: var(--violet); }

.sim-tag { font-size: 0.55rem; color: var(--faint); border: 1px solid var(--line); padding: 1px 6px; border-radius: 20px; margin-left: 8px; letter-spacing: 0.1em; vertical-align: middle; }
.ops-log { font-size: 0.64rem; line-height: 1.9; color: var(--muted); letter-spacing: 0.02em; min-height: 11em; }
.ops-log .t { color: var(--faint); margin-right: 0.6em; }
.ops-log .ok { color: var(--cyan); }

.speed-big {
  font-family: 'Clash Display', sans-serif; font-size: var(--step-3); font-weight: 580;
  color: var(--text) !important; line-height: 1.02; margin-bottom: 0.8rem; letter-spacing: -0.02em;
}

/* ============ WORK / CASES ============ */
.case {
  display: grid; grid-template-columns: 7fr 5fr; gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  padding: clamp(2rem, 5vh, 4rem) 0;
  border-top: 1px solid var(--line);
}
.case--flip { grid-template-columns: 5fr 7fr; }
.case--flip .case-media { order: 2; }
.case--flip .case-body { order: 1; }
.case-media {
  position: relative; border-radius: var(--radius); overflow: clip;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  aspect-ratio: 16 / 10;
}
.case-media img, .case-media video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.case-media img { transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); will-change: transform; }
.case:hover .case-media img { transform: scale(1.035); }
.case-tags { display: flex; gap: 8px; margin-bottom: 1.2rem; flex-wrap: wrap; }
.case-tags span {
  font-size: 0.62rem; letter-spacing: 0.16em; color: var(--muted);
  border: 1px solid var(--line); padding: 4px 12px; border-radius: 30px;
}
.case-body h3 { font-size: var(--step-3); }
.case-kicker { color: var(--cyan); font-size: 0.9rem; margin: 0.5rem 0 1rem; font-weight: 500; }
.case-body > p:not(.case-kicker) { color: var(--muted); }
.case-links { display: flex; gap: 10px; margin-top: 1.8rem; align-items: center; flex-wrap: wrap; }

/* ============ CONTACT ============ */
.contact { text-align: center; padding-top: clamp(7rem, 16vh, 12rem); padding-bottom: clamp(7rem, 16vh, 12rem); overflow: clip; }
.contact-glow {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 90vw; height: 90vw; max-width: 1100px; max-height: 1100px; pointer-events: none;
  background: radial-gradient(circle, oklch(50% 0.18 305 / 0.14) 0%, transparent 60%);
}
.contact .label { text-align: center; }
.contact-h { font-size: var(--step-4); margin-bottom: 2.8rem; position: relative; letter-spacing: -0.02em; }
.contact-mail { color: var(--faint); margin-top: 2rem; letter-spacing: 0.08em; font-size: 0.7rem; position: relative; }

/* ============ FOOTER ============ */
.footer { border-top: 1px solid var(--line); padding: 3rem var(--pad-x) 2rem; }
.footer-top { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.footer-links { display: flex; gap: 2rem; }
.footer-links a { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.16em; transition: color 0.25s; }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-top: 2.2rem; padding-top: 1.6rem; border-top: 1px solid var(--line);
  color: var(--faint); font-size: 0.64rem; letter-spacing: 0.1em;
}
.made-by { display: inline-flex; align-items: center; gap: 8px; }

/* ============ REVEALS (CSS scroll-driven first, JS fallback) ============ */
.reveal { opacity: 0; transform: translateY(28px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.9s cubic-bezier(0.16,1,0.3,1), transform 0.9s cubic-bezier(0.16,1,0.3,1); }

/* hero entrance initial states (JS animates in; noscript unhides) */
.h1-line, .hero-sub, .hero-ctas, .eyebrow, .hero-telemetry { opacity: 0; }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .tile--build, .tile--run { grid-column: span 12; }
  .tile--fleet, .tile--ops { grid-column: span 6; }
  .tile--speed { grid-column: span 12; }
  .case, .case--flip { grid-template-columns: 1fr; gap: 1.5rem; }
  .case--flip .case-media { order: 0; }
  .case--flip .case-body { order: 1; }
}
@media (max-width: 640px) {
  .tile--fleet, .tile--ops { grid-column: span 12; }
  .hero { padding-bottom: 110px; }
  .nav-links { gap: 1rem; }
  .hero-telemetry { gap: 1rem; font-size: 0.6rem; }
  .contact-h br { display: none; }
}

/* ============ REDUCED MOTION — hard gate ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .h1-line, .hero-sub, .hero-ctas, .eyebrow, .hero-telemetry { opacity: 1 !important; transform: none !important; }
  .hero-field { display: none; }
  html { scroll-behavior: auto; }
}
