/* ==========================================================================
   Reels Editing (/reels-editing)
   Page-only layouts. Shared pieces come from components.css; values are tokens.
   ========================================================================== */

/* ── Hero: the reel on the phone, its edit on the timeline ────────────────── */
.re-hero { position: relative; padding-bottom: var(--section-pad-tight); overflow-x: clip; isolation: isolate; }
.re-hero__light { position: absolute; z-index: -1; inset: -15% -10% auto 40%; height: 120%; background: var(--light-spot); pointer-events: none; }
.re-hero__grid { display: grid; gap: var(--sp-6) var(--grid-gutter); align-items: center; }
@media (min-width: 992px) { .re-hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.re-hero__copy { display: grid; gap: var(--sp-3); justify-items: start; }
.re-hero__title { max-width: 12ch; }
.re-hero__answer { color: var(--c-text); max-width: 52ch; }
.re-hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-1); }
@media (max-width: 575.98px) { .re-hero__actions .btn { width: 100%; } }
.re-hero__facts { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); list-style: none; font-size: var(--fs-small); color: var(--c-text-muted); }
.re-hero__facts strong { color: var(--c-text); }
.js-motion .re-hero__copy > * { animation: re-rise var(--dur-slow) var(--ease-signature) backwards; }
.js-motion .re-hero__copy > :nth-child(2) { animation-delay: var(--stagger-items); }
.js-motion .re-hero__copy > :nth-child(3) { animation-delay: calc(var(--stagger-items) * 2); }
.js-motion .re-hero__copy > :nth-child(n + 4) { animation-delay: calc(var(--stagger-items) * 3); }
@keyframes re-rise { from { opacity: 0.01; transform: translateY(var(--reveal-rise)); } }

.re-stage { position: relative; display: grid; justify-items: end; padding-bottom: var(--sp-8); }
.re-stage__phone { width: clamp(12rem, 9rem + 9vw, 16rem); box-shadow: var(--shadow), 0 0 90px -30px var(--glow-color); }
.re-stage__phone video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--dur-base) var(--ease-signature); }
.re-stage__phone video.is-playing { opacity: 1; }
.re-stage__phone .reel__ui { z-index: 1; }

.timeline {
  position: absolute;
  z-index: 2;
  left: 0;
  bottom: 0;
  display: grid;
  gap: var(--sp-1);
  width: min(24rem, 86%);
  padding: var(--sp-2);
  border: var(--border-strong);
  border-radius: var(--r-md);
  background: var(--c-surface-1);
  box-shadow: var(--shadow);
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--c-text-muted);
}
.timeline__head { display: flex; justify-content: space-between; }
.timeline__tracks { position: relative; display: grid; gap: 6px; }
.timeline__track { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); align-items: center; }
.timeline__lane { position: relative; height: 1.25rem; border-radius: 4px; background: var(--c-surface-2); }
.timeline__lane i { position: absolute; top: 2px; bottom: 2px; left: calc(var(--a) * 1%); width: calc((var(--b) - var(--a)) * 1% - 2px); border-radius: 3px; background: var(--c-surface-3); box-shadow: inset 0 0 0 1px var(--c-line-strong); }
.timeline__lane--text i { background: rgb(var(--c-accent-rgb) / 0.28); box-shadow: inset 0 0 0 1px rgb(var(--c-accent-rgb) / 0.55); }
.timeline__lane--audio i { background: repeating-linear-gradient(90deg, rgb(var(--c-accent-rgb) / 0.55) 0 2px, transparent 2px 5px); -webkit-mask-image: linear-gradient(transparent 20%, #000 20% 80%, transparent 80%); mask-image: linear-gradient(transparent 20%, #000 20% 80%, transparent 80%); box-shadow: none; }
/* the playhead sweeps the edit in time with the 6-second loop on the phone */
.timeline__head-line { position: absolute; top: -4px; bottom: -4px; left: 1.75rem; right: 0; pointer-events: none; }
.timeline__head-line::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--c-accent-bright); box-shadow: 0 0 10px var(--glow-color); animation: re-playhead 6s linear infinite; }
@keyframes re-playhead { from { left: 0; } to { left: 100%; } }
.timeline__raw { display: flex; flex-wrap: wrap; gap: 6px; padding-top: var(--sp-1); border-top: var(--border); list-style: none; }
.timeline__raw li { padding: 2px 6px; border: var(--border); border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .timeline__head-line::before { animation: none; left: 62%; } }

/* ── 01 · Who it's for: one statement, three kinds of people ───────────── */
.re-who__inner { display: grid; justify-items: center; gap: var(--sp-4); text-align: center; }
.re-who__title { max-width: 20ch; }
.re-who__list { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); list-style: none; }
.re-who__list li { display: inline-flex; align-items: center; gap: var(--sp-1); padding: var(--sp-1) var(--sp-3) var(--sp-1) var(--sp-1); border: var(--border-strong); border-radius: var(--r-pill); color: var(--c-text); }
/* phones: pills that wrap to two lines read better left-aligned, with the card radius */
@media (max-width: 575.98px) { .re-who__list li { border-radius: var(--r-md); text-align: left; } .re-who__list .icon { flex: none; } }
.re-who__list .icon { box-sizing: content-box; --icon-size: 1rem; padding: var(--sp-1); border-radius: 50%; background: rgb(var(--c-accent-rgb) / 0.14); color: var(--c-accent-text); }

/* ── 02 · What goes into every edit ────────────────────────────────────── */
.edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4) var(--grid-gutter); list-style: none; }
@media (min-width: 992px) { .edit-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.edit-grid li { display: grid; align-content: start; gap: var(--sp-1); padding-top: var(--sp-2); border-top: var(--border-strong); }
.edit-grid__icon { display: grid; place-items: center; width: 2.75rem; aspect-ratio: 1; margin-bottom: var(--sp-1); border-radius: 50%; background: rgb(var(--c-accent-rgb) / 0.12); color: var(--c-accent-text); }
.edit-grid__icon .icon { --icon-size: 1.25rem; }
.edit-grid h3 { font-size: var(--fs-h4); letter-spacing: -0.015em; line-height: 1.2; }
.edit-grid p { color: var(--c-text-muted); font-size: var(--fs-small); }

/* ── 03 · Editing levels ───────────────────────────────────────────────── */
.levels { display: grid; gap: var(--grid-gutter); list-style: none; align-items: stretch; }
@media (min-width: 992px) { .levels { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.level { display: grid; grid-template-rows: auto auto auto 1fr auto; justify-items: start; gap: var(--sp-1); padding: clamp(1.5rem, 1rem + 1.6vw, 2.5rem); }
.level--lit { border-color: rgb(var(--c-accent-rgb) / 0.6); background: linear-gradient(180deg, var(--c-surface-2), var(--c-surface-1)); box-shadow: 0 0 80px -30px var(--glow-color); }
.level--lit::before { content: ""; position: absolute; z-index: -1; inset: -40% -30% auto auto; width: 80%; aspect-ratio: 1; background: var(--light-spot); }
@media (min-width: 992px) { .level--lit { transform: translateY(calc(var(--sp-2) * -1)); } }
.level__badge { position: absolute; top: var(--sp-3); right: var(--sp-3); padding: 2px var(--sp-1); border-radius: var(--r-pill); background: var(--c-accent); color: var(--c-accent-ink); font-size: var(--fs-caption); font-weight: var(--text-weight-bold); }
.level__name { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: 1; }
.level__for { color: var(--c-text-muted); }
.level__time { margin-top: var(--sp-1); font-size: var(--fs-small); color: var(--c-text-muted); }
.level__time strong { font-family: var(--font-display); font-size: var(--fs-h4); font-weight: var(--display-weight); color: var(--c-accent-text); }
.level__list { display: grid; align-content: start; gap: var(--sp-1); width: 100%; margin: var(--sp-1) 0 var(--sp-3); padding-top: var(--sp-2); border-top: var(--border); list-style: none; }
.level__list li { display: flex; align-items: baseline; gap: var(--sp-1); }
.level__list li::before { content: ""; flex: none; width: 6px; aspect-ratio: 1; border-radius: 50%; background: var(--c-accent); translate: 0 -2px; }
.levels__note { display: flex; align-items: center; justify-content: center; gap: var(--sp-1); margin-top: var(--sp-4); color: var(--c-text-muted); }
.levels__note .icon { --icon-size: 1rem; color: var(--c-accent-text); }

/* ── 04 · How it works: a chain of five ────────────────────────────────── */
.chain { display: grid; gap: var(--sp-2); list-style: none; }
@media (min-width: 992px) { .chain { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-4); } }
.chain__step { position: relative; display: grid; align-content: start; gap: var(--sp-1); padding: var(--sp-3); border: var(--border); border-radius: var(--r-md); background: var(--c-bg); }
/* one lit step per viewport: the first is filled, the rest are outlines */
.chain__icon { display: grid; place-items: center; width: var(--tap-min); aspect-ratio: 1; border: 1px solid rgb(var(--c-accent-rgb) / 0.5); border-radius: 50%; color: var(--c-accent-text); }
.chain__step:first-child .chain__icon { border-color: var(--c-accent); background: var(--c-accent); color: var(--c-accent-ink); }
.chain__icon .icon { --icon-size: 1.25rem; }
.chain__no { position: absolute; top: var(--sp-3); right: var(--sp-3); font-family: var(--font-mono); font-size: var(--fs-caption); color: var(--c-text-muted); }
.chain__step h3 { margin-top: var(--sp-1); font-size: var(--fs-h4); letter-spacing: -0.015em; line-height: 1.2; }
.chain__step p { color: var(--c-text-muted); font-size: var(--fs-small); }
/* a small arrow between the steps */
@media (min-width: 992px) {
  .chain__step:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: calc(var(--sp-4) / -2 - 5px); width: 10px; aspect-ratio: 1; border-top: 2px solid var(--c-accent); border-right: 2px solid var(--c-accent); transform: translateY(-50%) rotate(45deg); }
}

/* ── 05 · Reels in phone frames: a swipeable row ───────────────────────── */
.phone-rail {
  --rail-pad: max(var(--page-gutter), calc((100vw - var(--container-max)) / 2 + var(--page-gutter)));
  display: flex;
  gap: var(--grid-gutter);
  padding: var(--sp-1) var(--rail-pad) var(--sp-3);
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--rail-pad);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.phone-rail::-webkit-scrollbar { display: none; }
.phone-rail__item { flex: none; width: clamp(11rem, 9rem + 7vw, 15rem); scroll-snap-align: start; }
.phone-rail .reel { max-width: none; }
.rail-buttons { display: flex; gap: var(--sp-1); }
/* the label sits on a deeper scrim, so it never fights text burned into the thumbnail */
.phone-rail .reel__ui { padding-top: var(--sp-10); background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--c-bg) 94%, transparent) 55%); }
.phone-rail .reel__handle { min-width: 0; white-space: nowrap; }
.phone-rail .reel__avatar { flex: none; }
.phone-rail .reel__handle, .phone-rail .reel__caption { overflow: hidden; text-overflow: ellipsis; }
/* phones: a smaller handle, so names stay on one line without being cut */
@media (max-width: 575.98px) { .phone-rail .reel__ui { padding-inline: var(--sp-1); } .phone-rail .reel__handle { font-size: var(--fs-caption); gap: var(--sp-0-5); } .phone-rail .reel__avatar { width: var(--sp-2); height: var(--sp-2); } }
.no-js .rail-buttons { display: none; }
@media (pointer: coarse) { .rail-buttons { display: none; } } /* touch: just swipe */

/* ── What clients say about the edits ──────────────────────────────────── */

/* ── 06 · Which service do you need ────────────────────────────────────── */
.which { display: grid; gap: var(--grid-gutter); list-style: none; }
@media (min-width: 768px) { .which { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.which__card { display: grid; align-content: start; gap: var(--sp-1); padding: clamp(1.5rem, 1rem + 1.4vw, 2.25rem); border: var(--border); border-radius: var(--r-lg); background: var(--c-bg); }
.which__card--here { border-color: rgb(var(--c-accent-rgb) / 0.6); box-shadow: 0 0 60px -30px var(--glow-color); }
.which__if { font-size: var(--fs-eyebrow); font-weight: var(--text-weight-bold); letter-spacing: var(--eyebrow-tracking); text-transform: uppercase; color: var(--c-accent-text); }
.which__name { font-size: var(--fs-h3); letter-spacing: var(--display-tracking); line-height: 1.05; }
.which__name a[href] { display: inline-block; padding-block: var(--sp-1); text-decoration: underline; text-decoration-color: var(--c-line-strong); text-underline-offset: 0.15em; }
.which__name a[href]:hover { text-decoration-color: var(--c-accent); }
.which__text { color: var(--c-text-muted); }
