:root {
  --bg: #07111e;
  --bg-strong: #081424;
  --panel: rgba(7, 17, 30, 0.7);
  --panel-strong: rgba(10, 22, 39, 0.9);
  --panel-edge: rgba(203, 226, 255, 0.14);
  --copy: #eef5ff;
  --copy-dim: #b5c6de;
  --line: rgba(171, 196, 226, 0.15);
  --warm: oklch(71% 0.21 28);
  --cool: oklch(76% 0.17 230);
  --lime: oklch(84% 0.19 128);
  --live-color: oklch(62.8% 0.258 29.23);
  --live-color-soft: oklch(86% 0.12 28 / 0.3);
  --live-glass: color-mix(in oklch, var(--live-color), white 52%);
  --shadow: 0 32px 110px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 119, 90, 0.2), transparent 22%),
    radial-gradient(circle at 84% 14%, rgba(86, 162, 255, 0.18), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(111, 255, 175, 0.08), transparent 28%),
    linear-gradient(180deg, #07111e 0%, #091424 46%, #07111e 100%);
  color: var(--copy);
  font-family: 'Sora', system-ui, sans-serif;
}

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

img {
  max-width: 100%;
}

code,
pre,
input {
  font-family: 'IBM Plex Mono', monospace;
}

.page-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 88%);
  opacity: 0.34;
  z-index: 0;
}

.ambient-grid,
.ambient-orbits {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.ambient-grid {
  opacity: 0.24;
  background:
    linear-gradient(rgba(150, 182, 224, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 182, 224, 0.06) 1px, transparent 1px);
  background-size: 110px 110px;
  mask-image: radial-gradient(circle at 50% 24%, black, transparent 74%);
}

.ambient-orbit {
  position: absolute;
  border: 1px solid rgba(225, 236, 255, 0.12);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), transparent 68%),
    color-mix(in oklch, var(--swatch), transparent 84%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 40px rgba(0, 0, 0, 0.18);
  animation: ambientDrift var(--dur, 18s) ease-in-out infinite;
}

.ambient-orbit-warm {
  --swatch: var(--warm);
  --dur: 22s;
  top: 9rem;
  left: -2rem;
  width: 11rem;
  height: 11rem;
}

.ambient-orbit-cool {
  --swatch: var(--cool);
  --dur: 26s;
  top: 22rem;
  right: 6vw;
  width: 7rem;
  height: 14rem;
  border-radius: 3rem;
}

.ambient-orbit-lime {
  --swatch: var(--lime);
  --dur: 28s;
  right: 12vw;
  bottom: 5rem;
  width: 9rem;
  height: 9rem;
}

.spotlight {
  position: fixed;
  border-radius: 999px;
  opacity: 0.42;
  pointer-events: none;
  z-index: 0;
  animation: ambientShift 24s ease-in-out infinite;
}

.spotlight-warm {
  top: 5rem;
  left: -6rem;
  width: 24rem;
  height: 24rem;
  background: radial-gradient(circle, color-mix(in oklch, var(--warm), transparent 58%) 0%, transparent 68%);
}

.spotlight-cool {
  right: -8rem;
  top: 10rem;
  width: 30rem;
  height: 30rem;
  background: radial-gradient(circle, color-mix(in oklch, var(--cool), transparent 62%) 0%, transparent 70%);
  animation-delay: -10s;
}

.token-cloud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
  z-index: 0;
}

.token-cloud span {
  position: absolute;
  color: rgba(195, 212, 235, 0.09);
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(0.82rem, 1.3vw, 1.06rem);
  letter-spacing: 0.02em;
  white-space: nowrap;
  user-select: none;
  transform: translate3d(0, 0, 0) rotate(var(--rotate, 0deg));
  animation: cloudFloat var(--dur, 13s) ease-in-out infinite var(--delay, 0s);
}

.topbar,
.page,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem clamp(1.2rem, 3vw, 2.8rem);
  backdrop-filter: blur(14px) saturate(120%);
  background: rgba(7, 17, 30, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.brand img {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
}

.brand span {
  display: grid;
  gap: 0.05rem;
}

.brand strong {
  font-size: 0.98rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand small {
  color: var(--copy-dim);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  color: var(--copy-dim);
  font-size: 0.95rem;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--copy);
}

.page {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding-bottom: 6rem;
}

.hero,
.section {
  position: relative;
  scroll-margin-top: 6rem;
}

.hero > *, .ship-grid > *, .playground-grid > * { min-width: 0; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.95fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  min-height: calc(100vh - 5rem);
  padding: 3.4rem 0 2rem;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: #9db4d5;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero h1,
.section h2 {
  margin: 0;
  letter-spacing: -0.05em;
  line-height: 0.96;
}

.hero h1 {
  max-width: 11ch;
  font-size: clamp(3rem, 8vw, 6.6rem);
}

.section h2 {
  font-size: clamp(2.15rem, 5vw, 4rem);
}

.lede,
.section-heading p,
.engine-card p,
.compatibility-card span,
.feature-card p,
.command-panel p,
.tip-card p {
  color: var(--copy-dim);
  line-height: 1.72;
}

.lede {
  max-width: 62ch;
  font-size: 1.08rem;
}

.cta-row,
.pill-row,
.preset-row,
.compatibility-grid,
.feature-grid,
.engine-grid,
.ship-grid,
.comparison-grid,
.format-grid,
.hero-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.9rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus-visible,
.preset-row button:hover,
.preset-row button:focus-visible {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(120deg, color-mix(in oklch, var(--warm), white 8%), color-mix(in oklch, var(--cool), white 8%));
  color: #07111e;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
}

.pill-row {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
}

.pill-row li,
.hero-chip {
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--copy-dim);
  font-size: 0.92rem;
}

.hero-stage {
  position: relative;
  min-height: 42rem;
  display: grid;
  align-items: center;
}

.hero-orb {
  position: absolute;
  inset: 2rem 3rem auto auto;
  width: min(30rem, 78vw);
  aspect-ratio: 1;
  border-radius: 46% 54% 60% 40% / 45% 40% 60% 55%;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.28), transparent 18%),
    radial-gradient(circle at 70% 22%, rgba(255, 255, 255, 0.12), transparent 16%),
    radial-gradient(circle at 50% 56%, color-mix(in oklch, var(--live-color), white 12%), color-mix(in oklch, var(--live-color), black 14%));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 48px 120px color-mix(in srgb, var(--live-color), transparent 76%);
  animation: drift 14s ease-in-out infinite;
  transition: background 220ms ease, box-shadow 220ms ease;
}

.hero-window,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.7rem;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(120%);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 220ms ease;
  contain: paint;
}

.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in oklch, var(--live-glass), transparent 88%), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 38%);
  opacity: 0.95;
}

.panel > * {
  position: relative;
  z-index: 1;
}

.panel:hover,
.panel:focus-within {
  transform: translateY(-2px);
  border-color: var(--panel-edge);
  box-shadow: 0 36px 120px rgba(0, 0, 0, 0.42);
}

.hero-window {
  position: relative;
  z-index: 2;
  width: min(31rem, 100%);
  overflow: hidden;
}

.window-bar {
  display: flex;
  gap: 0.45rem;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.window-bar span {
  width: 0.76rem;
  height: 0.76rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.window-content {
  padding: 1.2rem 1.2rem 1.4rem;
}

.panel-kicker,
.preview-topline p,
.format-card span,
.code-block p {
  margin: 0;
  color: #97a8c4;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.window-content pre,
.command-panel pre,
.code-block pre {
  overflow: auto;
  padding: 1rem 1.05rem;
  border-radius: 1rem;
  background: var(--panel-strong);
  color: #ccffde;
  line-height: 1.7;
}

.hero-chip-row {
  margin-top: 0.9rem;
}

.hero-marquee {
  display: flex;
  margin-top: 1.8rem;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}

.hero-marquee-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  animation: marquee 28s linear infinite;
}

.hero-marquee span {
  flex: 0 0 auto;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(224, 236, 255, 0.78);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
}

.hero-swatch-stack {
  position: absolute;
  right: 0;
  bottom: 3rem;
  display: grid;
  gap: 0.8rem;
  z-index: 1;
}

.mini-swatch {
  width: 9rem;
  height: 3.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--swatch);
  transform: rotate(var(--tilt, 0deg));
  animation: floatSwatch var(--dur, 10s) ease-in-out infinite;
}

.mini-swatch:nth-child(1) { --tilt: -7deg; }
.mini-swatch:nth-child(2) { --tilt: 5deg; }
.mini-swatch:nth-child(3) { --tilt: -3deg; }
.mini-swatch:nth-child(1) { --dur: 8.8s; }
.mini-swatch:nth-child(2) { --dur: 10.4s; }
.mini-swatch:nth-child(3) { --dur: 9.6s; }

.hero-logo {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: grid;
  place-items: center;
  width: 12.4rem;
  aspect-ratio: 1;
  border-radius: 2rem;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 70%),
    rgba(8, 19, 34, 0.74);
}

.hero-logo::after,
.hero-window::after,
.preview-stage::after {
  content: '';
  position: absolute;
  inset: -30%;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.22), transparent 62%);
  transform: translateX(-80%) rotate(10deg);
  animation: shimmer 8s ease-in-out infinite;
}

.hero-logo img {
  position: relative;
  z-index: 1;
  width: 9rem;
  height: 9rem;
}

.hero-beam {
  position: absolute;
  inset: auto;
  width: 22rem;
  height: 4.5rem;
  border-radius: 999px;
  filter: blur(12px);
  opacity: 0.32;
  mix-blend-mode: screen;
  animation: beamPulse 7s ease-in-out infinite;
}

.hero-beam-one {
  top: 3rem;
  right: 2rem;
  background: linear-gradient(90deg, transparent, rgba(255, 125, 89, 0.9), transparent);
}

.hero-beam-two {
  bottom: 7rem;
  right: 7rem;
  background: linear-gradient(90deg, transparent, rgba(86, 174, 255, 0.85), transparent);
  animation-delay: -3.1s;
}

.section {
  padding: 3rem 0;
}

.section-heading {
  max-width: 58rem;
  margin-bottom: 1.6rem;
}

.color-anatomy { padding: clamp(1rem, 3vw, 2rem); margin-bottom: 1rem; }
.formula { display: flex; flex-wrap: wrap; align-items: start; gap: clamp(0.7rem, 2vw, 1.7rem); padding: 1.5rem 0 2rem; }
.formula code { font-size: clamp(1.05rem, 3vw, 2rem); color: #d4f7ec; }
.formula > div { display: grid; gap: 0.5rem; }
.formula span, .ramp-labels { font-size: 0.8rem; color: var(--copy-dim); }
.channel-lessons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.channel-lessons h3 { font-size: 1rem; margin: 0; }
.channel-lessons h3 b { display: inline-grid; place-items: center; width: 2rem; height: 2rem; margin-right: 0.35rem; border: 1px solid var(--line); border-radius: 0.6rem; color: #d4f7ec; }
.channel-lessons p, .lesson-note, .gamut-note { color: var(--copy-dim); line-height: 1.7; font-size: 0.92rem; }
.channel-ramp { height: 3.5rem; border-radius: 0.75rem; border: 1px solid var(--line); }
.ramp-labels { display: flex; justify-content: space-between; margin-top: 0.5rem; }
.lesson-note a, .command-panel p a { text-decoration: underline; text-underline-offset: 3px; }
.gamut-note { border-left: 2px solid #b4ddc9; padding-left: 0.8rem; }
@media (max-width: 760px) { .channel-lessons { grid-template-columns: 1fr; } }

.playground-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: 1rem;
}

.preview-panel,
.controls-panel,
.ladder-panel,
.engine-card,
.feature-card,
.compatibility-card,
.command-panel {
  padding: 1.25rem;
}

.preview-topline {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.preview-dot {
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 999px;
  background: var(--live-color);
  box-shadow: 0 0 18px color-mix(in srgb, var(--live-color), transparent 50%);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 18rem;
  margin: 1rem 0 1.2rem;
  padding: 1.2rem;
  border-radius: 1.5rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.18), transparent 22%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 70%);
}

.preview-surface {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 60%),
    radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.15), transparent 14%),
    var(--live-color);
  transition: background 180ms ease;
}

.preview-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.35rem;
  width: min(18rem, 100%);
  padding: 1rem 1.1rem;
  border-radius: 1.2rem;
  background: rgba(7, 17, 30, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px) saturate(118%);
}

.preview-card strong {
  font-size: 1.2rem;
}

.preview-card span {
  color: rgba(255, 255, 255, 0.82);
  font-family: 'IBM Plex Mono', monospace;
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.format-card {
  padding: 0.95rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.format-card code {
  display: block;
  margin-top: 0.45rem;
  color: var(--copy);
  line-height: 1.6;
  word-break: break-word;
}

.code-block {
  margin-top: 1rem;
}

.preset-row {
  margin-bottom: 1rem;
}

.preset-row button {
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--copy);
  font: inherit;
  cursor: pointer;
}

.preset-row button.is-active {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.11);
}

.control {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.control span {
  color: var(--copy-dim);
  font-size: 0.96rem;
}

.control strong {
  font-family: 'IBM Plex Mono', monospace;
}

.control input[type='range'] {
  width: 100%;
  accent-color: color-mix(in oklch, var(--live-color), white 10%);
}

.tip-card {
  margin-top: 1.2rem;
  padding: 1rem;
  border-radius: 1.2rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 90%),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.comparison-grid,
.engine-grid,
.ship-grid,
.compatibility-grid,
.feature-grid {
  display: grid;
}

.equivalent-row {
  display: grid;
  grid-template-columns: minmax(0, 0.55fr) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
  padding: 1.2rem 1.25rem;
}

.equivalent-row h3 {
  margin: 0.35rem 0 0;
}

.equivalent-codes {
  display: grid;
  gap: 0.75rem;
}

.equivalent-codes code {
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: var(--copy);
  line-height: 1.5;
}

.comparison-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.ladder-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.ladder-heading p {
  margin: 0;
  color: var(--copy-dim);
}

.ladder-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.ladder-swatch {
  display: grid;
  gap: 0.4rem;
}

.ladder-swatch span {
  display: block;
  height: 6rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--swatch);
}

.ladder-swatch code {
  color: var(--copy-dim);
  font-size: 0.8rem;
}

.feature-grid,
.engine-grid,
.compatibility-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.ship-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.feature-card h3,
.engine-card h3,
.command-panel h3,
.ladder-panel h3 {
  margin-top: 0;
}

.compatibility-card strong {
  display: block;
  margin-bottom: 0.45rem;
}

.spectrum-ribbon {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 1rem;
}

.spectrum-ribbon span {
  height: 4.5rem;
  border-radius: 1.1rem;
  background: var(--swatch);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: floatSwatch 9.8s ease-in-out infinite;
}

.spectrum-ribbon span:nth-child(2) { animation-delay: -0.8s; }
.spectrum-ribbon span:nth-child(3) { animation-delay: -1.6s; }
.spectrum-ribbon span:nth-child(4) { animation-delay: -2.4s; }
.spectrum-ribbon span:nth-child(5) { animation-delay: -3.2s; }
.spectrum-ribbon span:nth-child(6) { animation-delay: -4s; }

.footer {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 3rem;
  color: var(--copy-dim);
  font-size: 0.96rem;
}

.footer a {
  color: #d7e7ff;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-note {
  margin: 0.45rem 0 0;
}

@keyframes drift {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-18px) rotate(3deg);
  }
}

@keyframes ambientShift {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(1.5rem, -1rem, 0) scale(1.05);
  }
}

@keyframes ambientDrift {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(0.8rem, -0.9rem, 0) rotate(4deg);
  }
}

@keyframes shimmer {
  0%, 12% {
    transform: translateX(-90%) rotate(10deg);
  }
  28%, 100% {
    transform: translateX(100%) rotate(10deg);
  }
}

@keyframes beamPulse {
  0%, 100% {
    opacity: 0.22;
    transform: scaleX(0.92);
  }
  50% {
    opacity: 0.42;
    transform: scaleX(1.05);
  }
}

@keyframes marquee {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes floatSwatch {
  0%, 100% {
    transform: translateY(0) rotate(var(--tilt, 0deg));
  }
  50% {
    transform: translateY(-8px) rotate(calc(var(--tilt, 0deg) + 2deg));
  }
}

@keyframes cloudFloat {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(var(--rotate, 0deg));
  }
  50% {
    transform: translate3d(0, -8px, 0) rotate(var(--rotate, 0deg));
  }
}

@media (max-width: 1080px) {
  .hero,
  .playground-grid,
  .comparison-grid,
  .ship-grid,
  .equivalent-row,
  .feature-grid,
  .engine-grid,
  .compatibility-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 2.2rem;
  }

  .hero h1 {
    max-width: 100%;
  }

  .hero-stage {
    min-height: 32rem;
    overflow: clip;
  }

  .hero-logo {
    left: auto;
    right: 0;
  }

  .ambient-orbit-cool {
    right: 1rem;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    flex-direction: column;
    align-items: flex-start;
  }

  .page {
    width: min(100% - 1.15rem, 1200px);
  }

  .format-grid,
  .ladder-row,
  .spectrum-ribbon {
    grid-template-columns: 1fr;
  }

  .hero-orb {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .hero-window {
    width: 100%;
  }

  .hero-swatch-stack {
    position: static;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 1rem;
  }

  .hero-logo {
    position: static;
    width: 100%;
    margin-top: 1rem;
  }

  .mini-swatch {
    width: 100%;
  }

  .hero-marquee span {
    font-size: 0.76rem;
  }

  .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .spotlight,
  .ambient-orbit-cool,
  .token-cloud {
    display: none;
  }

  .panel,
  .topbar,
  .preview-card {
    backdrop-filter: blur(10px);
  }
}

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

  .hero-orb,
  .hero-beam,
  .mini-swatch,
  .token-cloud span,
  .hero-marquee-track,
  .ambient-orbit,
  .spotlight,
  .button,
  .preset-row button {
    animation: none;
    transition: none;
  }

  .panel,
  .topbar,
  .preview-card {
    backdrop-filter: none;
  }
}
:root { scroll-padding-top: 6rem; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 100; background: #fff; color: #111; padding: 12px 20px; border-radius: 10px; }
.skip-link:focus { top: 12px; }
.color-anatomy summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.color-anatomy[open] summary { margin-bottom: 22px; }
.format-card { position: relative; min-width: 0; }
.format-card input { width: 100%; min-width: 0; margin-top: 10px; padding: 12px 10px; border: 1px solid #485265; border-radius: 8px; background: #0a101b; color: #f5f7ff; font: 12px/1.6 'IBM Plex Mono', monospace; }
.format-card input:focus-visible { outline: 2px solid #79e4cc; outline-offset: 2px; }
.format-card input[aria-invalid=true] { border-color: #ff818a; }
.format-card button { position: absolute; right: 14px; top: 10px; background: transparent; color: #bceee1; border: 1px solid #465064; border-radius: 6px; padding: 3px 8px; cursor: pointer; font-size: 11px; }
.converter-status { color: #b5c2d7; min-height: 3em; font-size: 13px; line-height: 1.7; }
.lightness-explorer { padding: clamp(18px, 4vw, 44px); }
.lab-control { display: grid; gap: 15px; }
.lab-control label { display: flex; justify-content: space-between; align-items: center; }
.lab-control output { color: #95f4d9; font: 600 30px 'IBM Plex Mono', monospace; }
.lab-control input { width: 100%; accent-color: #96ebd5; cursor: ew-resize; }
.lab-control p, .experiment-note { color: #adbcd2; font-size: 13px; line-height: 1.8; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 20px; font: 12px 'IBM Plex Mono', monospace; margin-top: 28px; }
.red { color: #ff7b87; } .green { color: #80efb2; } .blue { color: #83b2ff; }
.rgb-chart { display: block; width: 100%; max-height: 430px; overflow: visible; }
.rgb-chart text { fill: #a5b4cb; font: 11px 'IBM Plex Mono', monospace; }
.chart-grid { fill: none; stroke: #687892; stroke-opacity: .25; }
[data-rgb-curve] { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
[data-rgb-curve=red] { stroke: #ff7b87; } [data-rgb-curve=green] { stroke: #80efb2; } [data-rgb-curve=blue] { stroke: #83b2ff; }
[data-channel-point=red] { fill: #ff7b87; } [data-channel-point=green] { fill: #80efb2; } [data-channel-point=blue] { fill: #83b2ff; }
[data-chart-cursor] { stroke: #ecf3ff; stroke-dasharray: 3 4; opacity: .6; }
.experiment-ramp { height: 30px; border-radius: 8px; margin: 0 0 24px; }
.channel-readouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.channel-readout { padding: 16px; background: #090f1b; border: 1px solid #313e51; border-radius: 10px; font: 13px 'IBM Plex Mono', monospace; }
.table-scroll { overflow-x: auto; margin-top: 26px; }
.conversion-table { width: 100%; border-collapse: collapse; font: 12px/1.8 'IBM Plex Mono', monospace; text-align: left; }
.conversion-table caption { text-align: left; color: #c7d3e5; margin-bottom: 14px; }
.conversion-table th, .conversion-table td { padding: 10px 12px; border-bottom: 1px solid #2a3444; white-space: nowrap; }
.conversion-table th { color: #99e4d0; font-weight: 500; }
@media (max-width: 620px) { .channel-readouts { grid-template-columns: 1fr; } .channel-readout { padding: 10px 14px; } .format-grid { grid-template-columns: 1fr; } }
.gamut-window { grid-column: 1 / -1; padding: 20px; background: #090f1b; border: 1px solid #39465c; border-radius: 18px; min-width: 0; }
.gamut-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.gamut-heading h3 { margin: 0; font-size: 17px; }
.gamut-heading span, .map-axis, .map-key { font: 11px 'IBM Plex Mono', monospace; color: #b8c8df; }
.gamut-window p { font-size: 12px; line-height: 1.7; color: #b1c0d5; }
.gamut-map { position: relative; aspect-ratio: 256 / 176; cursor: crosshair; touch-action: none; border: 1px solid #4b5870; border-radius: 8px; }
.gamut-map:focus-visible { outline: 3px solid #9defd8; outline-offset: 4px; }
.gamut-map canvas, .gamut-map svg { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 8px; }
.gamut-map svg { overflow: visible; pointer-events: none; }
[data-map-boundary] { stroke: #fff; stroke-width: .65; fill: none; opacity: .75; }
[data-map-guide] { stroke: #fff; stroke-width: .8; stroke-dasharray: 2 2; }
[data-map-marker] { stroke: #fff; stroke-width: 1.6; fill: #0b162c; filter: drop-shadow(0 0 1px #000); }
[data-map-fallback] { stroke: #0b162c; stroke-width: 1; fill: #fff; }
.map-light, .map-dark { position: absolute; right: 8px; font: 10px 'IBM Plex Mono', monospace; padding: 3px 5px; border-radius: 4px; color: #dce7fa; background: #101a2be0; pointer-events: none; }
.map-light { top: 8px; } .map-dark { bottom: 8px; }
.map-axis, .map-key { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.map-key { padding-top: 12px; border-top: 1px solid #2c384a; }
.map-status { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.map-status output { font: 11px/1.7 'IBM Plex Mono', monospace; flex: 1; min-width: 160px; color: #cceede; }
.map-status button { border: 1px solid #7cbfab; border-radius: 8px; padding: 8px 12px; background: #183a32; color: #d6ffed; cursor: pointer; }
.map-status button:disabled { opacity: .4; cursor: default; }
.lightness-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; margin: 28px 0; }
.lightness-pair article { display: flex; align-items: center; gap: 18px; padding: 16px; border: 1px solid #46536a; border-radius: 16px; background: #0d1829; min-width: 0; }
.compare-color { width: 88px; height: 88px; border-radius: 12px; flex-shrink: 0; border: 1px solid #ffffff30; }
.lightness-pair article > div:last-child { display: grid; gap: 7px; }
.lightness-pair span { color: #b5c6dd; font-size: 12px; }
.lightness-pair strong { font: 24px 'IBM Plex Mono', monospace; }
.lightness-pair code { color: #c8d5e9; font-size: 12px; }
.lightness-pair .compare-arrow { font-size: 28px; }
.chart-takeaway { font-size: clamp(17px, 2.3vw, 24px); line-height: 1.5; max-width: 800px; color: #e1f3ee; }
.chart-instructions { color: #b4c3d9; font-size: 13px; line-height: 1.7; }
.rgb-chart { touch-action: pan-y; cursor: crosshair; }
.channel-readout { display: grid; gap: 12px; }
.channel-readout strong { font-size: 25px; font-weight: 500; }
@media (max-width: 760px) { .lightness-pair { grid-template-columns: 1fr; gap: 10px; } .lightness-pair .compare-arrow { text-align: center; transform: rotate(90deg); } .compare-color { width: 64px; height: 64px; } .gamut-window { padding: 14px; } }
.preview-panel .preview-stage { min-height: 150px; height: 150px; }
/* The editor is a quiet, direct-manipulation workbench. No animated paint lag. */
:root { scroll-behavior: auto; }
.playground-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
.preview-panel, .controls-panel, .preview-card { backdrop-filter: none; }
.preview-surface, .preview-dot { transition: none; }
.preview-card { background: #0b1529e8; }
.visual-tools { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 14px; align-items: start; }
.wheel-window { min-width: 0; padding: 14px; border: 1px solid #39465c; border-radius: 18px; background: #090f1b; }
.wheel-window h3 { margin: 0; font-size: 17px; }
.wheel-window p { font-size: 12px; line-height: 1.6; color: #b1c0d5; }
.hue-wheel { position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; cursor: crosshair; touch-action: none; user-select: none; }
.hue-wheel:focus-visible { outline: 3px solid #9defd8; outline-offset: 5px; }
.gamut-map[aria-busy=true] canvas, .gamut-map[aria-busy=true] [data-map-boundary] { opacity: .4; }
#playground .section-heading h2 { font-size: clamp(28px, 3vw, 40px); }
#playground .section-heading { margin-bottom: 20px; }
.color-anatomy { padding: 14px 20px; }
.wheel-center { position: absolute; inset: 18%; border-radius: 50%; background: #0a1323; display: grid; place-content: center; gap: 8px; pointer-events: none; text-align: center; }
.wheel-center span { width: 40px; height: 40px; margin: auto; border-radius: 50%; border: 1px solid #ffffff80; }
.wheel-center strong { font: 13px 'IBM Plex Mono', monospace; }
.wheel-marker { position: absolute; width: 16px; height: 16px; border: 3px solid white; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px #101726; pointer-events: none; }
.mini-rgb { display: grid; gap: 8px; font: 12px 'IBM Plex Mono', monospace; }
.mini-rgb > div { display: grid; grid-template-columns: 12px 1fr 28px; gap: 8px; align-items: center; }
.mini-track { background: #283346; height: 6px; border-radius: 4px; overflow: hidden; }
.mini-track i { display: block; height: 100%; background: currentColor; transform-origin: left; }
.visual-tools .gamut-window { grid-column: auto; padding: 14px; }
.controls-panel .control { grid-template-columns: 1fr auto; gap: 6px; margin-top: 12px; }
.control input { grid-column: 1 / -1; touch-action: pan-y; min-height: 28px; }
.controls-panel .format-grid { gap: 8px; margin-top: 18px; }
.format-card { padding: 10px; border-radius: 10px; }
.format-card input { padding: 8px 6px; font-size: 11px; }
.converter-status { min-height: 0; }
.controls-panel .tip-card, .controls-panel .code-block { display: none; }
.rgb-chart { max-height: none; height: auto; aspect-ratio: 600 / 270; touch-action: none; }
.hero-orb, .hero-beam, .mini-swatch, .token-cloud span, .hero-marquee-track, .ambient-orbit, .spotlight { animation: none; }
@media (max-width: 1100px) { .playground-grid { grid-template-columns: 1fr; } }
@media (max-width: 460px) { .visual-tools { grid-template-columns: 1fr; } .hue-wheel { max-width: 200px; margin: 14px auto; } }

/* One opaque header layer, predictable anchor landings, no scroll hijacking. */
:root { --header-height: 76px; scroll-padding-top: calc(var(--header-height) + 16px); }
.hero, .section { scroll-margin-top: 0; }
.topbar { position: sticky; top: 0; z-index: 30; isolation: isolate; background: #091424; backdrop-filter: none; flex-direction: row; padding: 10px max(16px, calc((100vw - 1200px) / 2)); gap: 12px; }
.brand { flex-shrink: 0; }
.nav { align-items: center; flex-wrap: nowrap; gap: 6px; font-size: 13px; }
.nav > a, .nav-more summary { display: block; padding: 12px; min-height: 44px; white-space: nowrap; border-radius: 8px; }
.nav > a:hover, .nav-more summary:hover { background: #203149; }
.nav a:focus-visible, .nav-more summary:focus-visible { outline: 2px solid #9defd8; outline-offset: 2px; }
.nav-more { position: relative; }
.nav-more summary { cursor: pointer; list-style: none; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary::after { content: ' ▾'; }
.nav-more[open] summary { background: #203149; }
.nav-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 210px; padding: 8px; border: 1px solid #43546a; border-radius: 12px; background: #0e1d30; box-shadow: 0 12px 30px #0006; }
.nav-menu a { display: block; padding: 12px; min-height: 44px; border-radius: 6px; }
.nav-menu a:hover { background: #203149; }
.custom-picker-showcase { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 28px; padding: 24px; margin-bottom: 32px; align-items: start; }
.custom-picker-showcase h2 { font-size: clamp(28px, 4vw, 44px); }
.custom-picker-showcase p:not(.eyebrow) { font-size: 14px; color: #b5c6de; line-height: 1.8; }
.custom-picker-frame { width: 100%; height: 780px; border: 1px solid #455369; border-radius: 12px; background: #181818; }
@media (max-width: 760px) { .custom-picker-showcase { grid-template-columns: 1fr; padding: 14px; gap: 18px; } .custom-picker-frame { height: 830px; } }
.fallback-guide { border-top: 1px solid #394b62; margin-top: 18px; padding-top: 14px; }
.fallback-guide:target { outline: 1px solid #79998d; outline-offset: 8px; }
.fallback-guide summary { cursor: pointer; font-size: 14px; min-height: 36px; }
.fallback-guide p, .fallback-guide output { font-size: 12px; line-height: 1.7; color: #bbcce0; }
.fallback-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fallback-pair figure { margin: 0; min-width: 0; background: repeating-conic-gradient(#344257 0% 25%, #172335 0% 50%) 0 0 / 16px 16px; border-radius: 8px; overflow: hidden; }
.fallback-tile { height: 64px; }
.fallback-pair figcaption { background: #0c192a; padding: 8px; font-size: 11px; line-height: 1.5; }
.fallback-guide pre { font-size: 11px; padding: 12px; background: #091322; border-radius: 8px; }
.lch-output { display: grid; gap: 8px; font-size: 12px; }
.lch-output input { width: 100%; min-width: 0; padding: 10px; background: #091322; border: 1px solid #405773; border-radius: 8px; color: #dbefdf; font-size: 12px; }
.extension-showcase { margin: 0 0 32px; padding: 20px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: center; }
.extension-showcase img { width: 100%; height: auto; border-radius: 12px; }
.extension-showcase strong { font-size: 22px; }
.extension-showcase p { color: #b5c6de; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
@media (max-width: 760px) { .extension-showcase { grid-template-columns: 1fr; padding: 14px; } }
.living-glow { position: fixed; right: -90px; top: 16vh; width: min(650px, 80vw); height: min(650px, 80vh); border-radius: 50%; background-color: #ff4d52; opacity: .08; mask-image: radial-gradient(ellipse, #000 0%, transparent 70%); transition: background-color 700ms ease, opacity 700ms ease; pointer-events: none; z-index: 0; contain: strict; }
.ambient-toggle { margin-left: auto; display: flex; gap: 6px; align-items: center; color: #b5c6de; font-size: 11px; min-height: 44px; cursor: pointer; }
.ambient-toggle input { accent-color: #95e5ca; }
.shared-color-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin: 0 0 24px; padding: 16px; border: 1px solid #466279; border-radius: 12px; background: #0b1b2e; }
.shared-color-swatch { flex: 0 0 44px; height: 44px; border: 1px solid #ffffff55; border-radius: 10px; }
.shared-color-strip > div { display: grid; gap: 7px; min-width: 0; flex: 1 1 220px; }
.shared-color-strip strong { font-size: 14px; }
.shared-color-strip code { color: #d2eddf; font-size: 12px; overflow-wrap: anywhere; }
.shared-color-strip span:not(.shared-color-swatch) { color: #afc2d5; font-size: 12px; line-height: 1.5; }
.shared-color-strip a { font-size: 12px; padding: 12px 0; }
@media (prefers-reduced-motion: reduce) { .living-glow { transition: none; } }
.compatibility-card { min-width: 0; overflow-wrap: anywhere; }
.compatibility-card > * { min-width: 0; }
pre { max-width: 100%; overflow-x: auto; }
@media (max-width: 680px) {
  :root { --header-height: 116px; }
  .topbar { flex-direction: column; align-items: stretch; gap: 6px; padding: 8px 12px; }
  .brand { align-self: flex-start; gap: 8px; }
  .brand img { width: 30px; height: 30px; }
  .brand strong { font-size: 12px; }
  .brand small { font-size: 9px; }
  .nav { width: 100%; justify-content: space-between; gap: 0; font-size: 12px; }
  .nav > a, .nav-more summary { padding: 12px 8px; }
}
