/* ═════ nav: floats on the film, frosted glass once past it ═════ */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; color: #fff; border-bottom: 1px solid transparent;
       transition: background-color .25s, border-color .25s, color .25s; }
.nav.scrolled { color: var(--ink); background: hsl(0 0% 100% / .72); border-bottom-color: var(--line);
                -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); }
.nav.on-dark { color: #fff; background: hsl(255 25% 8% / .6); border-bottom-color: hsl(0 0% 100% / .08); }
.nav .wrap { display: flex; height: 64px; align-items: center; justify-content: space-between; }

/* ═════ hero: the film fills the whole screen ═════ */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 520px; overflow: hidden;
        background: hsl(255 35% 5%); color: #fff; }
.hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scrim { position: absolute; inset: 0; pointer-events: none; }
.scrim.v { background: linear-gradient(to bottom, hsl(255 40% 5% / .55) 0%, hsl(255 40% 5% / .12) 22%,
           hsl(255 40% 5% / .12) 45%, hsl(255 40% 5% / .84) 100%); }
.scrim.h { background: linear-gradient(to right, hsl(255 40% 5% / .5) 0%, transparent 55%); }
.scrim.tint { background: radial-gradient(70% 55% at 0% 100%, hsl(265 60% 45% / .32) 0%, transparent 70%); }
.tap { position: absolute; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center;
       background: hsl(255 40% 5% / .2); }
.tap.on { display: flex; }
.tap span { display: flex; width: 80px; height: 80px; align-items: center; justify-content: center; border-radius: 50%;
            background: hsl(0 0% 100% / .92); color: var(--primary); box-shadow: 0 25px 50px -12px rgba(0,0,0,.4);
            transition: transform .2s var(--ease); }
.tap:hover span { transform: scale(1.06); }
.tap svg { width: 32px; height: 32px; margin-left: 4px; fill: currentColor; }
.corner { display: inline-flex; align-items: center; gap: 6px; position: absolute; bottom: 20px; right: 24px; z-index: 30; border-radius: 999px; padding: 6px 16px;
        background: hsl(0 0% 100% / .1); font-size: 12px; font-weight: 500; color: hsl(0 0% 100% / .8);
        -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: background-color .15s, color .15s; }
.corner:hover { background: hsl(0 0% 100% / .2); color: #fff; }
.corner[hidden] { display: none; }
.hero-copy { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; }
.hero-copy .wrap { padding-bottom: 56px; }
.eyebrow { margin-bottom: 16px; font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
           color: hsl(272 85% 82%); }
.hero h1 { max-width: 56rem; font-family: var(--display); font-weight: 700; font-size: 2.5rem; line-height: 1.02;
           letter-spacing: -0.025em; text-wrap: balance; }
.grad-light { background: linear-gradient(100deg, hsl(228 85% 80%) 0%, hsl(262 85% 83%) 50%, hsl(283 75% 83%) 100%);
              -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .06em; }
.hero .lede { margin-top: 20px; max-width: 36rem; font-size: 1rem; line-height: 1.625; color: hsl(0 0% 100% / .78); }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn-glass { height: 48px; padding: 0 24px; font-weight: 500; color: hsl(0 0% 100% / .88); border: 1px solid hsl(0 0% 100% / .28); }
.btn-glass:hover { background: hsl(0 0% 100% / .1); color: #fff; }
.js .hero-reveal { opacity: 0; transform: translateY(24px); filter: blur(10px);
                   transition: opacity .85s var(--ease), transform .85s var(--ease), filter .85s var(--ease); }
.js .hero.show .hero-reveal { opacity: 1; transform: none; filter: blur(0); }
.hero.show .hero-reveal:nth-child(2) { transition-delay: .13s; }
.hero.show .hero-reveal:nth-child(3) { transition-delay: .26s; }
.hero.show .hero-reveal:nth-child(4) { transition-delay: .39s; }

/* ═════ drawing-sheet language used across the page ═════ */
.blueprint { background-color: var(--bg);
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px; background-position: -1px -1px; }
.label { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 12px; font-weight: 500;
         letter-spacing: .08em; text-transform: uppercase; color: var(--primary-ink); }
.label::after { content: ""; flex: 0 1 72px; height: 1px; background: currentColor; opacity: .35; }
.section { position: relative; padding: 96px 0; }
@media (min-width: 768px) { .section { padding: 136px 0; } }
h2 { margin-top: 16px; max-width: 20ch; font-family: var(--display); font-weight: 700;
     font-size: clamp(2rem, 4.6vw, 3.5rem); line-height: 1.04; letter-spacing: -0.03em; text-wrap: balance; }
.sub { margin-top: 18px; max-width: 40rem; font-size: 1.0625rem; line-height: 1.65; color: var(--muted); }
.mono { font-family: var(--mono); }

/* crop marks at the corners of a sheet */
.sheet { position: relative; }
.sheet::before, .sheet::after, .sheet > .cm::before, .sheet > .cm::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-color: var(--primary); opacity: .55; pointer-events: none; }
.sheet::before { left: -10px; top: -10px; border-left: 1.5px solid; border-top: 1.5px solid; }
.sheet::after { right: -10px; top: -10px; border-right: 1.5px solid; border-top: 1.5px solid; }
.sheet > .cm::before { left: -10px; bottom: -10px; border-left: 1.5px solid; border-bottom: 1.5px solid; }
.sheet > .cm::after { right: -10px; bottom: -10px; border-right: 1.5px solid; border-bottom: 1.5px solid; }

/* dimension line that draws itself */
.dim { display: block; width: 100%; height: 34px; margin: 56px 0 28px; color: var(--primary); overflow: visible; }
.dim line, .dim path { stroke: currentColor; stroke-width: 1.25; fill: none; vector-effect: non-scaling-stroke; }
.dim .run { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease) .2s; }
.dim.in .run { stroke-dashoffset: 0; }
.dim-wrap { position: relative; }
.dim-num { position: absolute; z-index: 2; left: 50%; top: 17px; transform: translate(-50%, -50%); padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line);
           background: var(--bg); font-family: var(--mono); font-size: 13px; color: var(--primary-ink);
           opacity: 0; transition: opacity .6s .9s; }
.dim-wrap.in .dim-num { opacity: 1; }

/* ═════ 01 the example ═════ */
.intro .facts { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px;
        background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--ink); }
.chip i { width: 8px; height: 8px; border-radius: 50%; }
.tilt-stage { perspective: 1800px; margin-top: 8px; }
.tilt { transform-origin: 50% 0; transform: rotateX(var(--tilt, 0deg)) scale(var(--tilt-s, 1)); will-change: transform; }
.frame { border-radius: 16px; overflow: hidden; background: var(--card); border: 1px solid var(--line);
         box-shadow: 0 50px 100px -40px hsl(265 52% 40% / .45), 0 18px 36px -18px hsl(222 47% 11% / .18); }
.frame-bar { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--line);
             background: hsl(266 50% 98%); font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.frame-bar .dots { display: flex; gap: 6px; margin-right: 6px; }
.frame-bar .dots b { width: 9px; height: 9px; border-radius: 50%; background: hsl(270 30% 86%); }
.frame img { width: 100%; height: auto; }

/* ═════ 02 story: sticky sheet that follows the steps ═════ */
.story-grid { margin-top: 56px; display: grid; gap: 40px; }
.step { position: relative; padding-left: 64px; }
.step-no { position: absolute; left: 0; top: 2px; width: 44px; height: 44px; display: grid; place-items: center;
           border-radius: 12px; border: 1px solid var(--line); background: var(--card);
           font-family: var(--mono); font-size: 13px; color: var(--primary-ink); transition: all .4s var(--ease); }
.step h3 { font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.1; letter-spacing: -0.02em; }
.step .kind { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.step p { margin-top: 12px; max-width: 30rem; color: var(--muted); font-size: 1.0625rem; line-height: 1.65; }
.step .inline-shot { margin-top: 24px; }
.story-sheet { display: none; }
@media (min-width: 1024px) {
  .story-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; margin-top: 24px; }
  .steps-col { padding: 22vh 0 30vh; }
  .step { min-height: 64vh; display: flex; flex-direction: column; justify-content: center; opacity: .32;
          transition: opacity .5s var(--ease); }
  .step.active { opacity: 1; }
  .step.active .step-no { background: var(--btn); color: #fff; border-color: transparent; box-shadow: var(--shadow-btn); }
  .step .inline-shot { display: none; }
  .story-sheet { display: block; position: sticky; top: max(96px, calc(50vh - 290px)); align-self: start; }
  .shots { position: relative; aspect-ratio: 7 / 5; background-color: hsl(210 20% 98%);
           background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
           background-size: 24px 24px; }
  /* one .shot per step: a still picture or a click-through demo */
  .shots > .shot { position: absolute; inset: 0; width: 100%; height: 100%; padding: 14px;
               filter: drop-shadow(0 12px 24px hsl(265 40% 40% / .12));
               opacity: 0; transform: scale(.985); transition: opacity .6s var(--ease), transform .8s var(--ease); }
  .shots > img.shot { object-fit: contain; }
  .shots > .shot.on { opacity: 1; transform: none; }
  .shots > .demo { display: flex; align-items: center; justify-content: center; container-type: size; }
  .shots > .demo .demo-box { width: min(100cqw, 100cqh * var(--arn)); }
  .progress { display: flex; gap: 6px; margin-left: auto; }
  .progress i { width: 22px; height: 3px; border-radius: 2px; background: hsl(270 30% 86%); transition: background-color .4s; }
  .progress i.on { background: var(--primary); }
}

/* ═════ 03 3D: dark stage, like the app's 3D view ═════ */
.stage { position: relative; overflow: hidden; color: #fff;
         background: radial-gradient(60% 55% at 50% 58%, hsl(28 30% 20%) 0%, hsl(255 22% 8%) 70%), hsl(255 22% 8%); }
.stage::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(hsl(0 0% 100% / .045) 1px, transparent 1px), linear-gradient(90deg, hsl(0 0% 100% / .045) 1px, transparent 1px);
  background-size: 32px 32px; -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent);
  mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent); }
.stage .label { color: hsl(272 85% 82%); }
.stage .sub { color: hsl(0 0% 100% / .7); }
.stage-head { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
model-viewer { display: block; width: 100%; height: min(72vh, 680px); min-height: 380px; --poster-color: transparent;
               background: transparent; position: relative; z-index: 1; }
.views { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: hsl(0 0% 100% / .08);
         border: 1px solid hsl(0 0% 100% / .12); }
.views button { height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: hsl(0 0% 100% / .75);
                transition: background-color .2s, color .2s; }
.views button:hover { color: #fff; }
.views button.on { background: var(--btn); color: #fff; }
.hotspot { display: none; padding: 5px 10px; border-radius: 999px; border: 1px solid hsl(0 0% 100% / .25);
           background: hsl(255 25% 8% / .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
           font-family: var(--mono); font-size: 12px; color: #fff; white-space: nowrap; pointer-events: none; }
.ready .hotspot { display: block; }
.hotspot b { color: hsl(272 85% 82%); font-weight: 500; margin-right: 6px; }
.stage-foot { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
              font-family: var(--mono); font-size: 12px; color: hsl(0 0% 100% / .5); }

/* ═════ footer, plain like the app ═════ */
footer { border-top: 1px solid hsl(214 32% 88%); background: var(--card); }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 28px; padding-bottom: 28px; }
.foot .brand img { width: 26px; height: 26px; border-radius: 7px; }
.foot .brand b { font-size: 1rem; }
.foot span { font-size: .875rem; color: var(--muted); }


@media (min-width: 640px) {
  .corner { right: 40px; }
  .hero-copy .wrap { padding-bottom: 80px; }
  .hero h1 { font-size: 3.75rem; line-height: 1; }
  .hero .lede { font-size: 1.125rem; line-height: 1.75rem; }
}
@media (min-width: 1024px) { .hero h1 { font-size: 4.5rem; } }
@media (prefers-reduced-motion: reduce) {
  .js .hero-reveal, .dim .run, .shots > .shot, .step { transition: none !important; }
  .tilt { transform: none !important; }
}

/* ═════ Replay / Skip share the bottom-right corner ═════ */
.corner svg { width: 14px; height: 14px; }

/* ═════ light sections: the app's lilac aurora instead of a blank page ═════ */
.lit { position: relative; isolation: isolate; background: var(--bg); }
h2.wide { max-width: 24ch; }
.aurora.tall {
  background:
    radial-gradient(55% 14% at 0% 6%, hsl(240 70% 90%) 0%, transparent 70%),
    radial-gradient(50% 14% at 100% 30%, hsl(288 60% 91%) 0%, transparent 70%),
    radial-gradient(55% 14% at 0% 58%, hsl(272 65% 91%) 0%, transparent 70%),
    radial-gradient(50% 14% at 100% 86%, hsl(244 70% 91%) 0%, transparent 70%),
    linear-gradient(180deg, hsl(266 50% 97%) 0%, hsl(210 30% 98%) 50%, hsl(266 45% 97%) 100%);
}
.aurora.tall::after { -webkit-mask-image: linear-gradient(180deg, transparent, #000 10%, #000 90%, transparent);
                      mask-image: linear-gradient(180deg, transparent, #000 10%, #000 90%, transparent); opacity: .35; }
.orb.d { left: -140px; top: 52%; width: 440px; height: 440px; opacity: .55;
  background: radial-gradient(circle, hsl(286 64% 82%) 0%, transparent 68%); animation: drift-b 21s ease-in-out infinite; }
.orb.e { right: -120px; top: 28%; width: 420px; height: 420px; opacity: .55;
  background: radial-gradient(circle, hsl(244 78% 80%) 0%, transparent 68%); animation: drift-a 18s ease-in-out infinite; }
.aurora.tall .orb.b { bottom: 2%; }
@media (prefers-reduced-motion: reduce) { .orb.d, .orb.e { animation: none; } }

/* ═════ silk ribbons behind the light sections (SVGs drawn by tools/make-backgrounds.cjs) ═════ */
#example .aurora::before, #how .aurora::before, #how2 .aurora::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background-repeat: no-repeat; }
#example .aurora::before { background-image: url(assets/bg/silk-light.svg);
  background-position: right -40px top -20px; background-size: min(1200px, 120vw) auto; }
/* the light section before the 3D ends in a ribbon rising towards the dark stage */
#how .aurora::before { background-image: url(assets/bg/silk-sweep.svg);
  background-position: center bottom -40px; background-size: max(1440px, 100%) auto; }
/* after the dark stage, the same ribbon turned around comes back in at the top */
#how2 .aurora::before { background-image: url(assets/bg/silk-sweep.svg);
  background-position: center bottom -230px; background-size: max(1440px, 100%) auto; transform: scale(-1, -1); }
/* the dark 3D stage: glowing ribbon and beams of light from the top right */
.stage::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url(assets/bg/silk-dark.svg) no-repeat right top -170px / max(1440px, 100%) auto; }
.stage .views { background: hsl(255 25% 8% / .72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.stage > .wrap { position: relative; z-index: 1; }
@media (max-width: 767px) {
  /* keep the ribbon above the heading on phones */
  #example .aurora::before { background-position: right -70px top -110px; }
  .stage::after { background-size: 700px auto; background-position: right -120px top -130px; }
}

/* ═════ click-through demos (demo.js + assets/app/demos.js): real frames from the app and a cursor ═════ */
.demo-box { position: relative; width: 100%; aspect-ratio: var(--ar); overflow: hidden; border-radius: 6px; background: #fff; }
.frame .demo-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  transition: opacity .42s var(--ease), transform .8s var(--ease); }
.frame .demo-box img.on { opacity: 1; }
.frame .demo-box img.instant { transition: none; }
.frame .demo-box img.zoom-out { z-index: 2; opacity: 0; transform: scale(2.2);
  transition: opacity .45s var(--ease) .45s, transform .9s cubic-bezier(.55, 0, .25, 1); }
.demo-cursor { position: absolute; left: 50%; top: 60%; z-index: 3; width: 0; height: 0; pointer-events: none;
  transition: left .75s cubic-bezier(.45, 0, .2, 1), top .75s cubic-bezier(.45, 0, .2, 1), opacity .3s; }
.demo-cursor svg { position: absolute; left: -4px; top: -3px; width: 22px; height: 22px; max-width: none; overflow: visible;
  filter: drop-shadow(0 2px 3px hsl(222 47% 11% / .35)); transition: transform .14s; transform-origin: 4px 3px; }
.demo-cursor.press svg { transform: scale(.82); }
.demo-ring { position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid hsl(265 70% 60%); background: hsl(265 70% 60% / .18); opacity: 0; transform: scale(.3); }
.demo-cursor.press .demo-ring { animation: demo-ring .6s ease-out; }
@keyframes demo-ring { 0% { opacity: .9; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.5); } }
.demo-cursor.rest { opacity: 0; }
.inline-shot .demo { display: block; }
@media (prefers-reduced-motion: reduce) { .demo-cursor { display: none; } .frame .demo-box img { transition: none; } }
.inline-shot .demo-cursor svg { width: 18px; height: 18px; left: -3px; top: -2px; }
@media (max-width: 639px) { .hotspot { padding: 3px 7px; font-size: 10.5px; } .hotspot b { margin-right: 4px; } }
