:root {
  --now-bg: #f3f1ec;
  --now-panel: #e9e5dc;
  --now-card: rgba(255, 255, 255, 0.64);
  --now-ink: #171716;
  --now-muted: #65625d;
  --now-faint: #8f8a80;
  --now-line: rgba(23, 23, 22, 0.1);
  --now-accent: #ff6a48;
  --now-accent-soft: #ffb19d;
  --now-shell: min(1180px, calc(100vw - 40px));
  --now-radius-lg: 32px;
  --now-radius-md: 22px;
  --now-ease: cubic-bezier(0.23, 1, 0.32, 1);
  --font-body:
    "SF Pro Text",
    "SF Pro Display",
    "Helvetica Neue",
    "PingFang SC",
    "Hiragino Sans GB",
    sans-serif;
}

html[data-theme='dark'] {
  --now-bg: #11100d;
  --now-panel: #1d1a16;
  --now-card: rgba(38, 34, 29, 0.72);
  --now-ink: #f2ede4;
  --now-muted: #b9b0a4;
  --now-faint: #857c71;
  --now-line: rgba(242, 237, 228, 0.1);
  --now-accent: #ff7a58;
  --now-accent-soft: #7c3528;
}

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

html {
  scroll-behavior: smooth;
  background: var(--now-bg);
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--now-bg);
  color: var(--now-ink);
  font-family: var(--font-body);
  line-height: 1.55;
  transition:
    background-color 220ms var(--now-ease),
    color 220ms var(--now-ease);
}

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

button {
  font: inherit;
}

.now-shell {
  width: var(--now-shell);
  margin: 0 auto;
}

.now-kicker {
  margin: 0;
  color: var(--now-faint);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.now-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 7vw, 96px) 0 clamp(68px, 9vw, 120px);
  isolation: isolate;
}

.now-hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.now-hero h1 {
  max-width: 980px;
  margin: 18px auto 0;
  white-space: pre-line;
  font-size: clamp(3.35rem, 9.7vw, 7.65rem);
  font-weight: 760;
  line-height: 0.94;
  letter-spacing: -0.065em;
  text-wrap: balance;
}

.now-hero__lead {
  max-width: 680px;
  margin: 30px auto 0;
  color: var(--now-muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.7;
  text-wrap: balance;
}

.now-hero__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.now-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px;
  transition:
    transform 160ms var(--now-ease),
    filter 160ms var(--now-ease);
}

.now-button__product {
  color: inherit;
  opacity: 0.72;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.now-button__badge {
  display: block;
  width: 132px;
  height: 44px;
}

.now-button__badge--on-light {
  display: none;
}

[data-theme='light'] .now-button__badge--on-dark {
  display: none;
}

[data-theme='light'] .now-button__badge--on-light {
  display: block;
}

.now-button:active,
.now-video__play:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .now-button:hover {
    transform: translateY(-2px);
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.35));
  }
}

.now-button:focus-visible,
.now-video__play:focus-visible {
  outline: 2px solid var(--now-accent);
  outline-offset: 4px;
}

.now-video-section {
  padding: 10px 0 clamp(90px, 12vw, 160px);
}

.now-video-heading,
.now-section-heading--split,
.now-preview-group__heading,
.now-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.now-video-heading {
  padding: 0 4px 22px;
}

.now-video-heading h2,
.now-section-heading h2,
.now-story h2,
.now-download h2 {
  margin: 8px 0 0;
  font-size: clamp(2.15rem, 5.4vw, 4.4rem);
  font-weight: 720;
  line-height: 1.02;
  letter-spacing: -0.052em;
  text-wrap: balance;
}

.now-video-heading > p {
  margin: 0 0 6px;
  color: var(--now-faint);
  font-size: 0.82rem;
}

.now-video {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--now-line);
  border-radius: var(--now-radius-lg);
  background: var(--now-panel);
  box-shadow: 0 50px 90px -62px rgba(0, 0, 0, 0.65);
}

.now-video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.now-video__play {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: grid;
  width: clamp(68px, 8vw, 88px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 50%;
  background: rgba(15, 14, 12, 0.72);
  color: white;
  cursor: pointer;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(16px) saturate(150%);
  transition:
    transform 160ms var(--now-ease),
    opacity 160ms var(--now-ease);
}

.now-video__play span {
  margin-left: 4px;
  font-size: 1.2rem;
}

.now-video__play:active {
  transform: translate(-50%, -50%) scale(0.96);
}

.now-video.is-playing .now-video__play {
  opacity: 0;
  pointer-events: none;
}

.now-story {
  padding: clamp(94px, 13vw, 170px) 0;
  background: var(--now-ink);
  color: var(--now-bg);
}

.now-story__grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.32fr) minmax(0, 1fr);
  gap: clamp(40px, 8vw, 120px);
}

.now-story__label {
  margin: 8px 0 0;
  color: color-mix(in srgb, var(--now-bg) 55%, transparent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.now-story__copy {
  max-width: 820px;
}

.now-story__copy > p {
  max-width: 730px;
  margin: 30px 0 0;
  color: color-mix(in srgb, var(--now-bg) 70%, transparent);
  font-size: clamp(1.02rem, 1.7vw, 1.18rem);
  line-height: 1.85;
}

.now-story__copy > p:first-child {
  margin-top: 0;
  color: var(--now-bg);
  font-size: clamp(1.22rem, 2.3vw, 1.62rem);
  line-height: 1.65;
  letter-spacing: -0.015em;
}

.now-story blockquote {
  margin: 48px 0 0;
  padding-left: 24px;
  border-left: 2px solid var(--now-accent);
  color: var(--now-bg);
  font-size: clamp(1.25rem, 2.8vw, 1.82rem);
  font-weight: 610;
  line-height: 1.5;
  letter-spacing: -0.02em;
}

.now-flow,
.now-previews,
.now-features {
  padding: clamp(94px, 12vw, 160px) 0;
}

.now-section-heading {
  max-width: 880px;
}

.now-flow__stages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 64px;
  border-top: 1px solid var(--now-line);
}

.now-flow__stages article {
  position: relative;
  padding: 30px 30px 0 0;
}

.now-flow__stages article:not(:last-child) {
  border-right: 1px solid var(--now-line);
}

.now-flow__stages article:not(:first-child) {
  padding-left: 30px;
}

.now-flow__stages article > span,
.now-feature-grid article > span {
  color: var(--now-accent);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.12em;
}

.now-flow__stages h3,
.now-feature-grid h3 {
  margin: 38px 0 0;
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.now-flow__stages p,
.now-feature-grid p {
  margin: 12px 0 0;
  color: var(--now-muted);
}

.now-previews {
  overflow: hidden;
  background: var(--now-panel);
}

.now-section-heading--split {
  max-width: none;
}

.now-section-heading--split > p {
  max-width: 400px;
  margin: 0 0 6px;
  color: var(--now-muted);
  font-size: 1rem;
}

.now-preview-group {
  margin-top: 76px;
}

.now-preview-group--mac {
  margin-top: 110px;
}

.now-preview-group__heading {
  padding-bottom: 20px;
}

.now-preview-group__heading h3 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.now-preview-group__heading span {
  color: var(--now-faint);
  font-size: 0.82rem;
}

.now-ios-gallery,
.now-mac-gallery {
  display: grid;
  gap: 18px;
}

.now-ios-gallery {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.now-mac-gallery {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.now-ios-gallery figure,
.now-mac-gallery figure {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--now-line);
  background: var(--now-bg);
  box-shadow: 0 24px 50px -38px rgba(0, 0, 0, 0.58);
}

.now-ios-gallery figure {
  border-radius: 24px;
}

.now-mac-gallery figure {
  border-radius: 18px;
}

.now-ios-gallery img,
.now-mac-gallery img {
  display: block;
  width: 100%;
  height: auto;
}

.now-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 68px;
  overflow: hidden;
  border: 1px solid var(--now-line);
  border-radius: var(--now-radius-lg);
  background: var(--now-line);
}

.now-feature-grid article {
  min-height: 310px;
  padding: 30px;
  background: var(--now-bg);
}

.now-feature-grid p {
  font-size: 0.96rem;
  line-height: 1.75;
}

.now-native-note {
  display: grid;
  grid-template-columns: 0.48fr 1fr;
  gap: 54px;
  margin-top: 30px;
  padding: 34px;
  border-radius: var(--now-radius-md);
  background: var(--now-panel);
}

.now-native-note > p:last-child {
  max-width: 720px;
  margin: 0;
  color: var(--now-muted);
  font-size: 1.02rem;
  line-height: 1.8;
}

.now-download {
  padding: 10px 0 clamp(100px, 12vw, 160px);
}

.now-download__panel {
  position: relative;
  overflow: hidden;
  padding: clamp(54px, 8vw, 96px);
  border-radius: var(--now-radius-lg);
  background: #ff8a69;
  color: #211510;
  text-align: center;
}

.now-download__panel .now-kicker {
  color: rgba(33, 21, 16, 0.54);
}

.now-download__panel > p:not(.now-kicker) {
  margin: 22px 0 0;
  color: rgba(33, 21, 16, 0.7);
}

.now-footer {
  border-top: 1px solid var(--now-line);
  padding: 34px 0 max(34px, env(safe-area-inset-bottom));
}

.now-footer__inner {
  align-items: center;
}

.now-footer__inner > a {
  font-size: 0.88rem;
  font-weight: 760;
  letter-spacing: 0.14em;
}

.now-footer nav {
  display: flex;
  gap: 18px;
  color: var(--now-muted);
  font-size: 0.82rem;
}

.now-store-popover[hidden] {
  display: none;
}

.now-store-popover {
  position: fixed;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transform-origin: top center;
  pointer-events: none;
  transition:
    opacity 180ms var(--now-ease),
    transform 180ms var(--now-ease);
}

.now-store-popover.is-above {
  flex-direction: column-reverse;
  transform: translateY(-6px) scale(0.97);
  transform-origin: bottom center;
}

.now-store-popover.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.now-store-popover__arrow {
  width: 12px;
  height: 6px;
  margin-bottom: -1px;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  background: var(--now-card);
}

.now-store-popover.is-above .now-store-popover__arrow {
  margin-top: -1px;
  margin-bottom: 0;
  clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
}

.now-store-popover__body {
  display: flex;
  min-width: 196px;
  padding: 16px;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--now-line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--now-card) 92%, var(--now-bg));
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
}

.now-store-popover__body > img {
  width: 160px;
  height: 160px;
  padding: 10px;
  border: 1px solid var(--now-line);
  border-radius: 14px;
  background: #fff;
  object-fit: contain;
  box-sizing: border-box;
}

.now-store-popover__body > p {
  margin: 0;
  color: var(--now-muted);
  font-size: 0.76rem;
}

.now-store-popover__body > a {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms var(--now-ease);
}

.now-store-popover__badge {
  display: block;
  width: 120px;
  height: 40px;
}

.now-store-popover__badge--on-light {
  display: none;
}

[data-theme='light'] .now-store-popover__badge--on-dark {
  display: none;
}

[data-theme='light'] .now-store-popover__badge--on-light {
  display: block;
}

@media (hover: hover) and (pointer: fine) {
  .now-store-popover__body > a:hover {
    transform: translateY(-1px);
  }
}

@media (max-width: 900px) {
  .now-story__grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .now-story__label {
    margin: 0;
  }

  .now-section-heading--split {
    align-items: flex-start;
    flex-direction: column;
  }

  .now-feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .now-ios-gallery {
    display: flex;
    width: calc(100vw - 20px);
    margin-right: calc((100vw - var(--now-shell)) / -2);
    padding-right: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .now-ios-gallery::-webkit-scrollbar {
    display: none;
  }

  .now-ios-gallery figure {
    flex: 0 0 min(42vw, 300px);
    scroll-snap-align: start;
  }
}

@media (max-width: 640px) {
  :root {
    --now-shell: min(100% - 28px, 1180px);
    --now-radius-lg: 22px;
  }

  .now-hero {
    padding: 32px 0 72px;
  }

  .now-hero .now-kicker {
    font-size: 0.66rem;
    letter-spacing: 0.14em;
  }

  .now-hero h1 {
    max-width: 100%;
    margin-top: 14px;
    font-size: clamp(2rem, 11.5vw, 3.15rem);
    line-height: 1.02;
    letter-spacing: -0.055em;
  }

  .now-hero__lead {
    max-width: 34ch;
    margin-top: 20px;
    font-size: 0.94rem;
    line-height: 1.65;
  }

  .now-hero__actions,
  .now-download .now-hero__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: 316px;
    margin: 26px auto 0;
  }

  .now-button {
    width: 100%;
    min-height: 68px;
    gap: 7px;
    padding: 5px 2px;
  }

  .now-button__product {
    font-size: 0.72rem;
  }

  .now-button__badge {
    width: min(118px, 100%);
    height: auto;
  }

  .now-video-section {
    padding-bottom: 76px;
  }

  .now-video-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 16px;
  }

  .now-video-heading h2,
  .now-section-heading h2,
  .now-download h2 {
    font-size: clamp(2rem, 10.5vw, 2.7rem);
    line-height: 1.06;
    letter-spacing: -0.045em;
  }

  .now-video {
    /* Keep 16:9 so the 1080p product film is not side-cropped by cover. */
    border-radius: 20px;
  }

  .now-story,
  .now-flow,
  .now-previews,
  .now-features {
    padding: 76px 0;
  }

  .now-story blockquote {
    margin-top: 36px;
    padding-left: 18px;
  }

  .now-flow__stages {
    margin-top: 42px;
    grid-template-columns: 1fr;
  }

  .now-flow__stages article,
  .now-flow__stages article:not(:first-child) {
    padding: 24px 0;
    border-right: 0;
    border-bottom: 1px solid var(--now-line);
  }

  .now-flow__stages h3 {
    margin-top: 24px;
  }

  .now-mac-gallery {
    grid-template-columns: 1fr;
  }

  .now-preview-group {
    margin-top: 52px;
  }

  .now-preview-group--mac {
    margin-top: 72px;
  }

  .now-ios-gallery figure {
    flex-basis: min(76vw, 300px);
  }

  .now-feature-grid {
    grid-template-columns: 1fr;
  }

  .now-feature-grid article {
    min-height: 0;
    padding: 26px;
  }

  .now-feature-grid h3 {
    margin-top: 26px;
  }

  .now-native-note {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 26px;
  }

  .now-download__panel {
    padding: 48px 18px 28px;
  }

  .now-download {
    padding-bottom: 88px;
  }

  .now-footer__inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .now-video__play {
    backdrop-filter: none;
  }
}
