:root {
  color-scheme: dark;
  --seam: #0a0d10;          /* the gaps between cells: the page background */
  --cell: #161b21;
  --cell-2: #1c232a;
  --line: #2a323b;
  --handle: #dfe6ee;
  --ink: #eef2f6;
  --text: #c0c9d3;
  --muted: #8592a0;

  --blue: #5B8DEF;
  --orange: #E8793A;
  --green: #3FA37F;
  --pink: #C9497A;
  --purple: #9C6FDB;
  --yellow: #E3AA35;

  --g: 8px;                  /* one gap rule for the whole page, like Multiplex */
  --r: 14px;
  --pad: clamp(22px, 3vw, 44px);
  --tl-h: 50px;
  --display: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--seam);
  color: var(--text);
  font: 400 17px/1.6 var(--display);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: calc(var(--tl-h) + var(--g) * 2);
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { color: var(--ink); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(38px, 4.4vw, 66px); line-height: 1.02; font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: clamp(28px, 3.4vw, 46px); line-height: 1.08; }
h3 { font-size: 20px; line-height: 1.25; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow {
  font: 500 12px/1 var(--mono);
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 18px;
}
.fine { font-size: 13px; color: var(--muted); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 999px;
  background: var(--ink); color: #0f1317;
  font: 600 16px/1 var(--display);
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { background: var(--cell-2); }

/* ---------- Cells and layouts ---------- */
.cell {
  position: relative;
  background: var(--cell);
  border-radius: var(--r);
  padding: var(--pad);
  min-width: 0;
  overflow: hidden;
}
.cell.fill { background: var(--fill); color: rgba(255,255,255,.88); }
.cell.fill h3 { color: #fff; }
.cell-tag {
  position: absolute; left: 14px; bottom: 12px; z-index: 1;
  font: 500 11px/1 var(--mono); letter-spacing: .08em;
  color: rgba(255,255,255,.92);
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
  white-space: nowrap;
}

main { padding: 0 var(--g); }
.split {
  position: relative;
  display: grid;
  grid-template-columns: var(--cols, 1fr);
  grid-template-rows: var(--rows, auto);
  gap: var(--g);
  margin-top: var(--g);
}
.split > .cell { grid-column: var(--gc, auto); grid-row: var(--gr, auto); }
.split.easing { transition: grid-template-columns .45s cubic-bezier(.2,.8,.2,1), grid-template-rows .45s cubic-bezier(.2,.8,.2,1); }

/* Seam handles, drawn over the gaps. */
.seams { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.seam { position: absolute; pointer-events: auto; touch-action: none; }
.seam.v { width: 18px; margin-left: -9px; cursor: ew-resize; }
.seam.h { height: 18px; margin-top: -9px; cursor: ns-resize; }
.seam::after { /* lights the seam while you're on it */
  content: ""; position: absolute; background: var(--handle); opacity: 0; transition: opacity .15s;
  border-radius: 2px;
}
.seam.v::after { left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; }
.seam.h::after { top: 50%; left: 0; right: 0; height: 2px; margin-top: -1px; }
.seam:hover::after, .seam.active::after { opacity: .35; }
.knob {
  position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: var(--handle);
  box-shadow: 0 1px 4px rgba(0,0,0,.5);
  transition: transform .15s ease;
  pointer-events: none;
}
.seam.v .knob, .handle.v .knob { left: 50%; }
.seam.h .knob, .handle.h .knob { top: 50%; }
.seam:hover .knob, .seam.active .knob { transform: scale(1.35); }
.junction {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  pointer-events: auto; touch-action: none; cursor: move; z-index: 1;
  display: grid; place-items: center;
}
.junction::before, .handle.j::before { /* a ring, so it reads differently from a seam knob */
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  background: var(--seam); border: 3px solid var(--handle);
  box-shadow: 0 1px 5px rgba(0,0,0,.5);
  transition: transform .15s ease;
}
.junction:hover::before, .junction.active::before { transform: scale(1.3); }
.seam:focus-visible, .junction:focus-visible { outline: none; }
.seam:focus-visible .knob, .junction:focus-visible::before { box-shadow: 0 0 0 3px var(--blue); }
body.drag-ew, body.drag-ew * { cursor: ew-resize !important; user-select: none; }
body.drag-ns, body.drag-ns * { cursor: ns-resize !important; user-select: none; }
body.drag-move, body.drag-move * { cursor: move !important; user-select: none; }

.hint {
  position: absolute; z-index: 6; pointer-events: none;
  padding: 9px 13px; border-radius: 10px;
  background: var(--handle); color: #0f1317;
  font: 500 13px/1.35 var(--display);
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  transform: translate(calc(-100% - 22px), -50%);
  transition: opacity .3s;
}
.hint::before {
  content: ""; position: absolute; right: -5px; top: 50%; width: 10px; height: 10px; margin-top: -5px;
  background: var(--handle); transform: rotate(45deg);
}
.hint.gone { opacity: 0; }
.pulse::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.45); } }

/* Entry patterns: cells wait hidden until their section plays in. */
.split.await > .cell { opacity: 0; }

/* ---------- Nav: three cells ---------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--g);
  padding: var(--g);
  background: var(--seam);
}
.nav .cell { padding: 0 20px; height: 54px; display: flex; align-items: center; border-radius: 12px; }
.nav-brand { gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 19px; }
.nav-brand img { border-radius: 4px; }
.nav-links { gap: 26px; justify-content: flex-end; }
.nav-links a { text-decoration: none; font-size: 15px; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { background: var(--ink) !important; color: #0f1317; font-weight: 600; font-size: 15px; text-decoration: none; transition: background .15s; }
.nav-cta:hover { background: #fff !important; }

/* ---------- Hero ---------- */
.hero { height: max(640px, calc(100svh - 70px - var(--tl-h) - var(--g) * 3)); margin-top: 0; }
.hero-copy { display: flex; flex-direction: column; justify-content: flex-end; }
.lede { margin-top: 18px; font-size: clamp(17px, 1.6vw, 20px); max-width: 600px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-media { padding: 0; background: #f0ede6; min-height: 220px; }
.hero-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.steps { display: flex; flex-direction: column; gap: 24px; }
.steps ol { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; justify-content: space-evenly; gap: 18px; }
.steps li { border-left: 3px solid var(--c); padding-left: 18px; }
.steps li p { margin-top: 6px; font-size: 15px; }
.step-num { display: block; font: 500 12px/1 var(--mono); color: var(--c); margin-bottom: 10px; }

/* ---------- Playground ---------- */
.play-side { display: flex; flex-direction: column; }
.play-intro { margin-top: 14px; }
.play-main { padding: clamp(14px, 1.8vw, 24px); background: var(--cell-2); display: flex; flex-direction: column; justify-content: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-bottom: 14px; }
.tool-group { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--seam); border-radius: 12px; }
.tool {
  width: 42px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.tool svg { width: 24px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tool[data-layout] svg rect { fill: currentColor; fill-opacity: .25; stroke: none; }
.tool:hover { color: var(--ink); background: var(--cell-2); }
.tool.is-on { color: var(--ink); background: #2c353f; }
.tool.is-on[data-layout] svg rect { fill-opacity: .9; }

.stage {
  position: relative; aspect-ratio: 16 / 9;
  border-radius: 10px; overflow: hidden;
  background: #1b2026;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.stage .cell-tag { bottom: auto; }
.pcell { position: absolute; inset: 0; will-change: transform; }
.handle { position: absolute; z-index: 3; touch-action: none; }
.handle.v { width: 26px; margin-left: -13px; cursor: ew-resize; }
.handle.h { height: 26px; margin-top: -13px; cursor: ns-resize; }
.handle:hover .knob, .handle.active .knob { transform: scale(1.35); }
.handle.j { width: 32px; height: 32px; margin: -16px 0 0 -16px; cursor: move; z-index: 4; display: grid; place-items: center; }
.handle.j::before { background: #1b2026; }
.handle.j:hover::before, .handle.j.active::before { transform: scale(1.3); }
.handle:focus-visible { outline: none; }
.handle:focus-visible .knob, .handle.j:focus-visible::before { box-shadow: 0 0 0 3px var(--blue); }
.play-main > .fine { margin-top: 14px; }

.controls { display: grid; gap: 8px; margin-top: auto; padding-top: 28px; }
.ctl { display: grid; gap: 6px; font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.ctl span { display: flex; justify-content: space-between; }
.ctl output { color: var(--ink); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: var(--line); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: var(--handle); border: 0; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--handle); border: 0; }
.patterns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.patterns-label { width: 100%; font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.chip {
  border: 0; border-radius: 999px; padding: 9px 14px;
  background: var(--cell-2); color: var(--ink);
  font: 500 14px/1 var(--display); cursor: pointer; transition: background .15s;
}
.chip:hover { background: #2c353f; }

/* ---------- Features ---------- */
.features { min-height: clamp(860px, 118svh, 1100px); }
.feat-head { display: flex; flex-direction: column; justify-content: flex-end; }
.feat-head h2 { max-width: 760px; }
.feature { display: flex; flex-direction: column; }
.feature .glyph { width: 120px; height: 68px; margin-bottom: auto; padding-bottom: 22px; box-sizing: content-box; }
.feature p { margin-top: 8px; font-size: 15.5px; max-width: 460px; }

/* ---------- Motion ---------- */
.motion-copy { display: flex; flex-direction: column; justify-content: flex-end; }
.motion-copy .eyebrow { margin-bottom: auto; padding-bottom: 32px; }
.motion-copy h2 { margin-bottom: 18px; }
.motion-demo { background: var(--cell-2); display: flex; flex-direction: column; gap: 14px; }
.mini {
  flex: 1; min-height: 180px;
  display: grid; grid-template-columns: 3fr 2fr 2fr; grid-template-rows: 1fr 1fr; gap: 5px;
  padding: 5px; border-radius: 10px; background: #1b2026; overflow: hidden;
}
.mini span { border-radius: 6px; }
.mini span:nth-child(1) { background: var(--blue); }
.mini span:nth-child(2) { background: var(--orange); }
.mini span:nth-child(3) { background: var(--green); }
.mini span:nth-child(4) { background: var(--pink); }
.mini span:nth-child(5) { background: var(--purple); }
.mini span:nth-child(6) { background: var(--yellow); }
.now-playing { font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.now-playing b { color: var(--ink); font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 3px rgba(229,72,77,.25); }
.pattern-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pattern-list li {
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink); font-size: 14.5px;
  transition: background .2s, border-color .2s, color .2s;
}
.pattern-list li.on { background: var(--ink); border-color: var(--ink); color: #0f1317; }

/* ---------- Buy ---------- */
.buy-logo { padding: 0; background: #1b2026; min-height: 260px; }
.buy-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.launch-badge { display: inline-block; padding: 6px 10px; border-radius: 999px; background: var(--orange); color: #fff; letter-spacing: .1em; }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-top: 18px; }
.price-now { font-size: clamp(40px, 4.4vw, 60px); font-weight: 700; color: var(--ink); letter-spacing: -0.03em; line-height: 1; }
.price-was { font-size: 24px; color: var(--muted); }
.price-note { font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--orange); }
.buy-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.buy-facts { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.buy-facts li { display: flex; gap: 10px; align-items: center; }
.buy-facts li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--green); flex: none; }

/* ---------- FAQ ---------- */
.faq-head { display: flex; flex-direction: column; }
.faq-head h2 { margin-bottom: 18px; }
.faq-head p:last-child { margin-top: auto; padding-top: 24px; }
.faq-head a { color: var(--ink); }
.qa { padding: clamp(20px, 2.2vw, 30px); }
.qa h3 { font-size: 18px; }
.qa p { margin-top: 8px; font-size: 15.5px; }

.footer {
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  margin-top: var(--g); padding: 18px 22px;
  background: var(--cell); border-radius: var(--r);
  font-size: 13px; color: var(--muted);
}

/* ---------- Timeline scroll bar ---------- */
.timeline {
  position: fixed; left: var(--g); right: var(--g); bottom: var(--g); z-index: 30;
  height: var(--tl-h);
  display: grid; grid-template-columns: auto 1fr; gap: var(--g);
}
.timeline::before { /* seam behind the two cells */
  content: ""; position: absolute; inset: calc(var(--g) * -1); background: var(--seam); z-index: -1;
}
.tl-time {
  display: flex; align-items: center; padding: 0 16px;
  background: var(--cell); border-radius: 12px;
  font: 500 14px/1 var(--mono); color: #f2b544; letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.tl-track {
  position: relative; background: var(--cell); border-radius: 12px;
  cursor: pointer; touch-action: none; overflow: hidden;
}
.tl-clips { position: absolute; inset: 8px 0; }
.tl-clip {
  position: absolute; top: 0; bottom: 0;
  margin: 0 2px; border-radius: 6px;
  background: color-mix(in srgb, var(--c) 40%, var(--cell));
  border-top: 2px solid var(--c);
  font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: rgba(255,255,255,.85);
  padding: 8px 10px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .2s;
}
.tl-clip.on { background: color-mix(in srgb, var(--c) 72%, var(--cell)); color: #fff; }
.tl-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #f2b544; pointer-events: none; }
.tl-head::before {
  content: ""; position: absolute; top: 0; left: -6px; width: 14px; height: 10px;
  background: #f2b544; clip-path: polygon(0 0, 100% 0, 100% 50%, 50% 100%, 0 50%);
}

/* ---------- Narrow screens: cells stack, seams stay as gaps ---------- */
@media (max-width: 860px) {
  .split { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .split > .cell { grid-column: auto; grid-row: auto; }
  .seams { display: none; }
  .hero, .features { min-height: 0; height: auto; }
  .hero-media { aspect-ratio: 2 / 1; min-height: 0; }
  .nav-links { display: none !important; }
  .nav { grid-template-columns: 1fr auto; }
  .feature .glyph { margin-bottom: 0; }
  .mini { min-height: 160px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  :root { --g: 6px; --tl-h: 44px; }
  .tl-time { font-size: 12px; padding: 0 10px; }
  .tl-clip { font-size: 0; }
  .nav .cell { height: 48px; padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .pulse::before { animation: none; }
}
