/* 3DN1.com hub: space, black glass, layer-by-layer reveals. Layers over the inline base styles in index.html. */
:root {
  --rim: rgba(255, 255, 255, 0.08);
  --rim-hi: rgba(255, 255, 255, 0.14);
  --gutter: 16px;
  --topbar: 60px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 16px); }
html, body { height: auto; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: rgba(25, 214, 232, 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: calc(var(--topbar) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.topbar.is-scrolled {
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--rim);
}
.tb-word { color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: 0.18em; font-size: 0.95rem; opacity: 0; transition: opacity 0.3s; }
.topbar.is-scrolled .tb-word { opacity: 1; }
.tb-nav { display: flex; align-items: center; gap: 0.25rem; }
.tb-link { color: var(--muted); text-decoration: none; font-size: 0.88rem; padding: 0.6rem 0.8rem; border-radius: 999px; transition: color 0.2s; }
.tb-link:hover { color: var(--text); }
.tb-cta {
  color: var(--text); text-decoration: none; font-size: 0.88rem; font-weight: 600;
  padding: 0.55rem 1rem; border-radius: 999px; border: 1px solid var(--rim-hi);
  background: rgba(255, 255, 255, 0.04); transition: border-color 0.2s, background 0.2s;
}
.tb-cta:hover { border-color: rgba(25, 214, 232, 0.6); background: rgba(25, 214, 232, 0.08); }

/* ---------- Layout ---------- */
.wrap { padding: 0 var(--gutter) 2.5rem; display: block; }
.card { margin: 0 auto; }

/* ---------- Hero: the video on a build plate ---------- */
.hero {
  position: relative;
  margin: 0 calc(-1 * var(--gutter));
  min-height: min(100svh, 980px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--topbar) + 2rem) var(--gutter) 5rem;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}
.plate { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.hero::after { /* fade the plate into the page floor */
  content: ""; position: absolute; inset: auto 0 0 0; height: 28%; z-index: -1;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
.hero-inner { width: min(920px, 100%); }
.hero-stage { perspective: 1400px; margin: 0 auto 2.25rem; width: min(760px, 100%); position: relative; }
.video-shell {
  width: 100%; margin: 0;
  border-radius: 20px;
  border: 1px solid rgba(25, 214, 232, 0.28);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 40px 120px -20px rgba(0,0,0,0.9),
    0 0 80px -30px rgba(25, 214, 232, 0.45);
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 6deg)) rotateY(var(--ry, 0deg)) translateZ(0);
  transition: transform 0.6s var(--ease);
  will-change: transform;
}
.glare {
  position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(600px circle at var(--gx, 50%) var(--gy, 0%), rgba(255,255,255,0.09), transparent 45%);
  mix-blend-mode: screen;
}
.stage-shadow {
  position: absolute; left: 8%; right: 8%; bottom: -34px; height: 40px;
  background: radial-gradient(ellipse at center, rgba(25, 214, 232, 0.28), transparent 70%);
  filter: blur(14px); pointer-events: none;
}
.tag { margin-bottom: 1.25rem; }
.soon { margin-bottom: 1.25rem; background: rgba(0,0,0,0.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pills { margin-bottom: 0; }
.pill { background: rgba(0, 0, 0, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-color: var(--rim-hi); color: rgba(236,238,240,0.78); }
.scroll-cue {
  position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border-radius: 14px; border: 1px solid var(--rim-hi);
  display: flex; justify-content: center; padding-top: 8px;
}
.scroll-cue span { width: 3px; height: 8px; border-radius: 2px; background: var(--cyan); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(-2px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- Glass panels ---------- */
.glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01)) , var(--raised);
  border: 1px solid var(--rim);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 30px 80px -40px rgba(0,0,0,0.9);
}

/* ---------- Account door + download doors ---------- */
.doors { width: min(760px, 100%); margin: 0 auto 1rem; gap: 1.25rem; align-items: center; }
.auth { width: min(440px, 100%); padding: 1.5rem; border-radius: 20px; }
.auth input { min-height: 48px; transition: border-color 0.2s, background 0.2s; }
.auth input:hover { border-color: var(--rim-hi); }
.auth input:focus { outline: none; border-color: rgba(25, 214, 232, 0.7); box-shadow: 0 0 0 4px rgba(25, 214, 232, 0.14); }
.auth button[type="submit"] { box-shadow: 0 10px 30px -10px rgba(25, 214, 232, 0.6); transition: transform 0.15s, box-shadow 0.2s, filter 0.2s; }
.auth button[type="submit"]:hover { filter: brightness(1.08); box-shadow: 0 14px 36px -10px rgba(25, 214, 232, 0.75); }
.auth button[type="submit"]:active { transform: translateY(1px); }
.stores { width: 100%; }
.store-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.75rem; }
.get {
  flex-direction: row; justify-content: flex-start; gap: 0.85rem; text-align: left;
  min-height: 64px; padding: 0.75rem 1rem; border-radius: 14px;
  border: 1px solid var(--rim-hi); background: var(--raised);
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.get:hover { transform: translateY(-2px); border-color: rgba(25, 214, 232, 0.5); }
.get-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.get-ico { flex: 0 0 auto; width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.9; }
.get.is-match { order: -1; box-shadow: 0 12px 34px -14px rgba(25, 214, 232, 0.8); }
.get.is-match:hover { background: var(--cyan); filter: brightness(1.06); }
.stores-note { font-size: 0.82rem; color: var(--faint); margin-top: 0.4rem; }

/* ---------- Features ---------- */
.features { width: min(1040px, 100%); padding-top: 5rem; gap: 1.5rem; }
.features-head { text-align: center; margin-bottom: 1rem; }
.features-title { font-size: clamp(1.7rem, 4.6vw, 2.8rem); line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; margin-top: 0.6rem; }
.feature {
  position: relative; overflow: hidden;
  border-radius: 28px; padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 4vw, 3rem) 0;
  gap: 2rem; text-align: center;
}
.feature::before { /* faint bed grid behind the phones */
  content: ""; position: absolute; inset: 40% 0 0 0; pointer-events: none;
  background:
    linear-gradient(rgba(25,214,232,0.08) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(90deg, rgba(25,214,232,0.08) 1px, transparent 1px) 0 0 / 36px 36px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 40%, transparent);
  transform: perspective(600px) rotateX(55deg); transform-origin: bottom;
}
.feature-copy { max-width: 560px; margin: 0 auto; position: relative; }
.feature-num { display: inline-block; font-size: 0.75rem; letter-spacing: 0.2em; color: var(--cyan); border: 1px solid var(--cyan-dim); border-radius: 999px; padding: 0.25rem 0.6rem; margin-bottom: 0.9rem; }
.feature h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); letter-spacing: -0.01em; margin-bottom: 0.6rem; }
.feature p { font-size: 1rem; line-height: 1.6; }
.feature-shots { display: flex; justify-content: center; gap: clamp(0.75rem, 3vw, 2rem); perspective: 1600px; position: relative; flex-wrap: nowrap; }
.phone {
  width: min(280px, 72vw); margin: 0;
  padding: 9px; border-radius: 40px 40px 0 0; border-bottom: 0;
  background: linear-gradient(160deg, #2a2f35, #0c0e10 40%, #16191c);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 -10px 60px -20px rgba(25, 214, 232, 0.35);
  transform: rotateX(22deg) translateY(60px) scale(0.94);
  transform-origin: bottom center;
  transition: transform 1.1s var(--ease);
  margin-bottom: -1px;
}
.phone img { width: 100%; height: auto; display: block; border-radius: 32px 32px 0 0; }
.feature-pair .phone { width: min(250px, 42vw); }
.feature-pair .phone-l { --ry: 10deg; }
.feature-pair .phone-r { --ry: -10deg; }
.feature.is-in .phone { transform: rotateX(0) rotateY(var(--ry, 0deg)) translateY(0) scale(1); }
.feature-shots { max-height: 420px; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent); mask-image: linear-gradient(to bottom, #000 78%, transparent); }

/* ---------- Layer-by-layer reveal ---------- */
.reveal { position: relative; }
.js .reveal { clip-path: inset(100% 0 0 0 round 28px); opacity: 0.2; }
.js .reveal.is-in { animation: print-up 1.15s var(--ease) forwards; }
.js .reveal.is-in::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 18px var(--cyan);
  animation: nozzle 1.15s var(--ease) forwards;
}
@keyframes print-up {
  from { clip-path: inset(100% 0 0 0 round 28px); opacity: 0.2; }
  to { clip-path: inset(0 0 0 0 round 28px); opacity: 1; }
}
@keyframes nozzle { from { top: 100%; opacity: 1; } 85% { opacity: 1; } to { top: 0; opacity: 0; } }

/* ---------- Footer ---------- */
.foot {
  margin-top: 4rem; padding: 1.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--rim);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem 1.5rem;
  text-align: left;
}
.foot-brand { display: flex; gap: 0.9rem; align-items: baseline; color: var(--muted); }
.foot-tag { font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; align-items: center; }
.foot-links a { padding: 0.5rem 0; }

/* ---------- Phone widths ---------- */
@media (max-width: 640px) {
  :root { --topbar: 54px; }
  .tb-link { display: none; }
  .tb-word { opacity: 1; }
  .hero { min-height: auto; padding: calc(var(--topbar) + 1.5rem) var(--gutter) 3rem; }
  .video-shell { border-radius: 16px; }
  .hero-stage { margin-bottom: 1.6rem; }
  .tag { letter-spacing: 0.26em; }
  .pills { gap: 0.5rem; }
  .pill { font-size: 0.78rem; padding: 0.45rem 0.75rem; }
  .scroll-cue { display: none; }
  .auth { padding: 1.25rem; border-radius: 18px; }
  .store-row { grid-template-columns: 1fr; }
  .features { padding-top: 3.5rem; }
  .feature { border-radius: 22px; padding-top: 1.5rem; gap: 1.5rem; }
  .feature p { font-size: 0.95rem; }
  .feature-shots { max-height: 340px; }
  .phone { border-radius: 32px 32px 0 0; padding: 7px; }
  .phone img { border-radius: 26px 26px 0 0; }
  .feature-pair .phone { width: 44vw; }
  .foot { flex-direction: column; align-items: flex-start; }
}

/* ---------- Motion off ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .reveal.is-in { clip-path: none; opacity: 1; animation: none; }
  .js .reveal.is-in::after { display: none; }
  .phone, .feature.is-in .phone { transform: none; transition: none; }
  .video-shell { transform: none; transition: none; }
  .scroll-cue span { animation: none; }
}

/* Touch screens: no pointer to follow, so the stage breathes on its own. */
@media (pointer: coarse) and (prefers-reduced-motion: no-preference) {
  .video-shell { animation: drift 10s ease-in-out infinite alternate; }
  @keyframes drift {
    from { transform: rotateX(7deg) rotateY(-3deg); }
    to { transform: rotateX(4deg) rotateY(3deg); }
  }
}

/* ===== v2: space, not a grid; black glass, not gray ===== */
:root {
  --raised: rgba(2, 6, 9, 0.62);
  --overlay: rgba(0, 0, 0, 0.6);
  --rim: rgba(25, 214, 232, 0.16);
  --rim-hi: rgba(25, 214, 232, 0.3);
}
.space { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; display: block; pointer-events: none; }
body { background: #000; }
.wrap, .card { position: relative; z-index: 0; }
.hero { isolation: auto; }
.hero::after { display: none; }
.feature::before { display: none; }

.glass, .auth {
  background: linear-gradient(180deg, rgba(25, 214, 232, 0.05), rgba(0, 0, 0, 0) 40%), rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  backdrop-filter: blur(14px) saturate(130%);
  border: 1px solid var(--rim);
  box-shadow: 0 1px 0 rgba(25, 214, 232, 0.12) inset, 0 0 60px -30px rgba(25, 214, 232, 0.35), 0 40px 90px -40px #000;
}
.auth input { background: rgba(0, 0, 0, 0.7); border-color: rgba(25, 214, 232, 0.14); }
.auth input:hover { border-color: rgba(25, 214, 232, 0.3); }
.get { background: rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-color: var(--rim); }
.get.is-match { background: var(--cyan); }
.session button, .session .install.is-soon { background: rgba(0, 0, 0, 0.6); border-color: var(--rim); }
.pill { background: rgba(0, 0, 0, 0.6); border-color: var(--rim); }
.tb-cta { background: rgba(0, 0, 0, 0.5); border-color: var(--rim-hi); }
.topbar.is-scrolled { background: rgba(0, 0, 0, 0.55); border-bottom-color: rgba(25, 214, 232, 0.12); }
.video-shell { background: #000; }

/* phones: black glass bezel with a cyan edge light instead of gray metal */
.phone {
  background: #000;
  box-shadow:
    0 0 0 1px rgba(25, 214, 232, 0.35) inset,
    0 0 0 2px rgba(0, 0, 0, 0.9) inset,
    0 -20px 70px -24px rgba(25, 214, 232, 0.55);
}
.feature-num { background: rgba(0, 0, 0, 0.6); }
.foot { border-top-color: rgba(25, 214, 232, 0.12); }
/* let the phone glow fall off naturally instead of stopping at a hidden box edge */
.feature-shots {
  margin: -60px calc(-1 * clamp(1.25rem, 4vw, 3rem)) 0;
  padding: 60px clamp(1.25rem, 4vw, 3rem) 0;
  max-height: 480px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 60px, #000 80%, transparent);
  mask-image: linear-gradient(to bottom, transparent 0, #000 60px, #000 80%, transparent);
}
@media (max-width: 640px) { .feature-shots { max-height: 400px; } }

/* ===== v3: two reels, one screen ===== */
.video-shell { position: relative; aspect-ratio: 16 / 9; }
.video-shell .reel {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.9s ease;
}
.video-shell .reel.is-on { opacity: 1; }
.chapters {
  display: flex; justify-content: center; gap: 0.75rem;
  margin: 1.1rem auto 0; width: min(360px, 100%);
}
.chapter {
  flex: 1; display: flex; flex-direction: column; gap: 0.45rem; align-items: stretch;
  background: none; border: 0; padding: 0.4rem 0; cursor: pointer; font: inherit;
  color: var(--faint); transition: color 0.2s;
}
.chapter:hover, .chapter.is-on { color: var(--text); }
.chapter-bar { height: 2px; border-radius: 2px; background: rgba(236, 238, 240, 0.14); overflow: hidden; }
.chapter-bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.chapter-label { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; text-align: left; }
.hero-stage { margin-bottom: 2rem; }
.stage-shadow { bottom: 10px; }

/* ===== v3: panels materialize like a scan, stronger than v2 ===== */
.js .reveal.is-in { animation: materialize 1.4s var(--ease) forwards; }
@keyframes materialize {
  0%   { clip-path: inset(100% 0 0 0 round 28px); opacity: 0.4; filter: brightness(2.2) saturate(0.4) blur(3px); }
  60%  { opacity: 1; filter: brightness(1.3) saturate(0.8) blur(0.5px); }
  100% { clip-path: inset(0 0 0 0 round 28px); opacity: 1; filter: none; }
}
.js .reveal.is-in::after {
  height: 90px; margin-top: -2px;
  background:
    linear-gradient(to bottom, rgba(25, 214, 232, 0.95) 0, rgba(25, 214, 232, 0.95) 2px, rgba(25, 214, 232, 0.22) 3px, transparent 90px),
    repeating-linear-gradient(to bottom, rgba(25, 214, 232, 0.18) 0 1px, transparent 1px 4px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  box-shadow: none;
  animation: scanline 1.4s var(--ease) forwards;
}
@keyframes scanline { from { top: 100%; opacity: 1; } 80% { opacity: 1; } to { top: 0; opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .js .reveal.is-in { animation: none; filter: none; }
  .video-shell .reel { transition: none; }
}

/* ===== v4: two doors, Android asks for the Play testing link ===== */
.store-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
button.get { font: inherit; font-weight: 600; cursor: pointer; width: 100%; color: var(--text); }
button.get.is-match { color: #041014; }
button.get[aria-expanded="true"] { border-color: rgba(25, 214, 232, 0.6); }
.access {
  margin-top: 0.75rem; padding: 1.1rem 1.25rem; border-radius: 16px; text-align: left;
  animation: access-in 0.45s var(--ease);
}
@keyframes access-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.access-title { color: var(--text); font-weight: 600; font-size: 0.98rem; margin-bottom: 0.35rem; }
.access-copy { color: var(--muted); font-size: 0.9rem; line-height: 1.5; margin-bottom: 0.9rem; }
.access-cta {
  display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 12px;
  background: var(--cyan); color: #041014; font-weight: 600; text-decoration: none;
  box-shadow: 0 10px 30px -10px rgba(25, 214, 232, 0.6);
}
.access-cta:hover { filter: brightness(1.08); }
.access-note { color: var(--faint); font-size: 0.8rem; margin-top: 0.7rem; letter-spacing: 0.01em; }
.access-note a { color: var(--cyan); }
.chapter.is-done { color: var(--muted); }
@media (max-width: 640px) { .store-row { grid-template-columns: 1fr; } }
.js .reveal.is-done { animation: none; clip-path: none; opacity: 1; filter: none; }
.js .reveal.is-done::after { display: none; }

/* ===== v5: no white type; everything that was white reads in the brand cyan ===== */
:root { --text: #19d6e8; }
.features-title { margin-top: 0; }
.chapter.is-on, .chapter:hover { color: var(--cyan); }
:root { --muted: rgba(25, 214, 232, 0.74); --faint: rgba(25, 214, 232, 0.48); }
.pill { color: var(--muted); }
::selection { color: #041014; background: rgba(25, 214, 232, 0.6); }
.chapters { width: min(520px, 100%); }
@media (max-width: 640px) { .chapter-label { font-size: 0.64rem; letter-spacing: 0.14em; } }

/* Shown only when the phone refused autoplay: one tap starts the reel. */
.reel-play {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  border: 1px solid rgba(25, 214, 232, 0.6); background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 0 40px -6px rgba(25, 214, 232, 0.7); cursor: pointer;
}
.reel-play svg { width: 30px; height: 30px; fill: var(--cyan); margin-left: 4px; }
.video-shell.is-blocked .reel-play { display: flex; }

/* Signed in: open the web app, or get the app from a store. Phones lead with their store. */
.session.is-on { display: flex; flex-direction: column; }
.session-stores { display: flex; flex-direction: column; gap: 0.55rem; margin: 0.15rem 0 0.55rem; }
.session-stores .get { min-height: 56px; }
.auth.is-phone.is-in .session-stores { order: 1; }
.auth.is-phone.is-in #hub-install { order: 2; padding: 0 1rem; text-align: center; background: rgba(0, 0, 0, 0.6); border: 1px solid var(--rim-hi); color: var(--cyan); }
.auth.is-phone.is-in #hub-signout { order: 3; }
.auth.is-phone.is-in .session-stores .get:not(.is-match) { display: none; }
/* Signed in, the panel carries the store doors, so the row below steps aside. */
.doors:has(.auth.is-in) .store-row { display: none; }
/* Every store door lines up the same: icon, then left-aligned text (a <button> centers by default). */
button.get, .get { justify-content: flex-start; text-align: left; }
.get-text { text-align: left; align-items: flex-start; }
