:root {
  color-scheme: light;
  --bg: #fbfbfd;
  --bg-alt: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --blue: #0071e3;
  --blue-dark: #0058b0;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.14);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 57px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, ui-sans-serif, system-ui, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(0, 0, 0, 0);
  background: rgba(251, 251, 253, 0.7);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  transition:
    padding 300ms var(--ease),
    background 300ms var(--ease),
    border-color 300ms var(--ease);
}

.site-header.is-scrolled {
  padding-top: 10px;
  padding-bottom: 10px;
  background: rgba(251, 251, 253, 0.9);
  border-bottom-color: var(--line);
}

.brand,
.site-header nav,
.hero-actions,
.site-footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.brand img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.site-header nav {
  gap: clamp(16px, 3vw, 32px);
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.site-header nav a {
  transition: color 200ms ease;
}

.site-header nav a:hover {
  color: var(--ink);
}

/* ---------- Type ---------- */

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(40px, 7vw, 80px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

h3 {
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lead {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: clamp(19px, 2.4vw, 24px);
  font-weight: 400;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Reveal-on-scroll ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 800ms var(--ease),
    transform 800ms var(--ease);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal="fade"] {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Hero (pinned, scroll-driven, multi-phase) ---------- */

.hero-pin {
  position: relative;
  height: 290vh;
}

.hero-pin__sticky {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  height: calc(100svh - var(--header-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(10px, 2vh, 20px) clamp(16px, 5vw, 40px);
  gap: clamp(18px, 3.2vh, 32px);
  text-align: center;
}

.device-stage {
  order: 1;
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-left {
  order: 2;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.6vh, 16px);
  width: 100%;
}

.hero-copy-stack {
  position: relative;
  width: 100%;
  max-width: 640px;
  height: clamp(88px, 15vh, 130px);
  flex: 0 0 auto;
}

.hero-phase {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 560ms var(--ease),
    transform 560ms var(--ease);
  pointer-events: none;
}

.hero-phase.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.hero-phase .eyebrow {
  margin-bottom: 6px;
}

.hero-phase h1 {
  margin-bottom: 6px;
  font-size: clamp(22px, 3.6vh, 40px);
}

.hero-phase .lead {
  margin-bottom: 0;
  font-size: clamp(14px, 1.9vh, 18px);
}

.hero-actions {
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  flex: 0 0 auto;
}

.hero-actions .button {
  min-height: 44px;
}

/* iPhone Air style device mockup: titanium band, uniform ultra-thin
   bezel, Dynamic Island. Corner radii follow real device proportions
   (~15% of width / ~6.9% of height). */
.iphone-frame {
  position: relative;
  aspect-ratio: 1290 / 2796;
  background: #050505;
  border-radius: 15% / 6.9%;
  box-shadow:
    0 0 0 1px rgba(160, 162, 168, 0.9),
    0 0 0 3.5px #d4d6da,
    0 0 0 4.5px rgba(90, 92, 97, 0.5),
    0 34px 90px rgba(0, 0, 0, 0.28);
}

.iphone-frame__island {
  position: absolute;
  top: 2.3%;
  left: 50%;
  transform: translateX(-50%);
  width: 24%;
  height: 2.2%;
  background: #000;
  border-radius: 100px;
  z-index: 5;
}

/* Uniform ultra-thin bezel: inset percentages are relative to the
   frame's own box (top/bottom vs height, left/right vs width), unlike
   percentage padding which resolves against the PARENT width and
   produced a fat, distorted bezel. 2.1% of width == 0.97% of height
   for the 1290/2796 aspect, so the bezel is even on all sides. */
.iphone-frame__screen {
  position: absolute;
  top: 0.97%;
  bottom: 0.97%;
  left: 2.1%;
  right: 2.1%;
  overflow: hidden;
  border-radius: 12.5% / 5.8%;
  background: #000;
}

.iphone-frame__screen img,
.iphone-frame__screen video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}

.device-frame {
  height: min(46vh, 460px);
  max-height: 100%;
  margin: 0 auto;
}

/* Crossfade: the incoming media fades in ON TOP of the still-opaque
   outgoing media, so the screen is always fully covered by real
   content -- never a blend of two translucent layers over black.
   The outgoing layer holds its opacity for the fade duration (0ms
   transition + delay), then snaps to 0 once fully covered. */
.device-media {
  opacity: 0;
  z-index: 1;
  transition: opacity 0ms linear 700ms;
}

.device-media.is-active {
  opacity: 1;
  z-index: 2;
  transition: opacity 640ms var(--ease);
}

.phase-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
}

.phase-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  transition:
    background 320ms var(--ease),
    transform 320ms var(--ease);
}

.phase-dot.is-active {
  background: var(--ink);
  transform: scale(1.35);
  animation: dot-pop 420ms var(--ease);
}

@keyframes dot-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(2);
  }
  100% {
    transform: scale(1.35);
  }
}

/* Larger viewports: same centered composition, scaled up. */
@media (min-width: 700px) {
  .hero-pin__sticky {
    gap: clamp(24px, 3.6vh, 40px);
  }

  .hero-copy-stack {
    max-width: 720px;
    height: clamp(120px, 18vh, 170px);
  }

  .hero-phase h1 {
    font-size: clamp(34px, 5vh, 58px);
  }

  .hero-phase .lead {
    font-size: clamp(17px, 2.2vh, 22px);
  }

  .device-frame {
    height: min(56vh, 580px);
  }
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 100px;
  padding: 0 24px;
  font-weight: 500;
  font-size: 16px;
  transition:
    transform 220ms var(--ease),
    opacity 220ms var(--ease),
    background 220ms var(--ease);
}

.button:hover {
  opacity: 0.86;
}

.button.primary {
  background: var(--ink);
  color: white;
}

.button.link {
  color: var(--blue);
  padding: 0 4px;
  min-height: auto;
}

.button.link:hover {
  color: var(--blue-dark);
  opacity: 1;
}

.dark .button.link {
  color: #2997ff;
}

/* ---------- Statement bands ---------- */

.statement-band {
  padding: clamp(80px, 13vw, 160px) clamp(20px, 6vw, 86px);
  text-align: center;
  background: var(--bg);
}

.statement-band.dark {
  background: #000;
  color: #f5f5f7;
}

.statement {
  max-width: 760px;
  margin: 0 auto;
}

/* ---------- Feature detail (bottom, in-depth) ---------- */

.feature-detail {
  padding: clamp(80px, 12vw, 140px) clamp(20px, 6vw, 86px);
  background: var(--bg);
}

.feature-detail__intro {
  max-width: 640px;
  margin: 0 auto clamp(56px, 9vw, 96px);
  text-align: center;
}

.feature-row {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
}

.feature-row + .feature-row {
  margin-top: clamp(72px, 11vw, 140px);
}

.feature-row.reverse .feature-copy {
  order: 2;
}

.feature-row.reverse .feature-shot {
  order: 1;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: var(--bg-alt);
  color: var(--ink);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature-copy {
  max-width: 460px;
}

.feature-copy p {
  color: var(--muted);
  font-size: 17px;
}

.feature-shot .iphone-frame {
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
}

.cta-band {
  padding: clamp(72px, 12vw, 140px) clamp(20px, 6vw, 86px);
  text-align: center;
  background: var(--bg-alt);
}

.cta-band .hero-actions {
  margin-top: 28px;
}

/* ---------- Footer ---------- */

.site-footer {
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  padding: 28px 20px 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  background: var(--bg-alt);
}

.legal-page {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) 22px;
}

.legal-page h1 {
  font-size: clamp(36px, 5vw, 56px);
}

.legal-page p {
  color: var(--muted);
  font-size: 17px;
}

/* ---------- Breakpoints ---------- */

@media (max-width: 900px) {
  .feature-row {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .feature-row .feature-copy {
    max-width: 480px;
    margin: 0 auto;
  }

  .feature-icon {
    margin-left: auto;
    margin-right: auto;
  }

  .feature-row.reverse .feature-copy,
  .feature-row.reverse .feature-shot {
    order: initial;
  }

  .feature-shot {
    width: 100%;
    max-width: 320px;
    justify-self: center;
  }
}

@media (max-width: 640px) {
  .site-header nav {
    gap: 14px;
    font-size: 12px;
  }

  h1 {
    font-size: clamp(34px, 10vw, 44px);
  }

  h2 {
    font-size: clamp(28px, 8vw, 38px);
  }

  .hero-pin {
    height: 260vh;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .hero-actions .button {
    width: 100%;
  }

  .cta-band .hero-actions {
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-pin {
    height: auto;
  }

  .hero-pin__sticky {
    position: relative;
    height: auto;
    padding-bottom: clamp(60px, 10vw, 100px);
  }

  .hero-copy-stack {
    height: auto;
  }

  .hero-phase {
    position: relative;
    display: none;
    opacity: 1;
    transform: none;
  }

  .hero-phase.is-active {
    display: flex;
  }

  .device-stage {
    flex: 0 0 auto;
  }

  .device-frame {
    height: min(50vh, 480px);
  }

  .phase-dots {
    display: none;
  }
}
