/* ============================================================
   kylebown.uk — dark parallax single-scroll
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  /* surfaces */
  --bg:            #07070b;
  --bg-elev:       #0c0c13;
  --panel:         rgba(255, 255, 255, 0.028);
  --panel-strong:  rgba(255, 255, 255, 0.05);
  --line:          rgba(255, 255, 255, 0.08);
  --line-strong:   rgba(255, 255, 255, 0.16);

  /* ink */
  --ink:           #f4f4f8;
  --ink-soft:      #b6b6c6;
  --ink-mute:      #7b7b90;
  --ink-faint:     #4a4a5c;

  /* accents */
  --violet:        #7c5cff;
  --violet-deep:   #4f34e0;
  --cyan:          #47ebeb;
  --grad:          linear-gradient(115deg, var(--cyan) 0%, #7ea2ff 45%, var(--violet) 100%);

  /* type */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* rhythm */
  --gutter: clamp(20px, 5vw, 64px);
  --maxw: 1180px;
  --radius: 18px;
  --radius-lg: 26px;

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

/* `width`/`height` attributes reserve layout space; `height: auto` keeps the
   ratio once CSS resizes the element. Without it images render at their
   literal attribute height and stretch. */
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--violet); color: #fff; }

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 3. Page atmosphere ---------- */
/* fixed backdrop: grid + drifting glow orbs + film grain */
.atmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.atmos__grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 30%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 65% at 50% 30%, #000 20%, transparent 78%);
  will-change: transform;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}
.orb--a { width: 46vw; height: 46vw; top: -12vw; left: -10vw; background: radial-gradient(circle, rgba(124, 92, 255, 0.55), transparent 68%); }
.orb--b { width: 40vw; height: 40vw; top: 38%;  right: -14vw; background: radial-gradient(circle, rgba(71, 235, 235, 0.30), transparent 68%); }
.orb--c { width: 52vw; height: 52vw; bottom: -18vw; left: 22%; background: radial-gradient(circle, rgba(79, 52, 224, 0.42), transparent 70%); }

.atmos__noise {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-repeat: repeat;
  background-size: 200px 200px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* pointer spotlight */
.spotlight {
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  width: 620px;
  height: 620px;
  margin: -310px 0 0 -310px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.14), transparent 62%);
  transition: opacity 0.6s var(--ease);
  will-change: transform;
}
.spotlight.is-on { opacity: 1; }

/* ---------- 4. Shell ---------- */
.shell { position: relative; z-index: 2; }

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

section { position: relative; }

/* ---------- 5. Scroll progress ---------- */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  z-index: 90;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.75);
  will-change: transform;
}

/* ---------- 6. Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background 0.45s var(--ease), backdrop-filter 0.45s var(--ease),
              border-color 0.45s var(--ease), padding 0.45s var(--ease);
}
.nav.is-stuck {
  padding-block: 12px;
  background: rgba(7, 7, 11, 0.72);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom-color: var(--line);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.03em;
}
.brand span { color: var(--cyan); }

.nav__links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}
.nav__links a {
  position: relative;
  z-index: 1;
  display: block;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-mute);
  white-space: nowrap;
  transition: color 0.3s var(--ease);
}
.nav__links a:hover,
.nav__links a.is-active { color: var(--ink); }

.nav__pill {
  position: absolute;
  z-index: 0;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-strong);
  opacity: 0;
  transition: transform 0.45s var(--ease), width 0.45s var(--ease), opacity 0.3s var(--ease);
  will-change: transform, width;
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #07070b;
  background: var(--grad);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.nav__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.4);
}

@media (max-width: 880px) {
  /* The links carry the `margin-left: auto` that pushes the row right, so the
     CTA has to take it over once they are hidden. */
  .nav__links { display: none; }
  .nav__cta { margin-left: auto; }
}

/* ---------- 7. Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 150px 0 110px;
  overflow: hidden;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

.hero .wrap { position: relative; z-index: 1; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #35e08a;
  box-shadow: 0 0 0 0 rgba(53, 224, 138, 0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 9px rgba(53, 224, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(53, 224, 138, 0); }
}

.hero__title {
  margin: 28px 0 0;
  font-size: clamp(52px, 11.5vw, 158px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.045em;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero__title .line > span {
  display: block;
  transform: translateY(105%);
  animation: rise 1.05s var(--ease) forwards;
}
.hero__title .line:nth-child(2) > span { animation-delay: 0.1s; }
@keyframes rise { to { transform: translateY(0); } }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__role {
  margin-top: 26px;
  font-family: var(--mono);
  font-size: clamp(14px, 2.1vw, 19px);
  letter-spacing: 0.02em;
  color: var(--cyan);
  min-height: 1.6em;
}
.caret {
  display: inline-block;
  width: 9px;
  margin-left: 3px;
  background: var(--cyan);
  color: transparent;
  animation: blink 1.05s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

.hero__blurb {
  margin-top: 22px;
  max-width: 56ch;
  font-size: clamp(16px, 2vw, 19px);
  color: var(--ink-soft);
}
.hero__blurb strong { color: var(--ink); font-weight: 600; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
              background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn:hover { transform: translateY(-3px); }
.btn--primary {
  color: #07070b;
  background: var(--grad);
  border-color: transparent;
}
.btn--primary:hover { box-shadow: 0 14px 40px rgba(124, 92, 255, 0.42); }
.btn--ghost { background: rgba(255, 255, 255, 0.03); }
.btn--ghost:hover { border-color: var(--cyan); background: rgba(71, 235, 235, 0.07); }
.btn svg { width: 17px; height: 17px; }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.scroll-cue__rail {
  position: relative;
  width: 1px;
  height: 54px;
  overflow: hidden;
  background: linear-gradient(to bottom, var(--line-strong), transparent);
}
.scroll-cue__rail::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  height: 18px;
  background: var(--cyan);
  animation: railRun 2.1s var(--ease-io) infinite;
}
@keyframes railRun {
  0%   { transform: translateY(-20px); opacity: 0; }
  35%  { opacity: 1; }
  100% { transform: translateY(56px); opacity: 0; }
}

/* ---------- 8. Marquee ---------- */
.marquee {
  position: relative;
  border-block: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  padding: 20px 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.marquee__track {
  display: flex;
  width: max-content;
  gap: 44px;
  animation: slide 46s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(calc(-50% - 22px)); } }
.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: 44px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  white-space: nowrap;
}
.marquee__item::after {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--violet);
}

/* ---------- 9. Section furniture ---------- */
.section { padding: clamp(90px, 13vh, 160px) 0; }

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 58px;
}

.sec-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--violet);
}
.sec-tag::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--violet);
}

.sec-title {
  margin-top: 16px;
  font-size: clamp(34px, 5.6vw, 62px);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.035em;
  max-width: 20ch;
}
.sec-note {
  max-width: 42ch;
  color: var(--ink-mute);
  font-size: 16px;
}

/* ---------- 10. Reveal ---------- */
/* Scoped to `.js` (set synchronously in <head>) so that if the script never
   runs, every section stays visible instead of a blank page. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- 11. Cards (shared) ---------- */
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.card::before {
  /* per-card cursor glow, fed by --mx/--my from TS */
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%),
              rgba(124, 92, 255, 0.16), transparent 60%);
}
.card:hover { border-color: var(--line-strong); background: var(--panel-strong); }
.card:hover::before { opacity: 1; }
.card > * { position: relative; }

/* ---------- 12. About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(36px, 6vw, 84px);
  align-items: start;
}
@media (max-width: 900px) { .about__grid { grid-template-columns: 1fr; } }

.about__lede {
  font-size: clamp(20px, 2.7vw, 29px);
  line-height: 1.45;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.about__body { margin-top: 26px; color: var(--ink-soft); font-size: 17px; }
.about__body + .about__body { margin-top: 16px; }
.about__body a {
  color: var(--cyan);
  border-bottom: 1px solid rgba(71, 235, 235, 0.32);
  transition: border-color 0.3s var(--ease);
}
.about__body a:hover { border-bottom-color: var(--cyan); }

.stats { display: grid; gap: 14px; align-content: start; }
.stat { padding: 24px 26px; }
.stat__num {
  font-size: clamp(32px, 4.4vw, 46px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
/* The timestamp qualifies the figure, so it sits on the number's baseline
   rather than trailing the label underneath it. */
.stat__top {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.stat__label {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ---------- 13. Work ---------- */
.work { display: grid; gap: clamp(80px, 12vh, 150px); }

.proj {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.proj--flip .proj__media { order: -1; }
@media (max-width: 980px) {
  .proj { grid-template-columns: 1fr; gap: 34px; }
  .proj--flip .proj__media { order: 0; }
}

.proj__index {
  display: block;
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
}

.proj__name {
  font-size: clamp(28px, 4.2vw, 44px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.proj__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.proj__meta span:not(:last-child)::after { content: " /"; color: var(--ink-faint); }

.proj__copy { margin-top: 20px; color: var(--ink-soft); font-size: 16.5px; max-width: 54ch; }

.proj__points { margin-top: 22px; display: grid; gap: 11px; }
.proj__points li {
  position: relative;
  padding-left: 26px;
  font-size: 15.5px;
  color: var(--ink-soft);
}
.proj__points li::before {
  content: "";
  position: absolute;
  left: 0; top: 11px;
  width: 12px; height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

.tagset { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.tag {
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.tag:hover { color: var(--ink); border-color: var(--line-strong); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 30px;
  font-size: 15px;
  font-weight: 600;
  color: var(--cyan);
}
.link-arrow svg { width: 15px; height: 15px; transition: transform 0.35s var(--ease); }
.link-arrow:hover svg { transform: translate(4px, -4px); }

/* media panel with 3D tilt */
.proj__media { perspective: 1400px; }
.frame {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(124, 92, 255, 0.14), rgba(71, 235, 235, 0.05));
  padding: 16px;
  transform-style: preserve-3d;
  box-shadow: 0 30px 90px -40px rgba(0, 0, 0, 0.9);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
  will-change: transform;
}
.frame:hover { box-shadow: 0 40px 110px -35px rgba(124, 92, 255, 0.45); }
.frame img {
  width: 100%;
  border-radius: 14px;
  transform: translateZ(38px);
}
.frame__glare {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%),
              rgba(255, 255, 255, 0.13), transparent 55%);
}
.frame:hover .frame__glare { opacity: 1; }

.frame--plate {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 52px;
}
.frame--plate img { max-width: 70%; transform: translateZ(50px); }

/* ---------- 14. Capabilities ---------- */
.caps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.cap { padding: 32px 30px 34px; }
.cap__ico {
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(124, 92, 255, 0.1);
  color: var(--cyan);
  margin-bottom: 22px;
}
.cap__ico svg { width: 20px; height: 20px; }
.cap h3 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.cap ul { margin-top: 16px; display: grid; gap: 9px; }
.cap li {
  position: relative;
  padding-left: 18px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-mute);
}
.cap li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--violet);
}

/* ---------- 15. Stack ---------- */
.stack {
  display: grid;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
.stack__row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 26px 30px;
  background: rgba(255, 255, 255, 0.018);
  transition: background 0.35s var(--ease);
}
.stack__row:hover { background: rgba(255, 255, 255, 0.045); }
.stack__row + .stack__row { border-top: 1px solid var(--line); }
.stack__label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-top: 5px;
}
.stack__items { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.stack__items span { font-size: 15px; color: var(--ink-soft); }
.stack__items span:not(:last-child)::after {
  content: "·";
  margin-left: 10px;
  color: var(--ink-faint);
}
@media (max-width: 720px) {
  .stack__row { grid-template-columns: 1fr; gap: 12px; }
}

/* ---------- 16. Contact ---------- */
.contact { padding-bottom: clamp(70px, 10vh, 120px); }
.contact__inner {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(124, 92, 255, 0.16), transparent 62%),
    rgba(255, 255, 255, 0.02);
  padding: clamp(46px, 8vw, 96px) clamp(28px, 6vw, 76px);
  text-align: center;
  overflow: hidden;
}
.contact__title {
  font-size: clamp(36px, 7vw, 82px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.contact__sub {
  margin: 22px auto 0;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 17px;
}
.contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 40px;
}

/* ---------- 17. Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 46px;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--ink-mute);
}
.socials { display: flex; gap: 10px; }
.socials a {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink-mute);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease),
              transform 0.3s var(--ease), background 0.3s var(--ease);
}
.socials a:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-3px);
}
.socials svg { width: 18px; height: 18px; }

/* ---------- 18. Live clock + live stat ---------- */
.eyebrow__state {
  color: var(--ink-mute);
  text-transform: none;
  letter-spacing: 0.04em;
}
/* amber outside working hours, green inside */
.eyebrow[data-clock-off] .dot {
  background: #e0a935;
  box-shadow: 0 0 0 0 rgba(224, 169, 53, 0.6);
  animation: none;
}

/* The figures are hand-maintained, so this says when — never "live". A pulsing
   dot next to a number someone edits by hand would be a lie. */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: none;
  color: var(--ink-faint);
  vertical-align: middle;
  white-space: nowrap;
}
.live-pill[hidden] { display: none; }

/* ---------- 19. Architecture ---------- */
.arch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(36px, 6vw, 80px);
  align-items: start;
}
@media (max-width: 980px) {
  .arch-grid { grid-template-columns: 1fr; }
}

.arch-copy__kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}
.arch-copy__lede {
  margin-top: 16px;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.5;
  letter-spacing: -0.015em;
}

.arch-steps {
  margin-top: 30px;
  display: grid;
  gap: 22px;
  counter-reset: step;
}
.arch-steps li {
  position: relative;
  padding-left: 46px;
  counter-increment: step;
}
.arch-steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(124, 92, 255, 0.1);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
}
.arch-steps h3 {
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -0.015em;
}
.arch-steps p {
  margin-top: 6px;
  font-size: 15px;
  color: var(--ink-mute);
}

/* --- the SVG itself --- */
.arch-figure {
  position: sticky;
  top: 96px;
}
@media (max-width: 980px) {
  .arch-figure { position: static; }
}

.arch {
  width: 100%;
  height: auto;
  max-width: 560px;
  margin-inline: auto;
  overflow: visible;
  font-family: var(--mono);
}

.arch__stage {
  opacity: 0.22;
  transition: opacity 0.7s var(--ease);
}
.arch__stage.is-lit { opacity: 1; }

.arch__box {
  fill: rgba(255, 255, 255, 0.022);
  stroke: var(--line);
  stroke-width: 1;
}
.arch__label {
  fill: var(--ink);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-anchor: middle;
}
.arch__meta {
  fill: var(--ink-faint);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-anchor: middle;
}

.arch__chip {
  fill: rgba(124, 92, 255, 0.12);
  stroke: rgba(124, 92, 255, 0.34);
  stroke-width: 1;
}
.arch__chipText {
  fill: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-anchor: middle;
}

.arch__shardBox {
  fill: rgba(255, 255, 255, 0.03);
  stroke: var(--line);
}
.arch__col { fill: rgba(71, 235, 235, 0.34); }
.arch__shard:nth-child(even) .arch__col { fill: rgba(124, 92, 255, 0.42); }

.arch__flow {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
/* branch labels sit on the connector, so they need the page background behind them */
.arch__meta--branch {
  fill: var(--cyan);
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 5px;
  stroke-linejoin: round;
}
.arch__tip { fill: var(--line-strong); }

.arch__packet {
  fill: var(--cyan);
  animation: packet 2.6s var(--ease-io) infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes packet {
  0%        { transform: translateY(0);          opacity: 0; }
  12%, 78%  {                                    opacity: 1; }
  100%      { transform: translateY(var(--to));  opacity: 0; }
}

.arch__badge {
  fill: rgba(71, 235, 235, 0.1);
  stroke: rgba(71, 235, 235, 0.45);
}
.arch__badgeText {
  fill: var(--cyan);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-anchor: middle;
}

/* ---------- 20. Query simulator ---------- */
.sim {
  margin-top: clamp(56px, 8vh, 96px);
  padding: clamp(26px, 4vw, 40px);
}

.sim__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  flex-wrap: wrap;
}
.sim__title {
  margin-top: 12px;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.sim__disclaimer {
  display: flex;
  gap: 10px;
  max-width: 42ch;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-mute);
}
.sim__disclaimer svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--ink-faint);
}

.sim__modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}
.sim__mode {
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.sim__mode:hover { color: var(--ink); border-color: var(--line-strong); }
.sim__mode.is-on {
  color: #07070b;
  background: var(--cyan);
  border-color: transparent;
}

.sim__plan {
  margin-bottom: 18px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--cyan);
  border-radius: 0 10px 10px 0;
  background: rgba(0, 0, 0, 0.3);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.sim__plan[hidden] { display: none; }

.sim__form {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.sim__input {
  flex: 1 1 260px;
  min-width: 0;
  padding: 13px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  transition: border-color 0.3s var(--ease);
}
.sim__input:focus { outline: none; border-color: var(--cyan); }
.sim__input::placeholder { color: var(--ink-faint); }
.sim__go[disabled] { opacity: 0.55; pointer-events: none; }

.sim__out { margin-top: 26px; }

.sim__shards { display: grid; gap: 8px; }
.sim__shard {
  display: grid;
  grid-template-columns: 92px 1fr 62px;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-mute);
}
@media (max-width: 560px) {
  .sim__shard { grid-template-columns: 74px 1fr 52px; gap: 10px; font-size: 11.5px; }
}
.sim__shardRail {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.sim__shardFill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: var(--grad);
  transition: width var(--fill-ms, 300ms) var(--ease-io);
}
.sim__shardMs { text-align: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.sim__shard.is-done .sim__shardMs { color: var(--cyan); }

.sim__summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.sim__statNum {
  display: block;
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sim__statLabel {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ---------- 20b. Segment cache simulator ---------- */
.sim__form--stack { flex-direction: column; align-items: stretch; }

.sim__input--area {
  /* .sim__input sets `flex: 1 1 260px`; in this column-direction form that
     basis becomes a 260px HEIGHT, so it has to be reset here. */
  flex: 0 0 auto;
  width: 100%;
  border-radius: 14px;
  padding: 14px 18px;
  line-height: 1.7;
  resize: vertical;
}

.sim__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.sim__cacheState {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mute);
}

.sim__segs { display: grid; gap: 10px; }

.sim__seg {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px 62px;
  grid-template-areas:
    "text tag ms"
    "rail rail rail";
  align-items: center;
  gap: 6px 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-mute);
}
@media (min-width: 700px) {
  .sim__seg {
    grid-template-columns: minmax(0, 1fr) 160px 46px 62px;
    grid-template-areas: "text rail tag ms";
    gap: 14px;
  }
}

.sim__segText {
  grid-area: text;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-soft);
}
.sim__seg .sim__shardRail { grid-area: rail; }
.sim__segTag {
  grid-area: tag;
  padding: 2px 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}
.sim__seg .sim__shardMs { grid-area: ms; }

.sim__seg.is-hit .sim__segTag { color: #6ee7ad; border-color: rgba(53, 224, 138, 0.4); }
.sim__seg.is-hit .sim__shardFill { background: linear-gradient(90deg, #35e08a, #6ee7ad); }
.sim__seg.is-hit .sim__shardMs { color: #6ee7ad; }

.sim__seg.is-miss .sim__segTag { color: #e0a935; border-color: rgba(224, 169, 53, 0.4); }
.sim__seg.is-miss .sim__shardFill { background: linear-gradient(90deg, #e0a935, #ff7a59); }
.sim__seg.is-miss .sim__shardMs { color: #e0a935; }

/* ---------- 21. Command palette ---------- */
.nav__kbd {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink-mute);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav__kbd:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}
.nav__kbd svg { width: 15px; height: 15px; }
.nav__kbd kbd {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}
@media (max-width: 880px) {
  /* becomes the mobile menu, so it keeps the auto margin instead of the CTA */
  .nav__kbd { margin-left: auto; }
  .nav__kbd kbd { display: none; }
  .nav__cta { margin-left: 0; }
}

.palette {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: start center;
  padding: clamp(60px, 12vh, 140px) 20px 20px;
}
.palette[hidden] { display: none; }

.palette__scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 8, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.24s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } }

.palette__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(60vh, 520px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #0e0e16;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.95);
  overflow: hidden;
  animation: paletteIn 0.28s var(--ease);
}
@keyframes paletteIn {
  from { opacity: 0; transform: translateY(-14px) scale(0.985); }
}

.palette__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.palette__bar > svg { width: 17px; height: 17px; flex: none; color: var(--ink-faint); }
.palette__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
}
.palette__input:focus { outline: none; }
.palette__input::placeholder { color: var(--ink-faint); }
.palette__close {
  flex: none;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
}
.palette__close:hover { color: var(--ink); border-color: var(--line-strong); }

.palette__list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  margin: 0;
}
.palette__group {
  padding: 12px 12px 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.palette__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 15px;
  color: var(--ink-soft);
  cursor: pointer;
}
.palette__item[aria-selected="true"] {
  background: rgba(124, 92, 255, 0.16);
  color: var(--ink);
}
.palette__ico {
  flex: none;
  width: 22px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
}
.palette__item[aria-selected="true"] .palette__ico { color: var(--cyan); }
.palette__hintText { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }

.palette__empty { padding: 26px 20px 30px; text-align: center; color: var(--ink-mute); font-size: 14px; }

.palette__foot {
  display: flex;
  gap: 18px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  font-size: 11.5px;
  color: var(--ink-faint);
}
.palette__foot kbd {
  display: inline-block;
  min-width: 17px;
  margin-right: 3px;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
}
@media (max-width: 560px) {
  .palette__foot { display: none; }
  .palette__panel { max-height: 72vh; }
}

/* ---------- 22. Motion opt-out ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .hero__title .line > span { transform: none; }
  .marquee__track { animation: none; }
  .hero__canvas { display: none; }
  .scroll-cue__rail::after { display: none; }
  .arch__packet { display: none; }
  .arch__stage { opacity: 1; }
  .sim__shardFill { transition: none; }
  .palette__scrim, .palette__panel { animation: none; }
}
