/* zorja.app — tokens from the app (ios/Zorja/Presentation/DesignSystem) */
@font-face { font-family: Outfit; src: url(/assets/fonts/Outfit-Regular.woff) format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: Outfit; src: url(/assets/fonts/Outfit-Medium.woff) format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: Outfit; src: url(/assets/fonts/Outfit-SemiBold.woff) format('woff'); font-weight: 600; font-display: swap; }

:root {
  color-scheme: dark;
  --bg-base: #05070D;
  --surface-card: #202020;
  --surface-control: #151515;
  --line-hairline: #2A2A2A;
  --line-outline: rgb(255 255 255 / 0.4);
  --text-primary: #FFFFFF;
  --text-secondary: #9E9E9E;
  --text-tertiary: #7A8698;
  --text-lead: rgb(255 255 255 / 0.84);
  --text-small: rgb(255 255 255 / 0.74);
  --shadow-text: 0 1px 2px rgb(5 7 13 / 0.7), 0 0 18px rgb(5 7 13 / 0.6);
  --action-primary: #0AFF74;
  --action-on-primary: #000000;
  --action-secondary: #434343;
  --data-clear-sky: #FFD60A;
  --data-aurora: #E742FD;
  --status-offline: #FF5F5F;
  --ease-rise: cubic-bezier(0.2, 0.9, 0.25, 1.06);   /* ZorjaMotion.rise, spring 0.7 s, bounce 0.12 */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --stagger: 70ms;                                   /* ZorjaMotion.stagger */
  --rise: 18px;                                      /* ZorjaMotion.riseDistance */
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg-base); }
body {
  margin: 0; min-height: 100vh; background: var(--bg-base); color: var(--text-primary);
  font: 400 17px/1.5 Outfit, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--action-primary); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 50; background: #fff; color: #000; padding: 10px 16px; border-radius: 999px; font-weight: 500; text-decoration: none; }
.skip-link:focus { top: 16px; }
[data-i="0"] { --i: 0 } [data-i="1"] { --i: 1 } [data-i="2"] { --i: 2 } [data-i="3"] { --i: 3 } [data-i="4"] { --i: 4 }

/* ---------- Sky (AuroraSkyView: rise from the horizon, "Fade to black" over 360 pt) ---------- */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--bg-base); }
.sky canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}
/* The aurora rises from the horizon (the app's RiseMask): a cover in bg/base, one and a
   half skies tall with a soft lower third, slides up and away. Sized to the sky itself,
   so it works for the full-screen sky and the shorter one on other pages. */
.sky-rise {
  position: absolute; left: 0; right: 0; top: 0; height: 150%;
  background: linear-gradient(to top, rgb(5 7 13 / 0) 0%, var(--bg-base) 33.333%);
  animation: sky-rise 2.4s ease-out 0.15s forwards;
}
@keyframes sky-rise { to { transform: translateY(-100%); } }
.sky-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 360px;
  background: linear-gradient(to bottom, rgb(5 7 13 / 0) 0%, rgb(5 7 13 / 0.85) 55%, var(--bg-base) 100%);
}
.subpage .sky { height: 620px; position: absolute; overflow: hidden; }

/* ---------- Header ---------- */
.nav {
  position: relative; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  max-width: 1280px; margin: 0 auto; padding: 22px var(--gutter);
}
.brand { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 600; font-size: 22px; letter-spacing: -0.03em; }
.nav nav { display: flex; gap: clamp(16px, 3vw, 32px); }
.nav nav a { text-decoration: none; color: var(--text-lead); font-weight: 500; font-size: 15px; padding: 10px 0; transition: color 0.2s; }
.nav nav a:hover { color: #fff; }

/* ---------- Type ---------- */
.display { font-weight: 600; font-size: clamp(52px, 9.4vw, 128px); line-height: 0.96; letter-spacing: -0.045em; margin: 0; text-wrap: balance; }
.display .line { display: block; overflow: clip; padding-bottom: 0.06em; }
.display-s { font-weight: 600; font-size: clamp(44px, 6.4vw, 88px); line-height: 0.98; letter-spacing: -0.04em; margin: 0; }
.title { font-weight: 600; font-size: clamp(36px, 4.4vw, 60px); line-height: 1.02; letter-spacing: -0.04em; margin: 0; text-wrap: balance; }
p.lead, .body { text-shadow: var(--shadow-text); }
.lead { font-size: clamp(18px, 1.7vw, 22px); line-height: 1.45; color: var(--text-lead); max-width: 34ch; margin: 24px auto 0; text-wrap: pretty; }
.body { font-size: clamp(17px, 1.4vw, 19px); line-height: 1.55; color: var(--text-lead); max-width: 40ch; margin: 22px 0 0; text-wrap: pretty; }
.kicker { margin: 0 0 14px; font-size: 13px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-small); }
.fine { margin: 20px 0 0; font-size: 15px; color: var(--text-small); text-shadow: var(--shadow-text); }
.muted { color: var(--text-secondary); }

/* ---------- Hero ---------- */
.hero { position: relative; z-index: 3; will-change: transform, opacity; min-height: 100svh; display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(40px, 11vh, 140px) var(--gutter) 0; }
.hero .lead { margin-bottom: 34px; }

.rise { display: inline-block; opacity: 0; transform: translateY(var(--rise)); filter: blur(6px); }
.ready .rise { animation: rise 0.9s var(--ease-rise) forwards; animation-delay: calc(0.25s + var(--i, 0) * var(--stagger) * 1.6); }
.display .rise { transform: translateY(0.9em); }
@keyframes rise { to { opacity: 1; transform: none; filter: none; } }

/* App Store badge: Apple's black badge (replace with Apple's official artwork before release). */
.store-badge {
  display: inline-flex; align-items: center; gap: 10px; height: 60px; padding: 0 22px 0 18px; border-radius: 14px;
  background: #000; color: #fff; text-decoration: none; border: 1px solid #A6A6A6;
  transition: transform 0.35s var(--ease-rise), box-shadow 0.35s, border-color 0.35s;
}
.store-badge span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.store-badge small { font-size: 12px; letter-spacing: 0.01em; }
.store-badge strong { font-size: 25px; font-weight: 600; letter-spacing: -0.02em; margin-top: 3px; }
.store-badge:hover { transform: translateY(-2px); border-color: #fff; box-shadow: 0 18px 40px -16px rgb(10 255 116 / 0.45); }
.store-badge:active { transform: scale(0.98); }

/* ---------- Phone ---------- */
.phone-rig {
  --pw: 340px;
  position: fixed; left: 50%; top: 50%; z-index: 2; width: var(--pw); pointer-events: none;
  transform: translate(-50%, -50%); will-change: transform;
}
.phone-intro { opacity: 0; }
.ready .phone-intro { animation: phone-in 1.4s var(--ease-out) 0.6s forwards; }
@keyframes phone-in { from { opacity: 0; transform: translateY(14vh); } to { opacity: 1; transform: none; } }

.phone {
  position: relative; width: 100%; padding: 4.2%; border-radius: calc(var(--pw) * 0.165);
  background: #0b0b0c;
  box-shadow:
    0 0 0 1px #2e3035,            /* titanium band */
    0 0 0 2.5px #17181a,
    0 50px 100px -30px rgb(0 0 0 / 0.75), 0 24px 48px -24px rgb(0 0 0 / 0.6);
}
.phone .hw { position: absolute; width: 3px; border-radius: 2px; background: #2a2c30; }
.hw-action { left: -4px; top: 17%; height: 4.5%; }
.hw-up { left: -4px; top: 25%; height: 8%; }
.hw-down { left: -4px; top: 35%; height: 8%; }
.hw-power { right: -4px; top: 28%; height: 12%; }
.screen {
  position: relative; aspect-ratio: 402 / 874; border-radius: calc(var(--pw) * 0.14); overflow: hidden;
  background: #000; isolation: isolate;
}
.shot { position: absolute; inset: 0; opacity: 0; transform: scale(1.035); filter: blur(10px);
  transition: opacity 0.75s var(--ease-out), transform 0.9s var(--ease-out), filter 0.75s var(--ease-out); }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot.is-active { opacity: 1; transform: none; filter: none; }
.island { position: absolute; z-index: 2; top: 2.6%; left: 50%; width: 31%; height: 4.3%; transform: translateX(-50%); border-radius: 999px; background: #000; }
.glare { display: none; }

/* ---------- Story (pinned phone) ---------- */
.story { position: relative; z-index: 3; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr); gap: 48px; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.phone-slot { position: relative; }
.step { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; padding: 4vh 0; }
.chapter { margin: 0; font-weight: 600; font-size: clamp(52px, 7vw, 104px); line-height: 0.98; letter-spacing: -0.045em; text-wrap: balance; }
.word { display: block; opacity: 0.1; transform: translateY(26px); filter: blur(10px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-rise), filter 1s var(--ease-out); transition-delay: calc(var(--i) * 140ms); }
.step.in .word { opacity: 1; transform: none; filter: none; }

.reveal { opacity: 0; transform: translateY(28px); filter: blur(8px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-rise), filter 0.9s var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger) * 1.5); }
.reveal.in, .in > .reveal { opacity: 1; transform: none; filter: none; }

/* ---------- Place check ---------- */
.check { position: relative; z-index: 3; max-width: 760px; margin: 0 auto; padding: 14vh var(--gutter) 6vh; text-align: center; display: flex; flex-direction: column; align-items: center; }
.check .body { margin-left: auto; margin-right: auto; }
.check-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; margin-top: 34px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--action-primary); color: var(--action-on-primary); font: 600 17px Outfit, system-ui, sans-serif; cursor: pointer;
  transition: transform 0.3s var(--ease-rise), box-shadow 0.3s;
}
.btn-primary:hover { box-shadow: 0 0 0 6px rgb(10 255 116 / 0.18); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.or { color: var(--text-small); font-size: 15px; text-shadow: var(--shadow-text); }
.select { position: relative; display: inline-flex; align-items: center; }
.select select {
  appearance: none; -webkit-appearance: none; min-height: 56px; padding: 0 48px 0 22px; border-radius: 999px;
  background: var(--surface-control); color: #fff; border: 1px solid var(--line-outline); font: 500 17px Outfit, system-ui, sans-serif; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.select select:hover { border-color: #fff; }
.select svg { position: absolute; right: 20px; pointer-events: none; color: var(--text-secondary); }

.result {
  width: 100%; max-width: 560px; margin-top: 40px; padding: 28px 28px 24px; border-radius: 28px; text-align: left;
  background: rgb(21 21 21 / 0.86); border: 1px solid var(--line-hairline); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  animation: card-in 0.7s var(--ease-rise);
}
@keyframes card-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.result > * { margin: 0; }
.result.is-loading .result-headline, .result.is-loading .result-lead { animation: breathe 1.2s ease-in-out infinite alternate; }
@keyframes breathe { from { opacity: 0.45; } to { opacity: 1; } }
.result-place { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.4; color: var(--text-lead); }
.result-place svg { flex: none; margin-top: 1px; }
.result-headline { margin-top: 18px !important; font-weight: 600; font-size: clamp(34px, 5vw, 44px); line-height: 1.06; letter-spacing: -0.04em; }
.result-headline u, .result-bottom u { text-decoration-thickness: 0.07em; text-underline-offset: 0.12em; }
.result-lead { margin-top: 12px !important; font-size: 17px; line-height: 1.45; color: var(--text-lead); }
.result-bottom { margin-top: 22px !important; padding-top: 18px; border-top: 1px solid var(--line-hairline); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; }
.result-bottom:empty { display: none; }
.result-meta { margin-top: 14px !important; font-size: 13px; color: var(--text-secondary); }
.note { margin: 28px 0 0; font-size: 15px; line-height: 1.5; color: var(--text-small); text-shadow: var(--shadow-text); max-width: 46ch; }

/* ---------- Outro + footer ---------- */
.outro { position: relative; z-index: 3; text-align: center; padding: 18vh var(--gutter) 12vh; display: flex; flex-direction: column; align-items: center; }
.outro .body { margin: 22px auto 36px; }
.footer {
  position: relative; z-index: 3; max-width: 1240px; margin: 0 auto; padding: 36px var(--gutter) calc(48px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-hairline); display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: center; justify-content: space-between; font-size: 14px;
}
.footer p { margin: 0; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.footer nav { display: flex; gap: 24px; }
.footer nav a { color: var(--text-secondary); text-decoration: none; padding: 10px 0; }
.footer nav a:hover { color: #fff; }

/* ---------- Subpages (support, privacy) ---------- */
.page { position: relative; z-index: 3; max-width: 820px; margin: 0 auto; padding: clamp(48px, 12vh, 120px) var(--gutter) 40px; }
.page h1 { margin: 0 0 18px; }
.page .lead { margin: 0; max-width: 40ch; text-align: left; }
.faq { margin-top: 64px; border-top: 1px solid var(--line-hairline); }
.faq details { border-bottom: 1px solid var(--line-hairline); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 2px; font-size: clamp(18px, 2vw, 21px); font-weight: 500; letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--action-primary); }
.faq .plus { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-outline); display: grid; place-items: center; transition: transform 0.45s var(--ease-rise), background 0.3s, color 0.3s; }
.faq details[open] .plus { transform: rotate(45deg); background: #fff; color: #000; }
.faq details p { margin: 0; padding: 0 2px 26px; color: var(--text-lead); max-width: 64ch; }
.faq details[open] p { animation: open 0.5s var(--ease-out); }
@keyframes open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.prose { margin-top: 48px; color: var(--text-lead); }
.prose h2 { color: #fff; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 44px 0 10px; }
.prose p, .prose li { max-width: 68ch; }
.prose ul { padding-left: 20px; }
.prose li { margin: 8px 0; }
.prose a { color: #fff; text-decoration-color: var(--line-outline); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: #fff; }
.prose strong { color: #fff; font-weight: 500; }
.effective { margin-top: 18px; font-size: 14px; color: var(--text-tertiary); }

/* ---------- Small screens: phone pinned at the top, words beneath ---------- */
@media (max-width: 959px) {
  .story { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .phone-slot { display: none; }
  .step { min-height: 100svh; justify-content: flex-end; padding: 0 0 12svh; }
  .chapter { font-size: clamp(44px, 12.5vw, 72px); }
  .title { font-size: clamp(32px, 9vw, 44px); }
  .nav nav a[href="#tonight"] { display: none; }
  .check { padding-top: 14vh; }
  .check-controls { flex-direction: column; width: 100%; }
  .btn-primary, .select, .select select { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sky-rise { display: none; }
  .rise, .reveal, .word, .phone-intro { opacity: 1 !important; transform: none !important; filter: none !important; animation: none !important; transition: none !important; }
  .shot { transition: opacity 0.2s linear; transform: none; filter: none; }
  .result, .faq details[open] p { animation: none; }
}

[hidden] { display: none !important; }
