/*
 * Landing page only (index.html). Layered on top of styles.css, which the legal pages share.
 *
 * Everything that moves is driven by landing.js. Without JavaScript, or with
 * prefers-reduced-motion, the page is complete and still: the blob falls back to the CSS ball,
 * the chips sit in a row, and every .reveal element is simply visible.
 */

.landing section + section { border-top: 0; }
.landing main { position: relative; z-index: 1; }

#sky {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

em { font-style: italic; color: var(--gold); }

/* ---------- header ---------- */

.site-head-bar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(6, 10, 20, 0.55);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-head-bar.scrolled { border-bottom-color: var(--hairline); background: rgba(6, 10, 20, 0.78); }
.site-head-bar .site-head { border-bottom: 0; padding: 16px var(--gutter); }
.site-head nav { align-items: center; }
.nav-cta {
  color: var(--bg-deep) !important; background: var(--gold);
  padding: 7px 16px; border-radius: 20px; font-weight: 600;
}
@media (max-width: 680px) { .site-head nav a:not(.nav-cta):not(.lang) { display: none; } }
.site-head nav a.lang { font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em; border: 1px solid var(--hairline); border-radius: 8px; padding: 4px 8px; }

/* ---------- reveal on scroll ---------- */

.js .reveal { opacity: 0; transform: translateY(26px); filter: blur(6px);
  transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1), filter .9s ease; }
.js .reveal.in { opacity: 1; transform: none; filter: none; }

/* ---------- hero ---------- */

.landing .hero {
  min-height: calc(100svh - 64px);
  padding: clamp(28px, 6vw, 64px) 0 0;
  display: flex; flex-direction: column; justify-content: center;
  position: relative;
}
.landing .hero-grid { display: grid; gap: 12px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) { .landing .hero-grid { grid-template-columns: 1.1fr 0.9fr; } }

.landing h1 { font-size: clamp(44px, 8.4vw, 86px); line-height: 1.02; letter-spacing: -0.025em; font-weight: 400; }
.landing h2 { font-size: clamp(32px, 5vw, 54px); line-height: 1.06; letter-spacing: -0.015em; font-weight: 400; }
.hero .lede { max-width: 46ch; }

.blob-stage { min-height: clamp(280px, 42vw, 460px); position: relative; display: grid; place-items: center; }
@media (max-width: 899px) { .blob-stage { order: -1; min-height: 240px; } }
.blob-fallback {
  width: clamp(150px, 22vw, 230px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 38% 33%, #fff8e6 0%, #f1dda9 32%, var(--gold-deep) 70%, var(--gold-dim) 100%);
  box-shadow: 0 0 70px rgba(236, 217, 163, .30), 0 0 160px rgba(236, 217, 163, .15);
}
.js-blob .blob-fallback { visibility: hidden; }
.blob-hint {
  position: absolute; bottom: 4%; margin: 0;
  font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--text-primary); opacity: .85;
}
@media (max-width: 899px) { .blob-hint { display: none; } }

/* Store buttons */
.actions { margin: 30px 0 18px; }
.actions.center { justify-content: center; }
.store {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 11px 22px 11px 18px; border-radius: 16px;
  background: var(--gold); color: var(--bg-deep); text-decoration: none;
  font-weight: 600; font-size: 18px; line-height: 1.1;
  box-shadow: 0 0 0 0 rgba(236, 217, 163, .5), 0 10px 30px -10px rgba(236, 217, 163, .45);
  transition: transform .2s ease, box-shadow .3s ease, background .2s ease;
}
.store svg { width: 22px; height: 22px; flex: none; }
.store small { display: block; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.store:hover { transform: translateY(-2px); box-shadow: 0 0 0 6px rgba(236, 217, 163, .12), 0 16px 40px -12px rgba(236, 217, 163, .6); }
.store-alt { background: var(--bg-surface); color: var(--text-primary); border: 1px solid rgba(236, 217, 163, .28); box-shadow: none; }
.store-alt:hover { background: var(--bg-surface-variant); box-shadow: 0 0 0 6px rgba(236, 217, 163, .06); }

/* Thought chips: a calm row without JS; flown into the blob with it. */
.chips {
  list-style: none; margin: 36px 0 0; padding: 0 var(--gutter) 28px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.chips li, .chip-fly {
  font-size: 14.5px; color: var(--text-primary);
  background: rgba(18, 21, 29, .78); border: 1px solid rgba(236, 217, 163, .16);
  padding: 8px 14px 8px 12px; border-radius: 999px; white-space: nowrap;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.chips li::before, .chip-fly::before {
  content: attr(data-kind); margin-right: 9px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-deep);
}
.js-chips .chips { visibility: hidden; height: 0; margin: 0; padding: 0; overflow: hidden; }
.chip-fly { position: fixed; left: 0; top: 0; z-index: 2; pointer-events: none; will-change: transform, opacity; }

/* ---------- say it messy demo ---------- */

.demo {
  margin-top: 44px; border-radius: 26px; padding: 10px;
  background: linear-gradient(160deg, rgba(236, 217, 163, .10), rgba(157, 180, 212, .05) 50%, rgba(18, 21, 29, .4));
  border: 1px solid rgba(236, 217, 163, .14);
}
.demo-tabs { display: flex; gap: 6px; padding: 6px; flex-wrap: wrap; }
.demo-tabs button {
  font: 500 14px var(--sans); color: var(--text-secondary); cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: 20px; padding: 7px 16px;
  position: relative; overflow: hidden;
}
.demo-tabs button[aria-selected="true"] { color: var(--bg-deep); background: var(--gold); }
.demo-tabs button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.demo-body { display: grid; gap: 14px; grid-template-columns: 1fr; padding: 8px; }
@media (min-width: 860px) { .demo-body { grid-template-columns: 1fr 56px 1.1fr; align-items: stretch; } }

.demo-said, .demo-note {
  background: rgba(6, 10, 20, .7); border: 1px solid var(--hairline); border-radius: 20px;
  padding: 24px 24px 26px; min-height: 290px;
}
.demo-label {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-tertiary);
}
.demo-label.gold { color: var(--gold-deep); }
.rec { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.demo-voice { font-family: var(--serif); font-size: clamp(19px, 2.2vw, 23px); line-height: 1.5; color: var(--text-primary); margin: 0; }
.demo-voice .um { color: var(--text-tertiary); transition: color .5s, opacity .5s; }
.demo-voice .um.struck { text-decoration: line-through; text-decoration-color: var(--gold-dim); opacity: .45; }
.demo-voice .caret { display: inline-block; width: 2px; height: 1em; background: var(--gold); vertical-align: -0.12em; margin-left: 2px; animation: pulse 1s steps(2) infinite; }

.demo-arrow { display: none; }
@media (min-width: 860px) {
  .demo-arrow { display: block; position: relative; }
  .demo-arrow::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-deep), transparent); }
  .demo-arrow::after { content: ""; position: absolute; top: calc(50% - 4px); left: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); animation: travel 1.6s ease-in-out infinite; }
}
@keyframes travel { from { left: 0; opacity: 0; } 20%, 80% { opacity: 1; } to { left: calc(100% - 8px); opacity: 0; } }

.demo-note h3 { font-size: clamp(24px, 3vw, 30px); margin-bottom: .35em; }
.demo-note p { color: var(--text-secondary); font-size: 15.5px; }
.demo-note ul { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.demo-note li { display: flex; gap: 10px; align-items: baseline; font-size: 15px; color: var(--text-primary); }
.demo-note li::before { content: ""; width: 13px; height: 13px; flex: none; border-radius: 4px; border: 1.5px solid var(--gold-deep); transform: translateY(2px); }
.demo-note li em { font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--connection); margin-left: auto; padding-left: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { font-family: var(--mono); font-size: 12.5px; color: var(--text-secondary); background: var(--bg-surface-variant); padding: 5px 10px; border-radius: 8px; }
.demo-note > * { transition: opacity .5s ease, transform .5s ease; }
.demo-note.hidden > *:not(.demo-label) { opacity: 0; transform: translateY(10px); }
.demo-note.hidden .tags span { opacity: 0; }

.kinds { margin-top: 56px; display: grid; gap: 1px; grid-template-columns: 1fr; background: var(--hairline); border: 1px solid var(--hairline); border-radius: 20px; overflow: hidden; }
@media (min-width: 640px) { .kinds { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .kinds { grid-template-columns: repeat(3, 1fr); } }
.kind { background: rgba(10, 13, 22, .92); padding: 26px 24px; transition: background .3s; }
.kind:hover { background: rgba(26, 29, 38, .95); }
.kind span { font-family: var(--serif); font-size: 24px; color: var(--gold); }
.kind p { margin: 6px 0 0; color: var(--text-secondary); font-size: 15.5px; }

/* ---------- the loop ---------- */

.steps { margin-top: 48px; display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step-card { text-align: center; }
.step-card p { margin: 0 auto; color: var(--text-secondary); font-size: 15.5px; max-width: 32ch; }
.step-card .step { margin: 22px 0 8px; }
.js .step-card.reveal:nth-child(2) { transition-delay: .12s; }
.js .step-card.reveal:nth-child(3) { transition-delay: .24s; }

.phone {
  margin: 0 auto; width: min(260px, 70vw); aspect-ratio: 600 / 1336;
  border-radius: 36px; padding: 8px; background: linear-gradient(160deg, #2a2a2e, #0c0d12 40%, #1c1d22);
  box-shadow: 0 30px 80px -30px rgba(236, 217, 163, .35), 0 0 0 1px rgba(255,255,255,.06) inset;
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .4s ease;
}
.phone img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 28px; }

/* ---------- constellation ---------- */

.sky-section { padding-bottom: 0; }
.constellation { position: relative; width: 100%; height: clamp(360px, 52vw, 620px); margin-top: 20px; }
.constellation canvas { width: 100%; height: 100%; display: block; }

/* ---------- ask ---------- */

.ask-art {
  background: rgba(18, 21, 29, .8); border: 1px solid var(--hairline); border-radius: 24px;
  padding: 26px; display: grid; gap: 16px;
}
.bubble { border-radius: 18px; padding: 14px 18px; font-size: 16px; }
.bubble.q { justify-self: end; background: var(--connection-glow); color: var(--bg-surface); border-bottom-right-radius: 6px; max-width: 85%; font-weight: 500; }
.bubble.a { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; padding: 4px 0 0; }
.bubble.a p { margin: 0; color: var(--text-primary); font-family: var(--serif); font-size: 19px; line-height: 1.45; }
.ask-orb { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 38% 33%, #fff8e6, #f1dda9 32%, var(--gold-deep) 70%, var(--gold-dim)); box-shadow: 0 0 22px rgba(236,217,163,.5); }
.sources { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; }
.sources span { font-size: 13px; color: var(--gold); border: 1px solid rgba(236,217,163,.3); border-radius: 999px; padding: 4px 10px; }
.sources span::before { content: "✦ "; color: var(--gold-deep); }
.js .ask-art .bubble { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.js .ask-art.in .bubble.q { opacity: 1; transform: none; transition-delay: .2s; }
.js .ask-art.in .bubble.a { opacity: 1; transform: none; transition-delay: 1.1s; }

/* ---------- privacy (kept from the old page; tightened) ---------- */

.landing #privacy .facts li { background: rgba(18, 21, 29, .7); border: 1px solid var(--hairline); border-radius: 14px; padding: 14px 16px; }

/* ---------- final call ---------- */

.cta { text-align: center; padding-bottom: clamp(80px, 12vw, 140px); }
.cta-inner { display: flex; flex-direction: column; align-items: center; position: relative; }
.cta .lede, .cta p { margin-left: auto; margin-right: auto; }
.cta-blob { width: 150px; height: 150px; margin-bottom: 26px; }
.cta .qr-row { justify-content: center; }

section[id] { scroll-margin-top: 64px; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .ask-art .bubble { opacity: 1; transform: none; filter: none; transition: none; }
  .rec, .demo-arrow::after { animation: none; }
}

/* ======================================================================== phones
 * Mobile pass (thumb-first). Targets: the store button visible on the first screen at 360×780,
 * every tap target at least 44 px, no section taller than it needs to be, nothing wider than the
 * screen. Desktop is unchanged.
 */

/* Sticky install bar: phones only, shown once the hero buttons scroll away, hidden again at the
 * closing call. landing.js picks the one store that matches the device. */
.install-bar { display: none; }
@media (max-width: 899px) {
  .js .install-bar {
    display: flex; align-items: center; gap: 12px;
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 30; padding: 10px 10px 10px 14px; border-radius: 18px;
    background: rgba(18, 21, 29, .92); border: 1px solid rgba(236, 217, 163, .22);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .7);
    transform: translateY(140%); transition: transform .35s cubic-bezier(.2,.7,.2,1);
  }
  .js .install-bar.show { transform: none; }
  .install-bar .mark { width: 26px; height: 26px; border-radius: 50%; flex: none;
    background: radial-gradient(circle at 38% 33%, #fff8e6 0%, #f1dda9 32%, var(--gold-deep) 70%, var(--gold-dim) 100%); }
  .install-bar p { margin: 0; flex: 1; line-height: 1.25; font-size: 14px; color: var(--text-secondary); }
  .install-bar p strong { display: block; color: var(--text-primary); font-size: 15px; font-weight: 600; }
  .install-bar .store { padding: 10px 14px; font-size: 15px; border-radius: 12px; min-height: 44px; }
  .install-bar .store small { display: none; }
  .install-bar .store svg { width: 18px; height: 18px; }
}

@media (max-width: 899px) {
  /* Header: 44 px targets. */
  .site-head-bar .site-head { padding: 10px var(--gutter); }
  .nav-cta, .site-head nav a.lang { min-height: 44px; display: inline-flex; align-items: center; }
  .site-head nav a.lang { min-width: 44px; justify-content: center; }

  /* Hero: smaller blob stage so the copy and the store buttons reach the first screen. */
  .landing .hero { min-height: 0; padding-top: 8px; }
  .blob-stage { min-height: 196px; }
  .blob-fallback { width: 120px; }
  .landing h1 { font-size: clamp(40px, 11.5vw, 56px); }
  .hero .lede { font-size: 17px; line-height: 1.55; }
  .hero .actions { margin: 22px 0 14px; }
  .chips li, .chip-fly { font-size: 13px; padding: 6px 12px 6px 10px; }
  .chips li::before, .chip-fly::before { font-size: 9.5px; margin-right: 7px; }

  /* Store buttons: full-width pair, easy to hit with a thumb. */
  .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .actions .store { justify-content: center; padding: 11px 12px; font-size: 16px; min-height: 52px; }
  .actions .store svg { width: 18px; height: 18px; }
  .actions .store small { font-size: 9.5px; }

  /* Demo: tabs in one scrollable row; shorter panels. */
  .demo { padding: 6px; border-radius: 22px; }
  .demo-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .demo-tabs::-webkit-scrollbar { display: none; }
  .demo-tabs button { flex: none; min-height: 44px; padding: 0 18px; font-size: 15px; }
  .demo-body { padding: 4px; gap: 10px; }
  .demo-said, .demo-note { min-height: 0; padding: 18px 18px 20px; }
  .demo-said { min-height: 214px; }
  .demo-note { min-height: 250px; }
  .demo-voice { font-size: 18px; }

  /* What goes in: two compact columns instead of six tall rows. */
  .kinds { margin-top: 36px; grid-template-columns: 1fr 1fr; }
  .kind { padding: 16px 14px 18px; }
  .kind span { font-size: 19px; }
  .kind p { font-size: 13.5px; line-height: 1.5; }

  /* The loop: a swipeable row with the next phone peeking in, not three phones stacked. */
  .steps {
    display: flex; gap: 16px; margin: 32px calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter) 8px;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    scroll-padding: 0 var(--gutter);
  }
  .steps::-webkit-scrollbar { display: none; }
  .step-card { flex: 0 0 74%; scroll-snap-align: start; }
  .phone { width: 100%; border-radius: 30px; padding: 6px; }
  .phone img { border-radius: 24px; }
  .js .step-card.reveal:nth-child(n) { transition-delay: 0s; }
  .swipe-hint { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
  .swipe-hint span { width: 6px; height: 6px; border-radius: 50%; background: var(--hairline); transition: background .3s, width .3s; }
  .swipe-hint span.on { background: var(--gold); width: 18px; border-radius: 3px; }

  /* Constellation: taller canvas so the story cluster can be read; JS zooms into it. */
  .constellation { height: min(118vw, 540px); }

  /* Ask, privacy, footer: tighter, bigger targets. */
  .ask-art { padding: 18px; }
  .bubble.a p { font-size: 17px; }
  .landing #privacy .facts li { padding: 12px 14px; font-size: 15px; }
  .foot-links { gap: 4px 18px; }
  .foot-links a, .site-foot p a, #privacy a, .cta .small a { display: inline-flex; align-items: center; min-height: 44px; }
  .cta { padding-bottom: 120px; }
  .site-foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}
@media (min-width: 900px) { .swipe-hint { display: none; } }

/* ------------------------------------------------------------------------ phones, round 2
 * Hero: the blob and the thoughts flying into it get most of the first screen, then the headline
 * and the store buttons. The lede moves below the buttons, and the eyebrow is dropped on phones.
 * Steps: a card waiting off to the right must not sit 26 px low (its reveal has not run yet),
 * which made the row scroll vertically. Phones fade cards in without moving them, and the row
 * never scrolls vertically.
 */
@media (max-width: 899px) {
  .blob-stage { min-height: 0; height: min(47svh, 420px); }
  .blob-fallback { width: 32vw; max-width: 150px; }
  .hero-copy { display: flex; flex-direction: column; }
  .hero-copy .eyebrow { display: none; }
  .hero-copy h1 { order: 1; margin-bottom: 0; }
  .hero-copy .actions { order: 2; }
  .hero-copy .lede { order: 3; margin-top: 44px; }
  .steps { overflow-y: hidden; touch-action: pan-x pan-y; }
  .js .step-card.reveal { transform: none; filter: none; }
}

/* Scroll cue: two gold chevrons travelling down in turn, glowing, until the first scroll. */
.scroll-cue { display: none; }
.js .scroll-cue {
  display: block; position: fixed; z-index: 15;
  left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); width: 44px; height: 56px; margin-left: -22px;
  color: var(--gold); text-decoration: none;
  animation: cue-in .8s ease 1.6s both;
  transition: opacity .35s ease, transform .35s ease;
}
.js .scroll-cue svg {
  width: 44px; height: 56px; overflow: visible;
  filter: drop-shadow(0 0 4px rgba(236, 217, 163, .9)) drop-shadow(0 0 12px rgba(236, 217, 163, .45));
}
.js .scroll-cue path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; animation: cue-travel 1.6s ease-in-out infinite; }
.js .scroll-cue .c2 { animation-delay: .22s; }
/* A soft pool of night behind the chevrons, so they stay legible over the lede without a hard circle. */
.js .scroll-cue::before { content: ""; position: absolute; inset: -18px -26px; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(6, 10, 20, .92), rgba(6, 10, 20, .6) 55%, rgba(6, 10, 20, 0)); }
.js .scroll-cue.gone { opacity: 0 !important; pointer-events: none; transform: translateY(12px); }
@keyframes cue-travel {
  0% { opacity: 0; transform: translateY(-6px); }
  35% { opacity: 1; }
  70% { opacity: .9; }
  100% { opacity: 0; transform: translateY(8px); }
}
@keyframes cue-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .js .scroll-cue path { animation: none; opacity: 1; } }
