/* TgPharmacy landing — built on Noxin design tokens */
@import url("./colors_and_type.css");

/* ── Dark theme tokens ─────────────────────────────────── */
html[data-theme="dark"] {
  color-scheme: dark;

  --bg-app:        #0e0e10;   /* page bg */
  --bg-surface:    #18181b;   /* cards, sections */
  --bg-muted:      #232328;   /* alt surface */

  --ink:           #f5f5f7;
  --ink-pure:      #ffffff;

  --fg-1:          rgba(255, 255, 255, 0.94);
  --fg-2:          rgba(255, 255, 255, 0.66);
  --fg-3:          rgba(255, 255, 255, 0.46);
  --fg-disabled:   rgba(255, 255, 255, 0.30);

  --line:          rgba(255, 255, 255, 0.10);
  --line-strong:   rgba(255, 255, 255, 0.22);
  --line-dashed:   rgba(255, 255, 255, 0.16);

  /* Slightly punchier primary glow on dark */
  --primary-soft:   rgba(105, 108, 255, 0.22);
  --primary-soft-2: rgba(105, 108, 255, 0.12);
  --primary-ring:   rgba(105, 108, 255, 0.36);

  /* Darker, more dramatic shadows */
  --shadow-button:  0 1px 5px 0 rgba(0, 0, 0, 0.5);
  --shadow-card:    0 2px 8px 0 rgba(0, 0, 0, 0.45);
  --shadow-lifted:  0 6px 20px -4px rgba(0, 0, 0, 0.55);
  --shadow-popover: 0 10px 24px 0 rgba(0, 0, 0, 0.6);
}

/* Phone mockups — light by default, adapt to site theme */
.phone {
  --bg-app:        #f5f5f7;
  --bg-surface:    #ffffff;
  --bg-muted:      #f4f5fa;
  --ink:           #22303e;
  --ink-pure:      #1d1d1f;
  --fg-1:          rgba(34, 48, 62, 0.9);
  --fg-2:          rgba(34, 48, 62, 0.7);
  --fg-3:          rgba(34, 48, 62, 0.5);
  --fg-disabled:   rgba(34, 48, 62, 0.38);
  --line:          rgba(34, 48, 62, 0.12);
  --line-strong:   rgba(34, 48, 62, 0.22);
  --primary-soft:   rgba(105, 108, 255, 0.16);
  --primary-soft-2: rgba(105, 108, 255, 0.08);
  --primary-ring:   rgba(105, 108, 255, 0.24);

  /* Phone-specific surface/text tokens (used by phone.css) */
  --ph-bg:         #ffffff;        /* phone screen + chrome bg */
  --ph-card:       #ffffff;        /* elevated cards on top of bg */
  --ph-card-2:     #f1f1f3;        /* message bubbles (lighter elevation) */
  --ph-text:       #000000;        /* primary text */
  --ph-input-bg:   rgba(0,0,0,0.04);  /* composer input track */
  --ph-divider:    rgba(0,0,0,0.05);
  --ph-shadow:     rgba(34, 48, 62, 0.06);
}

/* Dark site theme → iOS-style dark phones */
html[data-theme="dark"] .phone {
  --bg-app:        #000000;
  --bg-surface:    #1c1c1e;
  --bg-muted:      #2c2c2e;
  --ink:           #ffffff;
  --ink-pure:      #ffffff;
  --fg-1:          rgba(255, 255, 255, 0.92);
  --fg-2:          rgba(255, 255, 255, 0.6);
  --fg-3:          rgba(255, 255, 255, 0.42);
  --fg-disabled:   rgba(255, 255, 255, 0.28);
  --line:          rgba(255, 255, 255, 0.10);
  --line-strong:   rgba(255, 255, 255, 0.22);

  --ph-bg:         #000000;        /* true black for OLED iOS feel */
  --ph-card:       #1c1c1e;
  --ph-card-2:     #2c2c2e;
  --ph-text:       #ffffff;
  --ph-input-bg:   rgba(255,255,255,0.10);
  --ph-divider:    rgba(255,255,255,0.08);
  --ph-shadow:     rgba(0, 0, 0, 0.5);
}

/* Smooth theme swap — only the few elements where it's noticeable */
html, body { transition: background-color 280ms var(--ease-out), color 280ms var(--ease-out); }
.nav, section, footer, .btn, .chip, .how-card, .trust__item, .fpinned__icon { transition: background-color 250ms var(--ease-out), border-color 250ms var(--ease-out), color 250ms var(--ease-out); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-surface);
  color: var(--fg-1);
  /* NOTE: do NOT set overflow-x:hidden on body — it breaks position:sticky descendants.
     Each section clips its own overflow individually (hero, final-cta, features). */
}

/* Globally prevent horizontal scroll without breaking sticky */
html {
  overflow-x: clip;
}

/* ── Layout helpers ────────────────────────────────────── */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Button (Apple-ish pill + Noxin primary) ───────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1;
  padding: 16px 24px;
  border-radius: 9999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 20px -6px rgba(105, 108, 255, 0.55);
}
.btn--primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -8px rgba(105, 108, 255, 0.65);
}
.btn--ghost {
  background: transparent;
  color: var(--fg-1);
}
.btn--ghost:hover { background: rgba(34, 48, 62, 0.06); }
.btn--ghost i { color: var(--primary); }
.btn--lg { padding: 18px 28px; font-size: 17px; }

/* ── Nav ───────────────────────────────────────────────── */
.nav {
  position: relative;       /* sits in normal flow, scrolls away with page */
  z-index: 50;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--line);
}
html[data-theme="dark"] .nav {
  background: var(--bg-app);
}

/* Dark variants for ghost button hover & misc light-only colors */
html[data-theme="dark"] .btn--ghost:hover { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .features__dot { background: rgba(255, 255, 255, 0.20); }
html[data-theme="dark"] .loc-add { border-color: rgba(255, 255, 255, 0.18); }
.nav__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav__brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  color: var(--fg-1);
}
.nav__brandmark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: transparent url("../assets/hp-logo-v2.svg") no-repeat center;
  background-size: 130% auto;
  flex-shrink: 0;
}
.nav__brandname {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.005em;
}
.nav__links {
  display: flex; gap: 28px;
  margin-left: 16px;
}
.nav__links a {
  text-decoration: none;
  color: var(--fg-2);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease-out);
}
.nav__links a:hover { color: var(--fg-1); }
.nav__cta { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav__cta .btn { padding: 10px 18px; font-size: 14px; }

/* Theme toggle (sun/moon icon button) */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-1);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  transition: background-color 200ms var(--ease-out), border-color 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.theme-toggle i {
  font-size: 18px;
  transition: transform 350ms var(--ease-out);
}
.theme-toggle:hover {
  background: var(--primary-soft-2);
  border-color: var(--primary-ring);
}
.theme-toggle:hover i { transform: rotate(20deg); }
html[data-theme="dark"] .theme-toggle:hover i { transform: rotate(-20deg); }
.theme-toggle:active { transform: scale(0.94); }

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 80px 0 96px;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: -10% -10% auto -10%;
  height: 720px;
  background:
    radial-gradient(ellipse 60% 60% at 30% 40%, rgba(105, 108, 255, 0.10), transparent 60%),
    radial-gradient(ellipse 50% 50% at 75% 20%, rgba(105, 108, 255, 0.06), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 72px;
  align-items: center;
}
.hero__copy {
  display: flex; flex-direction: column; gap: 24px;
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 8px 14px;
  border-radius: 9999px;
  align-self: flex-start;
}
.hero__eyebrow i { font-size: 16px; }
.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 6.8vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--fg-1);
  margin: 0;
}
.hero__title .accent { color: var(--primary); }
.hero__sub {
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 30px;
  color: var(--fg-2);
  max-width: 520px;
  margin: 0;
}
.hero__cta {
  display: flex; gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.hero__small {
  font-size: 13px;
  color: var(--fg-3);
  margin-top: 4px;
  display: inline-flex; align-items: center; gap: 8px;
}
.hero__small .dot { width: 6px; height: 6px; background: var(--success); border-radius: 50%; }

.hero__visual {
  position: relative;
  height: 640px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1400px;
}
.hero__phone-wrap {
  position: relative;
  z-index: 2;
  will-change: transform;
}
.hero__glow {
  position: absolute;
  inset: 10% 5%;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(105, 108, 255, 0.22), transparent 70%);
  filter: blur(40px);
  z-index: 1;
}
/* Chips layer: sized to scaled phone bounds, centered in visual.
   Chips inside use % offsets relative to this box → identical chip-to-phone
   relationship on desktop and mobile. JS writes translate3d() for parallax. */
.hero__chips-layer {
  position: absolute;
  left: 50%;
  top: 50%;
  width:        calc(360px * var(--phone-scale, 1));
  height:       calc(720px * var(--phone-scale, 1));
  margin-left:  calc(-180px * var(--phone-scale, 1));
  margin-top:   calc(-360px * var(--phone-scale, 1));
  z-index: 3;
  pointer-events: none;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 9999px;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-1);
  box-shadow: var(--shadow-lifted);
  white-space: nowrap;
}
.chip i { font-size: 16px; }
.chip--primary i { color: var(--primary); }
.chip--success i { color: var(--success); }
.chip--warning i { color: var(--warning); }
.chip--error   i { color: var(--error); }

/* ── Section heads ─────────────────────────────────────── */
.section-head {
  max-width: 720px;
  margin: 0 auto 64px;
  text-align: center;
  display: flex; flex-direction: column; gap: 16px; align-items: center;
}
.section-head__eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}
.section-head__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 4.4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--fg-1);
  margin: 0;
}
.section-head__sub {
  font-size: 18px;
  line-height: 28px;
  color: var(--fg-2);
  max-width: 560px;
  margin: 0;
}

/* ── Pinned-scroll feature section (Apple-style) ─────────── */
.features {
  position: relative;
  background: var(--bg-app);
  padding: 128px 0 0;
}
.features__intro { padding-bottom: 32px; }

/* Outer container is N × 100vh tall to give scroll runway */
.features__pin-outer {
  position: relative;
  height: calc(4 * 100vh);   /* 4 features */
}

/* Sticky inner pins to viewport */
.features__pin-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Each pinned feature layout — 2-col grid (text + phone) */
.fpinned {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.fpinned--reverse { direction: rtl; }
.fpinned--reverse > * { direction: ltr; }

/* Copy column — entry animation slides up + fades in */
.fpinned__copy {
  display: flex; flex-direction: column; gap: 18px;
  animation: feat-text-in 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  will-change: transform, opacity;
}
@keyframes feat-text-in {
  0%   { opacity: 0; transform: translateY(50px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Stagger each child for proper "ladder" entry */
.fpinned__copy > * {
  animation: feat-text-child-in 800ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.fpinned__copy > *:nth-child(1) { animation-delay: 50ms; }
.fpinned__copy > *:nth-child(2) { animation-delay: 130ms; }
.fpinned__copy > *:nth-child(3) { animation-delay: 220ms; }
.fpinned__copy > *:nth-child(4) { animation-delay: 320ms; }
.fpinned__copy > *:nth-child(5) { animation-delay: 420ms; }
@keyframes feat-text-child-in {
  0%   { opacity: 0; transform: translateY(28px); }
  100% { opacity: 1; transform: translateY(0); }
}

.fpinned__num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--primary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.fpinned__icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.fpinned__icon i { font-size: 28px; }
.fpinned__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 3.6vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--fg-1);
  margin: 0;
}
.fpinned__body {
  font-size: 18px;
  line-height: 28px;
  color: var(--fg-2);
  margin: 0;
  max-width: 480px;
}
.fpinned__bullets {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex; flex-direction: column; gap: 10px;
}
.fpinned__bullets li {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 15px;
  color: var(--fg-1);
}
.fpinned__bullets i {
  color: var(--primary);
  font-size: 18px;
  margin-top: 1px;
  flex-shrink: 0;
}

/* Visual column — entry slide+fade, then continuous bob */
.fpinned__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: feat-phone-in 1000ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  will-change: transform, opacity;
}
@keyframes feat-phone-in {
  0%   { opacity: 0; transform: translateY(40px) scale(0.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.fpinned__phone-glow {
  position: absolute;
  inset: 10% 5%;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(105, 108, 255, 0.20), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}
.fpinned__phone-scale {
  position: relative;
  z-index: 1;
}
.fpinned__phone-bob {
  animation: phone-bob 5s ease-in-out infinite;
  transform-origin: center center;
}
@keyframes phone-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-14px) rotate(-1deg); }
}

/* Progress dots — vertical strip on right side */
.features__dots {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 5;
}
.features__dot {
  width: 8px; height: 8px;
  border-radius: 9999px;
  background: rgba(34, 48, 62, 0.18);
  transition: all 350ms var(--ease-out);
}
.features__dot.is-active {
  background: var(--primary);
  height: 32px;
}

/* ── Final CTA ─────────────────────────────────────────── */
.final-cta {
  position: relative;
  padding: 160px 0 200px;
  text-align: center;
  background: var(--bg-surface);
  overflow: hidden;
}
.final-cta__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 55% at 50% 65%, rgba(105, 108, 255, 0.18), transparent 70%);
  pointer-events: none;
}
.final-cta__inner {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 28px;
}
.final-cta__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--fg-1);
  margin: 0;
  max-width: 1000px;
}
.final-cta__sub {
  font-size: 19px;
  line-height: 30px;
  color: var(--fg-2);
  max-width: 540px;
  margin: 0;
}
.final-cta__small {
  font-size: 13px;
  color: var(--fg-3);
}

/* ── Trust strip — infinite marquee ─────────────────────── */
.trust {
  padding: 64px 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.trust__marquee {
  position: relative;
  /* Soft fade-in/out at edges for that premium feel */
  mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.trust__track {
  display: flex;
  width: max-content;
  gap: 72px;
  animation: trust-scroll 50s linear infinite;
  will-change: transform;
  /* Marquee runs continuously — no pause on hover (pointer-events ignored) */
  pointer-events: none;
}

@keyframes trust-scroll {
  /* Two copies of the list — when first copy fully scrolls past, second is in place → seamless */
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

.trust__item {
  display: flex; flex-direction: column;
  gap: 14px;                 /* generous spacing between number & label */
  flex-shrink: 0;
  /* No min-width — each item is exactly its content width, so the 72px gap
     between items reads as visually uniform. */
}
.trust__n {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 38px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg-1);
  white-space: nowrap;
}
.trust__l {
  font-size: 14px;
  line-height: 20px;
  color: var(--fg-2);
  white-space: nowrap;
}

/* ── Footer ────────────────────────────────────────────── */
.footer {
  background: var(--bg-app);
  border-top: 1px solid var(--line);
  padding: 56px 0 40px;
}
.footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 3fr;
  gap: 64px;
}
.footer__brand-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
/* Footer brand uses a slightly larger mark */
.footer__brand-row .nav__brandmark { width: 44px; height: 44px; border-radius: 12px; background-size: 130% auto; }
.footer__brand-row .nav__brandname { font-size: 22px; }
.footer__tag {
  font-size: 14px;
  color: var(--fg-2);
  max-width: 280px;
  margin: 0;
}
.footer__cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
.footer__col h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 14px;
}
.footer__col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.footer__col a {
  text-decoration: none;
  color: var(--fg-1);
  font-size: 14px;
}
.footer__col a:hover { color: var(--primary); }
.footer__bottom {
  max-width: 1240px;
  margin: 40px auto 0;
  padding: 24px 32px 0;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
  font-size: 13px;
  color: var(--fg-3);
}

/* ── How it works grid ──────────────────────────────────── */
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.how-card {
  background: var(--bg-app);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 240px;
}
.how-card__num {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}
.how-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.01em;
  margin: 8px 0 0;
  color: var(--fg-1);
}
.how-card__body {
  font-size: 16px;
  line-height: 26px;
  color: var(--fg-2);
  margin: 0;
}
.how-card__icon {
  margin-top: auto;
  color: var(--primary);
}
.how-card__icon i { font-size: 28px; }

/* ── Reveal-on-load utility (single CSS animation, no IntersectionObserver) ── */
@keyframes nx-reveal {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal {
  animation: nx-reveal 700ms var(--ease-out) both;
}
.reveal.delay-1 { animation-delay: 80ms; }
.reveal.delay-2 { animation-delay: 160ms; }
.reveal.delay-3 { animation-delay: 240ms; }
.reveal.delay-4 { animation-delay: 320ms; }

/* ── Responsive ────────────────────────────────────────── */

/* ── Tablet (≤980px) ─────────────────────────────────── */
@media (max-width: 980px) {
  .container { padding: 0 24px; }

  /* Nav */
  .nav__links { display: none; }
  .nav__inner { padding: 12px 24px; gap: 16px; }
  .nav__cta .btn { padding: 9px 16px; font-size: 13px; }

  /* Hero */
  .hero { padding: 56px 0 56px; }
  .hero__inner { grid-template-columns: 1fr; gap: 48px; text-align: center; }
  .hero__copy { align-items: center; order: 2; }   /* text BELOW phone on tablet */
  .hero__visual { order: 1; }
  .hero__sub { max-width: 560px; }
  .hero__cta { justify-content: center; }
  .hero__visual { height: auto; min-height: 560px; }
  /* Set scale via CSS var on .hero__visual so BOTH phone wrap AND chips layer inherit it */
  .hero__visual { --phone-scale: 0.88; }

  /* Pinned features — keep sticky pin but stack vertically inside */
  .features { padding: 80px 0 0; }
  .features__pin-outer { height: calc(4 * 100vh); }
  .fpinned {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 24px;
    text-align: center;
  }
  .fpinned--reverse { direction: ltr; }
  .fpinned__copy { align-items: center; order: 2; gap: 12px; }
  .fpinned__visual { order: 1; }
  .fpinned__body { max-width: 100%; font-size: 16px; line-height: 24px; }
  .fpinned__bullets { align-items: center; }
  .fpinned__title { font-size: clamp(26px, 4.5vw, 36px); }
  .fpinned__phone-scale { transform: scale(0.65); transform-origin: top center; }
  .fpinned__phone-bob { transform-origin: top center; }
  .fpinned__visual { height: 480px; align-items: flex-start; }

  /* Dots: move to bottom horizontal */
  .features__dots {
    flex-direction: row;
    right: auto; top: auto;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
  }
  .features__dot.is-active {
    width: 32px; height: 8px;
  }

  /* How it works */
  .how-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .section-head { margin-bottom: 40px; }

  /* Trust marquee responsive */

  /* Final CTA */
  .final-cta { padding: 100px 0 120px; }

  /* Footer */
  .footer__inner { grid-template-columns: 1fr; gap: 32px; }
  .footer__cols { grid-template-columns: repeat(2, 1fr); }
  .footer__bottom { padding: 20px 24px 0; }
}

/* ── Mobile (≤640px) ──────────────────────────────────── */
@media (max-width: 640px) {
  .container { padding: 0 20px; }

  /* Nav */
  .nav__inner { padding: 10px 16px; gap: 12px; }
  .nav__brandname { font-size: 16px; }
  .nav__brandmark { width: 30px; height: 30px; border-radius: 8px; }
  .nav__cta { gap: 8px; }
  .nav__cta .btn { padding: 8px 14px; font-size: 12px; gap: 6px; }
  .theme-toggle { width: 32px; height: 32px; }
  .theme-toggle i { font-size: 16px; }

  /* Hero */
  .hero { padding: 40px 0 40px; }
  .hero__inner { gap: 28px; }
  .hero__title { font-size: clamp(36px, 10vw, 52px); line-height: 1.0; }
  .hero__sub { font-size: 16px; line-height: 26px; }
  .hero__cta { flex-direction: column; align-items: center; gap: 10px; }
  .hero__cta .btn { width: 100%; max-width: 320px; justify-content: center; }
  .btn--lg { padding: 16px 24px; font-size: 15px; }
  .hero__visual { min-height: 500px; }
  .hero__visual { --phone-scale: 0.78; }

  /* Floating chips — same desktop positions (inline %), just smaller text */
  .chip {
    font-size: 11px;
    padding: 7px 11px;
    gap: 5px;
    border-radius: 9999px;
  }
  .chip i { font-size: 13px; }

  /* Section heads */
  .section-head__title { font-size: clamp(28px, 8vw, 40px); }
  .section-head__sub { font-size: 15px; line-height: 24px; }
  .section-head { margin-bottom: 32px; }

  /* Pinned features — compact for mobile */
  .features { padding: 56px 0 0; }
  .fpinned { gap: 16px; }
  .fpinned__title { font-size: clamp(24px, 6.8vw, 32px); line-height: 1.1; }
  .fpinned__body { font-size: 14px; line-height: 22px; }
  .fpinned__icon { width: 44px; height: 44px; border-radius: 12px; }
  .fpinned__icon i { font-size: 22px; }
  .fpinned__bullets li { font-size: 13px; }
  .fpinned__num { font-size: 11px; }

  /* Phone: smaller scale for mobile */
  .fpinned__phone-scale { transform: scale(0.5); }
  .fpinned__visual { height: 380px; }

  /* How it works — single column on mobile */
  .how-grid { grid-template-columns: 1fr; gap: 16px; }
  .how-card { padding: 24px; min-height: auto; }
  .how-card__title { font-size: 20px; }
  .how-card__body { font-size: 15px; line-height: 24px; }

  /* Trust marquee — slower on mobile + smaller numbers */
  .trust { padding: 48px 0; }
  .trust__track { gap: 56px; animation-duration: 40s; }
  .trust__item { gap: 10px; }
  .trust__n { font-size: 28px; }
  .trust__l { font-size: 13px; }

  /* Final CTA */
  .final-cta { padding: 80px 0 100px; }
  .final-cta__title { font-size: clamp(32px, 9vw, 52px); }
  .final-cta__sub { font-size: 16px; line-height: 26px; }

  /* Footer */
  .footer { padding: 40px 0 32px; }
  .footer__inner { gap: 28px; }
  .footer__cols { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .footer__brand-row .nav__brandmark { width: 36px; height: 36px; }
  .footer__brand-row .nav__brandname { font-size: 18px; }
  .footer__bottom { flex-direction: column; gap: 4px; text-align: center; }
}

/* ── Small mobile (≤400px) ────────────────────────────── */
@media (max-width: 400px) {
  .container { padding: 0 16px; }

  .hero { padding: 32px 0 32px; }
  .hero__title { font-size: 32px; }
  .hero__sub { font-size: 15px; }
  .hero__visual { min-height: 420px; }

  .hero__visual { --phone-scale: 0.64; }
  /* Tiny screens — chip text shorter / compact */
  .chip { font-size: 10px; padding: 6px 9px; }
  .chip i { font-size: 12px; }
  .hero__chips-layer .chip[style*="left: -22%"] { left: -4% !important; }
  .hero__chips-layer .chip[style*="right: -26%"] { right: -6% !important; }
  .fpinned__phone-scale { transform: scale(0.44); }
  .fpinned__visual { height: 330px; }
  .fpinned__title { font-size: 22px; }

  /* Trust marquee on tiny screens — even more compact */
  .trust__track { gap: 40px; }
  .trust__item { gap: 8px; }
  .trust__n { font-size: 24px; }
  .footer__cols { grid-template-columns: 1fr; }
}

/* ── Reduce motion (accessibility) ────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .fpinned__copy,
  .fpinned__copy > *,
  .fpinned__visual,
  .fpinned__phone-bob {
    animation: none !important;
  }
}
