/* Super Notch v3 — instrument landing */

:root {
  --bg: #0d0d0d;
  --card: #0c0c0c;
  --card-hover: #101010;
  --ink: #fafafa;
  --muted: #b4b4b4;
  --dim: #7a7a7a;
  --line: #1d1d1d;
  --line-hover: #2a2a2a;
  --fill: #1c1c1c;
  --wire: #3a3a3a;
  --serif: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --pad: clamp(20px, 4vw, 32px);
  --reel-max-h: calc(100svh - 8.5rem);
  --max: min(1000px, calc(var(--reel-max-h) * 1600 / 1040));
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; scroll-padding-top: 80px; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
figure { margin: 0; }

.wrap { width: min(var(--max), calc(100% - var(--pad) * 2)); margin-inline: auto; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 17px;
  letter-spacing: -0.02em;
}
.brand-mark { flex: none; }
.nav-links {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}
.nav-links a:hover { color: var(--ink); }
.nav-cta { margin-left: 8px; }
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.btn:hover { border-color: var(--line-hover); background: var(--fill); }
.btn-solid {
  background: var(--ink);
  color: #171717;
  border-color: var(--ink);
}
.btn-solid:hover { background: #e8e8e8; }
.btn-lg { height: 42px; padding: 0 18px; }
.btn-price { color: var(--dim); font-variant-numeric: tabular-nums; }
.btn-solid .btn-price { color: #555; }

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: calc(100svh - 64px);
  padding: 80px 0 56px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-ascii {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.hero-copy,
.hero-bar { position: relative; z-index: 1; }

.hero h1 {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(40px, 10vw, 120px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin: 0;
}
.h1-line {
  display: block;
  overflow: hidden;
  margin-bottom: -0.08em;
  padding-bottom: 0.08em;
}
.h1-line > span {
  display: block;
  animation: rise 1s var(--ease) both;
}
.h1-line:nth-child(2) > span { animation-delay: 0.14s; white-space: nowrap; }
.h1-dot { color: var(--muted); }
@keyframes rise {
  from { transform: translateY(112%); }
  to { transform: translateY(0); }
}

.hero-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px 40px;
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  animation: fade 0.8s ease 0.65s both;
}
.hero-bar p {
  margin: 0;
  max-width: 42ch;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--muted);
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cmd {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--card);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: -0.02em;
  transition: background 160ms, border-color 160ms, transform 200ms var(--ease);
}
.cmd:hover { background: var(--fill); border-color: var(--line-hover); }
.cmd-prompt { color: var(--dim); }
.cmd-go { color: var(--muted); }

/* Chapters */
.chapter {
  padding: 120px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 80px;
}
.ch-head {
  display: grid;
  gap: 12px;
  align-items: start;
}
.ch-index {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  margin: 0;
}
.chapter h2 {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 16ch;
}
.lede {
  max-width: 720px;
  margin: 48px 0 0;
  font-family: var(--sans);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.4;
  color: var(--muted);
}
@media (min-width: 860px) {
  .ch-head {
    grid-template-columns: 180px 1fr;
    gap: 40px;
  }
  .ch-index { padding-top: 14px; }
  .lede { margin: 56px 0 0 220px; }
}

/* Mosaic */
.mosaic {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin-top: 56px;
  border: 1px solid var(--line);
  background: var(--line);
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  background: var(--card);
  min-height: 200px;
  transition: background 280ms;
}
.tile:hover { background: var(--card-hover); }
.tile-k {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
  transition: color 280ms;
}
.tile:hover .tile-k { color: var(--muted); }
.tile-big {
  margin: auto 0 0;
  font-family: var(--sans);
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.tile-s {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--muted);
}
.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}
.live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  animation: signal 2s ease-in-out infinite;
}
@keyframes signal {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.tile-convo { gap: 22px; }
.turn { margin: 0; }
.turn > div + div { margin-top: 18px; }
.turn dt {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
}
.turn dd {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--muted);
}
.turn .is-reply dt { color: var(--ink); }
.turn .is-reply dd {
  max-width: 22ch;
  font-family: var(--sans);
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.2;
  color: var(--ink);
}

.tile-reel {
  padding: 22px 0 0;
  min-height: 0;
}
.tile-reel .tile-k { padding: 0 28px; }
.tile-reel video {
  width: 100%;
  height: auto;
  flex: none;
  min-height: 0;
  max-height: var(--reel-max-h);
  margin: 16px 0 0;
  aspect-ratio: 1600 / 1040;
  object-fit: contain;
  object-position: center;
  background: #000;
}

.tile-kat {
  position: relative;
  padding: 0;
  aspect-ratio: 1;
  min-height: 0;
  overflow: hidden;
}
.tile-kat .tile-k,
.tile-kat .tile-s {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 16px 18px;
  margin: 0;
}
.tile-kat .tile-k {
  top: 0;
  background: linear-gradient(var(--card), transparent);
}
.tile-kat .tile-s {
  bottom: 0;
  background: linear-gradient(transparent, var(--card));
}
.kat-rig {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--card);
}
.kat-well {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.kat-frame,
.kat-fallback {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  border: 0;
  background: transparent;
  color-scheme: dark;
}
.kat-frame { opacity: 0; }
.kat-fallback {
  object-fit: cover;
  object-position: center 16%;
}
.kat-rig.is-live .kat-frame { opacity: 1; }
.kat-rig.is-live .kat-fallback { opacity: 0; pointer-events: none; }

/* Mobile: finger-drag overlay stands in for the desktop cursor. */
.kat-touch {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: contain;
}
.kat-cursor {
  position: absolute;
  left: 50%;
  top: 38%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  border: 1px solid rgba(250, 250, 250, 0.62);
  background: radial-gradient(circle at 50% 45%, rgba(250, 250, 250, 0.18), rgba(250, 250, 250, 0.03) 68%);
  box-shadow:
    0 0 0 10px rgba(250, 250, 250, 0.05),
    0 8px 22px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.84);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}
.kat-cursor i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--ink);
}
.kat-touch-hint {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 20%;
  margin: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(250, 250, 250, 0.82);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  transition: opacity 180ms var(--ease);
}
.kat-touch.is-dragging .kat-cursor {
  opacity: 1;
  transform: scale(1);
}
.kat-touch.is-dragging .kat-touch-hint {
  opacity: 0;
}

@media (hover: none), (pointer: coarse), (max-width: 720px) {
  .kat-touch { display: block; }
  .kat-frame { pointer-events: none; }
}

.chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.chips span {
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.chips span:nth-child(2) { margin-left: 10px; }
.chips span:nth-child(3) { margin-left: 20px; opacity: 0.7; }

.wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 44px;
}
.wave i {
  width: 3px;
  height: 28%;
  background: #3a3a3a;
  animation: waveform 1.2s ease-in-out infinite;
}
.wave i:nth-child(3n) { animation-delay: 0.15s; height: 55%; }
.wave i:nth-child(3n+1) { animation-delay: 0.3s; height: 38%; }
.wave i:nth-child(3n+2) { animation-delay: 0.45s; height: 72%; }
.tile:hover .wave i { background: var(--dim); animation-duration: 0.55s; }
@keyframes waveform {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1); }
}

.settle {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  height: 44px;
}
.settle i {
  display: block;
  height: 1px;
  background: #2a2a2a;
  transform-origin: left;
  animation: settle 2.4s var(--ease) infinite;
}
.settle i:nth-child(1) { width: 100%; }
.settle i:nth-child(2) { width: 72%; animation-delay: 0.2s; }
.settle i:nth-child(3) { width: 44%; animation-delay: 0.4s; }
@keyframes settle {
  0% { transform: scaleX(0.2); opacity: 0.4; }
  40%, 100% { transform: scaleX(1); opacity: 1; }
}

.tile-orb {
  gap: 14px;
}
.orb-canvas {
  width: 100%;
  height: 168px;
  display: block;
  margin: 4px 0 0;
}
.orb-legend {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--dim);
}

.tile-underlay { gap: 14px; }
.underlay-stage {
  position: relative;
  min-height: 168px;
  padding: 16px 16px 72px;
  border: 1px solid var(--line);
  background: #111;
}
.underlay-src {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}
.underlay-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.underlay-meta {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.underlay-bubble {
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: min(72%, 280px);
  padding: 10px 12px;
  background: #171717;
  border: 1px solid var(--line-hover);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.ub-you,
.ub-kat {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}
.ub-you { color: var(--dim); }
.ub-kat { margin-top: 6px; color: var(--ink); }

@media (min-width: 860px) {
  .mosaic { grid-template-columns: repeat(3, 1fr); }
  .tile-reel { grid-column: 1 / -1; }
  .tile-orb { grid-column: span 2; }
  .tile-underlay { grid-column: span 2; }
  .tile-reel video {
    min-height: 0;
    max-height: var(--reel-max-h);
    aspect-ratio: 1600 / 1040;
  }
  .tile-convo { grid-column: span 2; }
  .tile-kat { align-self: start; }
}

/* Graph */
.graph {
  display: grid;
  gap: 12px;
  margin-top: 56px;
  align-items: stretch;
}
.g-node {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--card);
}
.g-k {
  font-size: 12px;
  color: var(--dim);
}
.g-node strong {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.g-node em {
  margin-top: auto;
  font-style: normal;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}
.g-core strong { font-size: 26px; }
.g-col {
  display: grid;
  gap: 10px;
}
.g-edge, .g-fan { display: none; }

@media (min-width: 960px) {
  .graph {
    grid-template-columns: 1fr 110px 1.25fr 110px 1fr;
    gap: 0;
    min-height: 300px;
  }
  .g-edge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 8px;
  }
  .g-edge span {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
  }
  .g-rail {
    position: relative;
    width: 100%;
    height: 1px;
    background: #5a5a5a;
  }
  .g-pulse {
    position: absolute;
    top: 50%;
    left: 0;
    width: 6px;
    height: 6px;
    background: var(--ink);
    transform: translate(-50%, -50%);
    opacity: 0;
  }
  .g-fan {
    display: block;
    position: relative;
    min-height: 240px;
  }
  .g-fan svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
  }
  .g-branch {
    fill: none;
    stroke: #5a5a5a;
    stroke-width: 1.25;
  }
  .g-dot { fill: #8a8a8a; }
  .g-token {
    fill: var(--ink);
    offset-path: path("M2 120 C 36 120, 36 40, 86 40");
    offset-rotate: 0deg;
    opacity: 0;
  }
  .graph.is-on .g-pulse:not(.g-back) { animation: pulse-fwd 4.8s linear 0.4s infinite; }
  .graph.is-on .g-back { animation: pulse-back 4.8s linear 2.6s infinite; }
  .graph.is-on .g-token { animation: token 4.8s linear 0.8s infinite; }
}
@keyframes pulse-fwd {
  0% { left: 0%; opacity: 0; }
  10% { opacity: 1; }
  85% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
@keyframes pulse-back {
  0% { left: 100%; opacity: 0; }
  10% { opacity: 1; }
  85% { opacity: 1; }
  100% { left: 0%; opacity: 0; }
}
@keyframes token {
  0% { offset-distance: 0%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* Feature rows */
.rows {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.rows li {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 16px 24px;
  align-items: center;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  transition: padding 280ms, background 280ms;
}
.rows li:hover {
  padding-left: 16px;
  background: linear-gradient(90deg, var(--card), transparent);
}
.rn {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  transition: color 280ms;
}
.rows li:hover .rn { color: var(--ink); }
.rt {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 24px;
  letter-spacing: -0.02em;
}
.rt i {
  font-family: var(--mono);
  font-style: normal;
  font-size: 15px;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 280ms, transform 280ms;
}
.rows li:hover .rt i { opacity: 1; transform: none; }
.rd {
  grid-column: 2;
  max-width: 48ch;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--muted);
}
.rm {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 12px;
  color: var(--dim);
  transition: color 280ms;
}
.rm i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0;
}
.rows li:hover .rm { color: var(--ink); }
.rows li:hover .rm i {
  opacity: 1;
  animation: signal 1.4s ease-in-out infinite;
}
@media (min-width: 860px) {
  .rows li {
    grid-template-columns: 90px 220px 1fr 140px;
    gap: 24px;
  }
  .rd { grid-column: auto; }
  .rm { display: flex; }
}

/* Close */
.close { padding: 120px 0 96px; }
.close h2 {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  max-width: 12ch;
}
.close p {
  max-width: 42ch;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--muted);
  margin: 0 0 28px;
}
.price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px 28px;
  margin-bottom: 22px;
}
.price {
  font-family: var(--sans);
  font-size: 56px;
  letter-spacing: -0.03em;
  line-height: 1;
}
.price span { font-size: 22px; color: var(--dim); }
.fine { font-size: 13px; color: var(--dim); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Footer */
.foot {
  border-top: 1px solid var(--line);
  padding: 22px 0 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  font-size: 12px;
  color: var(--dim);
}
.foot a:hover { color: var(--ink); }

/* Modal */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  background: var(--card);
  padding: 22px;
}
.modal-card h2 { margin: 0 0 8px; font-size: 18px; font-weight: 500; }
.modal-card p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.modal-card code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .h1-line > span,
  .hero-bar,
  .live i,
  .wave i,
  .settle i,
  .graph.is-on .g-pulse,
  .graph.is-on .g-token,
  .rows li:hover .rm i {
    animation: none;
  }
  .h1-line > span,
  .hero-bar { opacity: 1; transform: none; }
}
