/* ============================================================
   SPOOL — design system  ·  "The Cutting Room"
   Warm analog film-editing bay. Bone paper, sumi ink.
   Vermilion (--splice) means RECORDING. Pthalo teal means live/ready.
   Ochre means cooking / in-flight. Signature motif: film sprocket
   perforations + a reel-hub record button.
   Plain CSS, no preprocessor. Fonts loaded via <link> in the layout.
   ============================================================ */

:root {
  /* warm paper surfaces */
  --paper:    #EFE7D6;
  --paper-2:  #E7DDC8;
  --card:     #FBF6EB;
  --card-hi:  #FFFDF7;

  /* ink */
  --ink:       #211D16;
  --ink-soft:  #544C3C;
  --ink-mute:  #897F69;
  --ink-faint: #B4A98E;

  /* hairlines */
  --line:     #D8CCAF;
  --line-soft:#E2D8C0;
  --line-ink: #C2B595;

  /* meaning colors */
  --splice:      #D6391E;   /* recording. ONLY recording. */
  --splice-deep: #A82C16;
  --splice-glow: rgba(214,57,30,.30);
  --teal:        #15695C;   /* link ready / live / copied */
  --teal-soft:   #1C7E6E;
  --ochre:       #BC7A12;   /* cooking / in flight */

  /* film black (frames, perforations) */
  --frame: #16140F;
  --film:  #100E0A;

  /* type */
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:  'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:  'DM Mono', ui-monospace, 'SF Mono', monospace;

  --r-sm: 5px;
  --r-md: 11px;
  --r-lg: 18px;
}

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

html { color-scheme: light; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  background-image:
    radial-gradient(120% 80% at 50% -10%, rgba(255,253,247,.6), transparent 60%),
    radial-gradient(80% 60% at 100% 100%, rgba(21,105,92,.05), transparent 60%);
  background-attachment: fixed;
}

/* paper grain over everything, quiet */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 999;
  opacity: .06; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--splice); color: #fff; }

a { color: inherit; }

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

/* ---------- top deck (nav) ---------- */
.deck {
  display: flex; align-items: center; gap: 26px;
  padding: 0 36px; height: 62px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}

.wordmark {
  display: inline-flex; align-items: center; gap: 11px;
  text-decoration: none;
  font-family: var(--serif); font-style: italic; font-weight: 600;
  font-size: 23px; letter-spacing: -.02em; color: var(--ink);
}
.wordmark svg { display: block; }
.wordmark .reel-spin { animation: spin 9s linear infinite; transform-origin: 11px 11px; }

.deck-spacer { flex: 1; }

.deck-status {
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-mute); letter-spacing: .05em;
}

.deck-nav { display: flex; align-items: center; gap: 8px; }
.deck-nav form { display: contents; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-weight: 700; font-size: 14px;
  padding: 9px 18px; border-radius: var(--r-md);
  border: 1px solid var(--line-ink);
  background: var(--card); color: var(--ink);
  cursor: pointer; text-decoration: none;
  transition: border-color .15s, background .15s, transform .12s, box-shadow .15s;
}
.btn:hover { background: var(--card-hi); border-color: var(--ink-mute); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.btn-primary:hover { background: #000; border-color: #000; color: var(--card-hi); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); font-weight: 600; }
.btn-ghost:hover { background: var(--paper-2); border-color: transparent; color: var(--ink); }

.btn-mono { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .02em; }

/* the stop button — recording context only */
.btn-stop {
  background: var(--splice); border-color: var(--splice); color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 28px -12px var(--splice-glow);
}
.btn-stop:hover { background: var(--splice-deep); border-color: var(--splice-deep); color: #fff; }
.btn-stop:disabled { background: var(--splice-deep); border-color: var(--splice-deep); cursor: wait; }
.btn-stop:disabled .stop-square { animation: stop-finishing 1.2s ease-in-out infinite; }
@keyframes stop-finishing { 50% { opacity: .25; } }

/* ---------- REC chip ---------- */
.rec-chip {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .16em; color: var(--splice);
  padding: 6px 14px; border: 1px solid color-mix(in srgb, var(--splice) 45%, transparent);
  border-radius: 999px; background: color-mix(in srgb, var(--splice) 9%, transparent);
}
.rec-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--splice);
  animation: rec-pulse 1.2s ease-in-out infinite;
}
@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--splice-glow); opacity: 1; }
  50%      { box-shadow: 0 0 0 7px transparent;  opacity: .5; }
}

/* ---------- timer / readouts ---------- */
.readout {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

/* ---------- hairline label (mono eyebrow) ---------- */
.hairline-label {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-mute);
}

/* the hero's first label gets the bordered "tape" treatment */
.hero-copy > .hairline-label {
  display: inline-flex; align-items: center;
  color: var(--ink-soft); background: var(--card);
  border: 1px solid var(--line); border-left: 3px solid var(--splice);
  border-radius: 4px; padding: 6px 12px;
  letter-spacing: .18em;
}

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.field input,
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  font-family: var(--sans); font-size: 15px;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line-ink); border-radius: var(--r-md);
  padding: 11px 14px; outline: none; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--ink-faint); }
.field input:focus,
.auth-form input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 12%, transparent);
}

/* ---------- flash ---------- */
.flash {
  max-width: 1024px; margin: 14px auto 0;
  padding: 10px 16px;
  border: 1px solid var(--line-ink);
  border-left: 3px solid var(--ochre);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--ink-soft);
  font-size: 13.5px;
}
.flash--notice { border-left-color: var(--teal); }

.link-button { font: inherit; }

/* ---------- entrance ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.rise { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
.rise-1 { animation-delay: .06s; } .rise-2 { animation-delay: .15s; }
.rise-3 { animation-delay: .24s; } .rise-4 { animation-delay: .33s; }

@keyframes wind { to { transform: rotate(360deg); } }

/* ============================================================
   Landing / recorder idle  (videos#new)
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: 1fr 410px;
  max-width: 1280px; margin: 0 auto;
  padding: 78px 36px 64px;
  align-items: center; gap: 64px;
  position: relative;
}
/* faint reel-arcs winding behind the hero copy */
.hero::before {
  content: ''; position: absolute; left: -180px; top: 30px;
  width: 520px; height: 520px; border-radius: 50%;
  pointer-events: none; z-index: 0;
  background: repeating-radial-gradient(circle at center, transparent 0 22px, rgba(33,29,22,.035) 22px 23px);
}

.hero-copy { position: relative; z-index: 1; }
.hero h1 {
  font-family: var(--serif); font-weight: 600; font-optical-sizing: auto;
  font-size: 67px; letter-spacing: -.025em; line-height: 1.0;
  margin: 22px 0 22px;
}
.hero h1 em { font-style: italic; font-weight: 500; }
.hero h1 .underthread {
  position: relative; white-space: nowrap; color: var(--splice);
}
.hero h1 .underthread::after {
  content: ''; position: absolute; left: -2px; right: -2px; bottom: -9px; height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='12' viewBox='0 0 90 12'%3E%3Cpath d='M2 7 C 22 1, 30 11, 48 6 S 78 2, 88 7' fill='none' stroke='%23D6391E' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 100% 100%;
}
.hero-sub {
  font-size: 18px; color: var(--ink-soft); max-width: 48ch; line-height: 1.62;
}
.hero-sub strong { color: var(--ink); font-weight: 700; }
.hero-sub em { font-style: italic; color: var(--ink); }

.hero-meta {
  margin-top: 30px; display: flex; align-items: stretch;
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  width: fit-content; background: var(--card);
}
.hero-meta span {
  padding: 12px 20px; font-family: var(--mono); font-size: 11.5px;
  color: var(--ink-mute); letter-spacing: .02em;
  display: flex; flex-direction: column; gap: 3px;
}
.hero-meta span + span { border-left: 1px solid var(--line); }
.hero-meta span b {
  font-family: var(--serif); font-style: italic; font-size: 22px;
  color: var(--ink); font-weight: 600; letter-spacing: -.01em;
}

/* ===== the recorder console (an instrument) ===== */
.console {
  position: relative; overflow: hidden;
  background: linear-gradient(178deg, var(--card-hi), var(--card));
  border: 1px solid var(--line-ink);
  border-radius: 22px;
  padding: 44px 0 26px;
  box-shadow: 0 2px 0 var(--line-soft), 0 30px 60px -28px rgba(33,29,22,.4),
              inset 0 1px 0 rgba(255,255,255,.7);
}
/* knurled top rail with sprocket holes — reads as a film gate */
.console::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 30px;
  background: var(--frame);
  background-image: radial-gradient(circle, #322d22 34%, transparent 35%);
  background-size: 16px 8px; background-position: center; background-repeat: repeat-x;
}
.console-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 26px; margin-bottom: 18px;
}
.console-head .readout {
  font-size: 14px; color: var(--ink-soft);
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 3px 10px;
}

.src-note {
  margin: 0 26px 22px; text-align: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: .02em;
  color: var(--ink-mute);
  border: 1px dashed var(--line-ink); border-radius: var(--r-md);
  background: var(--paper); padding: 11px 14px;
}

/* device pickers */
.device-row { display: flex; gap: 11px; padding: 0 26px; margin-bottom: 24px; }
.device {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--paper); padding: 10px 13px;
}
.device:hover { border-color: var(--line-ink); }
.device-kind {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em;
  color: var(--ink-faint); flex-shrink: 0;
}
.device select {
  flex: 1; min-width: 0; appearance: none; border: 0; outline: 0;
  background: transparent; color: var(--ink-soft); cursor: pointer;
  font: inherit; font-size: 13px;
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
}
.device select option { background: var(--card); color: var(--ink-soft); }

/* THE record button — a film-reel hub, pure CSS */
.record-well { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 6px 26px 0; }
.record-btn {
  position: relative;
  width: 132px; height: 132px; border-radius: 50%;
  border: 1px solid var(--line-ink); cursor: pointer; padding: 0;
  background: radial-gradient(circle at 50% 42%, var(--card-hi), var(--card) 74%);
  display: grid; place-items: center;
  box-shadow: 0 14px 32px -14px rgba(33,29,22,.4), inset 0 1px 0 rgba(255,255,255,.7);
  transition: transform .14s, box-shadow .22s;
}
/* spinning reel ring with three holes */
.record-btn::before {
  content: ''; position: absolute; inset: 16px; border-radius: 50%;
  border: 1.4px solid var(--line);
  background:
    radial-gradient(circle at 50% 12%, var(--line-ink) 0 3px, transparent 4px),
    radial-gradient(circle at 86% 76%, var(--line-ink) 0 3px, transparent 4px),
    radial-gradient(circle at 14% 76%, var(--line-ink) 0 3px, transparent 4px);
  animation: spin 14s linear infinite;
}
/* dashed outer rim, like a reel edge */
.record-btn::after {
  content: ''; position: absolute; inset: 2px; border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--ink) 26%, transparent);
}
.record-btn .core {
  position: relative; z-index: 1;
  width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #e8624a, var(--splice) 60%, var(--splice-deep));
  box-shadow: 0 0 0 1px var(--splice-deep), 0 4px 12px var(--splice-glow);
  animation: idle-breathe 2.8s ease-in-out infinite;
}
@keyframes idle-breathe {
  0%, 100% { box-shadow: 0 0 0 1px var(--splice-deep), 0 4px 12px var(--splice-glow); }
  50%      { box-shadow: 0 0 0 1px var(--splice-deep), 0 4px 22px var(--splice-glow); }
}
.record-btn:hover { transform: scale(1.035); box-shadow: 0 18px 42px -16px rgba(33,29,22,.45); }
.record-btn:active { transform: scale(.97); }
.record-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.record-btn:disabled::before { animation-play-state: paused; }

.record-hint { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink-soft); text-align: center; }
.guest-note {
  margin-top: 2px; font-family: var(--mono); font-size: 11px;
  color: var(--ink-mute); letter-spacing: .02em; text-align: center;
}
.guest-note a { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }
.recorder-status {
  min-height: 1.5em; font-family: var(--mono); font-size: 11.5px;
  color: var(--ink-mute); text-align: center;
}

/* corner rivets, because it's an instrument */
.screw { position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: #9b8f6f; box-shadow: inset 0 1px 1px rgba(0,0,0,.4); z-index: 1; }
.screw.tl { top: 11px; left: 12px; } .screw.tr { top: 11px; right: 12px; }
.screw.bl { bottom: 12px; left: 12px; } .screw.br { bottom: 12px; right: 12px; }

/* ===== below the fold ===== */
.fold { max-width: 1280px; margin: 0 auto; padding: 30px 36px; }
.fold > .hairline-label { color: var(--splice); display: block; margin-bottom: 28px; }

/* a strip of film between the hero and the rest */
.recorder-idle .hero + .fold { position: relative; padding-top: 60px; }
.recorder-idle .hero + .fold::before {
  content: ''; position: absolute; top: 14px; left: 36px; right: 36px; height: 30px;
  background: var(--film); border-radius: 4px;
  background-image:
    radial-gradient(circle, #2b2820 32%, transparent 33%),
    radial-gradient(circle, #2b2820 32%, transparent 33%);
  background-size: 22px 9px, 22px 9px;
  background-position: 0 6px, 0 calc(100% - 6px);
  background-repeat: repeat-x;
}

.loop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 8px; }
.loop-step {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 26px 30px 44px;
  box-shadow: 0 1px 0 var(--line-soft);
}
/* sprocket edge down the left of every step — it's a film cell */
.loop-step::before {
  content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 18px;
  background: var(--film);
  background-image: radial-gradient(circle, #2b2820 30%, transparent 31%);
  background-size: 9px 16px; background-position: center; background-repeat: repeat-y;
}
.loop-step .step-no {
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  letter-spacing: .14em; display: block; margin-bottom: 18px;
}
.loop-step h3 { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: -.015em; margin-bottom: 8px; }
.loop-step p { font-size: 14px; color: var(--ink-soft); line-height: 1.6; }
.loop-step .step-art { height: 62px; margin-bottom: 16px; display: flex; align-items: center; }

.pipeline { margin-top: 64px; display: grid; grid-template-columns: 480px 1fr; gap: 64px; align-items: start; }
.pipeline .hairline-label { color: var(--splice); }
.pipeline h2 { font-family: var(--serif); font-weight: 600; font-size: 38px; letter-spacing: -.025em; line-height: 1.1; margin: 14px 0 18px; }
.pipeline h2 em { font-style: italic; }
.pipeline .lede { color: var(--ink-soft); font-size: 15.5px; line-height: 1.66; }
.pipeline .lede + .lede { margin-top: 14px; }
.pipeline .lede strong { color: var(--ink); font-weight: 700; }

.pipe-diagram {
  border: 1px solid var(--line-ink); border-radius: var(--r-lg);
  background: var(--card); padding: 24px 26px;
  box-shadow: 0 1px 0 var(--line-soft);
}
.pipe-diagram .hairline-label { color: var(--ink-mute); display: block; margin-bottom: 6px; }
.pipe-line { display: flex; align-items: center; gap: 14px; padding: 16px 2px; }
.pipe-line + .pipe-line { border-top: 1px dashed var(--line); }
.pipe-node {
  font-family: var(--mono); font-size: 12px; padding: 7px 12px;
  border: 1px solid var(--line-ink); border-radius: var(--r-sm);
  background: var(--paper); color: var(--ink-soft); white-space: nowrap;
}
.pipe-arrow { color: var(--splice); font-family: var(--mono); font-size: 13px; }
.pipe-note { font-family: var(--mono); font-size: 10.5px; color: var(--ink-mute); margin-left: auto; text-align: right; letter-spacing: .01em; line-height: 1.45; }
.pipe-no-server {
  margin-top: 16px; padding: 13px 16px; border-radius: var(--r-md);
  border: 1px solid var(--teal); background: color-mix(in srgb, var(--teal) 8%, transparent);
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11.5px; color: var(--teal);
}
.pipe-no-server s { color: var(--ink-faint); }
.pipe-no-server::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); flex-shrink: 0;
}

.closer { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 96px 36px 84px; text-align: center; }
.closer .record-btn { transform: scale(.92); }
.closer .record-btn:hover { transform: scale(.95); }
.closer-prompt { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 30px; letter-spacing: -.02em; color: var(--ink); }

.site-foot {
  border-top: 1px solid var(--line); padding: 24px 36px 50px;
  display: flex; align-items: center; gap: 22px;
  max-width: 1280px; margin: 0 auto;
  font-size: 13px; color: var(--ink-mute);
}
.site-foot > span:first-child { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 18px; color: var(--ink); }
.site-foot .mono { font-size: 11px; color: var(--ink-faint); margin-left: auto; letter-spacing: .02em; }

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .loop-grid, .pipeline { grid-template-columns: 1fr; }
}

/* ============================================================
   Recording in progress  (the `live` target)
   ============================================================ */
/* `:not([hidden])` so the `hidden` attribute the controller toggles actually
   wins — a bare `display: flex` here would outrank the UA's `[hidden]` rule
   and the stage would leak onto the idle page. (Same guard the bubble uses.) */
.recording-stage:not([hidden]) {
  background: var(--paper);
  min-height: calc(100vh - 62px);
  display: flex; flex-direction: column;
}

/* the live strip replaces the deck's mood while recording */
.rec-deck {
  display: flex; align-items: center; gap: 18px;
  padding: 0 36px; height: 62px; position: relative;
  background: var(--card);
  border-bottom: 1px solid color-mix(in srgb, var(--splice) 30%, var(--line));
}
.rec-deck::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--splice), transparent);
  animation: strip-sweep 2.4s linear infinite;
  opacity: .8;
}
@keyframes strip-sweep {
  from { transform: translateX(-28%); } to { transform: translateX(28%); }
}

.timer {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 21px; font-weight: 500; letter-spacing: .02em;
  color: var(--ink);
}

/* ===== stage ===== */
.stage {
  flex: 1; display: grid; place-items: center; padding: 40px 36px;
  position: relative;
}
.stage::before {
  content: ''; position: absolute; right: -120px; bottom: -120px;
  width: 460px; height: 460px; border-radius: 50%; pointer-events: none;
  background: repeating-radial-gradient(circle at center, transparent 0 20px, rgba(33,29,22,.035) 20px 21px);
}
/* Sized by the window's HEIGHT as well as width: the deck, preview, transport
   and status must all fit without scrolling — a Stop button below the fold
   reads as a recorder that won't stop. ~300px is everything that isn't preview. */
.preview-wrap { width: clamp(320px, calc((100dvh - 300px) * 16 / 9), min(960px, 100%)); position: relative; z-index: 1; }

/* the dark film frame seated in the warm bay */
.preview {
  position: relative; border-radius: var(--r-lg);
  overflow: hidden; aspect-ratio: 16 / 9;
  background: var(--frame);
  border: 1px solid var(--ink);
  box-shadow: 0 30px 70px -24px rgba(33,29,22,.5), inset 0 0 0 1px rgba(255,255,255,.04);
}
/* sprocket gutters on the frame edges — a film gate */
.preview::before, .preview::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 14px; z-index: 2;
  pointer-events: none;
  background-image: radial-gradient(circle, #34301f 32%, transparent 33%);
  background-size: 9px 18px; background-position: center; background-repeat: repeat-y;
}
.preview::before { left: 0; }
.preview::after { right: 0; }
.preview video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; display: block; background: var(--frame);
}

/* the Loom-style camera bubble — your face, floating over the capture.
   `.preview video` pins videos to inset 0 / full size; this must out-rank it. */
.preview video.camera-bubble {
  inset: auto auto 22px 22px; z-index: 4;
  width: 152px; height: 152px; border-radius: 50%;
  object-fit: cover; transform: scaleX(-1); /* mirrored, like every self-view */
  border: 3px solid var(--card);
  box-shadow: 0 18px 48px rgba(0,0,0,.55), 0 0 0 1px color-mix(in srgb, var(--splice) 40%, transparent);
}
.preview video.camera-bubble[hidden] { display: none; }

/* ===== 3-2-1 prep countdown ===== */
/* The numeral overlay shown during prep — Loom-style: a clean count over the
   dark frame, no fake REC state. DM Mono numeral in splice-red; splice is the
   RECORDING colour, and prep IS the lead-in to recording, so lighting it on
   the count (and ONLY the count) reads as "about to roll", not "rolling". */
.prep-count {
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 500;
  font-size: clamp(80px, 22vh, 200px); line-height: 1;
  color: var(--splice);
  background: rgba(33, 29, 22, .45);
  text-shadow: 0 0 36px var(--splice-glow);
}
.prep-count[hidden] { display: none; }

/* During prep the live pane is revealed only to host the count: nothing is
   encoding, no /videos row exists, the link isn't live. Gate the REC chip, the
   running-looking timer, the "already live" clipboard chip and the Stop button
   off until true recording start — or the UI would claim we're live when we
   aren't, and burn splice-red (reserved for RECORDING) on a fake REC state. */
.recording-stage.is-prepping .rec-chip,
.recording-stage.is-prepping .timer,
.recording-stage.is-prepping .transport,
.recording-stage.is-prepping .recorder-status--live { visibility: hidden; }

/* ===== transport bar ===== */
.transport {
  width: min(960px, 100%); margin: 24px auto 0;
  display: flex; align-items: center; gap: 18px;
}
.transport .spacer { flex: 1; }

.btn-stop-big {
  padding: 13px 30px; font-size: 15px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; gap: 11px;
}
.stop-square { width: 13px; height: 13px; background: #fff; border-radius: 2px; }

.clipboard-chip {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid color-mix(in srgb, var(--teal) 42%, transparent);
  background: color-mix(in srgb, var(--teal) 9%, transparent);
  color: var(--ink-soft); border-radius: var(--r-md);
  padding: 11px 17px; font-size: 13.5px;
}
.clipboard-chip .url {
  font-family: var(--mono); font-size: 12.5px; color: var(--teal-soft);
  background: var(--card); border: 1px solid color-mix(in srgb, var(--teal) 25%, transparent);
  padding: 2px 8px; border-radius: 5px;
}
.clipboard-chip .ok-mark {
  width: 18px; height: 18px; border-radius: 50%; background: var(--teal); color: #fff;
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 700;
}

.recorder-status--live {
  text-align: center; margin-top: 14px;
  color: var(--ochre); font-size: 13px;
  font-family: var(--mono); letter-spacing: .02em;
  min-height: 1.4em;
}

/* ============================================================
   Watch page  (watches#show)
   ============================================================ */
.watch-wrap {
  max-width: 1024px; margin: 0 auto; padding: 26px 36px 70px;
  display: flex; flex-direction: column;
}

/* ===== claim banner (guest recording) ===== */
.claim {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 16px;
  border: 1px dashed var(--line-ink); border-radius: var(--r-lg);
  background: linear-gradient(90deg, var(--card), color-mix(in srgb, var(--splice) 5%, transparent));
  padding: 15px 20px 15px 24px; margin-bottom: 24px;
}
.claim::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--splice); }
.claim .spool-ic { flex-shrink: 0; }
.claim .claim-text { display: flex; flex-direction: column; gap: 6px; }
.claim p { font-size: 14px; color: var(--ink-soft); }
.claim p b { color: var(--ink); font-weight: 700; }
.claim .claim-warning { font-family: var(--mono); font-size: 11.5px; color: var(--ochre); }
.claim .btn { margin-left: auto; flex-shrink: 0; }

/* ===== player ===== */
.player-col { min-width: 0; }
.player {
  position: relative; aspect-ratio: 16/9; border-radius: var(--r-lg);
  overflow: hidden; border: 1px solid var(--ink);
  background: var(--frame);
  box-shadow: 0 30px 70px -26px rgba(33,29,22,.5);
}
.player::before, .player::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 14px; z-index: 2;
  pointer-events: none;
  background-image: radial-gradient(circle, #34301f 32%, transparent 33%);
  background-size: 9px 18px; background-position: center; background-repeat: repeat-y;
}
.player::before { left: 0; }
.player::after { right: 0; }
.player video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; display: block; background: var(--frame);
}

/* ===== cooking player ===== */
.player--cooking {
  background: var(--frame);
  display: grid; place-items: center;
}
.player--cooking::before, .player--cooking::after { z-index: 1; }
/* slow scanning sheen across the dark frame */
.player--cooking .cook-center::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.04) 50%, transparent 70%);
  background-size: 250% 100%;
  animation: sheen 3.2s linear infinite;
}
@keyframes sheen { from { background-position: 120% 0; } to { background-position: -120% 0; } }

.cook-center { text-align: center; position: relative; z-index: 3; padding: 0 24px; }

/* winding spool loader */
.spool-loader { width: 92px; height: 92px; margin: 0 auto 22px; position: relative; }
.spool-loader svg { animation: wind 2.6s linear infinite; transform-origin: 50% 50%; }
.spool-loader::after {
  content: ''; position: absolute; inset: -9px; border-radius: 50%;
  border: 1px dashed rgba(255,255,255,.18);
  animation: wind 9s linear infinite reverse;
}

.cook-center h1 { font-family: var(--serif); font-weight: 600; font-size: 26px; letter-spacing: -.02em; margin-bottom: 8px; color: var(--card-hi); }
.cook-center .sub { font-size: 14px; color: rgba(255,253,247,.65); max-width: 42ch; margin: 0 auto; line-height: 1.6; }
.cook-center .sub b { color: var(--card-hi); font-weight: 600; }

.morph-note {
  margin-top: 22px; font-family: var(--mono); font-size: 11px; color: rgba(255,253,247,.4);
  letter-spacing: .04em;
}
.morph-note .blink { animation: caret-blink 1.1s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }

/* ===== title row ===== */
.title-row { margin: 22px 2px 0; display: flex; align-items: flex-start; gap: 18px; }
.title-main { flex: 1; min-width: 0; }
.title-row h1 { font-family: var(--serif); font-weight: 600; font-size: 28px; letter-spacing: -.02em; line-height: 1.2; }
.title-meta {
  margin-top: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-mute);
  display: flex; align-items: center; gap: 16px; letter-spacing: .02em;
}
.copy-wrap { flex-shrink: 0; }
.watch-actions { margin-left: auto; flex-shrink: 0; display: flex; gap: 10px; }

.cooking-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .1em;
  color: var(--ochre); border: 1px solid color-mix(in srgb, var(--ochre) 35%, transparent);
  background: color-mix(in srgb, var(--ochre) 9%, transparent);
  padding: 4px 11px; border-radius: 999px;
}
.cooking-chip i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ochre);
  animation: arriving .8s ease-in-out infinite alternate;
}
@keyframes arriving { from { opacity: .35; } to { opacity: 1; } }

/* owner's inline title edit */
.watch-title-form { min-width: 0; }
.watch-title-input {
  width: 100%;
  font-family: var(--serif); font-size: 28px; font-weight: 600; letter-spacing: -.02em;
  color: var(--ink); background: transparent;
  border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 2px 8px; margin-left: -8px;
}
.watch-title-input:hover, .watch-title-input:focus {
  border-color: var(--line-ink); background: var(--card); outline: none;
}

/* ===== conversation (comments + reactions) ===== */
.convo { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 22px; }

/* the timeline strip is literally a strip of film */
.timeline-strip {
  position: relative; height: 34px; margin-bottom: 18px; border-radius: 6px;
  background: var(--film);
  background-image:
    radial-gradient(circle, #2b2820 30%, transparent 31%),
    radial-gradient(circle, #2b2820 30%, transparent 31%);
  background-size: 20px 7px, 20px 7px;
  background-position: 0 5px, 0 calc(100% - 5px);
  background-repeat: repeat-x;
}
.tl-marker {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  background: none; border: none; cursor: pointer; padding: 0;
  line-height: 1;
}
.tl-marker:hover { transform: translate(-50%, -50%) scale(1.3); }
.tl-emoji { font-size: 16px; }
.tl-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ochre); border: 2px solid var(--film);
  box-shadow: 0 0 0 1px var(--ochre);
}

.react-bar { display: flex; align-items: center; gap: 7px; margin-bottom: 18px; }
.react-bar form { display: contents; }
.react-btn {
  font-size: 17px; line-height: 1; padding: 8px 11px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  transition: border-color .13s, background .13s, transform .13s;
}
.react-btn:hover { border-color: var(--teal); background: var(--card-hi); transform: translateY(-2px); }
.react-hint { margin-left: 8px; font-family: var(--mono); font-size: 11px; color: var(--ink-mute); letter-spacing: .02em; }

.comment-form { display: flex; gap: 11px; align-items: flex-start; flex-wrap: wrap; }
.comment-name {
  flex: 0 0 170px; padding: 11px 13px; font: inherit; font-size: 13.5px;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line-ink); border-radius: var(--r-md);
}
.comment-body {
  flex: 1; min-width: 240px; padding: 11px 13px; font: inherit; font-size: 14px;
  font-family: var(--sans); resize: vertical;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line-ink); border-radius: var(--r-md);
}
.comment-name::placeholder, .comment-body::placeholder { color: var(--ink-faint); }
.comment-name:focus, .comment-body:focus {
  border-color: var(--teal); outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 12%, transparent);
}
.comment-post { flex-shrink: 0; align-self: stretch; font-variant-numeric: tabular-nums; }

.claim-nudge { margin-top: 12px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-mute); }
.claim-nudge a { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }
.claim-nudge b { color: var(--ink-soft); }

.comment-list { list-style: none; margin-top: 26px; display: flex; flex-direction: column; gap: 18px; }
.comment-head { display: flex; align-items: center; gap: 11px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-mute); }
.comment-author { color: var(--ink); font-weight: 700; font-family: var(--sans); font-size: 13.5px; }
.t-chip {
  font-family: var(--mono); font-size: 11px; font-weight: 500; cursor: pointer;
  color: var(--teal); background: color-mix(in srgb, var(--teal) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--teal) 35%, transparent);
  border-radius: 999px; padding: 2px 10px;
}
.t-chip:hover { background: color-mix(in srgb, var(--teal) 18%, transparent); }
.comment-text { margin-top: 6px; font-size: 14.5px; color: var(--ink); line-height: 1.55; overflow-wrap: anywhere; }
.comment-delete-form { margin-left: auto; }
.comment-delete {
  background: none; border: none; cursor: pointer;
  color: var(--ink-faint); font-size: 16px; line-height: 1; padding: 2px 6px;
}
.comment-delete:hover { color: var(--splice); }

/* ============================================================
   Library  (videos#index)
   ============================================================ */
.lib-wrap { max-width: 1280px; margin: 0 auto; padding: 34px 36px 80px; }

.lib-head { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
.lib-head h1 { font-family: var(--serif); font-weight: 600; font-size: 34px; letter-spacing: -.02em; }
.lib-stats {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-mute);
  letter-spacing: .02em; padding-bottom: 8px;
}
.lib-stats b { color: var(--ink-soft); font-weight: 500; }
.lib-new { margin-left: auto; }
.rec-mini {
  width: 9px; height: 9px; border-radius: 50%; background: var(--splice);
  display: inline-block; margin-right: 2px;
}

.lib-empty { color: var(--ink-mute); }
.lib-empty a { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }

/* ===== grid ===== */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 1080px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px)  { .grid { grid-template-columns: 1fr; } }

.card {
  position: relative;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--card); overflow: hidden;
  box-shadow: 0 1px 0 var(--line-soft);
  transition: border-color .15s, transform .15s, box-shadow .2s;
}
.card:hover {
  border-color: var(--line-ink); transform: translateY(-2px);
  box-shadow: 0 16px 40px -20px rgba(33,29,22,.4);
}

.thumb {
  position: relative; aspect-ratio: 16/9; overflow: hidden;
  display: block; background: var(--frame); text-decoration: none;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-blank {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: rgba(255,253,247,.4); font-size: 22px;
}
.thumb .dur {
  position: absolute; right: 8px; bottom: 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  background: rgba(16,14,10,.85); color: var(--card-hi);
  padding: 2.5px 8px; border-radius: 5px; letter-spacing: .02em;
}

.card-body { padding: 14px 16px 15px; }
.card-body h3 {
  font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3;
  margin-bottom: 7px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-body h3 a { text-decoration: none; }
.card-meta {
  display: flex; gap: 13px; font-family: var(--mono); font-size: 11px;
  color: var(--ink-mute); letter-spacing: .02em;
}
.card-meta .cooking-note { color: var(--ochre); }

/* cooking card */
.card.cooking .thumb { display: grid; place-items: center; }
.cook-spin { animation: wind 2.6s linear infinite; }
.card.cooking .cook-label {
  position: absolute; bottom: 8px; left: 8px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .12em;
  color: var(--ochre);
}
.card.cooking .seg-line {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,253,247,.15);
}
.card.cooking .seg-line i {
  display: block; height: 100%; width: 72%; background: var(--ochre);
  animation: grow 4s ease-out infinite;
}
@keyframes grow { 0% { width: 58%; } 100% { width: 86%; } }

/* hover row actions */
.row-actions {
  position: absolute; top: 8px; right: 8px; display: flex; gap: 6px;
  opacity: 0; transition: opacity .15s; z-index: 2;
}
.card:hover .row-actions, .card:focus-within .row-actions { opacity: 1; }
.row-actions .row-action {
  border: 1px solid var(--line-ink); background: rgba(251,246,235,.92);
  color: var(--ink-soft); border-radius: 6px; padding: 4px 9px;
  font-family: var(--mono); font-size: 11px; cursor: pointer;
}
.row-actions .row-action:hover { color: var(--splice); border-color: var(--splice); }

/* ============================================================
   Auth  (users#new, sessions#new, passwords)
   ============================================================ */
.auth-stage {
  min-height: calc(100vh - 62px);
  display: grid; place-items: center;
  padding: 40px 20px;
  position: relative;
  background: radial-gradient(60% 50% at 50% 110%, color-mix(in srgb, var(--splice) 6%, transparent), transparent 70%);
}
/* faint reel arc winding across the backdrop */
.auth-stage::after {
  content: ''; position: absolute; right: -160px; top: -120px;
  width: 520px; height: 520px; border-radius: 50%; pointer-events: none; z-index: 0;
  background: repeating-radial-gradient(circle at center, transparent 0 22px, rgba(33,29,22,.04) 22px 23px);
}

.auth-stack { position: relative; z-index: 1; }

.auth-card {
  position: relative;
  width: min(400px, 100%);
  background: linear-gradient(178deg, var(--card-hi), var(--card));
  border: 1px solid var(--line-ink);
  border-radius: 20px;
  padding: 44px 34px 30px;
  box-shadow: 0 2px 0 var(--line-soft), 0 30px 60px -28px rgba(33,29,22,.4), inset 0 1px 0 rgba(255,255,255,.7);
  overflow: hidden;
}
/* film-gate top rail, like the recorder console */
.auth-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 26px;
  background: var(--frame);
  background-image: radial-gradient(circle, #322d22 34%, transparent 35%);
  background-size: 16px 8px; background-position: center; background-repeat: repeat-x;
}

.auth-mark { display: flex; justify-content: center; margin-bottom: 22px; }

.auth-card h1 {
  font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -.02em;
  text-align: center; margin-bottom: 6px;
}
.auth-sub {
  text-align: center; font-size: 13.5px; color: var(--ink-mute);
  margin-bottom: 28px;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .flash { margin: 0; }
.btn-submit { margin-top: 6px; padding: 12px; font-size: 14.5px; }
input.btn-submit { font-family: var(--sans); font-weight: 700; cursor: pointer; }

.auth-foot {
  margin-top: 24px; text-align: center; font-size: 13px; color: var(--ink-mute);
}
.auth-foot a { color: var(--teal); text-decoration: underline dotted; text-underline-offset: 3px; }
.auth-foot a:hover { color: var(--ink); }

.stopwatch {
  position: absolute; top: 36px; right: 22px; z-index: 1;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  color: var(--ink-mute); background: var(--paper);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
}

.under-card {
  width: min(400px, 100%); margin-top: 16px;
  text-align: center; font-family: var(--mono); font-size: 11px;
  color: var(--ink-faint); letter-spacing: .03em;
}

/* ── Trim editor (owner-only) ─────────────────────────────────────────────
   Non-destructive: the bytes never change, we store the kept window. The
   track is the same film strip as the timeline; the teal band is what's kept,
   the splice handles are where we cut. Two range inputs are stacked and made
   pointer-transparent except at the thumbs, so both handles stay grabbable. */
.trim-editor { margin-bottom: 18px; }
.trim-summary {
  cursor: pointer; user-select: none; list-style: none;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink-soft); width: fit-content;
}
.trim-summary::-webkit-details-marker { display: none; }
.trim-summary:hover { border-color: var(--ink-mute); color: var(--ink); }
.trim-on { color: var(--teal); }

/* Transcript — same quiet pill as the trim editor, rows share the comment
   register: a seekable timecode chip and the spoken line. */
.transcript { margin-bottom: 18px; }
.transcript-summary {
  cursor: pointer; user-select: none; list-style: none;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink-soft); width: fit-content;
}
.transcript-summary::-webkit-details-marker { display: none; }
.transcript-summary:hover { border-color: var(--ink-mute); color: var(--ink); }
.transcript-list {
  list-style: none; margin: 12px 0 0; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  max-height: 340px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
}
.transcript-row { display: flex; gap: 10px; align-items: baseline; }
.transcript-row .t-chip { flex-shrink: 0; }
.transcript-text { color: var(--ink-soft); line-height: 1.5; }
.transcript-note { margin-bottom: 18px; }

.trim-form { margin-top: 12px; }
.trim-track {
  position: relative; height: 46px; border-radius: 6px;
  background: var(--film);
  background-image:
    radial-gradient(circle, #2b2820 30%, transparent 31%),
    radial-gradient(circle, #2b2820 30%, transparent 31%);
  background-size: 20px 7px, 20px 7px;
  background-position: 0 5px, 0 calc(100% - 5px);
  background-repeat: repeat-x;
}
.trim-band {
  position: absolute; top: 0; bottom: 0; left: 0; right: 0;
  background: color-mix(in srgb, var(--teal) 28%, transparent);
  border-left: 2px solid var(--teal-soft); border-right: 2px solid var(--teal-soft);
  pointer-events: none;
}
.trim-range {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  margin: 0; background: transparent; -webkit-appearance: none; appearance: none;
  pointer-events: none; /* only the thumbs catch the pointer */
}
.trim-range:focus { outline: none; }
.trim-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto;
  width: 12px; height: 54px; margin-top: -4px; border-radius: 3px;
  background: var(--splice); border: 1px solid var(--splice-deep);
  box-shadow: 0 4px 10px -3px var(--splice-glow); cursor: ew-resize;
}
.trim-range::-moz-range-thumb {
  pointer-events: auto;
  width: 12px; height: 54px; border-radius: 3px;
  background: var(--splice); border: 1px solid var(--splice-deep); cursor: ew-resize;
}
.trim-range::-webkit-slider-runnable-track { background: transparent; }
.trim-range::-moz-range-track { background: transparent; }

.trim-readout {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
  color: var(--ink-mute);
}
.trim-reset {
  margin-left: auto; cursor: pointer; font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-soft); background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px;
}
.trim-reset:hover { border-color: var(--ink-mute); color: var(--ink); }
