/* overshoot.tools — version 2. One scroll, nine beats.
   Wears the plugin's own tokens: near-black ground, mint accent, Geist for headings,
   Instrument Sans for reading. One theme, locked dark. */

@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/Geist-var.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-stretch: 100%; font-display: swap; src: url("../fonts/InstrumentSans-var.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --mint: #4DFFBC; --mint-rgb: 77, 255, 188; --on-accent: #14100C;
  --bg: #0D0D0F; --card: #131316; --inset: #0A0A0C;
  --b1: #202026; --b2: #1C1C21; --b3: #232328; --b4: #2A2A31; --grid: #1E1E24;
  --t-primary: #EDEDED; --t-body: #D9D9D9; --t-secondary: #C9C9D0; --t-muted: #898989; --t-faint: #5A5A5A;
  --sg: "Geist", "Helvetica Neue", Arial, sans-serif;
  --is: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --r-card: 14px; --r-ui: 8px;
  --gutter: 28px; --max: 1240px;
  --settle: cubic-bezier(0.22, 1.18, 0.36, 1);
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 62px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--t-body); font-family: var(--is); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
::selection { background: rgba(var(--mint-rgb), 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
@media (max-width: 640px) { :root { --gutter: 18px; } body { font-size: 16px; } }

/* ── type ─────────────────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--sg); color: var(--t-primary); margin: 0; letter-spacing: -0.032em; line-height: 1.04; font-weight: 640; }
h1 { font-size: clamp(2.3rem, 3.4vw, 3.1rem); }
h2 { font-size: clamp(1.9rem, 2.9vw, 2.7rem); }
h3 { font-size: 1.1rem; letter-spacing: -0.012em; font-weight: 600; }
p { margin: 0; }
.lede { font-size: clamp(1.02rem, 1.25vw, 1.16rem); color: var(--t-secondary); line-height: 1.5; max-width: 46ch; }
.mint { color: var(--mint); }

/* ── nav ──────────────────────────────────────────────────────────────── */
.nav { position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 30; display: flex; align-items: center;
  background: rgba(13, 13, 15, 0.7); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s, background .3s; }
.nav.stuck { border-bottom-color: rgba(255,255,255,0.05); }
.nav .wrap { display: flex; align-items: center; gap: 24px; }
.wordmark { font-family: var(--sg); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; color: var(--t-primary); }
.wordmark b { color: var(--mint); font-weight: 700; }
.nav .btn { margin-left: auto; height: 38px; padding: 0 15px; font-size: 13.5px; }

/* ── buttons, form ────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  height: 46px; padding: 0 20px; border-radius: var(--r-ui); background: var(--mint); color: var(--on-accent);
  font-family: var(--sg); font-weight: 650; font-size: 15px; border: none; cursor: pointer;
  transition: filter .2s, box-shadow .25s, transform .12s; }
.btn:hover { filter: brightness(1.06); box-shadow: 0 0 22px rgba(var(--mint-rgb), 0.35); }
.btn:active { transform: scale(0.98); }
.btn.ghost { background: transparent; color: var(--t-secondary); border: 1px solid var(--b4); }
.btn.ghost:hover { border-color: var(--mint); color: var(--mint); box-shadow: none; }
.form { display: flex; gap: 10px; width: 100%; max-width: 480px; }
.form input { flex: 1; min-width: 0; height: 46px; padding: 0 16px; border-radius: var(--r-ui); background: var(--inset); border: 1px solid var(--b4); color: var(--t-primary); transition: border-color .2s; }
.form input::placeholder { color: #8A8A92; }
.form input:focus { border-color: var(--mint); outline: none; }
.form-msg { font-size: 14px; color: var(--t-muted); min-height: 1.4em; margin-top: 10px; }
.form-msg.ok { color: var(--mint); } .form-msg.err { color: #FF7A7A; }
.form-msg a { color: var(--mint); text-decoration: underline; }
.form.busy .btn { opacity: .6; pointer-events: none; }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form.closed input, .form.closed .btn { opacity: .45; pointer-events: none; }
.ts:empty { display: none; } .ts { margin-top: 10px; }
.consent { font-size: 12px; line-height: 1.5; color: var(--t-faint); max-width: 480px; margin-top: 2px; }
.consent a { color: var(--t-muted); text-decoration: underline; }
@media (max-width: 480px) { .form { flex-direction: column; } .form .btn { width: 100%; } }

/* ── beats ────────────────────────────────────────────────────────────── */
.beat { padding: clamp(78px, 9vw, 130px) 0; position: relative; }
.beat + .beat { border-top: 1px solid var(--b2); }
.say { display: grid; gap: 16px; }
.say .lede { margin-top: 2px; }

/* the demo frame, everywhere: it is the panel, so it wears the panel's card */
.frame { background: var(--card); border: 1px solid var(--b1); border-radius: var(--r-card); padding: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.42); display: grid; gap: 14px; min-width: 0; }

/* layouts, one per beat so no two read the same */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4.5vw, 64px); align-items: center; }
.split.flip > .say { order: 2; }
.stack { display: grid; gap: clamp(28px, 4vw, 48px); justify-items: start; }
.stack > .frame { width: 100%; }
/* beat 1: canvas and its strip on the left, the controls beside them, both starting at the top */
.bench { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; align-items: stretch; }
.bench .left { display: grid; gap: 10px; min-width: 0; }
.bench .right { display: grid; gap: 12px; align-content: start; min-width: 0; }
/* a fixed height reads better here than a ratio: it keeps the two columns near the same size */
.bench .left .canvas { aspect-ratio: auto; height: clamp(250px, 25vw, 330px); }
/* the stagger beat wants it the other way round: narrow bars, room for five order buttons */
.bench.rev { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
@media (max-width: 900px) { .bench, .bench.rev { grid-template-columns: minmax(0, 1fr); } .bench .right { align-content: start; } }
.centred { display: grid; gap: clamp(26px, 3.5vw, 44px); justify-items: center; text-align: center; }
.centred .say { justify-items: center; }
.centred .lede { max-width: 52ch; }
.centred > .frame { width: 100%; }
@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split.flip > .say { order: 0; }
}

/* ── hero ─────────────────────────────────────────────────────────────── */
.hero { min-height: 100dvh; display: flex; align-items: center; padding: calc(var(--nav-h) + 54px) 0 60px; }
.hero .split { align-items: center; }
.hero .say { gap: 22px; }
.hero-panel { margin: 0; width: 100%; max-width: 560px; justify-self: center; }
.hero-panel .hp-box { position: relative; width: 100%; overflow: visible; border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.hero-panel .hp-box:not([style*=height]) { aspect-ratio: 1 / 1.07; }
.hero-panel iframe { position: absolute; left: 0; top: 0; border: 0; display: block; transform-origin: 0 0; background: transparent; opacity: 0; transition: opacity .5s var(--out); }
.hero-panel.ready iframe { opacity: 1; }
.hero-panel figcaption { margin-top: 14px; text-align: center; font: 12px/1.4 var(--mono); color: var(--t-muted); }
.hero-graph { width: 100%; height: auto; border-radius: var(--r-ui); background: var(--inset); border: 1px solid var(--b2); }
@media (max-width: 900px) { .hero { min-height: 0; padding-top: calc(var(--nav-h) + 36px); } }

/* the object stage: what the curve is actually moving */
.stage { position: relative; height: 46px; border-radius: var(--r-ui); background: var(--inset); border: 1px solid var(--b2); overflow: hidden; }
.stage i { position: absolute; top: 50%; left: 10px; width: 26px; height: 26px; margin-top: -13px; border-radius: 7px; background: var(--mint); box-shadow: 0 0 18px rgba(var(--mint-rgb), 0.45); will-change: transform; }
.stage::before, .stage::after { content: ""; position: absolute; top: 12px; bottom: 12px; width: 1px; background: rgba(201,201,208,0.25); }
.stage::before { left: 9px; } .stage::after { right: 9px; }

/* ── the curve canvas, wearing the plugin's own classes ───────────────── */
.curve-svg { display: block; width: 100%; height: 100%; background: var(--inset); border: 1px solid var(--b2); border-radius: var(--r-ui); touch-action: none; }
.curve-svg .gv, .curve-svg .gh { stroke: var(--grid); stroke-width: 1; }
.curve-svg .gv.out, .curve-svg .gh.out { opacity: 0.45; }
.curve-svg .gbox { fill: none; stroke: rgba(201,201,208,0.34); stroke-width: 1; }
.curve-svg .curve-path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.curve-svg .cpt { fill: var(--mint); stroke: var(--inset); stroke-width: 1.5; cursor: grab; }
.curve-svg .cpt.end { fill: #fff; }
.curve-svg .cpt.sel { stroke: var(--mint); stroke-width: 2; }
.curve-svg .cpt.hot { r: 5.5; }
.curve-svg .cpt.held { fill: #ff9a5a; }
.curve-svg .chandle-line { stroke: var(--mint); stroke-width: 1; opacity: 0.45; }
.curve-svg .chandle-line.hot { opacity: 0.85; }
.curve-svg .chandle-dot { fill: var(--mint); opacity: 0.65; cursor: grab; }
.curve-svg .chandle-dot.hot { opacity: 1; }
.curve-svg .marquee { fill: rgba(var(--mint-rgb), 0.08); stroke: var(--mint); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.curve-svg.locked { cursor: default; }
.curve-svg.locked .cpt { opacity: 0.45; }
.canvas { aspect-ratio: 3 / 2; min-height: 260px; width: 100%; min-width: 0; }
.canvas.wide { aspect-ratio: 16 / 7; min-height: 240px; }
/* a min-height under an aspect-ratio sets a min WIDTH too, so drop it where the screen is narrow */
@media (max-width: 760px) { .canvas, .canvas.wide, .pair .side .canvas { min-height: 0; } }

/* ── small parts shared by the demos ──────────────────────────────────── */
.tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.tile { display: inline-flex; flex-direction: column; gap: 1px; min-width: 88px; padding: 7px 12px 6px; border-radius: var(--r-ui); background: var(--inset); border: 1px solid var(--b3); }
.tile em { font-family: var(--sg); font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t-muted); }
.tile b { font-family: var(--is); font-weight: 600; font-size: 16px; color: var(--t-primary); line-height: 1.15; }
.tile b small { font-size: 11.5px; color: var(--t-muted); margin-left: 2px; font-weight: 500; }
.tile.dial { cursor: ew-resize; min-width: 112px; position: relative; user-select: none; }
.tile.dial input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: ew-resize; }
.tile.dial:hover, .tile.dial:focus-within { border-color: var(--mint); }
.tile.dial::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--b4); }
.tile.dial i { position: absolute; left: 10px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--mint); width: calc((100% - 20px) * var(--p, 0.5)); z-index: 1; }

.seg { display: flex; gap: 4px; padding: 4px; background: var(--inset); border: 1px solid var(--b2); border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; height: 34px; padding: 0 15px; border-radius: 999px; border: none; background: transparent; color: var(--t-muted); font-family: var(--is); font-weight: 600; font-size: 13.5px; cursor: pointer; transition: color .2s, background .25s; }
.seg button:hover { color: var(--t-primary); }
.seg button.on { background: var(--mint); color: var(--on-accent); }

.meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12.5px; color: var(--t-muted); letter-spacing: 0.02em; padding: 0 2px; }
.meta b { color: var(--t-secondary); font-weight: 500; }
.meta .mint { color: var(--mint); }

/* ── beat 2, the expression writing itself ────────────────────────────── */
.expr { margin: 0; background: var(--inset); border: 1px solid var(--b2); border-radius: var(--r-ui); padding: 14px 16px;
  font-family: var(--mono); font-size: 12px; line-height: 1.55; color: var(--t-secondary);
  height: 190px; overflow: hidden; white-space: pre; min-width: 0;
  -webkit-mask-image: linear-gradient(180deg, #000 76%, transparent 100%), linear-gradient(90deg, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(180deg, #000 76%, transparent 100%), linear-gradient(90deg, #000 88%, transparent 100%);
  mask-composite: intersect; }
.expr .c { color: var(--t-faint); }
.expr .k { color: var(--mint); }

/* ── beat 3, commit ───────────────────────────────────────────────────── */
.commit-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.commit-row .btn { height: 38px; padding: 0 15px; font-size: 13.5px; }
.keydiamond { fill: var(--mint); stroke: var(--inset); stroke-width: 1; }

/* ── beat 4, copy and paste ───────────────────────────────────────────── */
.pair { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 14px; align-items: center; }
.pair .side { display: grid; gap: 8px; min-width: 0; }
.pair .side .canvas { aspect-ratio: 1 / 1; min-height: 190px; }
.pair .cap { font-family: var(--sg); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--t-muted); text-align: center; }
.pair .arrow { color: var(--t-faint); font-size: 22px; padding: 0 2px; }
@media (max-width: 760px) { .pair { grid-template-columns: minmax(0,1fr); } .pair .arrow { transform: rotate(90deg); justify-self: center; } }

/* ── beat 5, the verbs ────────────────────────────────────────────────── */
.verbs { display: flex; gap: 8px; flex-wrap: wrap; }
.verb { height: 38px; padding: 0 16px; border-radius: var(--r-ui); border: 1px solid var(--b4); background: transparent;
  color: var(--t-secondary); font-family: var(--sg); font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: border-color .18s, color .18s, background .18s; }
.verb:hover { border-color: var(--mint); color: var(--mint); }
.verb.on { background: rgba(var(--mint-rgb), 0.14); border-color: var(--mint); color: var(--mint); }

/* ── beat 6, the library ──────────────────────────────────────────────── */
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.lib .card { position: relative; background: var(--inset); border: 1px solid var(--b3); border-radius: 10px; padding: 6px;
  cursor: grab; transition: border-color .18s, transform .28s var(--settle), box-shadow .2s; }
.lib .card:hover { border-color: var(--b4); }
.lib .card.fav { border-color: rgba(var(--mint-rgb), 0.55); }
.lib .card.drag { cursor: grabbing; border-color: var(--mint); box-shadow: 0 12px 30px rgba(0,0,0,0.5); z-index: 2; }
.lib .card.over { border-color: var(--mint); }
.lib .card svg { width: 100%; height: 46px; }
.lib .card span { display: block; margin-top: 4px; font-size: 10.5px; color: var(--t-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib .card .heart { position: absolute; top: 5px; right: 6px; font-size: 10px; color: var(--mint); opacity: 0; }
.lib .card.fav .heart { opacity: 1; }

/* ── beat 7, auto ─────────────────────────────────────────────────────── */
.keyrow { position: relative; height: 40px; border-radius: var(--r-ui); background: var(--inset); border: 1px solid var(--b2); }
.keyrow i { position: absolute; top: 50%; width: 9px; height: 9px; margin: -5px 0 0 -4.5px; background: var(--mint); transform: rotate(45deg); border-radius: 1px; transition: box-shadow .2s; }
.keyrow i.hit { box-shadow: 0 0 12px rgba(var(--mint-rgb), 0.8); }
.bolt { display: inline-flex; align-items: center; gap: 7px; font-family: var(--sg); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t-faint); transition: color .25s; }
.bolt svg { width: 14px; height: 14px; }
.bolt.on { color: var(--mint); }
.bolt.on svg { filter: drop-shadow(0 0 6px rgba(var(--mint-rgb), 0.7)); }

/* ── beat 8, stagger ──────────────────────────────────────────────────── */
.bars { display: grid; align-content: center; gap: 8px; padding: 14px 0; overflow: hidden;
  background: var(--inset); border: 1px solid var(--b2); border-radius: var(--r-ui); min-width: 0; }
.bars .bar { height: 26px; border-radius: 6px; background: linear-gradient(90deg, rgba(var(--mint-rgb),0.85), rgba(var(--mint-rgb),0.45));
  transform-origin: left center; will-change: transform, opacity; }
.bars .bar:nth-child(even) { background: linear-gradient(90deg, rgba(var(--mint-rgb),0.65), rgba(var(--mint-rgb),0.3)); }

/* ── close ────────────────────────────────────────────────────────────── */
.facts { display: grid; gap: 10px; color: var(--t-muted); font-size: 15px; border-left: 1px solid var(--b3); padding-left: 20px; }
.facts b { color: var(--t-secondary); font-weight: 500; }
@media (max-width: 900px) { .facts { border-left: none; padding-left: 0; } }

.foot { border-top: 1px solid var(--b2); padding: 32px 0 42px; }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; font-size: 14px; color: var(--t-muted); }
.foot a:hover { color: var(--mint); }
.foot .spacer { flex: 1; }

/* ── reveal ───────────────────────────────────────────────────────────── */
.rv { opacity: 0; transform: translateY(20px); transition: opacity .65s var(--out), transform .85s var(--settle); transition-delay: calc(var(--i, 0) * 80ms); }
.rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .lib .card, .btn, .verb { transition: none; }
}
