/* Afterglow — the landing page. Same rules as the app (see DESIGN.md): night, glass, light;
   white ink at three strengths; colour only where light is. */

:root {
  --bg: #07080b;
  --ink: rgba(255, 255, 255, .94);
  --ink-2: rgba(255, 255, 255, .56);
  --ink-3: rgba(255, 255, 255, .32);
  --rim: rgba(255, 255, 255, .12);
  --side: max(20px, env(safe-area-inset-left));
  --side-r: max(20px, env(safe-area-inset-right));
  --spring: ease-out;           /* replaced at load with a real spring curve */
  --spring-dur: .6s;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--ink); }
html { touch-action: manipulation; }
body {
  font: 17px/1.45 -apple-system, system-ui, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  overscroll-behavior: none;
}

/* Fine grain over everything, like the app's night: keeps deep gradients from banding. */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.page {
  height: 100dvh; overflow-y: auto; overflow-x: hidden; position: relative;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(40, 30, 70, .35), transparent 60%),
    var(--bg);
}

.wrap { max-width: 480px; margin: 0 auto; padding: 0 var(--side-r) 0 var(--side); }

/* Type: three voices. */
.caps {
  font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  font-stretch: 125%; color: var(--ink-2);
}
.dim { color: var(--ink-3); }
h1 { font-size: clamp(38px, 11vw, 46px); line-height: 1.04; letter-spacing: -.028em; font-weight: 650; }
h2 { font-size: 28px; line-height: 1.12; letter-spacing: -.02em; font-weight: 650; margin-top: 10px; }
.lede, section > .wrap > p:not(.caps) { color: var(--ink-2); margin-top: 14px; }
.num { font-family: ui-rounded, -apple-system, system-ui, sans-serif; font-variant-numeric: tabular-nums; }

/* Top line */
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: calc(env(safe-area-inset-top) + 18px);
}
.top .mark { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
/* The app icon: its four beams of light are the only colour up here. */
.top .mark img {
  width: 22px; height: 22px; border-radius: 6px; display: block;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 0 18px 2px rgba(190, 90, 255, .28);
}

/* Sections */
section { margin-top: 96px; }
.hero { margin-top: 56px; }
.hero h1 { margin-top: 2px; }
.hint { text-align: center; margin-top: 16px; min-height: 16px; transition: color .3s; }

/* Reveal as sections arrive */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease-out, transform var(--spring-dur) var(--spring); }
.reveal.in { opacity: 1; transform: none; }

/* Screenshots in a phone of dark glass, with the light of the screen spilling behind it. */
.phone {
  position: relative; isolation: isolate;
  width: min(78%, 330px); margin: 44px auto 0; aspect-ratio: 786 / 1704;
}
.phone img {
  display: block; width: 100%; height: 100%; border-radius: 14% / 6.46%;
  box-shadow: 0 0 0 5px #0d0e12, 0 0 0 6px rgba(255, 255, 255, .13), 0 40px 80px -30px rgba(0, 0, 0, .9);
}
.phone::before {
  content: ""; position: absolute; inset: 6% -16% 8%; z-index: -1; opacity: .5; filter: blur(46px);
  background:
    radial-gradient(42% 30% at 28% 32%, var(--g1, #8a3cff), transparent 70%),
    radial-gradient(42% 30% at 72% 52%, var(--g2, #ff3fa0), transparent 70%),
    radial-gradient(40% 26% at 46% 82%, var(--g3, #ffa23a), transparent 70%);
}
.phone figcaption { margin-top: 18px; text-align: center; }
.phone.small { width: min(62%, 270px); }

/* Glass, as the app draws it: a dark slab with a lit rim. */
.glass {
  background: rgba(22, 23, 30, .42);
  -webkit-backdrop-filter: blur(24px) saturate(1.3); backdrop-filter: blur(24px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), inset 0 0 0 1px rgba(255, 255, 255, .07);
}

/* ---------- Tile (the gesture widget) ---------- */
.tile {
  position: relative; height: 188px; margin-top: 32px; border-radius: 30px; overflow: hidden;
  background: #0b0c10; touch-action: pan-y; cursor: grab;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .05), 0 18px 64px -16px var(--halo, transparent);
  transition: box-shadow .6s;
}
.wash {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  filter: blur(9px) saturate(1.08); transform: scale(1.14);
}
.tile .sheen, .card .sheen {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), transparent 38%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.tile-text { position: absolute; left: 18px; top: 15px; right: 60px; pointer-events: none; }
.tile-text b { display: block; font-size: 18px; font-weight: 600; }
.tile-text span { display: block; margin-top: 1px; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: opacity .25s; }
.tile .glyph { position: absolute; right: 18px; top: 17px; width: 22px; height: 22px; color: var(--ink-3); }
.digits { position: absolute; left: 16px; top: 42px; pointer-events: none; }
.leds { position: absolute; inset: 0; pointer-events: none; }
.led { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; }
.level { position: absolute; left: 0; right: 0; height: 1.5px; pointer-events: none; opacity: 0; }
.level-fill { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(to top, rgba(255, 255, 255, .12), rgba(255, 255, 255, .05)); }
.pip {
  position: absolute; right: 7px; bottom: 7px; width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer;
}
.pip svg { width: 16px; height: 16px; }
.pip::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1.6px var(--pip, rgba(255, 255, 255, .35)), 0 0 14px -2px var(--pip-glow, transparent); }

/* Scenes blooming around the thumb */
.ring-layer { position: fixed; inset: 0; z-index: 30; pointer-events: none; background: rgba(3, 4, 7, 0); transition: background .4s; }
.ring-layer.open { background: rgba(3, 4, 7, .6); }
.ring-layer.sticky { pointer-events: auto; }
.orb {
  position: absolute; left: 0; top: 0; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%;
  box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, .6), inset 0 -8px 14px rgba(0, 0, 0, .22), 0 0 22px -4px var(--c);
}
.orb label {
  position: absolute; left: 50%; top: 50%; white-space: nowrap; pointer-events: none;
  font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-stretch: 125%; color: var(--ink);
}
.orb svg.dwell { position: absolute; inset: -11px; width: 72px; height: 72px; overflow: visible; pointer-events: none; }
.ring-hint {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 14px); transform: translateX(-50%);
  padding: 9px 16px; border-radius: 99px; white-space: nowrap; opacity: 0; transition: opacity .3s;
  font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-stretch: 125%;
}
.ring-layer.hinting .ring-hint { opacity: 1; }

/* Waves of sound through the light */
.wave {
  position: fixed; z-index: 40; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .55); box-shadow: 0 0 12px rgba(255, 255, 255, .25), inset 0 0 12px rgba(255, 255, 255, .15);
  animation: wave 1.1s cubic-bezier(.2, .7, .3, 1) forwards;
}
@keyframes wave { to { transform: scale(var(--to, 16)); opacity: 0; border-width: .2px; } }

/* ---------- Rays or glow ---------- */
.compare {
  position: relative; margin-top: 32px; border-radius: 26px; overflow: hidden; aspect-ratio: 786 / 1006;
  touch-action: pan-y; cursor: ew-resize; box-shadow: 0 0 0 1px rgba(255, 255, 255, .06);
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.compare .over { clip-path: inset(0 0 0 var(--x, 50%)); }
.compare .bar { position: absolute; top: 0; bottom: 0; left: var(--x, 50%); width: 1.5px; margin-left: -.75px; background: rgba(255, 255, 255, .85); box-shadow: 0 0 14px rgba(255, 255, 255, .6); pointer-events: none; }
.compare .knob {
  position: absolute; top: 50%; left: var(--x, 50%); width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  display: grid; place-items: center; pointer-events: none;
}
.compare .knob svg { width: 18px; height: 18px; color: #fff; }
.cmp-labels { display: flex; justify-content: space-between; margin-top: 14px; padding: 0 6px; }

/* ---------- Vibe check ---------- */
.card { position: relative; margin-top: 32px; border-radius: 32px; overflow: hidden; padding: 12px; background: #0e0f14;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .05), 0 24px 70px -24px var(--halo, transparent); transition: box-shadow .8s; }
.card .card-glow { position: absolute; inset: 0; pointer-events: none; opacity: .55; filter: blur(30px); transition: background 1s; }
.viewfinder { position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 4 / 2.6; background: #050507; }
.viewfinder canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.viewfinder .brackets { position: absolute; left: 50%; top: 50%; width: 62%; aspect-ratio: 1; max-height: 62%; transform: translate(-50%, -50%); pointer-events: none; }
.viewfinder .badge { position: absolute; left: 10px; top: 10px; padding: 6px 11px; border-radius: 99px; font-size: 9px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase; font-stretch: 125%; }
.vibe-leds { position: relative; height: 34px; margin-top: 8px; }
.vibe-name { position: relative; text-align: center; color: var(--ink-2); }
.posters { position: relative; display: flex; justify-content: center; gap: 12px; margin-top: 16px; padding-bottom: 6px; }
.posters button {
  width: 62px; height: 46px; border-radius: 14px; border: 0; padding: 0; overflow: hidden; cursor: pointer; background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); transition: transform .3s var(--spring), box-shadow .3s;
}
.posters button canvas { width: 100%; height: 100%; display: block; }
.posters button[aria-pressed="true"] { box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 0 18px -2px var(--c, #fff); transform: scale(1.06); }
.posters button:active { transform: scale(.94); }

/* TestFlight */
.testflight {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 26px; padding: 9px 22px 9px 9px; min-height: 58px;
  border-radius: 99px; color: var(--ink); text-decoration: none; -webkit-user-select: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 0 0 1px rgba(255, 255, 255, .09), 0 10px 34px -10px rgba(40, 140, 255, .55);
  transition: transform .25s var(--spring);
}
.testflight:active { transform: scale(.96); }
.testflight .tf-icon { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 2px 8px rgba(30, 130, 255, .5)); }
.testflight b { display: block; font-size: 17px; font-weight: 600; line-height: 1.2; }
.testflight small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-stretch: 125%; color: var(--ink-2); }

/* Quiet facts */
.facts { list-style: none; margin-top: 18px; display: grid; gap: 14px; }
.facts li { color: var(--ink-2); padding: 16px 18px; border-radius: 22px; background: rgba(255, 255, 255, .035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), inset 0 0 0 1px rgba(255, 255, 255, .05); }
.facts b { color: var(--ink); font-weight: 600; }

footer { margin-top: 110px; padding-bottom: calc(env(safe-area-inset-bottom) + 40px); text-align: center; }
footer .caps { line-height: 2; }
footer p.end { margin-top: 18px; color: var(--ink-3); font-size: 13px; }
footer a, .prose a { color: var(--ink-2); text-decoration: none; }

/* Privacy: plain reading. */
.prose h2 { font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; margin-top: 40px; }
.prose .wrap > p:not(.caps) { margin-top: 10px; -webkit-user-select: text; user-select: text; }
.prose .stamp { margin-top: 44px; }

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: opacity .3s; transform: none; }
  .wave { display: none; }
}
