/*
 * App pages. Loaded after site.css.
 * Layout: a centred hero, then a story where the feature text scrolls past a phone that stays in view
 * and changes screen to match. On narrow screens each feature carries its own screenshot instead.
 * Each page sets --app (its accent) and --screen-ratio (its screenshots' shape).
 */
:root { --app: var(--accent); --app-soft: color-mix(in srgb, var(--app) 30%, transparent); --screen-ratio: 9 / 20; }

/* Hero */
.app-hero { padding-block: 104px 40px; text-align: center; position: relative; }
.app-hero .blobs i:nth-child(1) { width: 38%; aspect-ratio: 1; left: 8%; top: 4%; background: var(--app); opacity: 0.4; }
.app-hero .blobs i:nth-child(2) { width: 30%; aspect-ratio: 1; right: 8%; top: 18%; background: var(--blob-violet); opacity: 0.35; }
.app-hero .icon { width: 112px; height: 112px; border-radius: 22%; box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08); }
.app-hero .status { margin-top: 26px; font-size: 15px; font-weight: 600; color: var(--app); }
.app-hero h1 { font-size: clamp(56px, 9vw, 112px); font-weight: 700; letter-spacing: -0.05em; line-height: 0.98; margin-top: 6px; }
.app-hero .tagline { font-family: var(--display); font-size: clamp(24px, 3.4vw, 40px); font-weight: 600; letter-spacing: -0.03em; color: var(--ink-muted); margin-top: 12px; }
.app-hero .lede { font-size: clamp(18px, 2vw, 21px); color: var(--ink-muted); max-width: 620px; margin: 22px auto 0; }
.app-hero .links-row { margin-top: 32px; }
.app-hero .note { margin-top: 16px; font-size: 14px; color: var(--ink-faint); }
.button.app-cta { background: var(--app); color: var(--app-ink, #0b0d14); }
.button.waiting { background: var(--control); color: var(--ink-muted); cursor: default; }
.button.waiting:hover { filter: none; }

/* Story */
.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; padding-block: 40px 80px; }
.steps { display: flex; flex-direction: column; }
.step { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding-block: 40px; transition: opacity 0.5s ease; }
/* Only dimmed once the script is running, so the text never stays faint without it. */
.story-live .step { opacity: 0.35; }
.story-live .step.is-active { opacity: 1; }
.step .kicker { font-size: 15px; font-weight: 600; color: var(--app); }
.step h2 { font-size: clamp(34px, 4.2vw, 52px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; }
.step p { font-size: 19px; color: var(--ink-muted); max-width: 460px; line-height: 1.5; }

.device-rail { position: relative; }
.device-sticky { position: sticky; top: calc(48px + 6vh); height: calc(88vh - 48px); display: flex; align-items: center; justify-content: center; }
.device-sticky::before {
  content: ""; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; z-index: -1;
  background: var(--glow, var(--app-soft)); filter: blur(90px); opacity: 0.9; transition: background 0.8s ease;
}

/*
 * A Galaxy S25 Ultra, built outward from its screen: the screen keeps the panel's real shape
 * (1440 by 3120), and the bezel and titanium band wrap around it. Every size follows --h, the
 * screen's height, so the proportions hold at any scale.
 */
.s25 {
  --h: 640px;
  --sw: calc(var(--h) * 1440 / 3120);
  --r: calc(var(--h) * 0.04);
  --bezel: calc(var(--h) * 0.009);
  --band: calc(var(--h) * 0.007);
  position: relative; flex: none; padding: var(--band);
  border-radius: calc(var(--r) + var(--bezel) + var(--band));
  background: linear-gradient(115deg, #8d8f94, #4a4c51 18%, #2b2c30 50%, #55575c 82%, #9a9ca1);
  box-shadow: 0 60px 120px -30px rgba(0, 0, 0, 0.75), 0 0 0 0.5px rgba(255, 255, 255, 0.25);
}
.s25-bezel { padding: var(--bezel); border-radius: calc(var(--r) + var(--bezel)); background: #030304; }
.s25-screen { position: relative; width: var(--sw); height: var(--h); border-radius: var(--r); overflow: hidden; background: var(--screen-bg, #000); isolation: isolate; }
.s25-screen::before {
  /* The punch-hole camera, centred near the top as on the real phone */
  content: ""; position: absolute; z-index: 3; top: calc(var(--h) * 0.014); left: 50%;
  width: calc(var(--h) * 0.019); aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #2a2d3a, #050507 60%); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.s25-screen::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(125deg, rgba(255, 255, 255, 0.1), transparent 28%); }
.s25-key { position: absolute; right: calc(var(--band) * -0.6); width: calc(var(--band) * 0.9); border-radius: 0 2px 2px 0; background: linear-gradient(90deg, #3c3d41, #8f9196); }
.s25-key.volume { top: 21%; height: 10%; }
.s25-key.power { top: 34%; height: 6%; }

/* Each screen: the screenshot at its own shape, over a soft blur of itself for any space it doesn't cover */
.layer { position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s ease; }
.layer.is-active, .step .layer { opacity: 1; }
.layer .fill { position: absolute; inset: -10%; width: 120%; height: 120%; object-fit: cover; object-position: bottom; filter: blur(28px) saturate(1.1); }
.layer .main { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: var(--screen-fit, cover); object-position: top center; }

.dots { display: grid; gap: 8px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--ink-faint); opacity: 0.5; transition: height 0.4s ease, background 0.4s ease, opacity 0.4s ease; }
.dots i.is-active { height: 22px; background: var(--app); opacity: 1; }
.device-sticky { gap: 32px; }
.device-sticky .s25 { --h: min(calc(88vh - 150px), 680px); }
.step > .s25 { display: none; }
@media (prefers-reduced-motion: reduce) {
  .step, .layer, .dots i, .device-sticky::before { transition: none; }
}

@media (max-width: 860px) {
  .story { grid-template-columns: 1fr; gap: 0; }
  .device-rail { display: none; }
  .step, .story-live .step { min-height: 0; opacity: 1; padding-block: 36px; }
  .step > .s25 { display: block; align-self: flex-start; margin-top: 18px; --h: min(66vh, 560px); }
}

/* Details */
.details { padding-block: 80px; position: relative; }
.details .blobs i:nth-child(1) { width: 34%; aspect-ratio: 1; left: 0; top: 10%; background: var(--app); opacity: 0.25; }
.details .blobs i:nth-child(2) { width: 30%; aspect-ratio: 1; right: 4%; top: 30%; background: var(--blob-blue); opacity: 0.3; }
.details .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.details .grid article { border-radius: 26px; padding: 28px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.details h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.details .grid p { color: var(--ink-muted); font-size: 15px; }
@media (max-width: 860px) { .details .grid { grid-template-columns: 1fr; } }

/* Closing call to action */
.closing { padding-block: 60px 120px; }
.closing .card { border-radius: 34px; padding: clamp(32px, 6vw, 64px); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px; align-items: center; }
.closing img { width: 88px; height: 88px; border-radius: 22%; }
.closing h2 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 700; letter-spacing: -0.04em; }
.closing p { color: var(--ink-muted); margin-top: 6px; }
.fine-print { margin-top: 18px; font-size: 13px; color: var(--ink-faint); max-width: 760px; }
@media (max-width: 760px) { .closing .card { grid-template-columns: 1fr; } }
