/* ============================================================
   SPOOL — design system  ·  "Transport Deck"
   Dark console chrome. Red means recording. Nothing else is red.
   Plain CSS, no preprocessor. Fonts loaded via <link> in the layout.
   ============================================================ */

:root {
  /* surfaces */
  --bg:        #0f0f12;
  --bg-deep:   #0a0a0d;
  --panel:     #15151a;
  --panel-2:   #1b1b22;
  --line:      #26262e;
  --line-hi:   #34343f;

  /* ink */
  --ink:       #f2f2f5;
  --ink-soft:  #b8b8c4;
  --ink-mute:  #77778a;
  --ink-faint: #4c4c5c;

  /* meaning colors */
  --rec:       #e5484d;   /* recording. ONLY recording. */
  --rec-deep:  #b3383c;
  --rec-glow:  rgba(229, 72, 77, .35);
  --ok:        #3ecf8e;   /* link ready / copied / live */
  --warn:      #f5b83d;   /* cooking / in flight */

  /* type */
  --sans: 'Archivo', -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
}

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

html { color-scheme: dark; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

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

a { color: inherit; }

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

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

.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 17px; letter-spacing: -.03em;
  text-decoration: none;
}
.wordmark svg { display: block; }

.deck-spacer { flex: 1; }

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

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

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

.btn-primary {
  background: var(--ink); color: var(--bg-deep); border-color: var(--ink);
}
.btn-primary:hover { background: #fff; border-color: #fff; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--panel-2); border-color: transparent; color: var(--ink); }

.btn-mono { font-family: var(--mono); font-size: 12.5px; font-weight: 500; }

/* the stop button — recording context only */
.btn-stop {
  background: var(--rec); border-color: var(--rec); color: #fff;
  font-weight: 700;
}
.btn-stop:hover { background: var(--rec-deep); border-color: var(--rec-deep); }
.btn-stop:disabled { background: var(--rec-deep); border-color: var(--rec-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: 8px;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: .14em; color: var(--rec);
  padding: 5px 12px; border: 1px solid color-mix(in srgb, var(--rec) 45%, transparent);
  border-radius: 999px; background: color-mix(in srgb, var(--rec) 9%, transparent);
}
.rec-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rec);
  animation: rec-pulse 1.2s ease-in-out infinite;
}
@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--rec-glow); opacity: 1; }
  50%      { box-shadow: 0 0 0 6px transparent;  opacity: .55; }
}

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

/* ---------- panels & cards ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.hairline-label {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-mute);
}

/* ---------- thread motif ---------- */
.thread-rule {
  height: 14px; border: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='14' viewBox='0 0 80 14'%3E%3Cpath d='M0 7 Q10 0 20 7 T40 7 T60 7 T80 7' fill='none' stroke='%2334343f' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
}

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.field input {
  font-family: var(--sans); font-size: 15px;
  background: var(--bg-deep); color: var(--ink);
  border: 1px solid var(--line-hi); border-radius: var(--r-md);
  padding: 11px 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--ink-faint); }
.field input:focus {
  border-color: var(--ink-mute);
  box-shadow: 0 0 0 3px rgba(242,242,245,.08);
}

/* ---------- toast ---------- */
.toast {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--panel-2); border: 1px solid var(--line-hi);
  border-radius: var(--r-md); padding: 10px 16px;
  font-size: 13.5px; color: var(--ink-soft);
}
.toast .ok-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 8px color-mix(in srgb, var(--ok) 60%, transparent);
}

/* ---------- misc ---------- */
.kbd {
  font-family: var(--mono); font-size: 11px;
  border: 1px solid var(--line-hi); border-bottom-width: 2px;
  border-radius: 5px; padding: 2px 6px; color: var(--ink-soft);
  background: var(--panel-2);
}

.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--bg-deep);
  flex-shrink: 0;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.rise { animation: rise .55s cubic-bezier(.2,.7,.2,1) both; }
.rise-1 { animation-delay: .05s; } .rise-2 { animation-delay: .14s; }
.rise-3 { animation-delay: .23s; } .rise-4 { animation-delay: .32s; }

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

/* ============================================================
   Layout chrome — flash messages
   ============================================================ */
.flash {
  max-width: 1224px; margin: 14px auto 0;
  padding: 10px 16px;
  border: 1px solid var(--line-hi);
  border-left: 3px solid var(--warn);
  border-radius: var(--r-md);
  background: var(--panel-2);
  color: var(--ink-soft);
  font-size: 13.5px;
}
.flash--notice { border-left-color: var(--ok); }

.link-button { font: inherit; }

/* ============================================================
   Landing / recorder idle  (videos#new)
   ============================================================ */
.hero {
  min-height: calc(100vh - 58px);
  display: grid;
  grid-template-columns: 1fr 380px;
  max-width: 1280px; margin: 0 auto;
  padding: 0 28px;
  align-items: center; gap: 56px;
  position: relative;
}
/* faint thread winding behind the hero */
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='800' viewBox='0 0 1200 800'%3E%3Cpath d='M-50 620 C 250 560, 380 700, 640 640 S 1050 520, 1280 600' fill='none' stroke='%2326262e' stroke-width='1.4'/%3E%3Cpath d='M-50 660 C 250 600, 400 740, 660 680 S 1060 560, 1280 640' fill='none' stroke='%231b1b22' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: bottom;
}

.hero-copy { position: relative; }
.hero h1 {
  font-size: 58px; font-weight: 800; letter-spacing: -.035em;
  line-height: 1.04; margin: 18px 0 20px;
}
.hero h1 .underthread {
  position: relative; white-space: nowrap;
}
.hero h1 .underthread::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='10' viewBox='0 0 60 10'%3E%3Cpath d='M0 5 Q7.5 0 15 5 T30 5 T45 5 T60 5' fill='none' stroke='%23e5484d' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
}
.hero-sub {
  font-size: 17.5px; color: var(--ink-soft); max-width: 46ch; line-height: 1.6;
}
.hero-sub strong { color: var(--ink); font-weight: 600; }

.hero-meta {
  margin-top: 30px; display: flex; gap: 26px; align-items: center;
  font-family: var(--mono); font-size: 12px; color: var(--ink-mute);
  letter-spacing: .03em;
}
.hero-meta span b { color: var(--ink-soft); font-weight: 500; }

/* ===== the recorder console ===== */
.console {
  position: relative;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-hi);
  border-radius: 20px;
  padding: 26px 26px 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.04);
}
.console-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px;
}
.console-head .readout { font-size: 13px; color: var(--ink-faint); }

.src-note {
  font-family: var(--mono); font-size: 11px; letter-spacing: .03em;
  color: var(--ink-mute); text-align: center;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg-deep); padding: 11px 14px; margin-bottom: 26px;
}

/* device pickers */
.device-row { display: flex; gap: 10px; margin-bottom: 22px; }
.device {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg-deep); padding: 9px 12px;
}
.device-kind {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  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: 12.5px;
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
}
.device select option { background: var(--panel-2); color: var(--ink-soft); }
.device:hover { border-color: var(--line-hi); }

/* THE record button */
.record-well { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.record-btn {
  width: 118px; height: 118px; border-radius: 50%;
  border: 1px solid var(--line-hi); cursor: pointer;
  background: radial-gradient(circle at 50% 38%, #23232c, var(--bg-deep) 75%);
  display: grid; place-items: center;
  box-shadow: 0 14px 36px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06);
  transition: transform .12s, box-shadow .25s;
}
.record-btn:hover { transform: scale(1.03); box-shadow: 0 16px 44px rgba(0,0,0,.55), 0 0 0 10px color-mix(in srgb, var(--rec) 7%, transparent); }
.record-btn:active { transform: scale(.98); }
.record-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.record-btn .core {
  width: 58px; height: 58px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #ff7a7e, var(--rec) 58%, var(--rec-deep));
  box-shadow: 0 0 24px var(--rec-glow);
  animation: idle-breathe 2.8s ease-in-out infinite;
}
@keyframes idle-breathe {
  0%, 100% { box-shadow: 0 0 18px var(--rec-glow); }
  50%      { box-shadow: 0 0 34px var(--rec-glow); }
}
.record-hint { font-size: 13px; color: var(--ink-mute); text-align: center; }
.guest-note {
  margin-top: 4px; font-family: var(--mono); font-size: 11px;
  color: var(--ink-faint); letter-spacing: .04em; text-align: center;
}
.guest-note a { color: var(--ink-mute); }
.recorder-status {
  min-height: 1.5em; font-family: var(--mono); font-size: 11.5px;
  color: var(--ink-mute); text-align: center;
}

/* corner screws, because it's a deck */
.screw { position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: var(--line-hi); box-shadow: inset 0 1px 1px rgba(0,0,0,.7); }
.screw.tl { top: 10px; left: 10px; } .screw.tr { top: 10px; right: 10px; }
.screw.bl { bottom: 10px; left: 10px; } .screw.br { bottom: 10px; right: 10px; }

/* ===== below the fold ===== */
.fold { max-width: 1280px; margin: 0 auto; padding: 90px 28px 40px; }
.loop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-top: 34px; }
.loop-step { background: var(--panel); padding: 30px 28px 34px; position: relative; }
.loop-step .step-no {
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  letter-spacing: .18em; display: block; margin-bottom: 18px;
}
.loop-step h3 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 8px; }
.loop-step p { font-size: 14px; color: var(--ink-mute); line-height: 1.6; }
.loop-step .step-art { height: 64px; margin-bottom: 18px; display: flex; align-items: center; }

.pipeline { margin-top: 110px; display: grid; grid-template-columns: 460px 1fr; gap: 64px; align-items: start; }
.pipeline h2 { font-size: 36px; font-weight: 800; letter-spacing: -.03em; line-height: 1.12; margin: 14px 0 16px; }
.pipeline .lede { color: var(--ink-soft); font-size: 15.5px; line-height: 1.65; }
.pipeline .lede + .lede { margin-top: 14px; }
.pipeline .lede strong { color: var(--ink); font-weight: 600; }

.pipe-diagram { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-deep); padding: 28px; }
.pipe-line { display: flex; align-items: center; gap: 14px; padding: 16px 6px; }
.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-hi); border-radius: var(--r-sm);
  background: var(--panel-2); color: var(--ink-soft); white-space: nowrap;
}
.pipe-arrow { color: var(--ink-faint); font-family: var(--mono); font-size: 12px; }
.pipe-note { font-family: var(--mono); font-size: 11px; color: var(--ink-mute); margin-left: auto; text-align: right; letter-spacing: .02em; }
.pipe-no-server {
  margin-top: 18px; padding: 12px 16px; border-radius: var(--r-md);
  border: 1px solid var(--line); display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; color: var(--ink-mute);
}
.pipe-no-server s { color: var(--ink-faint); }

.closer { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 110px 28px 90px; }
.closer-prompt { font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }

.site-foot {
  border-top: 1px solid var(--line); padding: 26px 28px;
  display: flex; align-items: center; gap: 24px;
  max-width: 1280px; margin: 0 auto;
  font-size: 13px; color: var(--ink-mute);
}
.site-foot .mono { font-size: 11px; color: var(--ink-faint); margin-left: auto; }

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; padding-top: 60px; }
  .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 outranks the UA's `[hidden]` rule and the
   stage leaks onto the idle page (same guard the camera bubble uses below). */
.recording-stage:not([hidden]) {
  background: var(--bg-deep);
  min-height: calc(100vh - 58px);
  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 28px; height: 58px; position: relative;
  border-bottom: 1px solid color-mix(in srgb, var(--rec) 28%, var(--line));
}
.rec-deck::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--rec), transparent);
  animation: strip-sweep 2.4s linear infinite;
  opacity: .7;
}
@keyframes strip-sweep {
  from { transform: translateX(-30%); } to { transform: translateX(30%); }
}

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

/* ===== stage ===== */
.stage {
  flex: 1; display: grid; place-items: center; padding: 36px 28px;
  position: relative;
}
/* 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%)); }

.preview {
  position: relative; border-radius: var(--r-lg);
  border: 1px solid var(--line-hi);
  outline: 1px solid color-mix(in srgb, var(--rec) 35%, transparent);
  outline-offset: 4px;
  overflow: hidden; aspect-ratio: 16 / 9;
  background: #101014;
  box-shadow: 0 40px 100px rgba(0,0,0,.6);
}
.preview video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; display: block; background: #101014;
}

/* 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;
  width: 152px; height: 152px; border-radius: 50%;
  object-fit: cover; transform: scaleX(-1); /* mirrored, like every self-view */
  border: 2px solid var(--line-hi);
  outline: 1px solid color-mix(in srgb, var(--rec) 35%, transparent);
  outline-offset: 3px;
  box-shadow: 0 18px 48px rgba(0,0,0,.6);
}
.preview video.camera-bubble[hidden] { display: none; }

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

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

.clipboard-chip {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid color-mix(in srgb, var(--ok) 38%, transparent);
  background: color-mix(in srgb, var(--ok) 8%, transparent);
  color: var(--ink-soft); border-radius: var(--r-md);
  padding: 10px 16px; font-size: 13px;
}
.clipboard-chip .url { font-family: var(--mono); font-size: 12px; color: var(--ink); }
.clipboard-chip .ok-mark { color: var(--ok); font-weight: 700; }

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

/* ===== claim banner (guest recording) ===== */
.claim {
  display: flex; align-items: center; gap: 16px;
  border: 1px dashed var(--line-hi); border-radius: var(--r-lg);
  background: linear-gradient(90deg, var(--panel), transparent);
  padding: 14px 20px; margin-bottom: 24px;
}
.claim .spool-ic { flex-shrink: 0; }
.claim p { font-size: 14px; color: var(--ink-soft); }
.claim p b { color: var(--ink); }
.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(--line-hi);
  background: radial-gradient(120% 90% at 30% 20%, #1d1d26, #101014 70%);
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
}
.player video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; display: block; background: #101014;
}

/* ===== cooking player ===== */
.player--cooking {
  background: var(--bg-deep);
  display: grid; place-items: center;
}
/* slow scanning sheen across the dark frame */
.player--cooking::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.035) 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: 2; 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 var(--line-hi);
  animation: wind 9s linear infinite reverse;
}

.cook-center h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 8px; }
.cook-center .sub { font-size: 14px; color: var(--ink-mute); max-width: 42ch; margin: 0 auto; line-height: 1.6; }
.cook-center .sub b { color: var(--ink-soft); font-weight: 600; }

.morph-note {
  margin-top: 22px; font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  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: 20px 2px 0; display: flex; align-items: flex-start; gap: 18px; }
.title-main { flex: 1; min-width: 0; }
.title-row h1 { font-size: 24px; font-weight: 700; letter-spacing: -.025em; line-height: 1.25; }
.title-meta {
  margin-top: 6px; 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: 600; letter-spacing: .1em;
  color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  background: color-mix(in srgb, var(--warn) 8%, transparent);
  padding: 4px 11px; border-radius: 999px;
}
.cooking-chip i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--warn);
  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(--sans); font-size: 24px; font-weight: 700; letter-spacing: -.025em;
  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-hi); background: var(--panel); outline: none;
}

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

/* markers pinned along the video's duration */
.timeline-strip {
  position: relative; height: 30px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: repeating-linear-gradient(90deg, var(--panel) 0 2px, transparent 2px 24px);
}
.tl-marker {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: 15px; line-height: 1;
}
.tl-marker:hover { transform: translate(-50%, -50%) scale(1.35); }
.tl-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--warn); border: 2px solid var(--bg);
}

.react-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.react-bar form { display: contents; }
.react-btn {
  font-size: 17px; line-height: 1; padding: 7px 10px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
}
.react-btn:hover { border-color: var(--ink-faint); background: var(--panel-2); transform: translateY(-1px); }
.react-hint { margin-left: 8px; }

.comment-form { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.comment-name {
  flex: 0 0 160px; padding: 10px 12px; font-size: 13.5px;
  background: var(--bg-deep); color: var(--ink);
  border: 1px solid var(--line-hi); border-radius: var(--r-md);
}
.comment-body {
  flex: 1; min-width: 220px; padding: 10px 12px; font-size: 14px;
  font-family: var(--sans); resize: vertical;
  background: var(--bg-deep); color: var(--ink);
  border: 1px solid var(--line-hi); border-radius: var(--r-md);
}
.comment-name::placeholder, .comment-body::placeholder { color: var(--ink-faint); }
.comment-name:focus, .comment-body:focus { border-color: var(--ink-mute); outline: none; }
.comment-post { flex-shrink: 0; font-variant-numeric: tabular-nums; }

.claim-nudge { margin-top: 10px; }
.claim-nudge a { color: var(--ink-soft); }

.comment-list { list-style: none; margin-top: 22px; display: flex; flex-direction: column; gap: 16px; }
.comment-head { display: flex; align-items: center; gap: 10px; }
.comment-author { color: var(--ink-soft); font-weight: 600; }
.t-chip {
  font-family: var(--mono); font-size: 11px; font-weight: 600; cursor: pointer;
  color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  border-radius: 999px; padding: 2px 9px;
}
.t-chip:hover { background: color-mix(in srgb, var(--warn) 18%, transparent); }
.comment-text { margin-top: 5px; 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: 15px; line-height: 1; padding: 2px 6px;
}
.comment-delete:hover { color: var(--red, #e5484d); }

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

.lib-head { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
.lib-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.lib-stats {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-mute);
  letter-spacing: .03em; padding-bottom: 6px;
}
.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(--rec);
  display: inline-block; margin-right: 2px;
}

.lib-empty { color: var(--ink-mute); }
.lib-empty a { color: var(--ink-soft); }

/* ===== 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(--panel); overflow: hidden;
  transition: border-color .15s, transform .15s, box-shadow .2s;
}
.card:hover {
  border-color: var(--line-hi); transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
}

.thumb {
  position: relative; aspect-ratio: 16/9; overflow: hidden;
  display: block; background: var(--bg-deep); 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: var(--ink-faint); font-size: 22px;
}
.thumb .dur {
  position: absolute; right: 8px; bottom: 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  background: rgba(10,10,13,.85); color: var(--ink-soft);
  padding: 2.5px 8px; border-radius: 5px; letter-spacing: .03em;
}

.card-body { padding: 14px 16px 15px; }
.card-body h3 {
  font-size: 14.5px; font-weight: 650; letter-spacing: -.01em; line-height: 1.4;
  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(--warn); }

/* 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: 600; letter-spacing: .12em;
  color: var(--warn);
}
.card.cooking .seg-line {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line);
}
.card.cooking .seg-line i {
  display: block; height: 100%; width: 72%; background: var(--warn);
  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-hi); background: rgba(10,10,13,.85);
  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(--ink); border-color: var(--ink-faint); }

/* ============================================================
   Auth  (users#new, sessions#new)
   ============================================================ */
.auth-stage {
  min-height: calc(100vh - 58px);
  display: grid; place-items: center;
  padding: 40px 20px;
  background: radial-gradient(60% 50% at 50% 110%, rgba(229,72,77,.05), transparent 70%);
  position: relative;
}
/* loose thread winding across the backdrop */
.auth-stage::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='900' viewBox='0 0 1400 900'%3E%3Cpath d='M-60 720 C 300 640, 460 820, 760 740 S 1240 600, 1480 700' fill='none' stroke='%2326262e' stroke-width='1.5'/%3E%3Cpath d='M-60 770 C 300 690, 480 860, 780 780 S 1250 650, 1480 750' fill='none' stroke='%231b1b22' stroke-width='1.5'/%3E%3Ccircle cx='1180' cy='180' r='64' fill='none' stroke='%231b1b22' stroke-width='1.5'/%3E%3Cpath d='M1120 168h120M1120 192h120' stroke='%2318181f' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
}

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

.auth-card {
  position: relative;
  width: min(400px, 100%);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-hi);
  border-radius: 20px;
  padding: 36px 34px 30px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.04);
}

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

.auth-card h1 {
  font-size: 23px; font-weight: 800; letter-spacing: -.025em;
  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: 600; }

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

.stopwatch {
  position: absolute; top: -13px; right: 22px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  color: var(--ink-faint); background: var(--bg);
  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: .04em;
}

.recorder-status--live {
  text-align: center;
  margin-top: 14px;
  color: var(--warn);
  font-size: 13.5px;
  min-height: 1.4em;
}
