/* /timeline: Reel 00. A vertical strip of film, one text-only frame per take (Kinetic Mono).
   Loaded only by /timeline, after motion.css; uses its theme variables so dark/light follow automatically.
   Filtering works without JavaScript (radio inputs + :has); hover motion only on fine pointers and never under
   prefers-reduced-motion. */

.tl-head .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
}
.tl-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: clamp(24px, 4vw, 36px) 0 0;
  max-width: 640px;
  background: var(--line);
  border: 1px solid var(--line);
}
.tl-stats > div {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  background: var(--bg);
  min-width: 0;
}
.tl-stats dd {
  margin: 0;
  order: -1;
  font: 700 clamp(1.75rem, 5vw, 2.5rem) / 1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--accent-text);
}

/* ---------- the showreel prompt: a script card with a clapper band ---------- */
.tl-prompt {
  /* follows the page head directly: the script card is part of the opening, not a new scene */
  border-top: 0;
  padding-top: clamp(8px, 2vw, 20px);
}
.script-card {
  position: relative;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 0 clamp(18px, 3vw, 32px) clamp(22px, 3vw, 32px);
}
.script-clapper {
  height: 14px;
  margin: 0 calc(-1 * clamp(18px, 3vw, 32px)) 18px;
  background: repeating-linear-gradient(135deg, var(--text) 0 14px, var(--bg) 14px 28px);
  opacity: 0.9;
}
.script-slate {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 14px;
}
.script-card .h2 {
  margin-bottom: 18px;
}
.script-text {
  margin: 0 0 24px;
  padding: 18px 20px;
  border-left: 2px solid var(--accent-border);
  background: var(--bg);
  font: 400 clamp(0.9375rem, 2vw, 1.0625rem) / 1.65 var(--font-mono);
  color: var(--text);
  overflow-wrap: anywhere;
}
.script-text::before {
  content: '> ';
  color: var(--accent-text);
}
.script-note {
  align-self: center;
  color: var(--muted);
  white-space: normal;
}

/* ---------- filter chips (radio inputs: work without JS) ---------- */
.tl-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  min-width: 0;
}
.tl-radio {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.tl-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font: 500 0.75rem/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.tl-chip .tl-count {
  color: var(--text);
}
.tl-radio:checked + .tl-chip {
  color: var(--text);
  border-color: var(--accent-border);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.tl-radio:focus-visible + .tl-chip {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.tl-status {
  margin: 0;
  flex: 1 1 100%;
}
.tl:has(#tl-showreel:checked) .take:not([data-prompt='showreel']) {
  display: none;
}

/* ---------- the strip: sprocket holes down both edges, one frame per take ---------- */
.strip {
  --sprocket: 30px;
  position: relative;
  list-style: none;
  margin: 0;
  padding: 10px var(--sprocket);
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(to bottom, var(--bg) 0 12px, transparent 12px 26px) left 9px top 6px / 12px 26px repeat-y,
    linear-gradient(to bottom, var(--bg) 0 12px, transparent 12px 26px) right 9px top 6px / 12px 26px repeat-y,
    var(--surface);
  counter-reset: take;
}
.take {
  position: relative;
  padding: 10px 0;
}
.take + .take {
  border-top: 1px dashed var(--line-strong);
}
.take-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--line);
  background: var(--bg);
  min-width: 0;
}
/* onion-skin ghosts: two fading copies of the frame edge, revealed on hover (fine pointers, motion allowed) */
.take-card::before,
.take-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border: 1px solid var(--accent-border);
  pointer-events: none;
  opacity: 0;
}
.take-slate {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 16px;
}
.take-no {
  color: var(--accent-text);
}
.take-time {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}
.take-tc {
  font: 700 clamp(1rem, 2.4vw, 1.25rem) / 1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--text);
}
.take-who {
  margin: 0;
  font: 600 1rem/1.35 var(--font-body, inherit);
  overflow-wrap: anywhere;
}
.take-handle {
  font: 400 0.8125rem/1.35 var(--font-mono);
  color: var(--muted);
  letter-spacing: 0.02em;
}
.take-quote {
  position: relative;
  margin: 0;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--line-strong);
}
.take-quote p {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  line-height: 1.6;
  color: var(--text);
  overflow-wrap: anywhere;
}
.take-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 16px;
}
.take-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.take-chip,
.take-tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius);
  font: 500 0.6875rem/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.take-chip {
  background: var(--accent);
  color: var(--void);
}
.take-tag {
  border: 1px solid var(--line);
  color: var(--muted);
}
.take-link {
  font: 500 0.75rem/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.take-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.tl-note {
  margin: 28px 0 0;
  max-width: 72ch;
}

@media (max-width: 480px) {
  .strip {
    --sprocket: 24px;
    background:
      linear-gradient(to bottom, var(--bg) 0 10px, transparent 10px 22px) left 7px top 6px / 10px 22px repeat-y,
      linear-gradient(to bottom, var(--bg) 0 10px, transparent 10px 22px) right 7px top 6px / 10px 22px repeat-y,
      var(--surface);
  }
  .take-card {
    padding: 16px 14px;
  }
}

/* Hover: the frame steps forward and leaves two onion-skin ghosts behind; the time code lights up. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .take-card {
    transition: transform var(--t-hover) var(--ease-out), border-color var(--t-hover) var(--ease-out);
  }
  .take-card::before,
  .take-card::after {
    transition: opacity var(--t-hover) var(--ease-out), transform var(--t-hover) var(--ease-out);
  }
  .take-card:hover,
  .take-card:focus-within {
    transform: translateX(6px);
    border-color: var(--line-strong);
    /* slice bands down the leading edge, like the Slice-M mark */
    background: repeating-linear-gradient(to bottom, var(--accent) 0 3px, transparent 3px 11px) left top / 3px 100% no-repeat, var(--bg);
  }
  .take-card:hover::before,
  .take-card:focus-within::before {
    opacity: 0.35;
    transform: translateX(-6px);
  }
  .take-card:hover::after,
  .take-card:focus-within::after {
    opacity: 0.15;
    transform: translateX(-12px);
  }
  .take-card:hover .take-tc,
  .take-card:focus-within .take-tc {
    color: var(--accent-text);
  }
}
.tl-note .placeholder {
  white-space: normal;
}
