/* ytd — editing-desk look: warm paper, ink, one red-orange "cut" accent. */
:root {
  color-scheme: light dark;
  --paper: oklch(96.6% 0.014 78);
  --paper-2: oklch(92.8% 0.02 76);
  --ink: oklch(23% 0.026 50);
  --ink-2: oklch(43% 0.026 52);
  --line: oklch(85.5% 0.022 72);
  --cut: oklch(60.5% 0.205 33);
  --cut-press: oklch(53% 0.2 32);
  --cut-soft: oklch(60.5% 0.205 33 / 0.14);
  --on-cut: oklch(98.5% 0.008 75);
  --strip: oklch(27% 0.024 50);
  --strip-hole: oklch(41% 0.022 52);
  --focus: oklch(60.5% 0.205 33 / 0.32);
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: oklch(19.5% 0.014 55);
    --paper-2: oklch(24.5% 0.017 55);
    --ink: oklch(94% 0.013 78);
    --ink-2: oklch(75% 0.02 70);
    --line: oklch(34% 0.018 55);
    --cut: oklch(67% 0.19 36);
    --cut-press: oklch(61% 0.19 35);
    --cut-soft: oklch(67% 0.19 36 / 0.18);
    --on-cut: oklch(17% 0.02 40);
    --strip: oklch(13.5% 0.012 50);
    --strip-hole: oklch(29% 0.016 50);
    --focus: oklch(67% 0.19 36 / 0.4);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

/* ---------- header */
.top { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand .mark { width: 32px; height: 32px; }
.brand span { font: 800 1.6rem/1 var(--font-display); letter-spacing: -0.04em; }
.install {
  border: 1.5px solid var(--ink); background: transparent; border-radius: 99px;
  padding: 7px 14px; font-size: 0.9rem; font-weight: 600;
}

/* ---------- intro */
.intro { padding: clamp(28px, 7vw, 64px) 0 clamp(20px, 4vw, 32px); }
h1 {
  margin: 0;
  font: 800 clamp(2.35rem, 9vw, 4.4rem)/0.96 var(--font-display);
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 96;
  text-wrap: balance;
}
h1 em { font-style: normal; color: var(--cut); }
.lede { margin: 18px 0 0; max-width: 34rem; color: var(--ink-2); font-size: clamp(1.02rem, 2.6vw, 1.15rem); text-wrap: pretty; }

@media (prefers-reduced-motion: no-preference) {
  .intro > *, .linkbar { animation: rise 0.7s var(--ease) both; }
  .lede { animation-delay: 0.08s; }
  .linkbar { animation-delay: 0.16s; }
  .editor, .job { animation: rise 0.5s var(--ease) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- link bar */
.linkbar { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.field { position: relative; }
.field input {
  width: 100%; height: 58px;
  padding: 0 84px 0 16px;
  border: 2px solid var(--ink); border-radius: var(--r);
  background: var(--paper); font-size: 1.0625rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input::placeholder { color: var(--ink-2); opacity: 0.8; }
.field input:focus { outline: none; border-color: var(--cut); box-shadow: 0 0 0 4px var(--focus); }
.paste {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  height: 40px; padding: 0 12px; border: 0; border-radius: 10px;
  background: var(--paper-2); font-size: 0.92rem; font-weight: 600;
}
.go {
  height: 58px; padding: 0 22px; border: 0; border-radius: var(--r);
  background: var(--ink); color: var(--paper);
  font: 700 1.05rem/1 var(--font-display); letter-spacing: -0.01em;
}
.go:active, .paste:active { transform: translateY(1px); }
.go[disabled] { opacity: 0.7; cursor: progress; }

.msg {
  margin: 12px 0 0; padding: 12px 14px; border-radius: 12px;
  background: var(--cut-soft); color: var(--ink); font-size: 0.98rem;
}

/* ---------- editor */
.editor { margin-top: 28px; }
.player {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border-radius: var(--r); overflow: hidden; background: var(--strip);
}
.player.vertical { aspect-ratio: 9 / 16; max-height: 62vh; width: auto; margin: 0 auto; }
.player iframe, .player #player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vmeta { margin: 14px 0 22px; }
.vmeta h2 { margin: 0; font: 700 1.25rem/1.2 var(--font-display); letter-spacing: -0.015em; text-wrap: balance; }
.vmeta p { margin: 4px 0 0; color: var(--ink-2); font-size: 0.95rem; }

.tl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.clen { margin: 0; color: var(--ink-2); font-size: 0.95rem; }
.clen b { color: var(--ink); font: 700 1.45rem/1 var(--font-display); font-variant-numeric: tabular-nums; margin-left: 4px; }
.clen.bad b { color: var(--cut); }
.preview {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; padding: 8px 0; font-weight: 600; font-size: 0.95rem; color: var(--ink);
}
.preview svg { width: 14px; height: 14px; color: var(--cut); }

/* timeline = a strip of film you cut */
.timeline { padding: 8px 12px 0; }
.track {
  position: relative; height: 60px; border-radius: 9px;
  background:
    repeating-linear-gradient(90deg, var(--strip-hole) 0 7px, transparent 7px 15px) 4px 6px / calc(100% - 8px) 5px no-repeat,
    repeating-linear-gradient(90deg, var(--strip-hole) 0 7px, transparent 7px 15px) 4px calc(100% - 6px) / calc(100% - 8px) 5px no-repeat,
    var(--strip);
  touch-action: none; cursor: pointer; user-select: none; -webkit-user-select: none;
}
.range {
  position: absolute; top: 0; bottom: 0;
  background: color-mix(in oklch, var(--cut) 38%, transparent);
  border-block: 3px solid var(--cut);
  cursor: grab;
}
.playhead { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--paper); border-radius: 2px; pointer-events: none; box-shadow: 0 0 0 1px var(--strip); }
.handle {
  position: absolute; top: -7px; bottom: -7px; width: 24px; margin-left: -12px;
  border: 0; border-radius: 7px; padding: 0;
  background: var(--cut); box-shadow: 0 2px 0 var(--cut-press);
  touch-action: none; cursor: ew-resize;
}
.handle::before { content: ""; position: absolute; inset: -8px -10px; }
.handle::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 20px; transform: translate(-50%, -50%);
  background: linear-gradient(90deg, var(--on-cut) 0 2px, transparent 2px 5px, var(--on-cut) 5px 7px);
  border-radius: 1px; opacity: 0.9;
}
.handle:active, .handle.dragging { background: var(--cut-press); }
.scale { display: flex; justify-content: space-between; margin-top: 10px; color: var(--ink-2); font-size: 0.82rem; font-variant-numeric: tabular-nums; }

.times { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.tfield label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.tin { display: grid; grid-template-columns: 40px 1fr 40px; height: 48px; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); }
.tin:focus-within { border-color: var(--cut); box-shadow: 0 0 0 3px var(--focus); }
.tin button { border: 0; background: var(--paper-2); font-size: 1.25rem; font-weight: 500; }
.tin button:active { background: var(--line); }
.tin input {
  min-width: 0; border: 0; background: transparent; text-align: center; outline: none;
  font: 600 1.06rem/1 var(--font-body); font-variant-numeric: tabular-nums;
}
.now {
  margin-top: 6px; padding: 6px 0; border: 0; background: none;
  font-size: 0.86rem; font-weight: 600; color: var(--cut); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px;
}

.opts { border: 0; padding: 0; margin: 26px 0 0; }
.opts legend { padding: 0; font: 700 1.05rem/1 var(--font-display); margin-bottom: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.seg label { position: relative; }
.seg input, .quals input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 50px; font-weight: 500; cursor: pointer; transition: background 0.15s, color 0.15s; }
.seg span b { font-family: var(--font-display); font-weight: 700; }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -3px; }
.quals { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.quals label span {
  display: inline-block; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 99px;
  font-size: 0.93rem; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer;
}
.quals input:checked + span { border-color: var(--cut); background: var(--cut-soft); color: var(--ink); }
.quals input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.quals small { align-self: center; color: var(--ink-2); font-size: 0.85rem; }

.cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 60px; margin-top: 22px; border: 0; border-radius: 16px;
  background: var(--cut); color: var(--on-cut);
  font: 700 1.18rem/1 var(--font-display); letter-spacing: -0.01em;
  box-shadow: 0 3px 0 var(--cut-press);
  transition: transform 0.1s, box-shadow 0.1s, opacity 0.15s;
}
.cta:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cut-press); }
.cta[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn {
  height: 52px; border: 2px solid var(--ink); border-radius: 14px; background: transparent;
  font: 700 1rem/1 var(--font-display);
}
.btn:active { background: var(--paper-2); }
.btn[disabled] { opacity: 0.5; }

/* ---------- job / result */
.job { margin-top: 8px; padding-top: 8px; }
.jobhead { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; }
.jobhead img { width: 112px; aspect-ratio: 16 / 9; height: auto; object-fit: cover; border-radius: 10px; background: var(--paper-2); }
.jtitle { margin: 0; font: 700 1.08rem/1.25 var(--font-display); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jrange { margin: 4px 0 0; color: var(--ink-2); font-size: 0.92rem; font-variant-numeric: tabular-nums; }

.working { margin-top: 26px; }
.bar { height: 14px; border-radius: 99px; background: var(--paper-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.bar i { display: block; height: 100%; width: 0; background: var(--cut); border-radius: inherit; transition: width 0.6s var(--ease); }
.bar.indeterminate i {
  width: 100%;
  background: repeating-linear-gradient(-45deg, var(--cut) 0 12px, color-mix(in oklch, var(--cut) 55%, var(--paper)) 12px 24px);
  background-size: 34px 34px;
  animation: slide 0.9s linear infinite;
}
@keyframes slide { to { background-position: 34px 0; } }
@media (prefers-reduced-motion: reduce) { .bar.indeterminate i { animation: none; } }
.jstatus { margin: 14px 0 0; font: 700 1.3rem/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.fine { margin: 8px 0 0; color: var(--ink-2); font-size: 0.88rem; }

.done { margin-top: 22px; }
.media video, .media audio { display: block; width: 100%; border-radius: var(--r); background: var(--strip); }
.media video { max-height: 68vh; }
.media.audio { padding: 18px; border-radius: var(--r); background: var(--paper-2); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.actions .cta { grid-column: 1 / -1; margin-top: 0; }
.hint { margin: 14px 0 0; font-size: 0.97rem; }
.hint b { font-weight: 700; }
.again { display: inline-block; margin-top: 22px; color: var(--ink); font-weight: 600; text-underline-offset: 3px; }

/* ---------- how + faq */
.how { margin-top: clamp(48px, 10vw, 80px); padding-top: 28px; border-top: 2px solid var(--ink); }
.how h2 { margin: 0 0 18px; font: 800 1.7rem/1 var(--font-display); letter-spacing: -0.03em; }
.how ol { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 16px; }
.how li { counter-increment: step; position: relative; padding-left: 44px; }
.how li::before { content: counter(step); position: absolute; left: 0; top: -0.05em; font: 800 1.6rem/1 var(--font-display); color: var(--cut); }
.how li b { font-weight: 700; }
.faq { margin-top: 32px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 16px 30px 16px 0; position: relative;
  font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font: 500 1.5rem/1 var(--font-display); color: var(--ink-2); transition: transform 0.2s var(--ease); }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { margin: -4px 0 16px; color: var(--ink-2); }

.foot { margin-top: 48px; color: var(--ink-2); font-size: 0.85rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }
.foot p { margin: 0; }

/* ---------- toast */
.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom));
  max-width: min(92vw, 26rem); padding: 12px 16px; border-radius: 12px;
  background: var(--ink); color: var(--paper); font-size: 0.95rem; font-weight: 500; text-align: center;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* clip page: hide marketing when showing a finished clip */
body.on-job .intro, body.on-job .linkbar, body.on-job #linkMsg { display: none; }

@media (min-width: 640px) {
  .times { gap: 20px; }
  .actions { grid-template-columns: 2fr 1fr 1fr; }
  .actions .cta { grid-column: auto; }
}
