:root {
  /* Same roles as constants/theme.ts Fonts: display = wordmark only, title = headings, sans = body. */
  --font-display: 'Alfa Slab One', Georgia, serif;
  --font-title: 'Gabarito', system-ui, sans-serif;
  --font-sans:
    system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mint: #34d399;
  --mint-deep: #059669;
  --mint-soft: #d1fae5;
  --mint-wash: #ecfdf5;
  --pink: #ff5c8a;
  --lilac: #a78bfa;
  --ink: #2d1b4e;
  --ink-soft: #6b5b7b;
  --bg: #f7fdf9;
  --surface: #ffffff;
  --border: #d9f2e4;
  --border-strong: #b8e6cd;
  --glow: rgba(52, 211, 153, 0.22);
  --badge-bg: #000000;
  --badge-fg: #ffffff;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --mint: #34d399;
    --mint-deep: #6ee7b7;
    --mint-soft: #123b2c;
    --mint-wash: #0c2a20;
    --ink: #f1ecf8;
    --ink-soft: #b7abc6;
    --bg: #0b1612;
    --surface: #12211b;
    --border: #1f3a2f;
    --border-strong: #2c5444;
    --glow: rgba(52, 211, 153, 0.14);
    --badge-bg: #ffffff;
    --badge-fg: #000000;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.6;
}

a {
  color: var(--mint-deep);
}

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */

.site-header {
  padding: 20px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--mint-deep);
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

/* App Store badge (Apple's artwork; keep it unmodified) */

.app-store-badge {
  display: inline-block;
  line-height: 0;
  transition: transform 0.15s ease;
}

.app-store-badge:hover {
  transform: translateY(-2px);
}

.app-store-badge img {
  width: 180px;
  height: auto;
}

/* Hero */

.hero {
  padding: 48px 0 8px;
  text-align: center;
}

.hero h1 {
  margin: 0 auto 16px;
  max-width: 14ch;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.hero h1 em {
  font-style: normal;
  color: var(--mint);
}

.hero p {
  margin: 0 auto 28px;
  max-width: 36ch;
  color: var(--ink-soft);
  font-size: 20px;
}

.hero-note {
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink-soft);
}

/* Section spacing */

section {
  padding: 72px 0;
}

.section-alt {
  background: var(--mint-wash);
}

.section-title {
  margin: 0 0 40px;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.15;
  text-align: center;
}

/* Tour: a pinned phone whose screen and caption follow the scroll */

.tour {
  padding: 0 0 24px;
}

.tour-pin {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 40px 20px 0;
}

/* Soft glow behind the phone */
.tour-pin::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  width: min(720px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow), transparent);
}

/*
 * A current iPhone Pro, sized from its screen. Every measurement is a share
 * of the screen width (393pt on the device the video was drawn for), so the
 * corners, bezel and island keep their real proportions at any size:
 * 55pt screen corners, a ~2.5% black bezel, a thin titanium band, and the
 * Dynamic Island (126 x 37pt, 11pt from the top).
 */
.phone {
  --screen-h: min(540px, 54vh);
  --screen-w: calc(var(--screen-h) * 886 / 1920);
  --screen-r: calc(var(--screen-w) * 0.14);
  --bezel: calc(var(--screen-w) * 0.026);
  --band: max(2px, calc(var(--screen-w) * 0.011));
  position: relative;
  flex-shrink: 0;
  /* The metal band is the phone's own background; the black bezel is a ring
     drawn around the screen by the video's box-shadow. */
  padding: calc(var(--band) + var(--bezel));
  border-radius: calc(var(--screen-r) + var(--bezel) + var(--band));
  background: linear-gradient(
    150deg,
    #6b6b70 0%,
    #2c2c30 30%,
    #55555a 55%,
    #26262a 80%,
    #5d5d62 100%
  );
  box-shadow:
    0 30px 60px rgba(45, 27, 78, 0.22),
    0 8px 18px rgba(45, 27, 78, 0.12);
}

@supports (height: 1svh) {
  .phone {
    --screen-h: min(540px, 54svh);
  }
}

/* Side buttons: Action and volume on the left, side button and Camera Control on the right */
.phone::before {
  content: '';
  position: absolute;
  inset: 0 calc(var(--band) * -1);
  background:
    linear-gradient(#3d3d42, #3d3d42) left 0 top 18% / var(--band) 5% no-repeat,
    linear-gradient(#3d3d42, #3d3d42) left 0 top 27% / var(--band) 8.5% no-repeat,
    linear-gradient(#3d3d42, #3d3d42) left 0 top 38% / var(--band) 8.5% no-repeat,
    linear-gradient(#3d3d42, #3d3d42) right 0 top 30% / var(--band) 12% no-repeat,
    linear-gradient(#3d3d42, #3d3d42) right 0 top 63% / var(--band) 7% no-repeat;
  pointer-events: none;
}

.phone video {
  display: block;
  height: var(--screen-h);
  width: auto;
  max-width: 100%;
  aspect-ratio: 886 / 1920;
  border-radius: var(--screen-r);
  box-shadow: 0 0 0 var(--bezel) #050506;
  background: var(--mint-wash);
  object-fit: cover;
  transition: opacity 0.18s ease;
}

/*
 * Two phones share one spot. For the partner steps (.is-duo) they part: yours
 * slides left, your partner's slides out from behind it to the right, both
 * scaled by --duo-scale so the pair fits the screen.
 */
.tour-phones {
  --duo-scale: 1;
  --duo-gap: 14px;
  display: grid;
}

.tour-phones .phone {
  grid-area: 1 / 1;
  justify-self: center;
  /* Shrink towards the caption, not into the middle of the screen. */
  transform-origin: 50% 100%;
  transition:
    transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.4s ease;
}

.phone-partner {
  opacity: 0;
  transform: scale(calc(var(--duo-scale) * 0.92));
}

.tour.is-duo .phone-you {
  transform: translateX(calc(-50% * var(--duo-scale) - var(--duo-gap))) scale(var(--duo-scale));
}

.tour.is-duo .phone-partner {
  opacity: 1;
  transform: translateX(calc(50% * var(--duo-scale) + var(--duo-gap))) scale(var(--duo-scale));
}

.phone-label {
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-bottom: calc(10px / var(--duo-scale));
  padding: calc(4px / var(--duo-scale)) calc(12px / var(--duo-scale));
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: calc(13px / var(--duo-scale));
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 0.3s ease;
}

.tour.is-duo .phone-label {
  opacity: 1;
}

@media (max-width: 640px) {
  .tour-phones {
    --duo-scale: 0.62;
    --duo-gap: 6px;
  }
}

.phone video.is-switching {
  opacity: 0.25;
}

.island {
  position: absolute;
  top: calc(var(--band) + var(--bezel) + var(--screen-h) * 0.0129);
  left: 50%;
  width: calc(var(--screen-w) * 0.32);
  height: calc(var(--screen-h) * 0.0434);
  border-radius: 999px;
  background: #000;
  transform: translateX(-50%);
}

.tour-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

.tour-steps li + li {
  margin-top: 28px;
}

.tour-steps h2 {
  margin: 0 auto 6px;
  max-width: 20ch;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.15;
  text-wrap: balance;
}

.tour-steps p {
  margin: 0 auto;
  max-width: 34ch;
  color: var(--ink-soft);
  font-size: 17px;
}

.tour-progress,
.tour-hint {
  display: none;
}

/* With JavaScript: the section is tall, the phone pins, one step shows at a time. */

.tour.is-live {
  height: calc(var(--steps) * 60vh + 100vh);
}

.tour.is-live .tour-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  justify-content: center;
  gap: 22px;
  padding-top: 12px;
}

.tour.is-live .tour-steps {
  display: grid;
  width: 100%;
}

.tour.is-live .tour-steps li {
  grid-area: 1 / 1;
  margin: 0;
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
  pointer-events: none;
}

.tour.is-live .tour-steps li.is-past {
  transform: translateY(-14px);
}

.tour.is-live .tour-steps li.is-active {
  opacity: 1;
  transform: none;
}

/* One bar per step; the active bar fills as you scroll through it. */
.tour.is-live .tour-progress {
  display: flex;
  gap: 6px;
}

.tour-progress button {
  position: relative;
  width: 36px;
  height: 20px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.tour-progress button::before,
.tour-progress button::after {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  height: 4px;
  border-radius: 999px;
}

.tour-progress button::before {
  right: 0;
  background: var(--border-strong);
}

.tour-progress button::after {
  width: calc(var(--fill, 0) * 100%);
  background: var(--mint);
}

.tour-progress button:focus-visible {
  outline: 2px solid var(--mint-deep);
  outline-offset: 2px;
  border-radius: 4px;
}

.tour.is-live .tour-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: -10px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tour-hint svg {
  width: 18px;
  height: 18px;
  animation: nudge 1.4s ease-in-out infinite;
}

@keyframes nudge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tour-phones .phone,
  .phone-label,
  .phone video,
  .tour.is-live .tour-steps li {
    transition: none;
  }

  .tour-hint svg {
    animation: none;
  }
}

.cta {
  text-align: center;
}

.cta p {
  margin: -20px auto 28px;
  max-width: 44ch;
  color: var(--ink-soft);
}

/* Contact */

.contact {
  text-align: center;
}

.contact p {
  margin: -20px auto 20px;
  max-width: 44ch;
  color: var(--ink-soft);
}

.email-link {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--mint);
  color: #06281c;
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.email-link:hover {
  transform: translateY(-2px);
}

/* Footer */

.site-footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 15px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.site-footer a {
  color: var(--ink-soft);
  text-decoration: none;
}

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

/* Responsive */

@media (max-width: 480px) {
  body {
    font-size: 17px;
  }

  .brand {
    gap: 8px;
    font-size: 22px;
  }

  .brand img {
    width: 30px;
    height: 30px;
  }

  .hero {
    padding-top: 24px;
  }
}
