/* canvas-act.css — "The Canvas Builds Itself" principal act (homepage only).
 * Pinned scroll cinema: photographic backdrop, JS-first (hidden until live),
 * transform/opacity animation only. All classes namespaced .act-*. */
#canvas-act { position: relative; background: #0c0e12; color: #fff; overflow: clip; }
.act-bg { position: absolute; inset: 0; z-index: 0; }
.act-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.act-bg-scrim { position: absolute; inset: 0; background: rgba(8, 10, 14, 0.72); }
.act-pin { position: relative; z-index: 1; height: 100vh; height: 100svh; overflow: hidden; }
.act-inner { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 76px clamp(16px, 4vw, 64px) clamp(12px, 3vh, 36px); visibility: hidden; }
#canvas-act.act-live .act-inner { visibility: visible; }
#canvas-act.act-dead { display: none; }

/* Exempt the principal act from the site-wide CSS entrance system
   (main h2/h3/p opacity-0 + .in keyframe entrances): every entrance here
   is authored by the scrubbed GSAP timeline. The IO still tags .in/.done —
   neutralized below so it can never fight the timeline. */
#canvas-act h2, #canvas-act h3, #canvas-act p { opacity: 1; }
#canvas-act h2.in, #canvas-act h3.in, #canvas-act p.in,
#canvas-act h2.done, #canvas-act h3.done, #canvas-act p.done { animation: none; opacity: 1; }

/* ---- chapter head ---- */
.act-head { position: relative; z-index: 5; max-width: 1200px; margin: 0 auto 1.2vh; width: 100%; }
.act-chapters { position: relative; min-height: clamp(170px, 28vh, 240px); }
/* chapters are absolute inside a fixed-height box: the tallest beat
   (2-line title + kicker + 2-line desc + 16px entrance dip) is ~217px.
   Anything shorter lets the desc drift onto the progress bar mid-entrance
   and park there at a fixed scroll offset. */
.act-ch { position: absolute; inset: 0; opacity: 0; visibility: hidden; max-width: 640px; }
.act-ch.is-on { opacity: 1; visibility: visible; }
.act-kicker { font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; color: #ffffff; margin: 0 0 10px; font-weight: 700; }
.act-ctitle { font-size: clamp(30px, 4.6vw, 58px); line-height: 1.04; margin: 0 0 12px; font-weight: 800; letter-spacing: -0.01em; color: #fff; }
.act-ctitle .act-cc { display: inline-block; will-change: transform, opacity; }
.act-cdesc { font-size: clamp(14px, 1.5vw, 18px); line-height: 1.55; color: rgba(255, 255, 255, 0.82); margin: 0; max-width: 46ch; }
.act-progress { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.act-pbar { position: relative; width: min(320px, 40vw); height: 3px; background: rgba(255, 255, 255, 0.18); border-radius: 3px; overflow: hidden; }
.act-pbar i { position: absolute; inset: 0; width: 100%; background: #ffffff; border-radius: 3px; transform: scaleX(0); transform-origin: 0 50%; }
.act-dots { display: flex; gap: 7px; }
.act-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); }
.act-dots i.is-on { background: #ffffff; }

/* ---- stage ---- */
.act-stage { position: relative; z-index: 4; display: flex; align-items: center; justify-content: center; gap: clamp(14px, 3vw, 48px); width: 100%; max-width: 1240px; margin: 0 auto; flex: 1; min-height: 0; }
.act-rail { display: flex; flex-direction: column; gap: 12px; align-items: stretch; flex: 0 0 auto; }
.act-tcard, .act-pthumb, .act-aitool, .act-bswatches, .act-extool { position: relative; width: 92px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); backdrop-filter: blur(6px); padding: 8px; text-align: center; }
.act-tcard img, .act-pthumb img { width: 100%; height: 56px; object-fit: cover; border-radius: 7px; display: block; }
.act-tcard-lines { display: flex; flex-direction: column; gap: 4px; margin: 7px 4px 2px; }
.act-tcard-lines i { display: block; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.35); }
.act-tcard-lines i:nth-child(2) { width: 72%; } .act-tcard-lines i:nth-child(3) { width: 55%; }
.act-rail span { display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.66); margin-top: 6px; font-weight: 700; }
.act-aitool b, .act-extool b { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: #ffffff; color: #ffffff; font-size: 15px; font-weight: 800; }
.act-extool b { background: rgba(255, 255, 255, 0.14); color: #fff; border: 1px solid rgba(255, 255, 255, 0.3); }
.act-bswatches { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.act-bswatches i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.5); }
.act-bswatches i:nth-child(1) { background: #7d2ae8; } .act-bswatches i:nth-child(2) { background: #ec4899; }
.act-bswatches i:nth-child(3) { background: #0ea5a4; } .act-bswatches i:nth-child(4) { background: #f5b942; }
.act-bswatches i:nth-child(5) { background: #14161a; }
.act-bswatches span { flex-basis: 100%; }
/* Rail placeholder: holds the template card's slot while it lives on the canvas. */
.act-tcard-ph { width: 92px; min-height: 126px; border-radius: 12px; border: 1px dashed rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.04); display: flex; align-items: flex-end; justify-content: center; padding: 8px; }
.act-tcard-ph span { display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.45); font-weight: 700; }
.act-ctitle .act-cw { display: inline-block; }

/* ---- canvas ---- */
.act-canvaswrap { position: relative; flex: 0 1 auto; display: flex; flex-direction: column; align-items: center; }
.act-canvas { position: relative; width: min(56vh, 78vw, 470px); aspect-ratio: 1 / 1; background: #0d0d0d; border-radius: 18px; box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.14); }
/* NOTE: no overflow:hidden here — the template card Flip-morphs from the rail
   while parented inside the canvas; clipping would swallow its from-state.
   Children carry their own corner rounding instead. */
.act-grid { position: absolute; inset: 0; border-radius: 18px; background-image: linear-gradient(rgba(20, 22, 26, 0.055) 1px, transparent 1px), linear-gradient(90deg, rgba(20, 22, 26, 0.055) 1px, transparent 1px); background-size: 8.333% 8.333%; opacity: 0.9; }
.act-design { position: absolute; inset: 0; }
.act-tslot { position: absolute; inset: 0; }
.act-tslot .act-tcard { position: absolute; inset: 0; width: 100%; border: 0; border-radius: 18px; overflow: hidden; background: #111111; padding: 0; backdrop-filter: none; }
.act-tslot .act-tcard img { height: 46%; border-radius: 0; }
.act-tslot .act-tcard .act-tcard-lines { margin: 6% 8% 0; gap: 8px; }
.act-tslot .act-tcard .act-tcard-lines i { height: 10px; background: rgba(20, 22, 26, 0.14); }
.act-tslot .act-tcard span { display: none; }
.act-photoframe { position: absolute; left: 8%; right: 8%; top: 9%; height: 44%; border-radius: 12px; overflow: hidden; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22); opacity: 0; }
.act-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.act-cutout { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.act-badge { position: absolute; left: 10px; top: 10px; z-index: 3; font-size: 10px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: #fff; background: #0ea5a4; padding: 7px 11px; border-radius: 999px; transform: scale(0); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); }
.act-headline { position: absolute; left: 8%; right: 8%; top: 58%; margin: 0; font-size: clamp(26px, 4.6vh, 44px); font-weight: 800; letter-spacing: -0.01em; color: #ffffff; opacity: 0; }
.act-headline .act-w { display: inline-block; will-change: transform, opacity; }
.act-subline { position: absolute; left: 8%; right: 8%; top: 70%; margin: 0; font-size: clamp(13px, 2.2vh, 18px); color: rgba(20, 22, 26, 0.72); font-weight: 600; opacity: 0; min-height: 1.4em; }
.act-accents { position: absolute; left: 8%; right: 8%; top: 80%; height: 9%; }
.act-accents .acc-a, .act-accents .acc-b { position: absolute; inset: 0; border-radius: 8px; }
.act-accents .acc-a { background: repeating-linear-gradient(90deg, #c9cfd8 0 18%, #e6e9ee 18% 36%, #c9cfd8 36% 54%, #e6e9ee 54% 72%, #c9cfd8 72% 90%, #e6e9ee 90% 100%); }
.act-accents .acc-b { background: repeating-linear-gradient(90deg, #ffffff 0 18%, #bdbdbd 18% 36%, #7a7a7a 36% 54%, #3d3d3d 54% 72%, #14161a 72% 90%, #ffffff 90% 100%); opacity: 0; }
.act-attr { margin: 12px 0 0; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); font-weight: 600; opacity: 0; }

/* ---- AI pill ---- */
.act-aipill { position: absolute; left: 50%; top: -8px; z-index: 6; display: flex; align-items: center; gap: 10px; background: rgba(16, 18, 24, 0.92); border: 1px solid rgba(255, 217, 138, 0.5); color: #fff; border-radius: 999px; padding: 10px 18px; font-size: 13px; white-space: nowrap; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); opacity: 0; }
.act-aipill .ai-dot { width: 10px; height: 10px; border-radius: 50%; background: #ffffff; box-shadow: 0 0 12px #ffd98a; flex: 0 0 auto; }
.act-aipill b { color: #ffffff; font-weight: 700; }
.act-aipill em { font-style: normal; color: rgba(255, 255, 255, 0.6); font-size: 11px; }

/* ---- export tray ---- */
.act-tray { flex: 0 0 auto; width: min(300px, 80vw); opacity: 0; }
.act-exportcard { background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 16px; padding: 14px; backdrop-filter: blur(8px); text-align: center; }
.act-exportslot { min-height: 120px; border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, 0.05); border: 1px dashed rgba(255, 255, 255, 0.25); margin-bottom: 12px; }
.act-exportslot .act-design { position: relative; inset: auto; width: 100%; aspect-ratio: 1 / 1; }
.act-exportslot .act-headline { font-size: 22px; }
.act-exportslot .act-subline { font-size: 11px; }
.act-exportmeta { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); margin: 0 0 12px; font-weight: 600; }
.act-exportmeta b { color: #ffffff; }
.act-cta { display: inline-block; }

/* ---- flyer ---- */
.act-flyer { position: absolute; z-index: 7; width: 96px; height: 96px; object-fit: cover; border-radius: 12px; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5); opacity: 0; pointer-events: none; left: 0; top: 0; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .act-stage { flex-direction: column; gap: 10px; justify-content: flex-start; }
  .act-rail { flex-direction: row; order: 2; gap: 8px; margin-bottom: 96px; align-items: flex-start; }
  .act-tcard, .act-pthumb, .act-aitool, .act-bswatches, .act-extool { width: 64px; padding: 6px; }
  .act-tcard-ph { width: 64px; min-height: 84px; padding: 6px; }
  .act-tcard-ph span { font-size: 8px; }
  .act-tcard img, .act-pthumb img { height: 38px; }
  .act-rail span { font-size: 8px; }
  .act-aitool b, .act-extool b { width: 30px; height: 30px; font-size: 12px; }
  .act-canvaswrap { order: 1; }
  .act-canvas { width: min(40vh, 86vw); }
  /* Finale tableau: the export tray overlays the canvas center (in-flow it
     would be pushed off-viewport). CSS `translate` composes with GSAP's
     transform, so the scrubbed y/autoAlpha tween is unaffected. */
  .act-tray { order: 3; position: absolute; z-index: 8; left: 50%; top: 50%; translate: -50% -50%; width: min(280px, 86vw); }
  .act-exportslot { min-height: 84px; }
  .act-chapters { min-height: clamp(150px, 24vh, 220px); }
  .act-aipill { font-size: 11px; padding: 8px 14px; max-width: 92vw; white-space: normal; text-align: center; }
  .act-aipill em { display: none; }
}
@media (max-height: 620px) {
  .act-canvas { width: min(44vh, 80vw); }
  .act-chapters { min-height: 150px; }
}

/* prefers-reduced-motion: static readable layout - no pin, no scrub,
   every chapter visible in normal flow, no hidden intermediate steps. */
@media (prefers-reduced-motion: reduce) {
  #canvas-act .act-pin { height: auto; overflow: visible; }
  #canvas-act .act-inner { position: static; visibility: visible; }
  #canvas-act .act-chapters { min-height: 0; }
  #canvas-act .act-ch { position: static; opacity: 1; visibility: visible; max-width: none; margin-bottom: 2rem; }
  #canvas-act .act-pbar, #canvas-act .act-dots { display: none; }
  #canvas-act .act-flyer { display: none; }
}
