/* Cutwright Studio, shared pieces for every design version:
   media placeholders, the edit (phone + timeline), charts, logo. Each version sets the variables. */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Logo: two clips and the cut */
.cw-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.cw-logo svg { width: 30px; height: auto; flex: none; }
.cw-logo .cw-cut { fill: var(--cut, #ff5a2e); }
.cw-logo-word { font-weight: 700; letter-spacing: -0.03em; font-size: 19px; }
.cw-logo-sub {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase; opacity: .6;
  padding-left: 10px; border-left: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 25%, transparent);
}

/* Media placeholders: moving colour fields until his reels drop in. A <video> inside .m covers it. */
.m { position: relative; overflow: hidden; background: var(--m-base); isolation: isolate; }
.m::before {
  content: ""; position: absolute; inset: -35%; z-index: -1;
  background:
    radial-gradient(38% 34% at 28% 30%, var(--m1), transparent 70%),
    radial-gradient(42% 38% at 74% 62%, var(--m2), transparent 72%),
    radial-gradient(30% 30% at 52% 84%, var(--m3), transparent 70%);
  filter: blur(26px) saturate(115%);
  animation: m-drift var(--m-speed, 16s) ease-in-out infinite alternate;
  will-change: transform;
}
.m::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .22; mix-blend-mode: overlay;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.m > video, .m > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
@keyframes m-drift {
  0% { transform: translate3d(-6%, -4%, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(5%, 3%, 0) rotate(18deg) scale(1.08); }
  100% { transform: translate3d(-2%, 6%, 0) rotate(-12deg) scale(1.02); }
}
.m-peach   { --m-base: #3a2218; --m1: #f4a77f; --m2: #c4573a; --m3: #ffd9b8; }
.m-cobalt  { --m-base: #050b2e; --m1: #2a4dff; --m2: #00b3ff; --m3: #9a7bff; }
.m-magenta { --m-base: #2a0520; --m1: #ff3ea5; --m2: #ff8a3d; --m3: #7a2cff; }
.m-emerald { --m-base: #021a12; --m1: #19c48a; --m2: #d4ff5a; --m3: #0a6b5a; }
.m-ember   { --m-base: #1c0602; --m1: #ff4d1a; --m2: #ffb020; --m3: #9c1a0a; }
.m-violet  { --m-base: #12052b; --m1: #8f5bff; --m2: #ff6ad5; --m3: #3d1aff; }
.m-sand    { --m-base: #2b2216; --m1: #e8cfa6; --m2: #b98a5a; --m3: #fff1d6; }
.m-teal    { --m-base: #031b20; --m1: #2fd4d4; --m2: #2a7fff; --m3: #c8fff4; }
.m-mono    { --m-base: #101010; --m1: #e9e9e6; --m2: #6d6d6a; --m3: #2b2b29; }
@media (prefers-reduced-motion: reduce) { .m::before { animation: none; } }

/* ---------- The edit: phone + timeline ---------- */

.cw-edit {
  --tl-bg: #141414; --tl-bar: #1b1b1b; --tl-line: rgba(255, 255, 255, .09);
  --tl-text: #ecebe6; --tl-muted: #9a978e; --tl-accent: #ff5a2e; --tl-accent-text: #ff8a6a;
  --tl-mono: ui-monospace, "SFMono-Regular", Consolas, monospace; --tl-radius: 16px;
  --clip-a: #3d5d8c; --clip-b: #575d91; --clip-cap: #8a6f2e; --clip-ins: #6d4f86; --clip-aud: #1d382e; --wave: #5aa585;
  display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 40px; align-items: center;
  user-select: none;
}
.cw-edit--stack { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.cw-edit--stack .cw-tl { width: 100%; }

.cw-phone { margin: 0; width: min(300px, 74vw); justify-self: center; }
.cw-phone-body {
  padding: 9px; border-radius: 40px;
  background: linear-gradient(145deg, #2c2c2a, #0f0f0e);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .75), inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.cw-screen { position: relative; aspect-ratio: 9 / 16; border-radius: 31px; overflow: hidden; background: #000; container-type: inline-size; }
.cw-screen::before {
  content: ""; position: absolute; top: 9px; left: 50%; width: 30%; height: 19px; transform: translateX(-50%);
  border-radius: 999px; background: #000; z-index: 8;
}
.cw-scene { position: absolute; inset: 0; opacity: 0; }
.cw-scene.is-on { opacity: 1; }
.cw-scene.is-punch::before { inset: -45%; }
.cw-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.cw-slot-note {
  position: absolute; left: 0; right: 0; top: 47%; z-index: 2; text-align: center;
  font: 500 9px/1.4 var(--tl-mono); letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .7);
}

.cw-sz { position: absolute; inset: 0; z-index: 3; pointer-events: none; transition: opacity .2s ease; }
.cw-sz.is-off { opacity: 0; }
.cw-sz i { position: absolute; background: color-mix(in srgb, var(--tl-accent) 18%, transparent); }
.cw-sz .t { top: 0; left: 0; right: 0; height: 11%; border-bottom: 1px dashed color-mix(in srgb, var(--tl-accent) 85%, white); }
.cw-sz .b { bottom: 0; left: 0; right: 0; height: 21%; border-top: 1px dashed color-mix(in srgb, var(--tl-accent) 85%, white); }
.cw-sz .r { top: 11%; bottom: 21%; right: 0; width: 15%; border-left: 1px dashed color-mix(in srgb, var(--tl-accent) 85%, white); }
.cw-sz b {
  position: absolute; top: 12.5%; left: 6%; font: 500 8px/1 var(--tl-mono); letter-spacing: .14em; text-transform: uppercase;
  color: #fff; background: var(--tl-accent); padding: 3px 5px; border-radius: 3px;
}

.cw-ov { position: absolute; z-index: 4; opacity: 0; visibility: hidden; }
.cw-ov.is-on { opacity: 1; visibility: visible; }
.cw-reply {
  top: 17%; left: 6%; max-width: 70%; background: #fff; color: #161614; border-radius: 12px; padding: 8px 10px 9px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .25); font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.cw-reply small { display: flex; align-items: center; gap: 6px; font-size: 9.5px; color: #77736b; margin-bottom: 4px; }
.cw-reply small::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, #e7b49a, #a86d55); }
.cw-reply span { display: block; font-weight: 600; font-size: 12.5px; line-height: 1.25; }
.cw-list { top: 27%; left: 6%; display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: ing; }
.cw-list li {
  counter-increment: ing; display: flex; align-items: center; gap: 8px; background: #fff; color: #161614;
  border-radius: 999px; padding: 6px 12px 6px 6px; font: 700 12.5px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .2);
}
.cw-list li::before {
  content: counter(ing); display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--tl-accent); color: #fff; font-size: 10px;
}
.cw-cta {
  bottom: 23%; left: 43%; transform: translateX(-50%); background: var(--tl-accent); color: #fff; border-radius: 999px;
  padding: 7px 14px; font: 700 12.5px/1 system-ui, -apple-system, "Segoe UI", sans-serif; white-space: nowrap;
}
.cw-cap {
  position: absolute; z-index: 5; left: 7%; right: 18%; bottom: 31%; margin: 0; text-align: center; color: #fff;
  font: 700 clamp(15px, 7.4cqw, 21px)/1.18 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: -0.01em;
  -webkit-text-stroke: 5px #000; paint-order: stroke fill;
}
.cw-cap .w { opacity: 0; }
.cw-cap .w.is-said { opacity: 1; }
.cw-tag {
  position: absolute; z-index: 6; bottom: 3.5%; left: 5%; font: 500 8.5px/1 var(--tl-mono); letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255, 255, 255, .88); background: rgba(0, 0, 0, .45); padding: 4px 6px; border-radius: 4px;
}

.cw-tl { background: var(--tl-bg); border: 1px solid var(--tl-line); border-radius: var(--tl-radius); overflow: hidden; color: var(--tl-text); }
.cw-tl-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding: 10px 14px; border-bottom: 1px solid var(--tl-line); background: var(--tl-bar);
}
.cw-tl-bar > div { display: flex; align-items: center; gap: 10px; }
.cw-play {
  width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
  background: var(--tl-accent); color: #fff; display: grid; place-items: center;
}
.cw-play svg { width: 13px; height: 13px; fill: currentColor; }
.cw-play .i-play { display: none; }
.cw-play[aria-pressed="false"] .i-play { display: block; }
.cw-play[aria-pressed="false"] .i-pause { display: none; }
.cw-name { font: 500 12px/1 var(--tl-mono); color: var(--tl-muted); letter-spacing: .04em; }
.cw-hooks-label { font: 500 11px/1 var(--tl-mono); color: var(--tl-muted); text-transform: uppercase; letter-spacing: .1em; margin-right: 4px; }
.cw-btn {
  font: 500 12px/1 var(--tl-mono); color: var(--tl-text); cursor: pointer; background: transparent;
  border: 1px solid var(--tl-line); border-radius: 7px; padding: 7px 10px;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.cw-btn:hover { border-color: color-mix(in srgb, var(--tl-text) 35%, transparent); }
.cw-hook.is-on { background: var(--tl-text); color: var(--tl-bg); border-color: var(--tl-text); }
.cw-szbtn.is-on { border-color: color-mix(in srgb, var(--tl-accent) 70%, transparent); color: var(--tl-accent-text); }
.cw-tc {
  font: 500 13px/1 var(--tl-mono); color: var(--tl-accent-text); background: #000; padding: 7px 9px; border-radius: 6px;
  letter-spacing: .04em; font-variant-numeric: tabular-nums;
}
.cw-tl-body { display: grid; grid-template-columns: 96px minmax(0, 1fr); }
.cw-labels { display: flex; flex-direction: column; border-right: 1px solid var(--tl-line); }
.cw-labels span {
  height: 32px; display: flex; align-items: center; gap: 6px; padding: 0 12px; border-top: 1px solid var(--tl-line);
  font: 500 11px/1 var(--tl-mono); color: var(--tl-text);
}
.cw-labels span:first-child { height: 24px; border-top: 0; }
.cw-labels span:last-child { height: 44px; }
.cw-labels em { font-style: normal; color: var(--tl-muted); font-size: 10px; }
.cw-tracks { position: relative; margin-right: 14px; cursor: ew-resize; touch-action: pan-y; outline-offset: -2px; }
.cw-ruler { position: relative; height: 24px; }
.cw-tick { position: absolute; bottom: 0; width: 1px; height: 6px; background: color-mix(in srgb, var(--tl-text) 20%, transparent); }
.cw-tick.is-major { height: 10px; background: color-mix(in srgb, var(--tl-text) 38%, transparent); }
.cw-tick-label { position: absolute; top: 4px; transform: translateX(-50%); font: 500 9.5px/1 var(--tl-mono); color: var(--tl-muted); font-variant-numeric: tabular-nums; }
.cw-tick-label:first-of-type { transform: none; }
.cw-track { position: relative; height: 32px; border-top: 1px solid var(--tl-line); }
.cw-track.is-audio { height: 44px; }
.cw-clip {
  position: absolute; top: 4px; bottom: 4px; border-radius: 5px; padding: 0 7px; display: flex; align-items: center;
  overflow: hidden; white-space: nowrap; font: 500 10px/1 var(--tl-mono); color: rgba(255, 255, 255, .92); letter-spacing: .02em;
  border: 1px solid rgba(255, 255, 255, .14); transition: filter .12s ease, border-color .12s ease;
}
.cw-clip span { overflow: hidden; text-overflow: ellipsis; }
.cw-clip.is-live { border-color: rgba(255, 255, 255, .85); filter: brightness(1.22); }
.cw-clip.k-a { background: var(--clip-a); }
.cw-clip.k-b { background: var(--clip-b); }
.cw-clip.k-cap { background: var(--clip-cap); }
.cw-clip.k-ins { background: var(--clip-ins); }
.cw-clip.k-hook { box-shadow: inset 3px 0 0 var(--tl-accent); }
.cw-clip.k-aud { background: var(--clip-aud); padding: 0 2px; }
.cw-clip.k-aud svg { width: 100%; height: 100%; }
.cw-clip.k-aud rect { fill: var(--wave); }
.cw-head { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; margin-left: -1px; background: var(--tl-accent); pointer-events: none; z-index: 2; }
.cw-head span { position: absolute; top: 0; left: 50%; width: 12px; height: 12px; transform: translateX(-50%); background: var(--tl-accent); clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%); }

@media (max-width: 860px) {
  .cw-edit { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 720px) {
  .cw-tl-body { grid-template-columns: 40px minmax(0, 1fr); }
  .cw-labels span { padding: 0 8px; font-size: 10px; }
  .cw-labels em, .cw-hooks-label { display: none; }
  .cw-hooks { order: 3; width: 100%; }
  .cw-hooks .cw-hook { flex: 1; }
  .cw-tracks { margin-right: 8px; }
  .cw-clip { font-size: 9px; padding: 0 4px; }
}
@media (max-width: 480px) { .cw-name { display: none; } }

/* ---------- Charts ---------- */

.viz {
  --viz-ours: #ff5a2e; --viz-base: #77756f; --viz-grid: rgba(255, 255, 255, .08);
  --viz-text: #ecebe6; --viz-muted: #9a978e; --viz-surface: #111;
  position: relative; color: var(--viz-text);
}
.viz svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; padding: 0; list-style: none; font-size: 12.5px; color: var(--viz-muted); }
.viz-legend li { display: inline-flex; align-items: center; gap: 8px; }
.viz-legend i { width: 16px; height: 2px; border-radius: 2px; }
.viz-legend i.is-bar { width: 10px; height: 10px; border-radius: 2px; }
.viz .grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz .tick { fill: var(--viz-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz .lbl { fill: var(--viz-text); font-size: 12px; font-weight: 600; }
.viz .lbl-muted { fill: var(--viz-muted); font-size: 11.5px; }
.viz .bar { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); transition: transform .9s cubic-bezier(.2, .8, .2, 1), opacity .15s ease; }
.viz.is-in .bar { transform: scaleY(1); }
.viz .bar-hit { fill: transparent; cursor: pointer; }
.viz .bar-hit:hover + .bar, .viz .bar-hit:focus + .bar { opacity: .82; }
.viz .line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: stroke-dashoffset 1.4s cubic-bezier(.3, .7, .2, 1); }
.viz .area { opacity: 0; transition: opacity .9s ease .5s; }
.viz.is-in .area { opacity: .12; }
.viz .dot { stroke: var(--viz-surface); stroke-width: 2; }
.viz .cross { stroke: color-mix(in srgb, var(--viz-text) 35%, transparent); stroke-width: 1; opacity: 0; }
.viz .cross.is-on { opacity: 1; }
.viz-tip {
  position: absolute; z-index: 5; pointer-events: none; opacity: 0; transform: translate(-50%, calc(-100% - 12px));
  background: color-mix(in srgb, var(--viz-surface) 92%, white); border: 1px solid var(--viz-grid); border-radius: 10px;
  padding: 8px 10px; font-size: 12px; line-height: 1.35; white-space: nowrap; box-shadow: 0 10px 24px rgba(0, 0, 0, .3);
  transition: opacity .12s ease;
}
.viz-tip.is-on { opacity: 1; }
.viz-tip b { display: block; font-size: 11px; font-weight: 500; color: var(--viz-muted); margin-bottom: 4px; }
.viz-tip div { display: flex; align-items: center; gap: 8px; }
.viz-tip div i { width: 12px; height: 2px; border-radius: 2px; }
.viz-tip div strong { font-weight: 600; color: var(--viz-text); }
.viz-tip div span { color: var(--viz-muted); }
.viz-note { margin-top: 10px; font-size: 11.5px; color: var(--viz-muted); }
.viz.viz-instant .bar, .viz.viz-instant .line, .viz.viz-instant .area { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .viz .bar, .viz .line, .viz .area { transition: none; }
}
