/* Text → Timeline section (from lab/fx/text-to-timeline). Colours come from site tokens. */
.t2t { position: relative; height: 560vh; }
.t2t-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  background: var(--bg);
}
.t2t canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.t2t-base { z-index: 1; touch-action: pan-y; }
.t2t-gl { z-index: 4; pointer-events: none; }

.t2t-kicker {
  position: absolute; z-index: 2; left: 0; top: 0; display: flex; gap: 12px; align-items: center;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  will-change: opacity, transform; pointer-events: none;
}
.t2t-kicker i { width: 8px; height: 8px; border-radius: 2px; background: var(--rec); display: block; }
.t2t-hint {
  position: absolute; z-index: 2; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  display: flex; gap: 10px; align-items: center; pointer-events: none; will-change: opacity; white-space: nowrap;
}
.t2t-hint b { display: block; width: 1px; height: 22px; background: linear-gradient(var(--muted), transparent); animation: t2t-drop 1.6s ease-in-out infinite; transform-origin: top; }
@keyframes t2t-drop { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

.t2t-monitor {
  position: absolute; z-index: 3; left: 0; top: 0; opacity: 0;
  display: grid; grid-template-rows: 28px 1fr 28px; background: #000;
  border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden;
  will-change: opacity, transform; transform-origin: 50% 100%;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9);
}
.t2t-mon-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px;
  background: #121214; font-family: var(--f-mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden;
}
.t2t-mon-bar b { color: var(--text); font-weight: 500; }
.t2t-mon-bar .tc { color: var(--text); font-size: 12px; letter-spacing: .02em; }
.t2t-mon-bar .tr { display: flex; gap: 12px; opacity: .7; }
.t2t-mon-bar .src { overflow: hidden; text-overflow: ellipsis; max-width: 45%; text-align: right; }
.t2t-frame { position: relative; overflow: hidden; background: #000; }
.t2t-layer { position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease; }
.t2t-layer.on { opacity: 1; }
.t2t-layer img, .t2t-layer video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.t2t-layer video { opacity: 0; transition: opacity .3s; }
.t2t-layer video.ready { opacity: 1; }
.t2t-stage {
  position: absolute; left: 14px; bottom: 12px; z-index: 2; font-family: var(--f-display); font-weight: 600;
  font-size: clamp(14px, 2vw, 22px); letter-spacing: -.01em; text-shadow: 0 2px 14px rgba(0,0,0,.7);
  display: flex; gap: 10px; align-items: baseline; pointer-events: none;
}
.t2t-stage span { font-family: var(--f-mono); font-weight: 500; font-size: .6em; color: rgba(255,255,255,.7); }
.t2t-title {
  position: absolute; left: 6%; bottom: 22%; z-index: 2; padding: 8px 14px 9px; border-left: 3px solid #e0a03c;
  background: rgba(0,0,0,.72);
  font-family: var(--f-ui); font-size: clamp(11px, 1.3vw, 15px); line-height: 1.25; opacity: 0; transform: translateX(-10px);
  transition: opacity .3s, transform .3s; pointer-events: none;
}
.t2t-title.on { opacity: 1; transform: none; }
.t2t-title b { display: block; font-family: var(--f-display); font-weight: 600; font-size: 1.25em; }
.t2t-safe { position: absolute; inset: 6%; border: 1px dashed rgba(255,255,255,.12); pointer-events: none; z-index: 1; }

.t2t-fps {
  position: fixed; left: 50%; top: 10px; transform: translateX(-50%); z-index: 99; white-space: nowrap; font-family: var(--f-mono); font-size: 11px;
  background: rgba(0,0,0,.7); border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 8px; color: var(--ok);
  pointer-events: none;
}

.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; }

@media (max-width: 767px) {
  .t2t { height: 520vh; }
  .t2t-monitor { grid-template-rows: 24px 1fr 24px; border-radius: 8px; }
  .t2t-mon-bar { font-size: 10px; padding: 0 8px; }
  .t2t-mon-bar .tr { display: none; }
  .t2t-stage { left: 10px; bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .t2t { height: 360vh; }
  .t2t-hint b { animation: none; }
}
