/* ==========================================================================
   AUTO-LEDGER SHOWCASE · photoreal plate engine
   Cinematic black & gold · portable · no libraries · NO external fonts
   Layered reveal + gold energy sweep + Auto-Ledger phone checklist + timed copy
   Builder: Super Claude (Opus 5.5) · render-farm · 2026-10-25  (revision 2)
   ========================================================================== */
:root{
  --gold-1:#c9a96e; --gold-2:#f1d9a6; --gold-3:#8a6d3b; --gold-hi:#fff3d6;
  --ink:#070608; --paper:#f2ece0; --ok:#ffd477;
  --ease:cubic-bezier(.22,.61,.36,1);
  --serif:Georgia,'Iowan Old Style','Times New Roman',serif;
  --sans:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  --mono:ui-monospace,'SF Mono','SFMono-Regular',Menlo,Consolas,monospace;
}
*{margin:0;padding:0;box-sizing:border-box}
html,body{height:100%}
body{background:var(--ink);color:var(--paper);font-family:var(--sans);-webkit-font-smoothing:antialiased;overflow:hidden}

/* ---------- the portable 16:9 frame ---------- */
.stage{position:relative;width:100%;aspect-ratio:16/9;max-height:100vh;margin:0 auto;overflow:hidden;
  background:var(--ink);isolation:isolate;container-type:inline-size;user-select:none}

/* photoreal plate — layered reveal (settle in from dim/soft/scaled) */
.plate{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:1;
  transform:scale(1.08);filter:brightness(.5) saturate(.55) blur(3px);opacity:0}
.stage.play .plate{animation:plateIn 1.9s var(--ease) both}
@keyframes plateIn{
  0%{opacity:0;transform:scale(1.08);filter:brightness(.5) saturate(.55) blur(3px)}
  30%{opacity:1}
  100%{opacity:1;transform:scale(1);filter:brightness(1) saturate(1) blur(0)}}

/* gold energy sweep — one diagonal pass that lights the existing burst */
.sweep{position:absolute;inset:-20% -40%;z-index:2;pointer-events:none;mix-blend-mode:screen;
  background:linear-gradient(105deg,transparent 40%,rgba(255,224,150,.0) 45%,
    rgba(255,230,165,.55) 50%,rgba(255,243,214,.85) 52%,rgba(255,230,165,.55) 54%,transparent 60%);
  transform:translateX(-120%);opacity:0}
.stage.play .sweep{animation:sweep 1.5s var(--ease) .55s both}
@keyframes sweep{0%{transform:translateX(-120%);opacity:0}15%{opacity:1}85%{opacity:1}100%{transform:translateX(120%);opacity:0}}

/* legibility scrim — darkens lower-left for copy; keeps the hero (right) clear */
.stage::before{content:"";position:absolute;inset:0;z-index:18;pointer-events:none;
  background:
    linear-gradient(to top,rgba(4,3,5,.8) 0%,rgba(4,3,5,.3) 24%,transparent 48%),
    linear-gradient(105deg,rgba(4,3,5,.62) 0%,rgba(4,3,5,.14) 30%,transparent 48%)}

/* cinematic vignette + fine grain */
.stage::after{content:"";position:absolute;inset:0;z-index:20;pointer-events:none;
  background:radial-gradient(120% 95% at 50% 46%,transparent 54%,rgba(0,0,0,.66) 100%);mix-blend-mode:multiply}
.grain{position:absolute;inset:0;z-index:21;pointer-events:none;opacity:.045;mix-blend-mode:overlay;
  background-image:repeating-linear-gradient(0deg,#fff,#fff 1px,transparent 1px,transparent 2px)}

/* ---------- timed service copy (lower-left) ---------- */
.copy{position:absolute;left:4.5%;bottom:7%;z-index:25;max-width:52%}
.copy .kick{font-family:var(--mono);font-size:1.25cqw;letter-spacing:.42em;text-transform:uppercase;
  color:var(--gold-1);opacity:0}
.stage.play .copy .kick{animation:rise .8s var(--ease) 1.2s both}
.copy .title{font-family:var(--serif);font-weight:700;font-size:5.4cqw;line-height:.98;margin:.14em 0 .2em;
  letter-spacing:.005em;opacity:0;
  background:linear-gradient(100deg,var(--gold-3) 0%,var(--gold-1) 28%,var(--gold-hi) 50%,var(--gold-1) 72%,var(--gold-3) 100%);
  background-size:220% auto;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent;
  filter:drop-shadow(0 2px 14px rgba(0,0,0,.85))}
.stage.play .copy .title{animation:rise .9s var(--ease) 1.5s both,shim 7s linear 2.4s infinite}
.copy .sub{font-family:var(--serif);font-style:italic;font-size:2.4cqw;color:var(--paper);opacity:0;
  text-shadow:0 1px 14px rgba(0,0,0,.7)}
.stage.play .copy .sub{animation:rise .9s var(--ease) 2s both}
.copy .svc{margin-top:1.1cqw;display:flex;flex-direction:column;gap:.35cqw}
.copy .svc span{font-family:var(--mono);font-size:1.35cqw;letter-spacing:.14em;color:var(--gold-2);opacity:0;
  text-shadow:0 1px 10px rgba(0,0,0,.8);padding-left:1.4cqw;position:relative}
.copy .svc span::before{content:"";position:absolute;left:0;top:.55em;width:.7cqw;height:.7cqw;
  background:var(--gold-1);transform:rotate(45deg);box-shadow:0 0 8px var(--gold-1)}
.stage.play .copy .svc span{animation:rise .7s var(--ease) both}
.stage.play .copy .svc span:nth-child(1){animation-delay:2.7s}
.stage.play .copy .svc span:nth-child(2){animation-delay:3.0s}
.stage.play .copy .svc span:nth-child(3){animation-delay:3.3s}

/* ---------- Auto-Ledger phone checklist (lower-right) ---------- */
.phone{position:absolute;right:2.6%;bottom:5.5%;z-index:26;width:17cqw;
  background:linear-gradient(170deg,rgba(18,15,10,.92),rgba(8,7,6,.94));
  border:.12cqw solid rgba(201,169,110,.45);border-radius:2.2cqw;
  box-shadow:0 1.2cqw 3cqw rgba(0,0,0,.55),0 0 2.4cqw rgba(201,169,110,.25);
  padding:1.5cqw 1.5cqw 1.7cqw;opacity:0;backdrop-filter:blur(3px)}
.stage.play .phone{animation:phoneIn 1s var(--ease) 2.2s both}
@keyframes phoneIn{from{opacity:0;transform:translateY(3cqw) scale(.96)}to{opacity:1;transform:none}}
.phone .hdr{display:flex;align-items:center;gap:.7cqw;border-bottom:.08cqw solid rgba(201,169,110,.25);
  padding-bottom:.9cqw;margin-bottom:.9cqw}
.phone .dot{width:1.5cqw;height:1.5cqw;border-radius:50%;flex:0 0 auto;
  background:radial-gradient(circle at 35% 30%,var(--gold-hi),var(--gold-1) 55%,var(--gold-3));
  box-shadow:0 0 1cqw rgba(241,217,166,.7)}
.phone .ttl{font-family:var(--mono);font-size:1.2cqw;letter-spacing:.14em;color:var(--gold-2);text-transform:uppercase}
.phone .ttl small{display:block;font-size:.85cqw;letter-spacing:.24em;color:var(--gold-3)}
.phone ul{list-style:none}
.phone li{display:flex;align-items:center;gap:.9cqw;padding:.52cqw 0;font-family:var(--sans);
  font-size:1.35cqw;color:#8d8678;opacity:.5}
.phone .box{width:1.7cqw;height:1.7cqw;flex:0 0 auto;border-radius:.45cqw;border:.12cqw solid rgba(201,169,110,.5);
  position:relative;background:rgba(201,169,110,.06)}
.phone .box::after{content:"";position:absolute;left:.52cqw;top:.2cqw;width:.5cqw;height:.95cqw;
  border:solid var(--ink);border-width:0 .28cqw .28cqw 0;transform:rotate(45deg) scale(0);transform-origin:center;opacity:0}
.stage.play .phone li{animation:tick .5s var(--ease) both}
.stage.play .phone li:nth-child(1){animation-delay:2.8s}
.stage.play .phone li:nth-child(2){animation-delay:3.3s}
.stage.play .phone li:nth-child(3){animation-delay:3.8s}
.stage.play .phone li:nth-child(4){animation-delay:4.3s}
@keyframes tick{to{opacity:1;color:var(--paper)}}
.stage.play .phone li .box{animation:boxOn .45s var(--ease) both}
.stage.play .phone li:nth-child(1) .box{animation-delay:2.95s}
.stage.play .phone li:nth-child(2) .box{animation-delay:3.45s}
.stage.play .phone li:nth-child(3) .box{animation-delay:3.95s}
.stage.play .phone li:nth-child(4) .box{animation-delay:4.45s}
@keyframes boxOn{to{background:linear-gradient(160deg,var(--gold-2),var(--gold-1));border-color:var(--gold-hi);
  box-shadow:0 0 1cqw rgba(241,217,166,.65)}}
.stage.play .phone li .box::after{animation:check .4s var(--ease) both}
.stage.play .phone li:nth-child(1) .box::after{animation-delay:3.1s}
.stage.play .phone li:nth-child(2) .box::after{animation-delay:3.6s}
.stage.play .phone li:nth-child(3) .box::after{animation-delay:4.1s}
.stage.play .phone li:nth-child(4) .box::after{animation-delay:4.6s}
@keyframes check{to{opacity:1;transform:rotate(45deg) scale(1)}}

/* ---------- factory glints (twinkle over taps/glasses), no phone ---------- */
.glint{position:absolute;z-index:3;width:1.2cqw;height:1.2cqw;pointer-events:none;opacity:0;
  background:radial-gradient(circle,var(--gold-hi) 0%,rgba(255,243,214,.6) 35%,transparent 70%)}
.stage.play .glint{animation:twinkle 3.4s var(--ease) infinite}

/* ---------- controls (replay / pause) ---------- */
.ctrls{position:absolute;right:2.4%;top:5%;z-index:30;display:flex;gap:.8cqw;opacity:0}
.stage.play .ctrls,.stage.poster .ctrls{opacity:1}
.ctrls button{font-family:var(--mono);font-size:1.5cqw;line-height:1;color:var(--gold-2);cursor:pointer;
  width:3.4cqw;height:3.4cqw;display:flex;align-items:center;justify-content:center;
  background:rgba(7,6,8,.55);border:.1cqw solid rgba(201,169,110,.4);border-radius:50%;
  backdrop-filter:blur(4px);transition:background .2s,color .2s,transform .2s}
.ctrls button:hover,.ctrls button:focus-visible{background:rgba(201,169,110,.2);color:var(--gold-hi);transform:scale(1.07);outline:none}
.badge{position:absolute;left:2.4%;top:5%;z-index:30;font-family:var(--mono);font-size:1cqw;letter-spacing:.22em;
  text-transform:uppercase;color:var(--gold-2);border:.1cqw solid rgba(201,169,110,.3);border-radius:999px;
  padding:.55cqw 1.1cqw;background:rgba(7,6,8,.5);backdrop-filter:blur(4px);display:flex;align-items:center;gap:.6cqw;opacity:0}
.stage.play .badge{animation:rise .8s var(--ease) 1s both}
.badge i{width:.7cqw;height:.7cqw;border-radius:50%;background:var(--ok);box-shadow:0 0 .8cqw var(--ok);animation:pulse 1.6s infinite}

/* ---------- shared keyframes ---------- */
@keyframes rise{from{opacity:0;transform:translateY(1.6cqw)}to{opacity:1;transform:none}}
@keyframes shim{to{background-position:220% center}}
@keyframes twinkle{0%,100%{opacity:0;transform:scale(.6)}50%{opacity:.9;transform:scale(1.15)}}
@keyframes pulse{50%{opacity:.4}}

/* ---------- pause ---------- */
.stage.paused,.stage.paused *,.stage.paused *::before,.stage.paused *::after{animation-play-state:paused!important}

/* ==========================================================================
   REDUCED MOTION / POSTER — freeze on the finished, fully-revealed frame
   ========================================================================== */
.frozen .plate{opacity:1!important;transform:none!important;filter:none!important;animation:none!important}
.frozen .sweep,.frozen .glint{opacity:0!important;animation:none!important}
.frozen .copy .kick,.frozen .copy .title,.frozen .copy .sub,.frozen .copy .svc span,
.frozen .phone,.frozen .badge{opacity:1!important;transform:none!important;animation:none!important}
.frozen .copy .title{animation:none!important;-webkit-text-fill-color:transparent}
.frozen .phone li{opacity:1!important;color:var(--paper)!important;animation:none!important}
.frozen .phone li .box{animation:none!important;background:linear-gradient(160deg,var(--gold-2),var(--gold-1))!important;
  border-color:var(--gold-hi)!important;box-shadow:0 0 1cqw rgba(241,217,166,.65)!important}
.frozen .phone li .box::after{opacity:1!important;transform:rotate(45deg) scale(1)!important;animation:none!important}
@media (prefers-reduced-motion:reduce){
  .stage.play .plate,.stage.play .sweep,.stage.play .copy *,.stage.play .phone,.stage.play .phone *,
  .stage.play .glint,.stage.play .badge{animation:none!important}
}

/* Atlas integration QA: usable touch controls and readable mobile composition. */
.ctrls button{min-width:44px;min-height:44px;font-size:20px}.ctrls button:focus-visible{outline:2px solid #f1d9a6;outline-offset:4px}.stage.offscreen,.stage.offscreen *,.stage.offscreen *::before,.stage.offscreen *::after,.stage.page-hidden,.stage.page-hidden *,.stage.page-hidden *::before,.stage.page-hidden *::after{animation-play-state:paused!important}
@media(max-width:700px){.stage{aspect-ratio:auto;height:560px;max-height:none}.plate{top:50px;height:300px;object-fit:contain;object-position:center}.stage:before{background:linear-gradient(0deg,#070608 0%,#070608f5 26%,transparent 65%)}.badge{font-size:9px;letter-spacing:.08em;left:15px;top:18px;padding:8px}.ctrls{right:12px;top:8px;gap:8px}.copy,.scene-factory .copy{left:22px;bottom:26px;max-width:86%;width:86%}.copy .kick{font-size:10px;letter-spacing:.13em}.copy .title,.scene-factory .title{font-size:38px;line-height:1.06}.copy .sub{font-size:14px;line-height:1.5;margin-top:9px}.copy .svc,.scene-factory .svc{gap:7px;flex-direction:column;margin-top:14px}.copy .svc span{font-size:12px;line-height:1.5}.phone{width:132px;right:15px;bottom:auto;top:210px;padding:12px;border-radius:14px}.phone .ttl{font-size:9px}.phone .ttl small{font-size:7px}.phone .dot{width:6px;height:6px}.phone li{font-size:10px;gap:6px;padding:6px 0}.phone .box{width:12px;height:12px;border-radius:3px}.phone .box:after{left:4px;top:2px;width:3px;height:6px;border-width:0 2px 2px 0}}

@media(min-width:701px){.scene-factory .copy{max-width:64%}.scene-factory .title{font-size:4.3cqw;line-height:1}.scene-factory .svc{flex-direction:row;flex-wrap:wrap;gap:1.6cqw}}

/* SC fix 2026-10-26: embedded in page chrome -> hide in-scene controls (page owns pause/replay) */
.stage.embedded .ctrls{display:none}
