/* ---- Scroll story: one device that turns, docks and changes screens as you scroll ---- */
.story { position: relative; overflow-x: clip; color: #fff; padding: 0;
  /* Layered glows over a top-to-bottom gradient, so the dark blue has depth. */
  background:
    radial-gradient(1100px 700px at 25% 20%, rgba(60, 90, 170, .45), transparent 65%),
    radial-gradient(900px 600px at 90% 60%, rgba(120, 60, 140, .22), transparent 70%),
    radial-gradient(800px 600px at 10% 95%, rgba(168, 48, 42, .18), transparent 70%),
    linear-gradient(180deg, #0e1528 0%, #18234a 40%, #121a36 70%, #0b1020 100%); }
.story > * { position: relative; }
.story .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; }
.stage { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; justify-content: center; }
.steps { padding: 30vh 0 40vh; }
.step { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; opacity: .25;
  transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.step.active { opacity: 1; transform: none; }
.step .kicker { text-transform: uppercase; letter-spacing: .14em; font-size: 13px; font-weight: 700; color: #f0b35a; margin-bottom: 10px; }
.step h3 { font: 700 clamp(30px, 3.6vw, 44px)/1.08 var(--serif); margin: 0 0 14px; }
.step p { color: rgba(255,255,255,.75); font-size: 18px; margin: 0; max-width: 440px; }
.story-intro { text-align: center; padding: 100px 20px 0; }
.story-intro h2 { color: #fff; }
.story-intro .sub { color: rgba(255,255,255,.7); margin: 0 auto; }

/* Ambient glow behind the device, tinted per step */
.stage::before { content: ""; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--glow, rgba(240,179,90,.35)), transparent 65%);
  filter: blur(20px); transition: background 1s ease; }

/* The device */
.device { position: relative; width: 290px; height: 610px; border-radius: 48px; padding: 11px; background: #0d0d10;
  box-shadow: 0 0 0 2px #2b2b31, 0 40px 80px rgba(0,0,0,.55);
  transition: width .9s cubic-bezier(.6,0,.2,1), height .9s cubic-bezier(.6,0,.2,1), border-radius .9s ease, transform .9s cubic-bezier(.6,0,.2,1); }
.device.landscape, .device.fullscreen, .device.standby { width: 540px; height: 262px; }
.device.ipad { width: 540px; height: 400px; border-radius: 34px; padding: 16px; }
.device.standby { transform: translateY(-30px) rotateX(8deg); }
.island { position: absolute; z-index: 5; width: 92px; height: 26px; border-radius: 20px; background: #000; top: 20px; left: 50%;
  transform: translateX(-50%); transition: all .9s cubic-bezier(.6,0,.2,1); }
.device.landscape .island, .device.fullscreen .island, .device.standby .island { width: 26px; height: 92px; top: 50%; left: 20px; transform: translateY(-50%); }
.device.ipad .island { width: 10px; height: 10px; top: 4px; }
.stand { position: absolute; width: 230px; height: 120px; left: 50%; top: calc(50% + 100px); transform: translateX(-50%) scaleY(.7);
  opacity: 0; transition: opacity .6s ease; pointer-events: none;
  background: linear-gradient(180deg, #3a3a40, #17171b); clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%); border-radius: 8px; }
.stage.standby .stand { opacity: 1; transition-delay: .5s; }

.screen { position: relative; width: 100%; height: 100%; border-radius: 38px; overflow: hidden; background: #000;
  transition: border-radius .9s ease; }
.device.ipad .screen { border-radius: 20px; }
.view { position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease .25s; pointer-events: none; }
.view.on { opacity: 1; }
.view .bg { position: absolute; inset: 0; background-size: cover; background-position: center; animation: kb 18s ease-in-out infinite alternate; }
@keyframes kb { from { transform: scale(1.05); } to { transform: scale(1.18) translate(-2%, -1%); } }
.flakes { position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(2px 2px at 20% 30%, #fff, transparent), radial-gradient(1.5px 1.5px at 70% 10%, #fff, transparent),
    radial-gradient(2px 2px at 40% 70%, #fff, transparent), radial-gradient(1.5px 1.5px at 85% 55%, #fff, transparent),
    radial-gradient(1px 1px at 10% 85%, #fff, transparent), radial-gradient(2px 2px at 55% 45%, rgba(255,255,255,.8), transparent);
  background-size: 180px 180px; animation: fall 9s linear infinite; opacity: .8; }
@keyframes fall { from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; } to { background-position: 30px 180px, -20px 180px, 25px 180px, -15px 180px, 10px 180px, -25px 180px; } }

/* Mock app UI */
.ui { position: absolute; font-family: var(--sans); color: var(--ink); }
.glass { background: rgba(251,246,238,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.countbar { left: 12px; right: 12px; top: 46%; border-radius: 18px; padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.countbar b { font: 700 28px var(--serif); color: var(--red); }
.countbar small { font-size: 10px; line-height: 1.15; color: var(--ink); }
.pill { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; padding: 7px 11px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.home-panel { left: 0; right: 0; bottom: 0; top: 58%; background: var(--cream); padding: 14px 12px; }
.home-panel h4 { margin: 0 0 8px; font: 700 15px var(--serif); }
.tiles { display: flex; gap: 8px; }
.tiles img { width: 74px; height: 74px; border-radius: 12px; object-fit: cover; box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.tabbar { left: 14px; right: 14px; bottom: 12px; height: 42px; border-radius: 22px; display: flex; justify-content: space-around; align-items: center; font-size: 9px; color: var(--muted); }
.tabbar span:first-child { color: var(--red); font-weight: 700; }

.player { left: 12px; right: 12px; bottom: 14px; border-radius: 24px; padding: 14px; }
.player .row { display: flex; gap: 10px; align-items: center; }
.player img { width: 52px; height: 52px; border-radius: 10px; }
.player .t { font: 700 14px var(--serif); }
.player .a { font-size: 11px; color: var(--muted); }
.star { margin-left: auto; color: var(--red); font-size: 18px; }
.bar { height: 4px; border-radius: 4px; background: rgba(0,0,0,.12); margin: 12px 0 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 30%; background: var(--red); animation: prog 12s linear infinite; }
@keyframes prog { from { width: 8%; } to { width: 92%; } }
.controls { display: flex; justify-content: space-around; align-items: center; font-size: 20px; margin-top: 8px; }
.controls .play { width: 46px; height: 46px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 18px; }
.bigcover { left: 50%; top: 80px; width: 170px; height: 170px; transform: translateX(-50%); border-radius: 18px; box-shadow: 0 18px 40px rgba(0,0,0,.45); }

.side { right: 0; top: 0; bottom: 0; width: 42%; background: var(--cream); padding: 16px 16px 14px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.side img { width: 64px; height: 64px; border-radius: 12px; box-shadow: 0 6px 14px rgba(0,0,0,.2); }
.side .t { font: 700 15px var(--serif); }
.side .a { font-size: 11px; color: var(--muted); }

.clock { right: 26px; top: 20px; text-align: right; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.clock b { display: block; font: 300 46px/1 var(--sans); letter-spacing: -1px; }
.clock span { font-size: 12px; font-weight: 600; }
.fs-count { left: 46px; bottom: 18px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.6); font: 700 22px var(--serif); }
.fs-count small { font: 600 11px var(--sans); display: block; opacity: .9; }

.sb { inset: 0; background: #000; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 14px 14px 52px; }
.sb .big { color: #ff6a52; font: 200 76px/1 var(--sans); letter-spacing: -3px; display: flex; flex-direction: column; justify-content: center; }
.sb .big small { font: 600 13px var(--sans); color: rgba(255,106,82,.8); letter-spacing: 0; margin-top: 6px; }
.sb .w { position: relative; border-radius: 22px; overflow: hidden; }
.sb .w img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.85) saturate(1.05); }
.sb .w b { position: absolute; left: 12px; bottom: 10px; font: 700 28px var(--serif); color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.6); }

.ipad-panel { right: 18px; bottom: 18px; width: 240px; border-radius: 22px; padding: 14px; }

.hs { inset: 0; background: linear-gradient(160deg, #2c3e6b, #6b3b55 60%, #a8302a); padding: 50px 14px 14px; display: grid;
  grid-template-columns: repeat(4, 1fr); grid-auto-rows: 52px; gap: 14px 12px; }
.hs .app { border-radius: 13px; background: rgba(255,255,255,.22); }
.hs .app.fc { background: url("images/icon.png") center / cover; }
.hs .wl { grid-column: span 4; grid-row: span 3; border-radius: 22px; overflow: hidden; position: relative; }
.hs .ws { grid-column: span 2; grid-row: span 2; border-radius: 20px; overflow: hidden; position: relative; }
.hs img { width: 100%; height: 100%; object-fit: cover; }
.hs .wl b, .hs .ws b { position: absolute; left: 10px; bottom: 8px; font: 700 24px var(--serif); color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.hs .ws b { font-size: 18px; }
.hs .wl .pill { position: absolute; right: 10px; bottom: 10px; }

/* Step tints */
.stage[data-step="home"] { --glow: rgba(240,179,90,.35); }
.stage[data-step="player"] { --glow: rgba(168,48,42,.45); }
.stage[data-step="landscape"] { --glow: rgba(90,150,240,.35); }
.stage[data-step="fullscreen"] { --glow: rgba(130,180,255,.35); }
.stage[data-step="standby"] { --glow: rgba(255,106,82,.35); }
.stage[data-step="ipad"] { --glow: rgba(120,200,140,.3); }
.stage[data-step="widgets"] { --glow: rgba(200,110,170,.35); }

@media (max-width: 900px) {
  .story .wrap { grid-template-columns: 1fr; gap: 0; }
  .stage { height: 62vh; top: 0; z-index: 2; background: linear-gradient(180deg, var(--night) 80%, transparent); }
  .stage .scaler { width: 0; display: flex; justify-content: center; transform: scale(var(--s, .62)); }
  .stage .device { flex-shrink: 0; }
  .steps { padding: 0 0 30vh; }
  .step { min-height: 60vh; justify-content: flex-start; padding-top: 4vh; }
}
@media (max-width: 420px) { .stage .scaler { --s: .6; } }
@media (prefers-reduced-motion: reduce) { .step { opacity: 1; transform: none; } }
