/* ==========================================================================
   Gluc marketing site
   Palette and type are derived from the app's theme (src/theme in the app):
   violet-sand brand, sage for in-range, sand for highs, setting-sun for lows.
   ========================================================================== */

/* Karla, the app's typeface. */
@font-face {
  font-family: "Karla";
  src: url("../fonts/karla-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #08060e;
  --bg-raise: #0f0b19;
  --ink: #f6f4fb;
  --ink-2: #c4bdd9;
  --ink-3: #958db3;
  --line: rgba(205, 197, 235, 0.11);
  --line-2: rgba(205, 197, 235, 0.2);

  --brand: #675297;
  --brand-500: #7b6fa9;
  --neon: #9b87f5;
  --neon-soft: #c9bdff;
  --sage: #c2d5b1;
  --sage-soft: #d6e6c8;
  --sand: #f2d675;
  --sun: #dd7e78;
  --sky: #a5c1e2;

  --grad: linear-gradient(96deg, #ece6ff 0%, #b8a6ff 34%, #8f7cf2 62%, #9ec5f2 100%);

  --font-display: "Karla", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Karla", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --nav-h: 68px;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(56px, 7vw, 96px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  /* Film grain keeps the large dark fields from looking flat. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

a {
  color: inherit;
  text-decoration-color: rgba(201, 189, 255, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

/* Email links only get an href once someone reaches for them; look like links before that. */
.eml {
  text-decoration-line: underline;
  cursor: pointer;
}

button {
  font: inherit;
}

::selection {
  background: rgba(155, 135, 245, 0.42);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--neon-soft);
  outline-offset: 3px;
  border-radius: 6px;
}

.i {
  display: inline-block;
  flex: none;
  width: 1em;
  height: 1em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 12px;
  background: #fff;
  color: #120e1f;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 6px 13px 6px 11px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--neon-soft);
  background: rgba(155, 135, 245, 0.1);
  border: 1px solid rgba(155, 135, 245, 0.24);
}

/* A label used on its own as the section heading */
.section-head > .eyebrow:last-child {
  margin-bottom: 0;
}

.eyebrow .i {
  width: 15px;
  height: 15px;
}

.h2 {
  font-size: clamp(34px, 4.6vw, 60px);
}

/* Three short sentences, one per line: sized so the longest fits the column. */
.h2--steps {
  font-size: clamp(27px, 3.95vw, 52px);
}

.h3 {
  font-size: clamp(28px, 2.7vw, 38px);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.lead {
  margin-top: 22px;
  max-width: 36em;
  font-size: clamp(17px, 1.45vw, 19.5px);
  line-height: 1.6;
  color: var(--ink-2);
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.grad--shimmer {
  background-size: 200% 100%;
  animation: shimmer 7s ease-in-out infinite alternate;
}

@keyframes shimmer {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

/* ---------- Layout ---------- */

.section {
  position: relative;
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: clamp(32px, 5vw, 64px);
}

.section-head {
  max-width: 780px;
  margin-bottom: clamp(32px, 4vw, 56px);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head--center .lead {
  margin-inline: auto;
}

.split {
  display: grid;
  gap: clamp(48px, 6vw, 96px);
  align-items: center;
}

@media (min-width: 1024px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font: 600 15px/1 var(--font-body);
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s, box-shadow 0.25s, border-color 0.25s;
}

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

.btn--sm {
  height: 40px;
  padding: 0 17px;
  font-size: 14px;
}

.btn--light {
  background: #fff;
  color: #130f20;
  box-shadow: 0 8px 26px -10px rgba(155, 135, 245, 0.65);
}

.btn--light:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 34px -8px rgba(155, 135, 245, 0.9);
}

.store-badge {
  display: inline-flex;
  flex: none;
  border-radius: 12px;
  transition: transform 0.25s var(--ease), filter 0.25s;
}

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

.store-badge--lg img {
  height: 56px;
}

.store-badge:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 12px 24px rgba(155, 135, 245, 0.45));
}

/* Placeholder for the Play Store listing: drawn inline (Google's badge can't be
   altered), grayed out and inert until there is a listing to link to. */
.store-badge--soon {
  opacity: 0.45;
  filter: grayscale(1);
  pointer-events: none;
}

.store-badge--soon .play-badge {
  display: block;
  width: auto;
  height: 50px;
}

.store-badge--lg.store-badge--soon .play-badge {
  height: 56px;
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s;
}

.nav.is-scrolled,
.nav.is-open {
  background: rgba(10, 8, 18, 0.74);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: var(--nav-h);
}

.nav__brand {
  display: inline-flex;
  color: #fff;
  border-radius: 8px;
}

.logo {
  width: calc(26px * 1336 / 284);
  height: 26px;
  fill: currentColor;
}

.nav__links {
  display: none;
  gap: 2px;
}

.nav__links a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}

.nav__links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav__toggle {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
}

.nav__toggle .i {
  width: 20px;
  height: 20px;
}

.nav__toggle .i--close,
.nav.is-open .nav__toggle .i--menu {
  display: none;
}

.nav.is-open .nav__toggle .i--close {
  display: block;
}

.nav__mobile {
  height: calc(100vh - var(--nav-h));
  height: calc(100dvh - var(--nav-h));
  padding: 8px var(--gutter) 32px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  background: rgba(8, 6, 14, 0.94);
}

.menu-open {
  overflow: hidden;
}

.nav__mobile nav {
  display: grid;
  margin-bottom: 22px;
}

.nav__mobile nav a {
  padding: 10px 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 960px) {
  .nav__links {
    display: flex;
  }

  .nav__toggle,
  .nav__mobile {
    display: none !important;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  padding: calc(var(--nav-h) + clamp(36px, 7vw, 88px)) 0 clamp(64px, 8vw, 112px);
  overflow: hidden;
  overflow: clip;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Fade the glow out instead of letting it stop hard at the section edge. */
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}

.aurora span {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
  animation: blob 22s ease-in-out infinite alternate;
}

.aurora span:nth-child(1) {
  width: 980px;
  height: 980px;
  left: -360px;
  top: -480px;
  background: radial-gradient(closest-side, rgba(103, 82, 151, 0.78), rgba(103, 82, 151, 0));
}

.aurora span:nth-child(2) {
  width: 820px;
  height: 820px;
  right: -300px;
  top: -160px;
  background: radial-gradient(closest-side, rgba(143, 124, 242, 0.42), rgba(143, 124, 242, 0));
  animation-duration: 27s;
  animation-delay: -7s;
}

.aurora span:nth-child(3) {
  width: 1200px;
  height: 640px;
  left: 18%;
  bottom: -400px;
  background: radial-gradient(closest-side, rgba(101, 140, 181, 0.3), rgba(101, 140, 181, 0));
  animation-duration: 31s;
  animation-delay: -13s;
}

@keyframes blob {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(50px, 30px, 0) scale(1.07); }
  100% { transform: translate3d(-40px, 12px, 0) scale(0.95); }
}

.gridlines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 62% 56% at 50% 32%, #000 18%, transparent 78%);
  mask-image: radial-gradient(ellipse 62% 56% at 50% 32%, #000 18%, transparent 78%);
}

.waves {
  position: absolute;
  left: 0;
  bottom: -2%;
  width: 100%;
  height: 74%;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 72%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 72%, transparent);
}

/* Side by side with the copy, keep the lines out from behind the text. */
@media (min-width: 1024px) {
  .waves {
    -webkit-mask-image:
      linear-gradient(to bottom, transparent, #000 35%, #000 72%, transparent),
      linear-gradient(to right, rgba(0, 0, 0, 0.1) 25%, #000 62%);
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(to bottom, transparent, #000 35%, #000 72%, transparent),
      linear-gradient(to right, rgba(0, 0, 0, 0.1) 25%, #000 62%);
    mask-composite: intersect;
  }
}

.waves path,
.cta__waves path {
  animation: wave-drift var(--t, 20s) linear infinite;
}

@keyframes wave-drift {
  to { transform: translateX(calc(var(--p) * -1px)); }
}

.hero__inner {
  display: grid;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}

@media (min-width: 1024px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  }
}

.hero__copy {
  max-width: 660px;
}

/* Sized so "The AI assistant" always fits one line: 84px on wide screens,
   6.25vw on laptops, 48px on phones, a little less on the narrowest ones. */
.hero__title {
  margin-top: 26px;
  font-size: min(max(48px, 6.25vw), (100vw - 2 * var(--gutter)) / 7.2, 84px);
  line-height: 0.96;
  letter-spacing: -0.045em;
}

/* "Meet Gluc": a small line above the claim, read as part of the heading. */
.hero__kicker {
  display: block;
  margin-bottom: 0.22em;
  font-size: 0.42em;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Keep "blood sugar." together on one line at every width. */
.hero__title .grad {
  white-space: nowrap;
}

.hero__lead {
  margin-top: 26px;
  max-width: 33em;
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--ink-2);
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
}

.hero-in {
  animation: rise 1s var(--ease) both;
}

.hero__copy > :nth-child(2) { animation-delay: 0.1s; }
.hero__copy > :nth-child(3) { animation-delay: 0.2s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}

.hero__visual {
  position: relative;
  display: grid;
  place-items: center;
  padding-block: 12px;
  animation: rise-visual 1.4s var(--ease) 0.15s both;
}

@keyframes rise-visual {
  from { opacity: 0; transform: translateY(48px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* Phone and its play/pause button bob together. */
.device {
  position: relative;
  z-index: 1;
  animation: bob 9s ease-in-out infinite;
}

.video-toggle {
  position: absolute;
  right: -22px;
  bottom: 72px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #fff;
  background: rgba(20, 14, 36, 0.62);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s;
}

.video-toggle:hover {
  transform: scale(1.06);
  background: rgba(20, 14, 36, 0.85);
}

.video-toggle .i {
  width: 18px;
  height: 18px;
}

/* One icon at a time: play (paused), pause (playing), replay (finished). */
.video-toggle .i--pause,
.video-toggle .i--replay,
.video-toggle.is-playing .i--play,
.video-toggle.is-ended .i--play {
  display: none;
}

.video-toggle.is-playing .i--pause,
.video-toggle.is-ended .i--replay {
  display: block;
}

.video-toggle[hidden] {
  display: none;
}

.halo {
  position: absolute;
  width: min(120%, 700px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(155, 135, 245, 0.5), rgba(103, 82, 151, 0.2) 55%, transparent 74%);
}

/* ---------- Phone frame ---------- */

.phone {
  --w: 300px;
  position: relative;
  flex: none;
  width: var(--w);
  padding: calc(var(--w) * 0.032);
  border-radius: calc(var(--w) * 0.165);
  background: linear-gradient(155deg, #4b4268 0%, #1e1829 30%, #0d0a14 68%, #2b2441 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    inset 0 0 0 calc(var(--w) * 0.013) #07060b,
    0 60px 120px -40px rgba(0, 0, 0, 0.9),
    0 30px 70px -30px rgba(103, 82, 151, 0.75);
}

.phone::before,
.phone::after {
  content: "";
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: #2b2441;
}

.phone::before {
  right: -2px;
  top: 25%;
  height: 11%;
}

.phone::after {
  left: -2px;
  top: 18%;
  height: 5%;
  box-shadow: 0 calc(var(--w) * 0.1) 0 #2b2441, 0 calc(var(--w) * 0.19) 0 #2b2441;
}

/* Dark behind the media, like a real display: the anti-aliased edge of the
   rounded clip blends into the bezel instead of showing a light rim. */
.phone__screen {
  position: relative;
  overflow: hidden;
  aspect-ratio: 680 / 1478;
  border-radius: calc(var(--w) * 0.134);
  background: #07060b;
  isolation: isolate;
}

/* Overscan by a pixel so the screen background never peeks past the media edge. */
.phone__screen > img,
.phone__screen > video {
  position: absolute;
  top: -1px;
  left: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  max-width: none;
  object-fit: cover;
}

.phone--hero {
  --w: clamp(250px, 23vw, 318px);
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* The hero still is a plain screenshot, so the Dynamic Island is drawn on it. */
.hero .phone__screen::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 1.3%;
  z-index: 1;
  width: 32%;
  height: 4.4%;
  border-radius: 999px;
  background: #000;
  transform: translateX(-50%);
}

/* ---------- Demo video ---------- */

.demo {
  overflow: clip;
}

.demo__stage {
  position: relative;
  display: grid;
  place-items: center;
  padding-block: 12px;
}

/* ---------- Checks list ---------- */

/* ---------- Why now ---------- */

/* Sits right under the hero, which carries the bottom spacing. */
.whynow {
  padding-block: clamp(8px, 1.5vw, 24px) clamp(48px, 6vw, 80px);
}

/* Statement left, paragraph right and bottom-aligned; stacked on narrow screens. */
.whynow__grid {
  display: grid;
  gap: 22px clamp(40px, 6vw, 96px);
  align-items: end;
}

.whynow__grid > .lead {
  margin-top: 0;
}

@media (min-width: 1024px) {
  .whynow__grid {
    grid-template-columns: 1.35fr 1fr;
  }
}

.nowrap {
  white-space: nowrap;
}

/* ---------- Highlights feed ----------
   App-styled highlight cards. The list is a fixed-height window with a fade at
   the bottom; the script slides a new card in at the top every few seconds. */

.feed {
  margin: 0;
  padding: 12px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
}

.feed__panel {
  padding: 14px 14px 0;
  border-radius: 18px;
  background: #f7f6fb;
  color: #221f33;
}

.feed__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 2px 12px;
  font-size: 15px;
  font-weight: 700;
}

.feed__day {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: rgba(103, 82, 151, 0.12);
}

.feed__list {
  height: 400px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 97%);
  mask-image: linear-gradient(to bottom, #000 70%, transparent 97%);
}

/* Two-line cards on a wide stacked panel or wide columns; three-line cards in the narrow two-column range. */
@media (min-width: 768px) {
  .feed__list {
    height: 340px;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .feed__list {
    height: 400px;
  }
}

.feed__item {
  display: grid;
  grid-template-rows: 1fr;
  padding-bottom: 10px;
  transition: grid-template-rows 0.55s var(--ease), padding-bottom 0.55s var(--ease), opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.feed__item.is-entering {
  grid-template-rows: 0fr;
  padding-bottom: 0;
  opacity: 0;
  transform: translateY(-8px);
}

/* The first cards cascade in with the section. */
.feed__item:nth-child(2) { --i: 1; }
.feed__item:nth-child(3) { --i: 2; }
.feed__item:nth-child(4) { --i: 3; }

.js-reveal .feed.is-in .feed__item {
  animation: feed-in 0.6s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 110ms + 200ms);
}

@keyframes feed-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.hl {
  min-height: 0;
  overflow: hidden;
  padding: 13px 15px 14px;
  border-radius: 14px;
  background: #efedf5;
  box-shadow: inset 0 0 0 1px rgba(34, 31, 51, 0.05);
}

.hl--good { background: #e7f3e2; }
.hl--high { background: #ebe9fa; }

.hl p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #4a4661;
  text-wrap: pretty;
}

.hl__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 15px;
  font-weight: 700;
  color: #221f33;
}

.hl__title .i {
  flex: none;
  width: 18px;
  height: 18px;
  color: #7a7396;
}

.hl--good .hl__title .i { color: #5a9a47; }
.hl--high .hl__title .i { color: #6f63b8; }

.hl b {
  font-weight: 700;
  color: #221f33;
}

/* ---------- AI scan demo ---------- */

.scan {
  position: relative;
  width: 100%;
  max-width: 580px;
  margin-inline: auto;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid var(--line-2);
  background: var(--bg-raise);
  box-shadow: 0 50px 110px -45px rgba(103, 82, 151, 0.95), 0 0 0 1px rgba(0, 0, 0, 0.4);
  isolation: isolate;
}

.scan__photo {
  position: relative;
  aspect-ratio: 1;
}

.scan__photo > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.8s, transform 1.4s var(--ease);
}

.scan[data-state="scanning"] .scan__photo > img {
  filter: saturate(0.85) brightness(0.82);
}

.scan[data-state="done"] .scan__photo > img {
  transform: scale(1.04);
}

.scan__frame {
  position: absolute;
  inset: 8%;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.6s, inset 0.9s var(--ease);
}

.scan__frame i {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 0 8px rgba(155, 135, 245, 0.6));
}

.scan__frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 16px; }
.scan__frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 16px; }
.scan__frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 16px; }
.scan__frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 16px; }

.scan[data-state="scanning"] .scan__frame {
  inset: 10%;
}

.scan[data-state="done"] .scan__frame {
  opacity: 0;
}

.scan__beam {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 9%;
  z-index: 2;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #c9bdff 18%, #fff 50%, #c9bdff 82%, transparent);
  box-shadow: 0 0 22px 5px rgba(155, 135, 245, 0.7);
  opacity: 0;
  pointer-events: none;
}

.scan[data-state="scanning"] .scan__beam {
  opacity: 1;
  animation: beam 1.5s ease-in-out infinite alternate;
}

@keyframes beam {
  from { top: 9%; }
  to { top: 89%; }
}

.scan__tags li {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  color: #fff;
  background: rgba(16, 12, 28, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transform: translate(-50%, -50%);
  transition: opacity 0.4s, transform 0.55s var(--ease);
}

.scan__tags li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9bdff;
  box-shadow: 0 0 0 3px rgba(201, 189, 255, 0.3);
}

.scan__tags b {
  font-weight: 600;
  color: #d9d0ff;
}

.js-scan .scan__tags li {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
}

.js-scan .scan__tags li.is-on {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.scan[data-state="done"] .scan__tags li[data-low] {
  opacity: 0;
}

@media (max-width: 560px) {
  .scan__photo {
    aspect-ratio: 4 / 5;
  }
}

.scan__status {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 7px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(16, 12, 28, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: opacity 0.4s;
}

.scan__spinner {
  display: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #c9bdff;
  animation: spin 0.8s linear infinite;
}

.scan__tick {
  width: 15px;
  height: 15px;
  color: #5fd887;
}

.scan[data-state="scanning"] .scan__spinner {
  display: block;
}

.scan[data-state="scanning"] .scan__tick {
  display: none;
}

.scan[data-state="idle"] .scan__status {
  opacity: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.scan__sheet {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: grid;
  gap: 2px;
  padding: 10px 14px 14px;
  border-radius: 26px;
  color: #1a1530;
  background: #fcfbfe;
  box-shadow: 0 -12px 40px -12px rgba(0, 0, 0, 0.55);
  transition: transform 0.8s var(--ease), opacity 0.5s;
}

.scan[data-state="idle"] .scan__sheet,
.scan[data-state="scanning"] .scan__sheet {
  opacity: 0;
  transform: translateY(calc(100% + 16px));
}

.scan__grabber {
  justify-self: center;
  width: 36px;
  height: 4px;
  margin-bottom: 8px;
  border-radius: 4px;
  background: #d8d4e3;
}

.scan__meal {
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.scan__sub {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  color: #7b6fa9;
}

.macros {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.macro {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 10px 4px 11px;
  border-radius: 15px;
}

.macro small {
  font-size: 11.5px;
  font-weight: 500;
}

.macro strong {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.3vw, 26px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.macro strong b {
  font-weight: inherit;
}

.macro strong i {
  margin-left: 1px;
  font-size: 0.55em;
  font-style: normal;
}

.macro--carbs { background: #e3e1ed; color: #4b3f72; }
.macro--protein { background: #edf7e5; color: #485041; }
.macro--fat { background: #fff6dc; color: #5d4b23; }
.macro--kcal { background: #eef2f8; color: #3a526b; }

/* The glucose response under the nutrition: the line draws itself once the
   numbers have landed, and resets when the next scan starts. */
.gl {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 10px 12px 7px;
  border-radius: 15px;
  background: #f3f1f8;
}

.gl__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: #4b3f72;
}

.gl__peak {
  color: #a1771a;
  opacity: 0;
  transition: opacity 0.3s;
}

.gl__chart {
  display: block;
  width: 100%;
  height: auto;
}

.gl__targets path {
  fill: none;
  stroke: #e06b6b;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.7;
}

.gl__axis text {
  font-family: var(--font-body);
  font-size: 8.5px;
  font-weight: 500;
  fill: #8f8aa6;
}

.gl__area {
  fill: rgba(240, 196, 80, 0.38);
  opacity: 0;
  transition: opacity 0.3s;
}

.gl__line {
  fill: none;
  stroke: #d4a12a;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.3s;
}

.gl__dot {
  fill: var(--brand);
  stroke: #fff;
  stroke-width: 2;
  opacity: 0;
  transition: opacity 0.3s;
}

.gl__peakdot {
  fill: #fff;
  stroke: #d4a12a;
  stroke-width: 2.2;
  opacity: 0;
  transition: opacity 0.3s;
}

.scan[data-state="done"] .gl__dot { opacity: 1; transition: opacity 0.3s 1s; }
.scan[data-state="done"] .gl__line { stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s var(--ease) 1.1s; }
.scan[data-state="done"] .gl__area { opacity: 1; transition: opacity 0.8s 1.7s; }
.scan[data-state="done"] .gl__peak,
.scan[data-state="done"] .gl__peakdot { opacity: 1; transition: opacity 0.4s 2.4s; }

/* ---------- Glucose impact ---------- */

/* Tablets: a swipeable row, so the tall cards don't get squeezed. Phones stack
   them in one column; from 1024px the three fit side by side. */
.impact-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(80vw, 340px);
  gap: 14px;
  margin-inline: calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}

.impact-grid::-webkit-scrollbar {
  display: none;
}

@media (max-width: 560px) {
  .impact-grid {
    grid-auto-flow: row;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-inline: 0;
    padding: 0;
    overflow: visible;
  }

  /* Stacked cards scroll into view one at a time, so skip the side-by-side stagger. */
  .js-reveal .impact-card[data-reveal] {
    transition-delay: 0ms;
  }
}

@media (min-width: 1024px) {
  .impact-grid {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-inline: 0;
    padding: 0;
    overflow: visible;
  }
}

.impact-card {
  padding: 12px 12px 26px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  scroll-snap-align: start;
}

/* Like the App Store screenshots: a real moment, with the matching app screen on top. */
.impact-card__poster {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 20px;
  isolation: isolate;
  background: var(--bg-raise);
}

.impact-card__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 30%);
  transition: transform 1.2s var(--ease);
}

.impact-card__poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 6, 14, 0) 40%, rgba(8, 6, 14, 0.6) 100%);
}

/* Anchored right and a little narrower: the people in every photo are on the left. */
.impact-card__ui {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  width: 86%;
  border-radius: 14px;
  box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.85);
  transition: transform 0.5s var(--ease);
}

.impact-card:hover .impact-card__photo {
  transform: scale(1.04);
}

.impact-card:hover .impact-card__ui {
  transform: translateY(-4px);
}

.impact-card__title {
  margin: 22px 10px 0;
  font-size: clamp(20px, 1.8vw, 23px);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.impact-card p {
  margin: 8px 10px 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Quote ---------- */

.quote {
  position: relative;
  max-width: 940px;
  margin-inline: auto;
  padding: clamp(28px, 4vw, 48px) clamp(20px, 5vw, 64px);
  overflow: hidden;
  border-radius: 32px;
  text-align: center;
  border: 1px solid var(--line);
  background: radial-gradient(80% 120% at 50% 0%, rgba(155, 135, 245, 0.14), transparent 70%), rgba(255, 255, 255, 0.02);
}

.quote__mark {
  position: absolute;
  right: -40px;
  top: -36px;
  width: 260px;
  height: 180px;
  fill: rgba(155, 135, 245, 0.07);
}

.quote blockquote p {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.quote figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  margin-top: 20px;
  font-size: 14.5px;
  color: var(--ink-3);
}

.quote figcaption b {
  font-weight: 600;
  color: var(--ink);
}

.quote__stars {
  display: inline-flex;
  gap: 2px;
  color: var(--sand);
}

.quote__stars .i {
  width: 16px;
  height: 16px;
}

/* ---------- FAQ ---------- */

.faq {
  display: grid;
  gap: 44px;
}

@media (min-width: 1024px) {
  .faq {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    align-items: start;
    gap: 88px;
  }

  .faq__head {
    position: sticky;
    top: calc(var(--nav-h) + 40px);
  }
}

.faq__head .lead a {
  color: var(--neon-soft);
}

.faq__list {
  display: grid;
  gap: 10px;
}

.faq__list details {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  transition: background-color 0.3s, border-color 0.3s;
}

.faq__list details[open] {
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.055);
}

.faq__list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-radius: 20px;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}

.faq__list summary::-webkit-details-marker {
  display: none;
}

.faq__icon {
  position: relative;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(155, 135, 245, 0.15);
}

.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  border-radius: 1px;
  background: var(--neon-soft);
  transform: translate(-50%, -50%);
  transition: transform 0.35s var(--ease);
}

.faq__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

details[open] .faq__icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.faq__a {
  padding: 0 22px 22px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.faq__a a {
  color: var(--neon-soft);
}

@supports (interpolate-size: allow-keywords) {
  :root {
    interpolate-size: allow-keywords;
  }

  .faq__list details::details-content {
    height: 0;
    overflow: clip;
    transition: height 0.4s var(--ease), content-visibility 0.4s allow-discrete;
  }

  .faq__list details[open]::details-content {
    height: auto;
  }
}

/* ---------- Final CTA ---------- */

.cta {
  padding-block: clamp(24px, 4vw, 48px) var(--section-y);
}

.cta__panel {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 40px;
  align-items: center;
  padding: clamp(36px, 6vw, 84px);
  overflow: hidden;
  border-radius: clamp(28px, 4vw, 44px);
  background: radial-gradient(90% 130% at 0% 0%, #9b88f3 0%, #7461ad 34%, #4b3c7b 70%, #2c2249 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 60px 140px -50px rgba(103, 82, 151, 0.95);
}

.cta__waves {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

.cta__title {
  max-width: 12em;
  font-size: clamp(38px, 5.4vw, 74px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.cta__title span {
  display: block;
  color: rgba(255, 255, 255, 0.6);
}

/* The real App Store icon, so the panel reads like a download card. */
.cta__icon {
  width: 72px;
  height: 72px;
  margin-bottom: 26px;
  border-radius: 17px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28), 0 18px 40px -12px rgba(20, 10, 50, 0.85);
}

.cta__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
}

.cta__lead {
  max-width: 30em;
  margin-top: 18px;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
  text-wrap: balance;
}

.cta__qr {
  display: none;
}

@media (min-width: 900px) {
  .cta__panel {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .cta__qr {
    display: grid;
    justify-items: center;
    gap: 14px;
  }
}

.qr {
  width: 176px;
  padding: 16px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
}

.qr svg {
  width: 100%;
  height: auto;
}

.cta__qr p {
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
}

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

.footer {
  padding-block: 64px 44px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(103, 82, 151, 0.08));
}

.footer__top {
  display: grid;
  gap: 44px;
}

@media (min-width: 900px) {
  .footer__top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  }
}

.logo--footer {
  width: calc(30px * 1336 / 284);
  height: 30px;
  color: #fff;
}

.footer__brand p {
  margin-top: 14px;
  font-size: 15px;
  color: var(--ink-2);
}

.footer__cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.footer__heading {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.footer__cols ul {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.footer__cols a {
  font-size: 15px;
  color: var(--ink-2);
  text-decoration: none;
}

.footer__cols a:hover {
  color: #fff;
}

.footer__legal {
  display: grid;
  gap: 12px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-3);
}

.footer__legal b {
  color: var(--ink-2);
}

.footer__copy a {
  color: var(--ink-2);
}

/* ---------- Scroll reveal ---------- */

.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0ms);
}

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

/* ---------- Reduced motion ---------- */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .aurora span,
  .waves path,
  .cta__waves path,
  .device,
  .grad--shimmer {
    animation: none !important;
  }
}
