/*
 * DriftEdit design tokens.
 *
 * A contemporary pro-tool palette: layered neutrals with a faint cool bias, hairline edges instead
 * of heavy borders, and colour used by role, the way editors already read it:
 *
 *   --accent   interactive things: the primary action, focus, toggles, sliders, the active tool
 *   --select   the selection on the timeline and the playhead: white on dark, ink on light
 *   --beat     musical information only: beats, bars, song sections, the auto-mode window
 *   --clip-*   what a clip is: video, audio, text, effect, adjustment
 *
 * The viewer's stage stays neutral (no hue) because colour is judged against it.
 *
 * Dark is the studio's default and lives on bare :root. Light follows the OS when the theme is
 * "system" (no data-theme) and is forced with data-theme="light"; "contrast" is high contrast.
 * The accent is azure (Dario's choice). Every text pair is checked against WCAG 2.2 AA in
 * README.md.
 */

:root {
  color-scheme: dark;

  --stage: #08080a;
  --ground: #0e0f12;
  --panel: #16171b;
  --raised: #1f2025;
  --hover: #26282e;
  --pressed: #2d2f36;
  --line: rgb(255 255 255 / 0.07);
  --line-strong: rgb(255 255 255 / 0.12);
  --control-edge: #64666d;      /* 3.1:1 on --panel */
  --well: #0b0c0e;              /* recessed fields and faders */
  --well-shadow: inset 0 1px 2px rgb(0 0 0 / 0.5);
  --cap: #2a2c32;               /* raised buttons and the selected key of a bank */
  --edge-hi: rgb(255 255 255 / 0.07);  /* the lit top edge of anything raised */
  --raise: inset 0 1px 0 var(--edge-hi), 0 1px 1px rgb(0 0 0 / 0.35), 0 0 0 1px rgb(0 0 0 / 0.25);
  --panel-head: #191a1f;
  --text: #f2f3f5;              /* 16.1:1 on --panel */
  --text-2: #a9adb6;            /* 8.0:1 */
  --text-3: #8a8e98;            /* 5.5:1; meta only */

  --accent: #3d8bff;            /* lines, text, focus: 5.4:1 on --panel */
  --accent-fill: #2667e0;       /* buttons and toggles, white on it 5.1:1 */
  --accent-fill-hover: #2f74f0;
  --on-accent: #ffffff;
  --accent-wash: rgb(61 139 255 / 0.14);
  --accent-wash-strong: rgb(61 139 255 / 0.26);

  --select: #ffffff;
  --beat: #f5b83d;              /* 10.1:1 on --panel */
  --beat-wash: rgb(245 184 61 / 0.12);

  --clip-video: #2b4e9e;
  --clip-audio: #157a63;
  --clip-text: #a65a16;
  --clip-effect: #6a4bd1;
  --clip-adjust: #4b5262;
  --clip-ink: #ffffff;          /* 5.1:1 or better on every clip colour */

  --good: #34c77b;
  --warn: #f2a93b;
  --bad: #f0524d;

  --float: #1c1d22;
  --float-shadow: 0 16px 40px rgb(0 0 0 / 0.45), 0 0 0 1px var(--line-strong);
  --card-shadow: 0 0 0 1px var(--line);
  --scrim: rgb(0 0 0 / 0.55);

  --font: "Inter", "Inter Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-11: 0.6875rem;
  --fs-12: 0.75rem;
  --fs-13: 0.8125rem;
  --fs-14: 0.875rem;
  --fs-15: 0.9375rem;
  --fs-17: 1.0625rem;
  --fs-20: 1.25rem;
  --fs-24: 1.5rem;
  --fs-32: 2rem;
  --lh-tight: 1.1;
  --lh-ui: 1.4;
  --lh-read: 1.6;
  --track-tight: -0.011em;
  --track-display: -0.032em;

  --s-1: 2px;
  --s-2: 4px;
  --s-3: 6px;
  --s-4: 8px;
  --s-5: 12px;
  --s-6: 16px;
  --s-7: 20px;
  --s-8: 24px;
  --s-9: 32px;
  --s-10: 48px;
  --s-11: 64px;
  --s-12: 96px;

  --r-1: 3px;                   /* controls, fields, clips: tight, like an instrument */
  --r-2: 4px;                   /* menus, tooltips, chips */
  --r-3: 6px;                   /* panels and cards */
  --r-4: 10px;                  /* sheets, dialogs, the hero frame */
  --r-pill: 999px;              /* status dots and avatars only */

  --control-h: 28px;
  --row-h: 28px;
  --icon: 16px;
  --base: var(--fs-13);

  --t-fast: 120ms;
  --t-med: 200ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="contrast"]) {
    color-scheme: light;
    --stage: #e4e5e8;
    --ground: #f4f5f7;
    --panel: #ffffff;
    --raised: #f1f2f4;
    --hover: #ebecef;
    --pressed: #e2e4e8;
    --line: rgb(17 18 22 / 0.08);
    --line-strong: rgb(17 18 22 / 0.14);
    --control-edge: #8c9099;
    --well: #eceef1;
    --well-shadow: inset 0 1px 2px rgb(17 18 22 / 0.12);
    --cap: #ffffff;
    --edge-hi: rgb(255 255 255 / 0.9);
    --raise: inset 0 1px 0 var(--edge-hi), 0 1px 1px rgb(17 18 22 / 0.1), 0 0 0 1px rgb(17 18 22 / 0.13);
    --panel-head: #f7f8fa;
    --text: #111216;
    --text-2: #4a4e57;
    --text-3: #646973;
    --accent: #1f63e0;
    --accent-fill: #1f63e0;
    --accent-fill-hover: #1a56c4;
    --on-accent: #ffffff;
    --accent-wash: rgb(31 99 224 / 0.1);
    --accent-wash-strong: rgb(31 99 224 / 0.2);
    --select: #111216;
    --beat: #a86c00;
    --beat-wash: rgb(232 160 30 / 0.16);
    --float: #ffffff;
    --float-shadow: 0 16px 40px rgb(17 18 22 / 0.14), 0 0 0 1px var(--line-strong);
    --card-shadow: 0 1px 2px rgb(17 18 22 / 0.06), 0 0 0 1px var(--line);
    --scrim: rgb(17 18 22 / 0.35);
    --good: #157f4a;
    --warn: #a35a00;
    --bad: #c8312c;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --stage: #e4e5e8;
  --ground: #f4f5f7;
  --panel: #ffffff;
  --raised: #f1f2f4;
  --hover: #ebecef;
  --pressed: #e2e4e8;
  --line: rgb(17 18 22 / 0.08);
  --line-strong: rgb(17 18 22 / 0.14);
  --control-edge: #8c9099;
  --well: #eceef1;
  --well-shadow: inset 0 1px 2px rgb(17 18 22 / 0.12);
  --cap: #ffffff;
  --edge-hi: rgb(255 255 255 / 0.9);
  --raise: inset 0 1px 0 var(--edge-hi), 0 1px 1px rgb(17 18 22 / 0.1), 0 0 0 1px rgb(17 18 22 / 0.13);
  --panel-head: #f7f8fa;
  --text: #111216;
  --text-2: #4a4e57;
  --text-3: #646973;
  --accent: #1f63e0;
  --accent-fill: #1f63e0;
  --accent-fill-hover: #1a56c4;
  --on-accent: #ffffff;
  --accent-wash: rgb(31 99 224 / 0.1);
  --accent-wash-strong: rgb(31 99 224 / 0.2);
  --select: #111216;
  --beat: #a86c00;
  --beat-wash: rgb(232 160 30 / 0.16);
  --float: #ffffff;
  --float-shadow: 0 16px 40px rgb(17 18 22 / 0.14), 0 0 0 1px var(--line-strong);
  --card-shadow: 0 1px 2px rgb(17 18 22 / 0.06), 0 0 0 1px var(--line);
  --scrim: rgb(17 18 22 / 0.35);
  --good: #157f4a;
  --warn: #a35a00;
  --bad: #c8312c;
}

:root[data-theme="contrast"] {
  color-scheme: dark;
  --stage: #000000;
  --ground: #000000;
  --panel: #000000;
  --raised: #111111;
  --hover: #1d1d1d;
  --pressed: #282828;
  --line: #7a7a7a;
  --line-strong: #c8c8c8;
  --control-edge: #ffffff;
  --well: #000000;
  --well-shadow: inset 0 0 0 1px #ffffff;
  --cap: #1a1a1a;
  --edge-hi: rgb(255 255 255 / 0.3);
  --raise: 0 0 0 1px #c8c8c8;
  --panel-head: #000000;
  --text: #ffffff;
  --text-2: #e4e4e4;
  --text-3: #d0d0d0;
  --accent: #7fb2ff;
  --accent-fill: #7fb2ff;
  --accent-fill-hover: #a3c8ff;
  --on-accent: #000000;
  --select: #ffffff;
  --beat: #ffd166;
  --float: #000000;
  --float-shadow: 0 0 0 2px #ffffff;
  --card-shadow: 0 0 0 1px #c8c8c8;
}

@media (pointer: coarse) {
  :root {
    --control-h: 44px;
    --row-h: 44px;
    --icon: 20px;
    --base: var(--fs-15);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --t-fast: 0ms;
    --t-med: 0ms;
  }
}

/*
 * Inter by Rasmus Andersson (SIL Open Font License 1.1), self-hosted because the studio is
 * cross-origin isolated. One variable file per subset with weight 100 to 900 and optical size
 * 14 to 32, so headlines get Inter Display's tighter shapes automatically
 * (font-optical-sizing: auto). Tabular figures for timecode come from the same file.
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/inter-latin.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/inter-latin-ext.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/inter-latin-italic.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Metric-matched fallback so the swap does not move the layout. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
}

/* Base: the page, text, focus, and the few element defaults every surface shares. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--base);
  line-height: var(--lh-ui);
  font-optical-sizing: auto;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
[aria-disabled="true"] {
  cursor: default;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: currentColor;
}

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

::selection {
  background: var(--accent-wash-strong);
}

.de-num {
  font-variant-numeric: tabular-nums;
}

/* `hidden` always hides, whatever display a component's class sets. */
[hidden] {
  display: none !important;
}

.de-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.de-icon {
  width: var(--icon);
  height: var(--icon);
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/*
 * Controls, built like the panel of an instrument rather than a web form: raised caps with a lit
 * top edge, recessed wells for anything you type or drag, banks of keys where one is lit, fader
 * caps on sliders, square switches. Tight 3 px corners throughout; nothing is a pill except a
 * status dot. Single-class selectors with --modifiers.
 */

/* ---------- Buttons: raised caps ---------- */

.de-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  min-height: var(--control-h);
  padding: 0 var(--s-5);
  border: 0;
  border-radius: var(--r-1);
  background: var(--cap);
  box-shadow: var(--raise);
  color: var(--text);
  font-size: var(--base);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.de-btn:hover {
  background: var(--hover);
}

.de-btn:active {
  background: var(--pressed);
  box-shadow: var(--well-shadow);
}

.de-btn:disabled,
.de-btn[aria-disabled="true"] {
  color: var(--text-3);
  background: var(--raised);
  box-shadow: none;
}

.de-btn--primary {
  background: var(--accent-fill);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2), 0 1px 1px rgb(0 0 0 / 0.35), 0 0 0 1px rgb(0 0 0 / 0.3);
  color: var(--on-accent);
  font-weight: 600;
}

.de-btn--primary:hover {
  background: var(--accent-fill-hover);
}

.de-btn--primary:active {
  background: var(--accent-fill);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.35);
}

.de-btn--ghost {
  background: transparent;
  box-shadow: none;
  color: var(--text-2);
}

.de-btn--ghost:hover {
  background: var(--hover);
  color: var(--text);
}

.de-btn--ghost:active {
  box-shadow: none;
}

.de-btn--danger {
  color: var(--bad);
}

.de-btn--icon {
  width: var(--control-h);
  padding: 0;
}

.de-btn--sm {
  min-height: 22px;
  padding: 0 var(--s-4);
  font-size: var(--fs-12);
}

.de-btn--sm.de-btn--icon {
  width: 22px;
  padding: 0;
}

.de-btn--sm .de-icon {
  width: 14px;
  height: 14px;
}

.de-btn--lg {
  min-height: 42px;
  padding: 0 var(--s-7);
  border-radius: var(--r-2);
  font-size: var(--fs-15);
}

/* A tool or a setting that is on: lit, with an indicator bar along the bottom edge. */
.de-btn[aria-pressed="true"] {
  background: var(--cap);
  box-shadow: var(--raise), inset 0 -2px 0 var(--accent);
  color: var(--text);
}

.de-btn--ghost[aria-pressed="true"] {
  background: var(--accent-wash);
  box-shadow: inset 0 -2px 0 var(--accent);
  color: var(--accent);
}

/* ---------- Fields: recessed wells ---------- */

.de-label {
  display: block;
  margin-bottom: var(--s-3);
  color: var(--text-2);
  font-size: var(--fs-12);
  font-weight: 500;
}

.de-input {
  display: block;
  width: 100%;
  min-height: calc(var(--control-h) + 4px);
  padding: 0 var(--s-4);
  border: 1px solid var(--control-edge);
  border-radius: var(--r-1);
  background: var(--well);
  box-shadow: var(--well-shadow);
  color: var(--text);
}

.de-input::placeholder {
  color: var(--text-3);
}

.de-input:focus-visible {
  outline-offset: 1px;
  border-color: var(--accent);
}

.de-input[aria-invalid="true"] {
  border-color: var(--bad);
}

.de-hint {
  margin-top: var(--s-3);
  color: var(--text-3);
  font-size: var(--fs-12);
}

.de-hint--error {
  color: var(--bad);
}

/* A numeric readout you drag sideways or click to type. */
.de-numfield {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 58px;
  height: 22px;
  padding: 0 var(--s-3);
  border-radius: var(--r-1);
  background: var(--well);
  box-shadow: var(--well-shadow), inset 0 0 0 1px var(--line);
  color: var(--text);
  font-size: var(--fs-12);
  font-variant-numeric: tabular-nums;
  cursor: ew-resize;
}

.de-numfield__axis {
  color: var(--text-3);
  font-weight: 600;
}

.de-numfield__unit {
  margin-left: auto;
  color: var(--text-3);
}

/* The number itself; it gives way to a text box while the value is typed. */
.de-numfield__value {
  flex: 1;
  min-width: 0;
}

.de-numfield__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.de-numfield:focus-within {
  box-shadow: var(--well-shadow), inset 0 0 0 1px var(--accent);
  cursor: text;
}

.de-numfield[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
}

.de-numfield--keyed {
  color: var(--accent);
}

/* ---------- Switch: square ---------- */

.de-toggle {
  position: relative;
  flex: none;
  width: 28px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: var(--r-1);
  background: var(--well);
  box-shadow: var(--well-shadow), inset 0 0 0 1px var(--line-strong);
  transition: background-color var(--t-fast) var(--ease);
}

.de-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--text-2);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25), 0 1px 1px rgb(0 0 0 / 0.4);
  transition: transform var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}

.de-toggle[aria-checked="true"] {
  background: var(--accent-fill);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.3);
}

.de-toggle[aria-checked="true"]::after {
  transform: translateX(12px);
  background: #ffffff;
}

@media (pointer: coarse) {
  .de-toggle {
    width: 44px;
    height: 26px;
  }
  .de-toggle::after {
    width: 22px;
    height: 22px;
  }
  .de-toggle[aria-checked="true"]::after {
    transform: translateX(18px);
  }
}

/* ---------- A bank of keys: one lit ---------- */

.de-seg {
  display: inline-flex;
  overflow: hidden;
  border-radius: var(--r-1);
  background: var(--well);
  box-shadow: var(--well-shadow), inset 0 0 0 1px var(--line);
}

.de-seg__opt {
  position: relative;
  flex: 1;
  min-height: calc(var(--control-h) - 2px);
  padding: 0 var(--s-5);
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-12);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.de-seg__opt:first-child {
  border-left: 0;
}

.de-seg__opt:hover {
  color: var(--text);
}

.de-seg__opt[aria-checked="true"],
.de-seg__opt[aria-selected="true"] {
  background: var(--cap);
  box-shadow: inset 0 1px 0 var(--edge-hi), inset 0 -2px 0 var(--accent);
  color: var(--text);
}

.de-seg__opt[aria-disabled="true"] {
  color: var(--text-3);
}

/* ---------- Slider: a fader groove and cap ---------- */

.de-slider {
  /* The thumb's width, which the fill (set by the studio's shared slider) stops half of in from each end. */
  --slider-thumb: 8px;
  width: 100%;
  height: 18px;
  margin: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}

.de-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 1px;
  background: linear-gradient(to right, var(--accent) var(--fill, 50%), var(--well) var(--fill, 50%));
  box-shadow: var(--well-shadow), inset 0 0 0 1px var(--line);
}

.de-slider::-moz-range-track {
  height: 4px;
  border-radius: 1px;
  background: var(--well);
}

.de-slider::-moz-range-progress {
  height: 4px;
  border-radius: 1px;
  background: var(--accent);
}

.de-slider::-webkit-slider-thumb {
  width: var(--slider-thumb);
  height: 16px;
  margin-top: -6px;
  border: 0;
  border-radius: 2px;
  background: linear-gradient(to right, transparent 3px, rgb(0 0 0 / 0.35) 3px, rgb(0 0 0 / 0.35) 5px, transparent 5px), #e7e9ee;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.5), inset 0 1px 0 #ffffff;
  -webkit-appearance: none;
}

.de-slider::-moz-range-thumb {
  width: var(--slider-thumb);
  height: 16px;
  border: 0;
  border-radius: 2px;
  background: #e7e9ee;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.5);
}

/* ---------- Tabs: an underline, nothing else ---------- */

.de-tabs {
  display: flex;
  gap: var(--s-5);
}

.de-tab {
  position: relative;
  min-height: var(--control-h);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: var(--fs-12);
  font-weight: 600;
}

.de-tab:hover {
  color: var(--text);
}

.de-tab[aria-selected="true"] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* ---------- Badges, keys, progress, avatar, timecode, meters ---------- */

.de-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 18px;
  padding: 0 var(--s-3);
  border-radius: 2px;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
  font-size: var(--fs-11);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* A badge that opens a menu: the sequence's format in the transport. */
.de-badge--button {
  gap: 4px;
  border: 0;
  cursor: pointer;
}

.de-badge--button:hover {
  color: var(--text);
  background: var(--hover);
}

.de-badge--button .de-icon {
  width: 10px;
  height: 10px;
}

.de-chip .de-icon:last-child:not(:first-child) {
  width: 12px;
  height: 12px;
  opacity: 0.8;
}

.de-badge--accent {
  background: var(--accent-wash);
  box-shadow: inset 0 0 0 1px var(--accent-wash-strong);
  color: var(--accent);
}

.de-badge--beat {
  background: var(--beat-wash);
  box-shadow: none;
  color: var(--beat);
}

.de-badge--good {
  color: var(--good);
}

.de-badge--warn {
  color: var(--warn);
}

/* A status light: the one round thing. */
.de-led {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--good);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--good) 25%, transparent);
}

.de-led--busy {
  background: var(--text-3);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--text-3) 25%, transparent);
}

.de-led--bad {
  background: var(--bad);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 25%, transparent);
}

.de-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 var(--s-2);
  border-radius: var(--r-1);
  background: var(--cap);
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 1px 0 rgb(0 0 0 / 0.5), 0 0 0 1px var(--line-strong);
  color: var(--text-2);
  font-size: var(--fs-11);
  font-weight: 600;
  line-height: 1;
}

.de-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 1px;
  background: var(--well);
  box-shadow: var(--well-shadow);
}

.de-progress__bar {
  height: 100%;
  width: var(--value, 0%);
  background: var(--accent);
  transition: width var(--t-med) linear;
}

.de-avatar {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--pressed);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text);
  font-size: var(--fs-11);
  font-weight: 700;
}

.de-timecode {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.de-timecode__dim {
  color: var(--text-3);
  font-weight: 500;
}

/* A stereo level meter: two recessed bars lit from the bottom, green to amber to red. */
.de-meter {
  display: inline-flex;
  gap: 2px;
  height: var(--meter-h, 26px);
}

.de-meter__ch {
  position: relative;
  width: 4px;
  overflow: hidden;
  border-radius: 1px;
  background: var(--well);
  box-shadow: var(--well-shadow);
}

.de-meter__ch::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--level, 60%);
  background: linear-gradient(to top, var(--good) 0 70%, var(--warn) 70% 88%, var(--bad) 88%);
  background-size: 100% var(--meter-h, 26px);
  background-position: bottom;
}

/*
 * The site (driftedit.app). Same tokens as the studio. A product site in the current idiom:
 * centred hero with the real product under it, sections that show working interface rather than
 * icons, plans, questions, and a closing call to action. Type is Inter at display optical size,
 * tightly tracked; colour comes from the footage and the interface, never from decoration.
 */

.de-site {
  --base: 1rem;
  font-size: var(--base);
  line-height: var(--lh-read);
}

.de-wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.de-nav {
  position: sticky;
  top: var(--nav-top, 0px);
  z-index: 10;
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}

.de-nav__inner {
  display: flex;
  align-items: center;
  gap: var(--s-8);
  min-height: 60px;
}

.de-nav__links {
  display: flex;
  gap: var(--s-7);
  color: var(--text-2);
  font-size: var(--fs-14);
}

.de-nav__links a {
  text-decoration: none;
}

.de-nav__links a:hover {
  color: var(--text);
}

.de-nav__actions {
  display: flex;
  gap: var(--s-3);
  margin-left: auto;
}

.de-h1 {
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  font-weight: 640;
  line-height: 1.02;
  letter-spacing: var(--track-display);
}

.de-h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 620;
  line-height: 1.08;
  letter-spacing: -0.028em;
}

.de-h3 {
  font-size: var(--fs-17);
  font-weight: 600;
  letter-spacing: -0.012em;
}

.de-lede {
  color: var(--text-2);
  font-size: clamp(1.0625rem, 1.5vw, 1.2rem);
  line-height: 1.55;
}

.de-copy {
  color: var(--text-2);
}

.de-hero {
  display: grid;
  justify-items: center;
  gap: var(--s-7);
  padding-block: clamp(48px, 9vw, 104px) var(--s-10);
  text-align: center;
}

.de-hero .de-h1 {
  max-width: 14ch;
  /* Room for the beat lights under "beat". */
  padding-bottom: 0.14em;
}

.de-hero .de-lede {
  max-width: 44ch;
}

.de-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-4);
}

.de-hero__note {
  color: var(--text-3);
  font-size: var(--fs-13);
}

/* The product under the hero: a live studio with the phone result over its corner. */
.de-showcase {
  position: relative;
  margin-bottom: clamp(56px, 9vw, 120px);
}

.de-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-4);
  background: var(--ground);
  box-shadow: 0 0 0 1px var(--line-strong), 0 30px 80px rgb(0 0 0 / 0.35);
}

.de-frame__inner {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  pointer-events: none;
}

.de-showcase__phone {
  position: absolute;
  right: clamp(-12px, -2vw, -28px);
  bottom: clamp(-28px, -4vw, -56px);
  width: clamp(120px, 19%, 210px);
  aspect-ratio: 9 / 19.5;
  overflow: hidden;
  border-radius: clamp(18px, 3vw, 32px);
  background: #000;
  box-shadow: 0 0 0 6px #0b0b0c, 0 0 0 7px rgb(255 255 255 / 0.12), 0 24px 60px rgb(0 0 0 / 0.5);
}

.de-showcase__phone img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.de-showcase__cap {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 18%;
  color: #fff;
  font-size: clamp(9px, 1.1vw, 14px);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 2px 8px rgb(0 0 0 / 0.6);
}

/* Sections */
.de-section {
  display: grid;
  gap: var(--s-9);
  padding-block: clamp(56px, 8vw, 104px);
}

.de-section__head {
  display: grid;
  justify-items: center;
  gap: var(--s-5);
  max-width: 40rem;
  margin-inline: auto;
  text-align: center;
}

.de-section__head .de-h2 {
  text-wrap: balance;
}

.de-twocol {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
}

.de-stylepick {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.de-pill {
  min-height: 36px;
  padding: 0 var(--s-6);
  border: 0;
  border-radius: var(--r-pill);
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
  font-size: var(--fs-14);
  font-weight: 500;
}

.de-pill:hover {
  color: var(--text);
}

.de-pill[aria-pressed="true"] {
  background: var(--text);
  box-shadow: none;
  color: var(--ground);
}

/* The strip: an auto edit laid out on its song. */
.de-card {
  border-radius: var(--r-4);
  background: var(--panel);
  box-shadow: var(--card-shadow);
}

.de-strip {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-6);
}

.de-strip__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-4);
  font-size: var(--fs-13);
}

.de-strip__meta {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.de-strip__track {
  position: relative;
  display: grid;
  grid-template-rows: 28px 64px 84px;
  gap: var(--s-2);
}

.de-strip__wave {
  width: 100%;
  height: 100%;
  color: var(--text-3);
}

.de-strip__cuts {
  position: relative;
}

.de-strip__shot {
  position: absolute;
  top: 0;
  bottom: 0;
  overflow: hidden;
  border-radius: 5px;
  background: var(--stage);
  transition: left var(--t-med) var(--ease), width var(--t-med) var(--ease);
}

.de-strip__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.de-strip__note {
  color: var(--text-3);
  font-size: var(--fs-13);
}

/* Feature tiles: each shows working interface. */
.de-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-6);
}

.de-tile-feature {
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
  gap: var(--s-5);
  min-width: 0;
  padding: var(--s-8);
  overflow: hidden;
}

.de-tile-feature__text {
  display: grid;
  gap: var(--s-3);
}

.de-tile-feature__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-3);
  background: var(--accent-wash);
  color: var(--accent);
}

.de-tile-feature__icon .de-icon {
  width: 22px;
  height: 22px;
}

.de-tile-feature__ui {
  align-self: end;
  min-width: 0;
  padding: var(--s-5);
  border-radius: var(--r-2);
  background: var(--ground);
  box-shadow: inset 0 0 0 1px var(--line);
}

.de-stems {
  display: grid;
  gap: var(--s-3);
}

.de-stem {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: var(--s-4);
  font-size: var(--fs-12);
  color: var(--text-2);
}

.de-stem svg {
  width: 100%;
  height: 26px;
}

.de-caption-demo {
  display: grid;
  place-items: center;
  height: 150px;
  overflow: hidden;
  border-radius: var(--r-1);
  background: center / cover no-repeat;
}

.de-caption-demo__text {
  max-width: 85%;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 2px 10px rgb(0 0 0 / 0.65);
}

.de-caption-demo__now {
  padding: 0 4px;
  border-radius: 4px;
  background: var(--accent-fill);
  color: var(--on-accent);
  text-shadow: none;
}

.de-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-6);
  margin: 0;
}

.de-fact {
  display: grid;
  gap: var(--s-2);
  padding-top: var(--s-6);
  border-top: 1px solid var(--line-strong);
}

.de-fact dt {
  font-size: var(--fs-20);
  font-weight: 620;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.de-fact dd {
  margin: 0;
  color: var(--text-2);
}

/* Plans */
.de-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-6);
  width: 100%;
  max-width: 860px;
  margin-inline: auto;
}

.de-plan {
  display: grid;
  align-content: start;
  gap: var(--s-6);
  padding: var(--s-8);
}

.de-plan--pro {
  box-shadow: inset 0 0 0 1.5px var(--accent), var(--card-shadow);
}

.de-plan__price {
  font-size: var(--fs-32);
  font-weight: 640;
  letter-spacing: -0.03em;
}

.de-plan__price small {
  color: var(--text-3);
  font-size: var(--fs-14);
  font-weight: 400;
  letter-spacing: 0;
}

.de-checks {
  display: grid;
  gap: var(--s-4);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
}

.de-checks li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: var(--s-4);
}

.de-checks .de-icon {
  margin-top: 3px;
  color: var(--accent);
}

/* Questions */
.de-faq {
  display: grid;
  width: 100%;
  max-width: 820px;
  margin-inline: auto;
  border-top: 1px solid var(--line-strong);
}

.de-faq details {
  border-bottom: 1px solid var(--line-strong);
}

.de-faq summary {
  display: flex;
  justify-content: space-between;
  gap: var(--s-6);
  padding-block: var(--s-6);
  font-size: var(--fs-17);
  font-weight: 560;
  cursor: pointer;
  list-style: none;
}

.de-faq summary::-webkit-details-marker {
  display: none;
}

.de-faq summary::after {
  content: "+";
  color: var(--text-3);
  font-weight: 400;
}

.de-faq details[open] summary::after {
  content: "−";
}

.de-faq p {
  max-width: 64ch;
  padding-bottom: var(--s-6);
  color: var(--text-2);
}

.de-closing {
  display: grid;
  justify-items: center;
  gap: var(--s-6);
  padding: clamp(40px, 7vw, 80px) var(--s-6);
  text-align: center;
}

.de-footer {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: var(--s-8);
  padding-block: var(--s-10, 64px) var(--s-9);
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: var(--fs-13);
}

.de-footer__brand {
  display: grid;
  align-content: start;
  gap: var(--s-4);
  max-width: 34ch;
}

.de-footer__brand .de-logo {
  justify-self: start;
}

.de-footer__col {
  display: grid;
  align-content: start;
  gap: var(--s-3);
}

.de-footer__col h2 {
  margin-bottom: var(--s-2);
  color: var(--text);
  font-size: var(--fs-13);
  font-weight: 600;
}

.de-footer__col a {
  color: var(--text-2);
  text-decoration: none;
}

.de-footer__col a:hover,
.de-footer__col a[aria-current="page"] {
  color: var(--text);
}

@media (max-width: 720px) {
  .de-footer { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .de-footer__brand { grid-column: 1 / -1; }
}

/* The logo in the nav, and a skip link for keyboards. */
/* The logo, in the nav and the footer alike. */
.de-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--s-4);
  color: var(--text);
  font-size: var(--fs-15);
  font-weight: 650;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.de-logo__mark {
  width: 26px;
  height: 26px;
  color: var(--accent-fill);
}

.de-nav__links a[aria-current="page"] {
  color: var(--text);
}

.de-skip {
  position: absolute;
  left: var(--s-6);
  top: -100px;
  z-index: 20;
  padding: var(--s-4) var(--s-6);
  border-radius: var(--r-2);
  background: var(--accent-fill);
  color: var(--on-accent);
}

.de-skip:focus {
  top: var(--s-4);
}

/* Auto mode's styles, as cards under the home page's section head. */
.de-styles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--s-5);
}

.de-style {
  display: grid;
  align-content: start;
  gap: var(--s-4);
  padding: var(--s-7);
}

/* Article pages: one readable column. */
.de-prose {
  display: grid;
  gap: var(--s-9);
  max-width: 44rem;
  padding-block: clamp(40px, 7vw, 88px) var(--s-10);
}

.de-prose__head {
  display: grid;
  gap: var(--s-6);
}

.de-prose__title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
}

.de-prose section {
  display: grid;
  gap: var(--s-5);
}

.de-prose p,
.de-prose li,
.de-prose dd {
  color: var(--text-2);
  line-height: var(--lh-read);
}

.de-prose strong,
.de-prose dt {
  color: var(--text);
  font-weight: 600;
}

.de-prose a {
  color: var(--accent);
}

.de-list,
.de-steps,
.de-credits {
  display: grid;
  gap: var(--s-4);
  margin: 0;
  padding-left: 1.2em;
}

.de-steps li::marker {
  color: var(--accent);
  font-weight: 700;
}

.de-credits {
  padding-left: 0;
  list-style: none;
}

.de-credits .de-copy {
  font-size: var(--fs-13);
  overflow-wrap: anywhere;
}

.de-defs {
  display: grid;
  gap: var(--s-6);
  margin: 0;
}

.de-defs dd {
  margin: var(--s-2) 0 0;
}

.de-prose section > h2 {
  font-size: var(--fs-24);
  letter-spacing: -0.02em;
}

.de-catgroup {
  display: grid;
  gap: var(--s-3);
}

.de-catgroup .de-h3 {
  font-size: var(--fs-15);
}

.de-catlist {
  font-size: var(--fs-14);
}

.de-count {
  margin-left: var(--s-2);
  color: var(--text-3);
  font-size: var(--fs-13);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.de-note {
  color: var(--text-3);
  font-size: var(--fs-13);
}

@media (max-width: 900px) {
  .de-twocol,
  .de-tiles,
  .de-plans {
    grid-template-columns: minmax(0, 1fr);
  }
  .de-nav__links {
    display: none;
  }
}

@media (max-width: 600px) {
  .de-facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .de-nav__actions .de-btn--ghost {
    display: none;
  }
  .de-tile-feature {
    padding: var(--s-6);
  }
  .de-showcase__phone {
    right: -6px;
    width: 30%;
  }
}


/* The landing's picture of the studio: the computer, with the phone over its corner. */
.de-shot {
  position: relative;
  display: grid;
  gap: var(--s-4);
  max-width: 1120px;
  margin: 0 auto var(--s-10, 64px);
}

.de-shot__desktop {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-2, 6px);
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgb(0 0 0 / 0.45);
}

.de-shot__phone {
  position: absolute;
  right: -2%;
  bottom: 6%;
  width: 21%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 18px;
  background: #0b0d12;
  box-shadow: 0 0 0 6px #0b0d12, 0 0 0 7px var(--line), 0 24px 50px rgb(0 0 0 / 0.55);
}

/* The exported edit plays in the phone; where motion is reduced, its first frame stands still. */
.de-shot__video,
.de-shot__still {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.de-shot__still {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .de-shot__video { display: none; }
  .de-shot__still { display: block; }
}

.de-shot figcaption {
  max-width: 64ch;
}

@media (max-width: 640px) {
  /* On a phone the playing edit comes first, under the buttons. */
  .de-shot__phone { position: static; order: -1; width: 64%; justify-self: center; }
}

/* The icon sprite inline in every page: there for <use>, never seen or laid out. */
.de-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/*
 * The hero's two words that move, at the 120 BPM the styles board runs at. "clips" is the footage's
 * blue and is cut like an edit once a bar: two slices of it jump sideways for a frame or two.
 * "beat" is the studio's beat amber, kicks on every beat, and lights a beat of four under it.
 * Where motion is reduced both stand still, coloured.
 */
.de-cutword,
.de-beatword {
  position: relative;
  display: inline-block;
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.de-cutword {
  background-image: linear-gradient(100deg, var(--accent) 0%, color-mix(in oklab, var(--accent) 45%, white) 28%, var(--text) 50%, color-mix(in oklab, var(--accent) 45%, white) 72%, var(--accent) 100%);
  animation: de-sheen 4s linear infinite;
}

.de-cutword::before,
.de-cutword::after {
  content: attr(data-text) / "";
  position: absolute;
  inset: 0;
  background: none;
  opacity: 0;
  pointer-events: none;
  animation: de-cut 2s linear infinite;
}

.de-cutword::before {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
  clip-path: inset(18% 0 52% 0);
}

.de-cutword::after {
  color: color-mix(in oklab, var(--accent) 35%, white);
  -webkit-text-fill-color: color-mix(in oklab, var(--accent) 35%, white);
  clip-path: inset(58% 0 12% 0);
  animation-name: de-cut-back;
}

.de-beatword {
  background-image: linear-gradient(100deg, var(--beat) 0%, color-mix(in oklab, var(--beat) 40%, white) 30%, var(--text) 50%, color-mix(in oklab, var(--beat) 40%, white) 70%, var(--beat) 100%);
  transform-origin: 50% 75%;
  animation: de-sheen 4s linear infinite reverse, de-kick 0.5s cubic-bezier(0.16, 0.8, 0.3, 1) infinite;
}

/* Four beats under the word: a dim bar of four, and the one playing lit. */
.de-beatword::after,
.de-beatword::before {
  content: "" / "";
  position: absolute;
  bottom: -0.1em;
  height: 0.065em;
  border-radius: 0.04em;
  pointer-events: none;
}

.de-beatword::after {
  left: 0.04em;
  right: 0.04em;
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--text) 18%, transparent) 0 calc(25% - 0.08em), transparent 0 25%);
}

.de-beatword::before {
  left: 0.04em;
  width: calc((100% - 0.08em) / 4);
  background: linear-gradient(90deg, var(--beat) 0 calc(100% - 0.08em), transparent 0);
  animation: de-beats 2s steps(4, end) infinite;
}

@keyframes de-sheen {
  from { background-position: 0% 50%; }
  to { background-position: 220% 50%; }
}

@keyframes de-cut {
  0% { opacity: 1; transform: translateX(-0.07em); }
  4% { opacity: 1; transform: translateX(0.05em); }
  8%, 100% { opacity: 0; transform: none; }
}

@keyframes de-cut-back {
  0% { opacity: 1; transform: translateX(0.06em); }
  5% { opacity: 1; transform: translateX(-0.04em); }
  9%, 100% { opacity: 0; transform: none; }
}

@keyframes de-kick {
  0% { transform: scale(1.075); filter: drop-shadow(0 0 0.18em color-mix(in srgb, var(--beat) 55%, transparent)); }
  45%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); }
}

@keyframes de-beats {
  from { transform: translateX(0); }
  to { transform: translateX(400%); }
}

/* Auto mode's styles as tracks: a head for each, its lane of cuts, one playhead over them all. */
.de-board {
  display: grid;
  gap: var(--s-3);
  width: 100%;
  padding: var(--s-6);
  border-radius: var(--r-4);
  background: var(--panel);
  box-shadow: var(--card-shadow);
}

.de-board__ruler,
.de-track {
  display: grid;
  grid-template-columns: minmax(180px, 17rem) minmax(0, 1fr);
  align-items: center;
  gap: var(--s-6);
}

.de-board__bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  color: var(--text-3);
  font-size: var(--fs-12);
  font-variant-numeric: tabular-nums;
}

.de-board__bars span {
  padding-left: var(--s-2);
  border-left: 1px solid var(--line-strong);
}

.de-track {
  padding-block: var(--s-4);
  border-top: 1px solid var(--line);
}

.de-track__head {
  display: grid;
  gap: var(--s-1);
}

.de-track__note {
  color: var(--accent);
  font-size: var(--fs-13);
  font-weight: 500;
}

.de-track__summary {
  color: var(--text-2);
  font-size: var(--fs-13);
  line-height: 1.45;
}

.de-track__lane {
  position: relative;
  height: 56px;
  border-radius: var(--r-2);
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 25%), var(--ground);
}

.de-lane__svg {
  display: block;
  width: 100%;
  height: 100%;
}

.de-lane__shot {
  fill: var(--clip-video);
}

.de-lane__shot--alt {
  fill: color-mix(in oklab, var(--clip-video) 72%, white);
}

.de-lane__shot--back {
  fill: url(#de-hatch);
}

.de-hatch__ground {
  fill: var(--clip-video);
}

.de-hatch__line {
  fill: color-mix(in oklab, var(--clip-video) 55%, white);
}

.de-lane__cut {
  fill: var(--text);
  opacity: 0.5;
  animation: de-hit 8s linear infinite;
}

.de-lane__cut--soft {
  fill: var(--accent);
}

/* The playhead: across four bars in 8 s, every lane together. */
.de-track__lane::after {
  content: "";
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--select);
  box-shadow: 0 0 10px color-mix(in srgb, var(--select) 45%, transparent);
  animation: de-sweep 8s linear infinite;
}

@keyframes de-sweep {
  from { left: 0%; }
  to { left: 100%; }
}

@keyframes de-hit {
  0% { opacity: 1; fill: var(--beat); }
  3% { opacity: 0.85; }
  6%, 100% { opacity: 0.5; }
}

/* Each cut lights when the playhead reaches it: half a beat (0.25 s) per step. */
.de-cut--b0 { animation-delay: 0s; }
.de-cut--b1 { animation-delay: 0.25s; }
.de-cut--b2 { animation-delay: 0.5s; }
.de-cut--b3 { animation-delay: 0.75s; }
.de-cut--b4 { animation-delay: 1s; }
.de-cut--b5 { animation-delay: 1.25s; }
.de-cut--b6 { animation-delay: 1.5s; }
.de-cut--b7 { animation-delay: 1.75s; }
.de-cut--b8 { animation-delay: 2s; }
.de-cut--b9 { animation-delay: 2.25s; }
.de-cut--b10 { animation-delay: 2.5s; }
.de-cut--b11 { animation-delay: 2.75s; }
.de-cut--b12 { animation-delay: 3s; }
.de-cut--b13 { animation-delay: 3.25s; }
.de-cut--b14 { animation-delay: 3.5s; }
.de-cut--b15 { animation-delay: 3.75s; }
.de-cut--b16 { animation-delay: 4s; }
.de-cut--b17 { animation-delay: 4.25s; }
.de-cut--b18 { animation-delay: 4.5s; }
.de-cut--b19 { animation-delay: 4.75s; }
.de-cut--b20 { animation-delay: 5s; }
.de-cut--b21 { animation-delay: 5.25s; }
.de-cut--b22 { animation-delay: 5.5s; }
.de-cut--b23 { animation-delay: 5.75s; }
.de-cut--b24 { animation-delay: 6s; }
.de-cut--b25 { animation-delay: 6.25s; }
.de-cut--b26 { animation-delay: 6.5s; }
.de-cut--b27 { animation-delay: 6.75s; }
.de-cut--b28 { animation-delay: 7s; }
.de-cut--b29 { animation-delay: 7.25s; }
.de-cut--b30 { animation-delay: 7.5s; }
.de-cut--b31 { animation-delay: 7.75s; }

.de-board__key {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: var(--fs-12);
}

.de-board__swatch {
  width: 18px;
  height: 10px;
  border-radius: 2px;
  background: repeating-linear-gradient(45deg, var(--clip-video) 0 2px, color-mix(in oklab, var(--clip-video) 55%, white) 2px 3px);
}

@media (max-width: 720px) {
  .de-board { padding: var(--s-4); }
  .de-board__ruler { grid-template-columns: 1fr; }
  .de-board__ruler > span:first-child { display: none; }
  .de-track { grid-template-columns: 1fr; gap: var(--s-3); }
}

@media (prefers-reduced-motion: reduce) {
  .de-cutword, .de-beatword, .de-beatword::before, .de-lane__cut, .de-track__lane::after { animation: none; }
  .de-cutword::before, .de-cutword::after { display: none; }
  .de-track__lane::after { display: none; }
}

/*
 * Inner pages. Each opens like the home page (centred title and lede) over the timeline's ruler,
 * with a playhead on it: the one motif the site borrows from the editor. Then designed blocks
 * rather than running text: steps, feature cards, chips, stats, and the legal documents with an
 * index beside them.
 */
.de-pagehero {
  display: grid;
  justify-items: center;
  gap: var(--s-6);
  padding-block: clamp(48px, 8vw, 96px) var(--s-8);
  text-align: center;
}

.de-pagehero .de-h1 {
  max-width: 18ch;
  text-wrap: balance;
}

.de-pagehero .de-lede {
  max-width: 50ch;
  text-wrap: pretty;
}

/* A ruler of bars and beats with the playhead resting on it. */
.de-pagehero__ruler {
  position: relative;
  width: min(100%, 560px);
  height: 14px;
  margin-top: var(--s-4);
  background:
    repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 25%) bottom / 100% 14px no-repeat,
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 6.25%) bottom / 100% 7px no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}

.de-pagehero__head {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 2px;
  height: 22px;
  margin-left: -1px;
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent);
}

.de-pagehero__head::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -4px;
  width: 10px;
  height: 7px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%);
}

.de-section--tight {
  padding-block: var(--s-6) clamp(40px, 6vw, 72px);
}

/* Steps: a sequence, so numbered, joined by a line like shots on a track. */
.de-steprow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-5);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.de-step {
  display: grid;
  align-content: start;
  gap: var(--s-4);
  padding: var(--s-7);
}

.de-step__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.de-step__n {
  color: var(--text-3);
  font-size: var(--fs-20);
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Feature cards: an icon, a title, a sentence or a few ticks. */
.de-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-5);
}

.de-features--two,
.de-features--four {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  max-width: 900px;
  width: 100%;
  margin-inline: auto;
}

.de-feature {
  display: grid;
  align-content: start;
  gap: var(--s-4);
  padding: var(--s-7);
}

.de-feature .de-checks {
  gap: var(--s-3);
  font-size: var(--fs-14);
}

.de-feature__link {
  color: var(--accent);
  font-size: var(--fs-14);
  font-weight: 500;
  text-decoration: none;
}

.de-feature__link:hover {
  text-decoration: underline;
}

/* The studio, framed, under an inner page's hero. */
.de-pageshot {
  margin: 0 auto var(--s-6);
  max-width: 1120px;
}

.de-pageshot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-4);
  box-shadow: 0 0 0 1px var(--line-strong), 0 30px 80px rgb(0 0 0 / 0.4);
}

.de-phonerow {
  display: grid;
  justify-items: center;
}

.de-phonerow__phone {
  position: relative;
  right: auto;
  bottom: auto;
  width: min(300px, 70vw);
}

.de-coming {
  max-width: 720px;
  margin-inline: auto;
  padding: var(--s-7);
  text-align: center;
  box-shadow: var(--card-shadow), inset 0 0 0 1px var(--accent-wash-strong);
}

/* Big numbers with their names, as a row. */
.de-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--s-5);
  margin: 0 0 var(--s-6);
}

.de-stats div {
  display: grid;
  justify-items: center;
  gap: var(--s-1);
  padding: var(--s-6) var(--s-4);
  border-radius: var(--r-4);
  background: var(--panel);
  box-shadow: var(--card-shadow);
  text-align: center;
}

.de-stats dt {
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 640;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.de-stats dd {
  margin: 0;
  color: var(--text-2);
  font-size: var(--fs-13);
}

/* A category and its names, as chips. */
.de-catcards {
  columns: 3 300px;
  column-gap: var(--s-5);
}

.de-catcard {
  display: grid;
  align-content: start;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
  padding: var(--s-6);
  break-inside: avoid;
}

.de-catcard .de-h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.de-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.de-chips li {
  padding: 3px var(--s-3);
  border-radius: var(--r-2);
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
  font-size: var(--fs-12);
  white-space: nowrap;
}

.de-centrednote {
  text-align: center;
}

.de-aboutcard {
  display: grid;
  gap: var(--s-4);
  max-width: 760px;
  margin-inline: auto;
  padding: var(--s-8);
}

.de-creditcards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.de-creditcard {
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: start;
  gap: var(--s-2) var(--s-4);
  padding: var(--s-5) var(--s-6);
}

.de-creditcard .de-copy {
  grid-column: 1 / -1;
  font-size: var(--fs-12);
  overflow-wrap: anywhere;
}

.de-email {
  color: var(--accent);
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* Releases: one card a version, the version and date beside what it brought. */
.de-releases {
  display: grid;
  gap: var(--s-5);
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.de-release {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: var(--s-7);
  padding: var(--s-8);
}

.de-release__when {
  display: grid;
  align-content: start;
  gap: var(--s-1);
}

.de-release__when strong {
  font-size: var(--fs-20);
  font-weight: 640;
  letter-spacing: -0.02em;
}

.de-release__what {
  display: grid;
  gap: var(--s-5);
}

/* The legal documents: the text in a readable column, its sections indexed beside it. */
.de-doc__stamp {
  margin: calc(var(--s-4) * -1) auto var(--s-8);
  width: max-content;
  max-width: 100%;
  padding: var(--s-2) var(--s-5);
  border-radius: var(--r-2);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
  font-size: var(--fs-13);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.de-doc__body {
  display: grid;
  grid-template-columns: 240px minmax(0, 44rem);
  justify-content: center;
  gap: clamp(32px, 5vw, 72px);
  padding-bottom: clamp(56px, 8vw, 104px);
}

.de-doc__toc {
  position: sticky;
  top: calc(var(--nav-top, 0px) + 84px);
  align-self: start;
  display: grid;
  gap: var(--s-6);
  font-size: var(--fs-13);
}

.de-doc__toc ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.de-doc__toc li {
  counter-increment: toc;
}

.de-doc__toc ol a {
  display: grid;
  grid-template-columns: 22px 1fr;
  padding: 5px var(--s-3);
  border-radius: var(--r-2);
  color: var(--text-2);
  text-decoration: none;
}

.de-doc__toc ol a::before {
  content: counter(toc);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.de-doc__toc ol li:last-child a::before {
  content: "";
}

.de-doc__toc a:hover {
  background: var(--panel);
  color: var(--text);
}

.de-doc__also {
  display: flex;
  gap: var(--s-4);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}

.de-doc__also a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.de-doc__text {
  display: grid;
  gap: var(--s-9);
}

.de-doc__text section {
  display: grid;
  gap: var(--s-4);
  scroll-margin-top: 96px;
}

.de-doc__text h2 {
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  font-size: var(--fs-20);
}

.de-doc__n {
  min-width: 1.6em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.de-doc__text p,
.de-doc__text li {
  color: var(--text-2);
  line-height: var(--lh-read);
}

.de-doc__text strong {
  color: var(--text);
  font-weight: 600;
}

.de-doc__text a:not(.de-email) {
  color: var(--text);
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.de-doc__text code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.88em;
}

.de-doc__text .de-list {
  display: grid;
  gap: var(--s-3);
  padding-left: 1.2em;
}

.de-doc__text .de-list li::marker {
  color: var(--accent);
}

@media (max-width: 860px) {
  .de-doc__body { grid-template-columns: minmax(0, 1fr); }
  .de-doc__toc { position: static; padding: var(--s-5); border-radius: var(--r-4); background: var(--panel); }
  .de-release { grid-template-columns: 1fr; gap: var(--s-4); padding: var(--s-6); }
  .de-catcards { columns: 1; }
}
