/* Apple-like marketing system: large type, sticky story, scroll-driven motion */

:root {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --bg-dark: #000000;
  --bg-soft: #fbfbfd;
  --text: #1d1d1f;
  --text-light: #f5f5f7;
  --muted: #6e6e73;
  --muted-light: #a1a1a6;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --border: rgba(0, 0, 0, 0.08);
  --nav-h: 52px;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: -0.022em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

code {
  font-family: var(--mono);
  font-size: 0.92em;
  letter-spacing: 0;
}

/* —— Page veil (soft crossfade, not wipe) —— */
.page-veil {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  background: #000;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}

.page-veil.is-on {
  pointer-events: all;
  opacity: 1;
}

/* —— Nav —— */
.apple-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(251, 251, 253, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.apple-nav.is-scrolled {
  border-bottom-color: var(--border);
  background: rgba(251, 251, 253, 0.86);
}

.apple-nav-inner {
  width: min(980px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-logo {
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav-logo:hover { text-decoration: none; opacity: 0.8; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 18px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 3px;
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 0 0 0.5px rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6e6e73;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  min-height: 28px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: 980px;
  cursor: pointer;
  transition:
    background 0.22s var(--ease),
    color 0.22s var(--ease),
    box-shadow 0.22s var(--ease),
    transform 0.18s var(--ease);
}

.lang-btn:hover {
  color: #1d1d1f;
  background: rgba(0, 0, 0, 0.04);
}

.lang-btn.is-active {
  background: #1d1d1f;
  color: #f5f5f7;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.lang-btn:active {
  transform: scale(0.97);
}

.lang-btn:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.5);
  outline-offset: 2px;
}

@media (max-width: 860px) {
  .lang-switch {
    margin-right: 2px;
  }
  .lang-btn {
    min-width: 30px;
    padding: 0 8px;
    font-size: 11px;
  }
}

.nav-menu a {
  color: var(--text);
  font-size: 12px;
  opacity: 0.88;
  text-decoration: none;
  transition: opacity 0.2s var(--ease);
}

.nav-menu a:hover { opacity: 1; text-decoration: none; }

.nav-pill {
  display: inline-flex !important;
  align-items: center;
  min-height: 28px;
  padding: 0 12px !important;
  border-radius: 980px;
  background: var(--blue);
  color: #fff !important;
  opacity: 1 !important;
  font-weight: 500;
}

.nav-pill:hover { background: var(--blue-hover); }

/* —— Buttons —— */
.btn-fill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 980px;
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: background 0.2s var(--ease), transform 0.25s var(--ease);
}

.btn-fill:hover {
  background: var(--blue-hover);
  text-decoration: none;
}

.btn-fill:active { transform: scale(0.98); }

.btn-fill.large {
  min-height: 52px;
  padding: 0 28px;
  font-size: 18px;
}

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  font-size: 17px;
  font-weight: 400;
  text-decoration: none;
}

.btn-text:hover { text-decoration: underline; text-underline-offset: 3px; }

/* —— Hero —— */
.hero-stage {
  position: relative;
  height: 160vh;
  background: var(--bg-soft);
}

.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: calc(var(--nav-h) + 24px) 20px 40px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(920px, 100%);
  text-align: center;
  will-change: transform, opacity;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: -0.01em;
}

.eyebrow.light { color: var(--muted-light); }

.hero-copy h1 {
  margin: 0;
  font-size: clamp(40px, 7.2vw, 80px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.hero-copy .line {
  display: block;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.hero-copy.is-ready .line { opacity: 1; transform: none; }
.hero-copy.is-ready .line:nth-child(2) { transition-delay: 0.1s; }

.subhead {
  margin: 22px auto 0;
  max-width: 28em;
  font-size: clamp(19px, 2.4vw, 28px);
  line-height: 1.25;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s var(--ease-out) 0.18s, transform 0.9s var(--ease-out) 0.18s;
}

.hero-cta {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 34px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s var(--ease-out) 0.28s, transform 0.9s var(--ease-out) 0.28s;
}

.hero-copy.is-ready .subhead,
.hero-copy.is-ready .hero-cta {
  opacity: 1;
  transform: none;
}

.hero-glow {
  position: absolute;
  width: min(900px, 90vw);
  height: min(900px, 90vw);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(0, 113, 227, 0.18), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(0, 0, 0, 0.05), transparent 50%);
  filter: blur(10px);
  z-index: 1;
  pointer-events: none;
  animation: glow-drift 12s ease-in-out infinite;
}

@keyframes glow-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -18px, 0) scale(1.04); }
}

/* —— Sticky story —— */
.story-stage {
  height: 280vh;
  background: #000;
  color: var(--text-light);
}

.story-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(var(--nav-h) + 20px) 20px 40px;
  overflow: hidden;
}

.story-frame {
  width: min(720px, 92vw);
  will-change: transform, opacity;
}

.device {
  border-radius: 18px;
  background: #1d1d1f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  overflow: hidden;
  transform-origin: center center;
}

.device-chrome {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  background: #2a2a2c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.device-chrome span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a3a3c;
}

.device-chrome span:nth-child(1) { background: #ff5f57; }
.device-chrome span:nth-child(2) { background: #febc2e; }
.device-chrome span:nth-child(3) { background: #28c840; }

.device-url {
  margin-left: 10px;
  flex: 1;
  min-height: 24px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-family: var(--mono);
}

.device-screen {
  position: relative;
  padding: 28px 24px 36px;
  min-height: 280px;
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 113, 227, 0.22), transparent 45%),
    linear-gradient(180deg, #141416, #0b0b0c);
}

.screen-block {
  height: 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
}

.screen-block.w80 { width: 80%; }
.screen-block.w60 { width: 60%; }
.screen-block.w90 { width: 90%; }
.screen-block.w45 { width: 45%; }

.screen-chip {
  position: absolute;
  right: 24px;
  bottom: 24px;
  padding: 8px 12px;
  border-radius: 980px;
  background: rgba(0, 113, 227, 0.22);
  color: #6cb6ff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.story-captions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8vh;
  text-align: center;
  pointer-events: none;
}

.story-cap {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(720px, 90vw);
  margin: 0;
  transform: translateX(-50%) translateY(12px);
  font-size: clamp(22px, 3.4vw, 36px);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: rgba(255, 255, 255, 0.92);
  opacity: 0;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.story-cap.is-active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* —— Statement —— */
.statement {
  padding: 22vh 20px;
  background: var(--bg);
  text-align: center;
}

.statement-text {
  margin: 0 auto;
  width: min(900px, 100%);
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.03em;
}

/* —— Bands —— */
.bands { background: var(--bg); }

.band {
  padding: 18vh 20px;
  background: var(--bg-elevated);
}

.band-dark {
  background: #000;
  color: var(--text-light);
}

.band-soft { background: var(--bg-soft); }

.band-inner {
  width: min(980px, 100%);
  margin: 0 auto;
}

.band-inner.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.band h3 {
  margin: 0 0 16px;
  font-size: clamp(32px, 4.8vw, 52px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.band-desc {
  margin: 0;
  max-width: 34em;
  font-size: 19px;
  line-height: 1.42;
  color: var(--muted);
}

.band-dark .band-desc { color: var(--muted-light); }

.token-demo {
  display: grid;
  gap: 12px;
}

.token-row {
  display: flex;
  align-items: baseline;
  gap: 2px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.04);
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
}

.token-row strong {
  color: var(--blue);
  font-size: 16px;
  font-weight: 600;
}

/* —— Flow —— */
.flow {
  padding: 18vh 20px 12vh;
  background: var(--bg);
}

.flow-head {
  width: min(980px, 100%);
  margin: 0 auto 48px;
  text-align: center;
}

.flow-head h2 {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: -0.03em;
  font-weight: 600;
}

.flow-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.flow-item {
  padding: 28px 24px 32px;
  border-radius: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.flow-num {
  display: block;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.flow-item h3 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.flow-item p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

/* —— Metrics —— */
.metrics {
  padding: 10vh 20px 16vh;
  background: var(--bg);
}

.metrics-grid {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  text-align: center;
}

.metric strong {
  display: block;
  margin-bottom: 8px;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1;
  letter-spacing: -0.035em;
  font-weight: 600;
}

.metric span {
  color: var(--muted);
  font-size: 15px;
}

/* —— Finale —— */
.finale {
  padding: 18vh 20px;
  background: #000;
  color: var(--text-light);
  text-align: center;
}

.finale-inner {
  width: min(720px, 100%);
  margin: 0 auto;
}

.finale h2 {
  margin: 0 0 12px;
  font-size: clamp(36px, 6vw, 64px);
  letter-spacing: -0.03em;
  font-weight: 600;
  line-height: 1.08;
}

.finale p {
  margin: 0 0 28px;
  color: var(--muted-light);
  font-size: 21px;
}

/* —— Footer —— */
.apple-footer {
  background: #f5f5f7;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.apple-footer-inner {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0 28px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.apple-footer a {
  color: var(--muted);
  margin-left: 14px;
}

.apple-footer a:hover { color: var(--text); }

/* —— Reveal base —— */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* —— Upload page reuse —— */
body.upload-page {
  background: var(--bg-soft);
}

.upload-shell {
  width: min(720px, calc(100% - 40px));
  margin: 0 auto;
  padding: calc(var(--nav-h) + 48px) 0 80px;
}

.upload-shell .eyebrow {
  color: var(--blue);
}

.upload-shell h1 {
  margin: 8px 0 12px;
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: -0.03em;
  font-weight: 600;
  line-height: 1.1;
}

.upload-shell .lead {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 19px;
  max-width: 34em;
}

.upload-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.04);
}

/* —— Responsive —— */
@media (max-width: 860px) {
  .band-inner.split,
  .flow-list,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .nav-menu a:not(.nav-pill) { display: none; }

  .hero-stage { height: 130vh; }
  .story-stage { height: 220vh; }

  .device-screen { min-height: 220px; }
  .story-captions { bottom: 6vh; }
}

@media (max-width: 520px) {
  .hero-cta { flex-direction: column; }
  .btn-fill, .btn-text { width: 100%; justify-content: center; }
  .apple-nav-inner,
  .apple-footer-inner,
  .upload-shell {
    width: min(100% - 28px, 980px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  [data-reveal],
  .hero-copy .line,
  .subhead,
  .hero-cta {
    opacity: 1 !important;
    transform: none !important;
  }
  .page-veil { display: none !important; }
}
