:root {
  --paper: #FFFFFF;
  --paper-2: #E6F6FC;
  --ink: #17171E;
  --ink-60: rgba(23, 23, 30, 0.6);
  --ink-40: rgba(23, 23, 30, 0.4);
  --blue: #EEFBFF;
  --blue-2: #D9F1FA;
  --sky: #2FAFE3;
  --sky-dark: #1B87B5;
  --yellow: #FFD338;
  --line: #17171E;
  --green: #0F9F4E;
  --green-dark: #0B7C3D;
  --green-soft: #E4F5EA;
  --red: #E03E31;
  --red-soft: #FBE4E0;
  --amber: #F2A20C;
  --kraft: #E7C98E;
  --shade-hover: #D9F1FA;
  --font-d: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-m: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

:root[data-theme="dark"] {
  --paper: #17171C;
  --paper-2: #232329;
  --ink: #EDEEF0;
  --ink-60: rgba(237, 238, 240, 0.62);
  --ink-40: rgba(237, 238, 240, 0.4);
  --blue: #202028;
  --blue-2: #262630;
  --sky-dark: #6FCFF2;
  --green-dark: #4CC57C;
  --green-soft: #173421;
  --red-soft: #3A1B17;
  --shade-hover: #262630;
  --line: #4A4A57;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-d);
  color: var(--ink);
  background-color: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

body::-webkit-scrollbar { width: 10px; }
body::-webkit-scrollbar-track { background: var(--paper-2); }
body::-webkit-scrollbar-thumb { background: var(--line); border: 2px solid var(--paper-2); }

a { color: inherit; }
img, svg { display: block; }
button { font: inherit; cursor: pointer; }

:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 62px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--blue-2);
  border-bottom: 2px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-logo { height: 24px; width: auto; }

[data-theme="dark"] .brand-logo,
[data-theme="dark"] .hero-logo { filter: invert(1); }

.brand.light { color: var(--paper); }

.site-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-nav > a,
.nav-dropdown-trigger {
  font-family: var(--font-m);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: relative;
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.site-nav > a::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--sky);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.site-nav > a:hover::after { transform: scaleX(1); }

.nav-chevron { transition: transform 0.25s var(--ease); }
.nav-dropdown:hover .nav-chevron { transform: rotate(180deg); }

.nav-dropdown { position: relative; }
.nav-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 14px;
}
.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  opacity: 0;
  pointer-events: none;
  min-width: 210px;
  padding: 6px;
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  z-index: 40;
}
.nav-dropdown:hover .nav-dropdown-panel,
.nav-dropdown:focus-within .nav-dropdown-panel {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.nav-dropdown-item {
  display: block;
  padding: 8px 14px;
  font-family: var(--font-d);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-dropdown-item:hover {
  color: var(--ink);
  background: var(--shade-hover);
}
.nav-dropdown-item--heading {
  font-weight: 600;
  color: var(--ink);
}
.nav-dropdown-item--heading:not(:last-of-type) {
  border-bottom: 2px solid var(--line);
  margin-bottom: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.cta-pill,
.theme-toggle {
  border: 2px solid var(--line);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--line);
  color: var(--ink);
  transition: transform 0.14s ease, box-shadow 0.14s ease, color 0.2s ease;
}

.cta-pill:hover,
.theme-toggle:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.cta-pill:active,
.theme-toggle:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }

.cta-pill {
  font-family: var(--font-m);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 8px 14px;
  display: inline-block;
}
.cta-pill:hover { color: var(--ink); }

.theme-toggle {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  color: var(--ink);
}

.theme-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.theme-icon--sun { display: none; }
:root[data-theme="dark"] .theme-icon--sun { display: block; }
:root[data-theme="dark"] .theme-icon--moon { display: none; }

.hero-band {
  background: var(--blue);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - clamp(56px, 8vw, 120px)), 0 100%);
  padding-bottom: clamp(76px, 9vw, 136px);
}

.hero {
  padding: 76px 24px 0;
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  column-gap: 32px;
  align-items: center;
}

.hero-inner { max-width: 600px; margin: 0; }

.eyebrow, .sec-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-m);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-60);
}

.sq { width: 8px; height: 8px; background: var(--sky); flex: none; }

.hero-logo {
  width: min(568px, 100%);
  height: auto;
}

h1 {
  margin-top: 22px;
  font-size: clamp(2rem, 3.2vw, 2.9rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.hl {
  background: var(--sky);
  color: #0D141B;
  padding: 0 0.12em;
  box-shadow: 0.14em 0.14em 0 var(--line);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.sub {
  max-width: 660px;
  margin: 26px 0 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-60);
}

.sub strong { color: var(--ink); }
.sub strong:first-of-type { color: var(--green-dark); }
.sub strong:last-of-type { color: var(--red); }

.cta-row { display: flex; justify-content: flex-start; gap: 16px; flex-wrap: wrap; margin-top: 34px; }

.btn {
  display: inline-block;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 13px 24px;
  font-family: var(--font-d);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 5px 5px 0 var(--line);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--line); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--line); }

.btn-primary { background: var(--yellow); color: #17171E; }
.btn-lg { padding: 16px 32px; font-size: 17px; }

/* ── Isometric voxel belt scene ─────────────────────────────── */

.belt-scene {
  position: relative;
  height: 480px;
  user-select: none;
}

#beltCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transition: filter 0.7s ease;
}

.belt-scene::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(120% 95% at 50% 42%, transparent 58%, rgba(23, 23, 30, 0.18) 100%);
  transition: opacity 0.7s ease;
}

.belt-scene.mode-other::after { opacity: 1; }
.belt-scene.mode-other #beltCanvas { filter: saturate(0.68) brightness(0.97); }

.belt-hud {
  position: absolute;
  top: 10px;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 6;
}

.hud-status {
  font-family: var(--font-m);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-align: right;
  color: var(--ink-60);
  transition: color 0.25s ease;
}

.hud-status.down { color: var(--red); font-weight: 700; }

.belt-switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 2px solid var(--line);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--line);
  padding: 7px 11px;
  font-family: var(--font-m);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-60);
  transition: transform 0.14s ease, box-shadow 0.14s ease, color 0.2s ease;
}

.belt-switch:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.belt-switch:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.belt-switch[aria-checked="true"] { color: var(--ink); }

.switch-track {
  position: relative;
  width: 30px;
  height: 16px;
  border: 2px solid var(--line);
  background: var(--paper-2);
  flex: none;
  transition: background 0.25s ease;
}

.switch-knob {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 10px;
  height: 10px;
  background: var(--line);
  transition: transform 0.24s cubic-bezier(0.55, -0.3, 0.3, 1.4), background 0.25s ease;
}

.belt-switch[aria-checked="true"] .switch-track { background: var(--red); }
.belt-switch[aria-checked="true"] .switch-knob { transform: translateX(14px); background: var(--paper); }

/* ── Section rules ──────────────────────────────────────────── */

.rule {
  position: relative;
  width: calc(100% - 48px);
  max-width: 1344px;
  margin: 0 auto;
  height: 2px;
  background: var(--line);
}

.rule span {
  position: absolute;
  right: 24px;
  top: -8px;
  background: var(--paper);
  padding: 0 12px;
  font-family: var(--font-m);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-60);
}

.section { padding: 100px 24px; }

.container { max-width: 1392px; margin: 0 auto; }

.sec-head { margin-bottom: 54px; }

.sec-head h2 {
  margin-top: 14px;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sec-label.center { justify-content: center; }

.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 26px; }

.step {
  position: relative;
  border: 2px solid var(--line);
  background: var(--paper);
  padding: 28px 26px 26px;
  box-shadow: 6px 6px 0 var(--line);
}

.step-tag {
  font-family: var(--font-m);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sky-dark);
  margin-bottom: 12px;
}

.step h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 10px; }
.step-p { font-size: 14.5px; line-height: 1.6; color: var(--ink-60); margin-bottom: 20px; }

.code {
  background: #17171E;
  color: #D9D6CC;
  font-family: var(--font-m);
  font-size: 12.5px;
  line-height: 1.7;
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre;
}

.code .p { color: #2FD07A; margin-right: 6px; }
.code .ok { color: #2FD07A; }
.code .bad { color: #FF5D5D; }
.code .dim { color: rgba(245, 242, 234, 0.55); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

.mini-chip {
  font-family: var(--font-m);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  border: 2px solid var(--line);
  background: var(--green-soft);
  padding: 4px 9px;
}

.mini-chip.red { background: var(--red-soft); }

.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

.feat {
  position: relative;
  border: 2px solid var(--line);
  background: var(--paper);
  padding: 24px 22px;
  box-shadow: 5px 5px 0 var(--line);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.feat:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--line); }

.feat-icon {
  width: 48px;
  height: 48px;
  border: 2.5px solid var(--line);
  background: var(--blue-2);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  color: var(--ink);
}

.feat-icon svg { width: 26px; height: 26px; }

.feat h3 { font-size: 16.5px; font-weight: 700; margin-bottom: 8px; }
.feat p { font-size: 14px; line-height: 1.6; color: var(--ink-60); }

.cta-final { padding: 120px 24px; text-align: center; }

.cta-final h2 {
  margin-top: 18px;
  font-size: clamp(2.1rem, 4.6vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.cta-sub { margin: 20px auto 34px; max-width: 480px; color: var(--ink-60); font-size: 16px; line-height: 1.6; }

.cta-hint {
  margin-top: 26px;
  font-family: var(--font-m);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-60);
}

.cta-hint .p { color: var(--green-dark); margin-right: 6px; }

footer {
  background: var(--blue);
  color: var(--ink);
  padding: calc(46px + clamp(56px, 8vw, 120px)) 24px 26px;
  clip-path: polygon(0 clamp(56px, 8vw, 120px), 100% 0, 100% 100%, 0 100%);
}

.footer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

.footer-tag {
  margin-top: 14px;
  font-family: var(--font-m);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-60);
}

.footer-links { display: flex; gap: 26px; flex-wrap: wrap; }

.footer-links a {
  font-family: var(--font-m);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-60);
  padding: 3px 0;
  border-bottom: 2px solid transparent;
}

.footer-links a:hover { color: var(--ink); border-bottom-color: var(--sky); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(23, 23, 30, 0.14);
  font-family: var(--font-m);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-40);
}

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

.steps-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.steps-grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.feat-grid .reveal:nth-child(2) { transition-delay: 0.06s; }
.feat-grid .reveal:nth-child(3) { transition-delay: 0.12s; }
.feat-grid .reveal:nth-child(4) { transition-delay: 0.18s; }
.feat-grid .reveal:nth-child(5) { transition-delay: 0.24s; }
.feat-grid .reveal:nth-child(6) { transition-delay: 0.3s; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-inner { max-width: 920px; margin: 0 auto; }
  .hero-logo { margin-inline: auto; }
  .sub { margin: 26px auto 0; }
  .cta-row { justify-content: center; }
  .belt-scene { margin-top: 48px; }
}

@media (max-width: 900px) {
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .belt-scene { height: 400px; }
}

@media (max-width: 640px) {
  .site-nav { display: none; }
  .hud-status { display: none; }
  .section { padding: 72px 20px; }
  .hero { padding-top: 56px; }
  .belt-scene { margin-top: 44px; height: 330px; }
  .rule span { right: 12px; }
}

@media (max-width: 600px) {
  .feat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .site-header { padding: 0 18px; }
  .cta-pill { padding: 7px 11px; font-size: 9.5px; }
  .theme-toggle { width: 33px; height: 33px; }
  .cta-row .btn { width: 100%; }
}
