/* ============================================================
   LivBright — Scan Smarter. Live Brighter.
   Static landing page. Sections: Header · Hero · Pillars · Showcase
   ============================================================ */

/* ---------------------------------------------------------------
   1. Design tokens
   --------------------------------------------------------------- */
:root {
  /* Brand palette */
  --teal-500: #1596b0;
  --teal-green: #18c39a;
  --teal-blue: #1580a6;
  --gold: #f7ca15;
  --ink: #17323b;
  --ink-soft: #4a5a61;
  --muted: #7b8a90;
  --white: #ffffff;
  --line: #eef2f3;

  /* Status colors (scan cards) */
  --good: #34c759;
  --warn: #ff9f0a;
  --bad: #ff4d4f;

  /* Surfaces */
  --card-bg: #ffffff;

  /* Layout */
  --maxw: 1160px;
  --gutter: 24px;
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;

  /* Elevation */
  --shadow-card: 0 24px 60px rgba(6, 40, 48, 0.22);
  --shadow-soft: 0 12px 30px rgba(6, 40, 48, 0.14);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.33, 1, 0.68, 1);
  --dur: 0.6s;
  --card-gap: 16px;
}

/* ---------------------------------------------------------------
   2. Base / reset
   --------------------------------------------------------------- */
/* Custom font — Funnel Display (site-wide) */
@font-face {
  font-family: "Funnel Display";
  src: url("../assets/fonts/Archive/FunnelDisplay-Light.ttf") format("truetype");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Funnel Display";
  src: url("../assets/fonts/Archive/FunnelDisplay-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Funnel Display";
  src: url("../assets/fonts/Archive/FunnelDisplay-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Funnel Display";
  src: url("../assets/fonts/Archive/FunnelDisplay-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Funnel Display";
  src: url("../assets/fonts/Archive/FunnelDisplay-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Funnel Display";
  src: url("../assets/fonts/Archive/FunnelDisplay-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

/* Logo wordmark only — AtAero */
@font-face {
  font-family: "AtAero";
  src: url("../assets/fonts/Archive/AtAero-Medium.otf") format("opentype");
  font-weight: 500;
  font-display: swap;
}
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: "Funnel Display", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--teal-500);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.section-title {
  color: var(--white);
  text-align: center;
  font-weight: 700;
  font-size: clamp(1.5rem, 3.4vw, 2.5rem);
  letter-spacing: -0.01em;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--white); color: var(--ink);
  padding: 10px 16px; border-radius: 0 0 10px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

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

/* ---------------------------------------------------------------
   3. Header
   --------------------------------------------------------------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: transparent;
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.header.is-scrolled {
  background: rgba(19, 140, 165, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 22px rgba(6, 40, 48, 0.18);
}
.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px; gap: 24px;
}
.header__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
}
.header__brand-logo {
  height: 36px;
  width: 36px;
  flex-shrink: 0;
  object-fit: contain;
}
.header__brand-name {
  font-family: "Funnel Display", sans-serif;
  font-weight: 400;
  font-size: 1.28rem;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}
.header__nav { display: none; }
.header__nav a {
  color: var(--white); font-weight: 500; opacity: 0.92;
  position: relative; transition: opacity 0.2s;
}
.header__nav a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 2px; background: var(--gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.28s var(--ease);
}
.header__nav a:hover { opacity: 1; }
.header__nav a:hover::after { transform: scaleX(1); }

/* ---------------------------------------------------------------
   4. Hero
   --------------------------------------------------------------- */
.hero {
  position: relative; padding-top: 76px; padding-bottom: 56px; text-align: center;
  background:
    radial-gradient(166% 100% at 1% 50%, var(--teal-green) 0%, transparent 50%),
    radial-gradient(120% 100% at 92% 5%, #1aa7c0 0%, transparent 55%),
    transparent;
}

/* Centered stage — packets start behind phone, then fan out beside it */
.stage {
  position: relative;
  width: 100%;
  max-width: 880px;
  margin: 6px auto 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.stage__phone {
  position: relative;
  z-index: 3;
  display: block;
  width: clamp(260px, 38vw, 380px);
  height: auto;
  filter: drop-shadow(0 26px 50px rgba(6, 40, 48, 0.36));
  animation: phone-rise 1.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

/* All packets start collapsed at the phone centre (behind it) */
.packet {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(92px, 13vw, 130px);
  height: auto;
  z-index: 1;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.06);
  filter: drop-shadow(0 12px 22px rgba(6, 40, 48, 0.28));
  will-change: transform, opacity;
}

/* Emerge from behind phone → fan out to final positions */
.stage.is-revealed .packet {
  opacity: 1;
  animation-duration: 1.3s;
  animation-timing-function: cubic-bezier(0.34, 1.46, 0.64, 1);
  animation-fill-mode: forwards;
}
.stage.is-revealed .packet--1 { animation-name: emerge-1; animation-delay: 0s;    }
.stage.is-revealed .packet--2 { animation-name: emerge-2; animation-delay: 0.14s; }
.stage.is-revealed .packet--3 { animation-name: emerge-3; animation-delay: 0.26s; }
.stage.is-revealed .packet--4 { animation-name: emerge-4; animation-delay: 0.38s; }

/* After emerge, lock final position then float (avoids snap when animation swaps) */
.packet--1.is-settled { left: 3%;  top: 43%; right: auto; --r: -16deg; transform: translate(0, -50%) rotate(var(--r)) scale(1.1); }
.packet--2.is-settled { left: 19%; top: 34%; right: auto; --r: -8deg;  transform: translate(0, -50%) rotate(var(--r)) scale(1.1); }
.packet--3.is-settled { right: 20%; left: auto; top: 25%; --r: 10deg;  transform: translate(0, -50%) rotate(var(--r)) scale(1.1); }
.packet--4.is-settled { right: 5%;  left: auto; top: 45%; --r: 15deg;  transform: translate(0, -50%) rotate(var(--r)) scale(1.1); }

/* After animation, packets sit in front so they're fully visible beside the phone */
.packet.is-settled { z-index: 2; }
.stage.is-revealed .packet.is-settled   { animation: float 5s ease-in-out infinite; }
.stage.is-revealed .packet--2.is-settled { animation-delay: -1.25s; }
.stage.is-revealed .packet--3.is-settled { animation-delay: -2.5s; }
.stage.is-revealed .packet--4.is-settled { animation-delay: -3.75s; }

/* Phase 1: grow at phone centre (behind). Phase 2: fly outward to final spot */
@keyframes emerge-1 {
  0%   { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.06); opacity: 0; }
  18%  { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.35); opacity: 1; }
  100% { left: 3%;  top: 43%; transform: translate(0, -50%) rotate(-16deg) scale(1.1); opacity: 1; }
}
@keyframes emerge-2 {
  0%   { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.06); opacity: 0; }
  18%  { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.35); opacity: 1; }
  100% { left: 19%; top: 34%; transform: translate(0, -50%) rotate(-8deg) scale(1.1); opacity: 1; }
}
@keyframes emerge-3 {
  0%   { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.06); opacity: 0; }
  18%  { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.35); opacity: 1; }
  100% { right: 20%; left: auto; top: 25%; transform: translate(0, -50%) rotate(10deg) scale(1.1); opacity: 1; }
}
@keyframes emerge-4 {
  0%   { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.06); opacity: 0; }
  18%  { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.35); opacity: 1; }
  100% { right: 5%; left: auto; top: 45%; transform: translate(0, -50%) rotate(15deg) scale(1.1); opacity: 1; }
}

/* Pull copy up close to the phone (Figma has minimal gap) */
.hero__copy { max-width: 700px; margin: -200px auto 0; padding: 0 var(--gutter); position: relative; z-index: 4; }
.hero__title {
  color: var(--white); font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 3.9rem);
  line-height: 1.06; letter-spacing: -0.025em;
  animation: fade-up 0.7s var(--ease-out) 0.15s both;
}
.hero__tagline {
  color: var(--gold); font-weight: 700;
  font-size: clamp(1.05rem, 2.6vw, 2.2rem);
  margin: 14px 0 24px;
  animation: fade-up 0.7s var(--ease-out) 0.28s both;
}
.store-buttons {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  animation: fade-up 0.7s var(--ease-out) 0.4s both;
}
.store-buttons__link { border-radius: 10px; transition: transform 0.22s var(--ease); }
.store-buttons__link img { width: 150px; height: auto; }
.store-buttons__link:hover { transform: translateY(-3px) scale(1.02); }

/* ---------------------------------------------------------------
   5. Pillars
   --------------------------------------------------------------- */
.pillars { padding: 72px 0 84px; }
.pillars .container { text-align: center; }
.pillars__grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 30px; margin-top: 52px;
  justify-items: center;
}
.pillar {
  text-align: center;
  width: 100%;
  max-width: 260px;
  /* Start hidden for staggered reveal */
  opacity: 0;
  transform: translateY(32px) scale(0.96);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}
/* Stagger delays driven by data-pillar index */
.pillar[data-pillar="0"] { transition-delay: 0s; }
.pillar[data-pillar="1"] { transition-delay: 0.14s; }
.pillar[data-pillar="2"] { transition-delay: 0.28s; }
.pillar.is-visible {
  opacity: 1;
  transform: none;
}
/* Icon pop when pillar arrives */
.pillar.is-visible .pillar__icon {
  animation: icon-pop 0.55s var(--ease-out) both;
}
.pillar[data-pillar="0"].is-visible .pillar__icon { animation-delay: 0.18s; }
.pillar[data-pillar="1"].is-visible .pillar__icon { animation-delay: 0.32s; }
.pillar[data-pillar="2"].is-visible .pillar__icon { animation-delay: 0.46s; }

.pillar__icon {
  width: 140px; height: 140px; margin: 0 auto 22px;
  border-radius: 50%; background: var(--white);
  display: grid; place-items: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.pillar__icon img { width: 90px; height: 90px; object-fit: contain; }
.pillar:hover .pillar__icon { transform: translateY(-6px) scale(1.04); box-shadow: 0 20px 40px rgba(6,40,48,0.24); }
.pillar__title { color: var(--white); font-size: 1.22rem; font-weight: 700; margin-bottom: 10px; }
.pillar__text { color: rgba(255,255,255,0.78); font-size: 1rem; max-width: 20rem; margin: 0 auto; }

/* ---------------------------------------------------------------
   6. Scroll showcase (pinned + rotating card stack)
   --------------------------------------------------------------- */
.showcase-pin { position: relative; height: 500vh; }
.showcase {
  position: sticky; top: 0;
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 40px 0;
}
.showcase__title { margin-bottom: 56px; }
.showcase__grid {
  display: grid; grid-template-columns: 0.95fr 1.05fr;
  gap: 48px; align-items: center;
  overflow: hidden;
}

/* --- Feature list (left) --- */
.features { display: flex; flex-direction: column; gap: 4px; }
.feature {
  width: 100%; text-align: left; background: transparent; border: 0;
  cursor: pointer; padding: 14px 0; position: relative;
  display: flex; align-items: baseline; gap: 16px;
}
.feature__bullet {
  flex: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255,255,255,0.45);
  transform: translateY(2px);
  transition: background 0.4s var(--ease), width 0.4s var(--ease), height 0.4s var(--ease);
}
.feature.is-active .feature__bullet {
  background: var(--gold); width: 18px; height: 18px;
  animation: bullet-pulse 0.45s var(--ease-out);
}
.feature__title {
  display: block; color: var(--white); font-weight: 700;
  font-size: 1.7rem; transition: color 0.35s var(--ease), font-size 0.35s var(--ease);
}
.feature:not(.is-active) .feature__title { color: rgba(255,255,255,0.4); }
.feature.is-active .feature__title { color: var(--gold); font-size: 2rem; }
.feature__desc {
  display: block; color: rgba(255,255,255,0.82); font-size: 0.92rem;
  max-height: 0; opacity: 0; overflow: hidden;
  /* Slight delay so description opens after card has started moving */
  transition: max-height 0.5s var(--ease) 0.12s, opacity 0.45s var(--ease) 0.12s, margin 0.45s var(--ease) 0.12s;
}
.feature.is-active .feature__desc { max-height: 70px; opacity: 1; margin-top: 6px; }

/* --- Card stack (right) ---
   Active card is front. Previous card sits behind on the LEFT (partial + faded).
   All other cards sit fully beside each other on the RIGHT — not stacked behind. */
.stack {
  display: flex; justify-content: flex-start; align-items: center;
  min-height: 576px;
  overflow: hidden;
  padding-left: 4%;
  /* Vignette mask: fades all four edges so the peek cards (left/right)
     and the card drop-shadows (top/bottom) dissolve into the page
     instead of being clipped with hard separation edges. The active
     card region stays fully solid. */
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 4.5%, #000 62%, rgba(0,0,0,0.35) 82%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image:
    linear-gradient(to right, transparent 0%, #000 4.5%, #000 62%, rgba(0,0,0,0.35) 82%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 8%, #000 92%, transparent 100%);
          mask-composite: intersect;
}
.stack__inner {
  position: relative;
  width: min(320px, 88%); height: 480px;
  overflow: visible;
}
.card {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: var(--card-bg); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-card);
  transition:
    transform 0.85s var(--ease-smooth),
    opacity 0.75s var(--ease-smooth),
    box-shadow 0.85s var(--ease-smooth);
  overflow: hidden;
  pointer-events: none;
}

/* Active — front */
.card[data-pos="0"] {
  transform: translateX(0) scale(1);
  opacity: 1;
  z-index: 6;
  pointer-events: auto;
  box-shadow: 0 32px 72px rgba(6, 40, 48, 0.32);
}
/* Previous — only this card tucks behind on the LEFT */
.card[data-pos="left"] {
  transform: translateX(calc(-30% - 10px)) scale(0.96);
  opacity: 0.38;
  z-index: 1;
  box-shadow: 0 12px 28px rgba(6, 40, 48, 0.12);
}
/* Right cards — full card width, side-by-side (not behind active) */
.card[data-pos="1"] {
  transform: translateX(calc(100% + var(--card-gap)));
  opacity: 0.65; z-index: 5;
}
.card[data-pos="2"] {
  transform: translateX(calc(200% + var(--card-gap) * 2));
  opacity: 0.58; z-index: 4;
}
.card[data-pos="3"] {
  transform: translateX(calc(300% + var(--card-gap) * 3));
  opacity: 0.52; z-index: 3;
}
.card[data-pos="4"] {
  transform: translateX(calc(400% + var(--card-gap) * 4));
  opacity: 0.46; z-index: 2;
}

/* Image-only card variant */
.card--img { padding: 0; overflow: hidden; }
.card__screen { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }

/* --- Card internals --- */
.card__head { display: flex; align-items: flex-start; gap: 11px; padding-bottom: 14px; }
.card__avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: #eef4f6 center / cover no-repeat;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.6);
}
.card__avatar--rahul { background-image: url("../assets/images/rahul-avathar.png"); }
.card__avatar--grandpa { background-image: url("../assets/images/granpa.png"); }

.card__head--simple { align-items: center; }
.card__head--simple .card__id { gap: 0; }

.card__id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.card__name { font-weight: 700; font-size: 0.98rem; color: var(--ink); line-height: 1.1; }

/* Score pill — "Good 70/100" */
.card__score {
  display: inline-flex; align-self: flex-start; align-items: stretch;
  border-radius: 6px; overflow: hidden;
  font-size: 0.74rem; font-weight: 700; line-height: 1;
  border: 1px solid rgba(0,0,0,0.08);
}
.card__score-tag { color: #fff; padding: 4px 8px; display: inline-flex; align-items: center; }
.card__score-val { color: var(--ink); background: #fff; padding: 4px 8px; display: inline-flex; align-items: center; }
.card__score--good .card__score-tag { background: #34c759; }
.card__score--warn .card__score-tag { background: #ff9f0a; }
.card__score--bad  .card__score-tag { background: #ff4d4f; }

/* Grade shield badge (pentagon pointing down) */
.card__badge {
  flex: none; width: 42px; height: 47px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; padding-bottom: 6px; color: #fff; line-height: 1;
  clip-path: polygon(0 0, 100% 0, 100% 66%, 50% 100%, 0 66%);
}
.card__badge-label { font-size: 0.46rem; font-weight: 700; letter-spacing: 0.1em; }
.card__badge-grade { font-size: 1.2rem; font-weight: 800; }
.card__badge--a { background: linear-gradient(155deg,#4fc36b,#1f9a45); }
.card__badge--b { background: linear-gradient(155deg,#63d16a,#2ea44f); }
.card__badge--c { background: linear-gradient(155deg,#ffc24d,#f0980f); }
.card__badge--d { background: linear-gradient(155deg,#ff8a6a,#e8452a); }

/* Note box (blue rec-quantity / red alert / green ok) */
.card__note {
  display: flex; align-items: center; gap: 11px;
  border-radius: 12px; padding: 9px 12px; margin-bottom: 14px;
}
.card__note--info   { background: #e9f3fb; }
.card__note--danger { background: #fdecec; }
.card__note--ok     { background: #e8f9ef; }
.card__note-icon {
  width: 36px; height: 36px; border-radius: 9px; background: #fff; flex: none;
  display: grid; place-items: center;
}
.card__note-icon svg { width: 20px; height: 20px; }
.card__note-icon img { width: 24px; height: 24px; object-fit: contain; }
.card__note-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card__note-text i { font-style: normal; font-size: 0.76rem; color: var(--muted); }
.card__note-text b { font-size: 0.9rem; color: var(--ink); font-weight: 700; }
.card__note-mark { flex: none; font-size: 0.95rem; }
.card__note-single { font-size: 0.8rem; font-weight: 600; }
.card__note--danger .card__note-mark,
.card__note--danger .card__note-single { color: #d64545; }
.card__note--ok .card__note-mark,
.card__note--ok .card__note-single { color: #1e9d55; }

/* Section header (Positives + serving) */
.card__section { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.card__section-title { font-weight: 700; font-size: 0.98rem; color: #2ea44f; }
.card__section-title--warn { color: #e8940f; }
.card__section-title--danger { color: #d64545; }
.card__serving { font-size: 0.78rem; color: var(--muted); }

/* List rows */
.card__list { display: flex; flex-direction: column; }
.card__list li { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid #f0f2f3; }
.card__list li:last-child { border-bottom: 0; }
.ico { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; }
.ico::before {
  content: ""; width: 18px; height: 18px;
  background: url("../assets/images/weight.png") center / contain no-repeat;
}
.ico--g { background: #e4f7ea; }
.ico--o { background: #fff4e0; }
.ico--r { background: #fdecec; }
.lbl { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lbl b { font-size: 0.92rem; color: var(--ink); font-weight: 700; }
.lbl i { font-style: normal; font-size: 0.78rem; color: var(--muted); }
.val { font-size: 0.85rem; color: var(--ink-soft); font-weight: 700; }
.val--emoji { font-size: 1rem; display: inline-flex; align-items: center; }
.val--emoji img { width: 20px; height: 20px; object-fit: contain; display: block; }
.card__list li.danger .lbl b { color: #c0392b; }
.card__list li.danger .val { color: #c0392b; }

/* ---------------------------------------------------------------
   7. Did you know? carousel
   --------------------------------------------------------------- */
.dyk { padding: 80px 0 96px; text-align: center; }
.dyk__title { margin-bottom: 48px; }

.dyk__carousel {
  max-width: 900px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 48px 40px 36px;
  position: relative;
  overflow: hidden;
}

.dyk__track {
  position: relative;
  width: 100%;
  min-height: 320px;
}

.dyk__slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
  transform: translateY(14px);
}
.dyk__slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  position: relative;
}
.dyk__slide.is-leaving {
  opacity: 0;
  transform: translateY(-10px);
  position: absolute;
  pointer-events: none;
}

.dyk__img-wrap {
  width: 345px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dyk__img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.dyk__text {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.7;
  max-width: 520px;
}

.dyk__dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}
.dyk__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 0;
  background: var(--teal-500);
  opacity: 0.3;
  cursor: pointer;
  transition: opacity 0.35s var(--ease), transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0;
  position: relative;
}
.dyk__dot.is-active {
  opacity: 1;
  width: 28px;
  border-radius: 5px;
  transform: scale(1);
}

/* Auto-play progress strip inside active dot */
.dyk__dot.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.45);
  animation: dot-progress var(--dyk-interval, 4.5s) linear forwards;
  transform-origin: left center;
  transform: scaleX(0);
}

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

/* ---------------------------------------------------------------
   8. Why I built / Founder
   --------------------------------------------------------------- */
.founder {
  position: relative;
  padding: 80px 0 72px;
  background: #0e3e4a;
  text-align: center;
  overflow: hidden;
  border-top: 4px solid var(--teal-500);
}

.founder__bg-dots {
  position: absolute; inset: 0; pointer-events: none;
}
.founder__dot {
  position: absolute;
  width: 28px; height: 20px;
  border-radius: 40%;
  background: rgba(255, 255, 255, 0.06);
  transform: rotate(-25deg);
  animation: dot-drift 8s ease-in-out infinite;
}
.founder__dot--1 { top: 14%; left: 5%; width: 32px; height: 22px; transform: rotate(-35deg); animation-delay: 0s; animation-duration: 9s; }
.founder__dot--2 { top: 28%; right: 9%; width: 22px; height: 16px; transform: rotate(15deg); animation-delay: -2s; animation-duration: 7s; }
.founder__dot--3 { top: 62%; left: 12%; width: 26px; height: 18px; transform: rotate(-50deg); animation-delay: -4s; animation-duration: 11s; }
.founder__dot--4 { top: 70%; right: 6%; width: 36px; height: 24px; transform: rotate(30deg); animation-delay: -1.5s; animation-duration: 8.5s; }
.founder__dot--5 { top: 40%; left: 38%; width: 18px; height: 14px; transform: rotate(-10deg); animation-delay: -3s; animation-duration: 10s; }
.founder__dot--6 { top: 18%; right: 25%; width: 24px; height: 16px; transform: rotate(45deg); animation-delay: -5s; animation-duration: 12s; }

.founder__title { margin-bottom: 40px; }

.founder__card {
  display: flex; flex-direction: column; align-items: center;
  max-width: 640px; margin: 0 auto;
}

/* Individual reveal elements — start hidden */
.founder__reveal-1,
.founder__reveal-2,
.founder__reveal-3 {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.founder__reveal-1.is-visible { opacity: 1; transform: none; transition-delay: 0s; }
.founder__reveal-2.is-visible { opacity: 1; transform: none; transition-delay: 0.18s; }
.founder__reveal-3.is-visible { opacity: 1; transform: none; transition-delay: 0.36s; }

/* Glow pulse on avatar when it arrives */
.founder__avatar.is-visible {
  animation: avatar-glow 1.2s var(--ease-out) 0.1s both;
}

.founder__avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 16px;
}

.founder__identity {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.founder__name {
  color: var(--white);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0;
}

.founder__linkedin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--teal-500);
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}

.founder__linkedin:hover {
  color: var(--white);
  transform: translateY(-2px);
}

.founder__role {
  color: var(--teal-500);
  font-weight: 600;
  font-size: 1.1rem;
  font-style: italic;
  margin-bottom: 28px;
}

.founder__quote {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  line-height: 1.7;
  font-style: italic;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------
   9. Footer
   --------------------------------------------------------------- */
.footer {
  background: #0e3e4a;
  padding: 36px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__social {
  display: flex;
  gap: 16px;
}

.footer__icon {
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  /* Start hidden for staggered reveal */
  opacity: 0;
  transform: translateY(12px);
  transition: color 0.3s var(--ease), transform 0.3s var(--ease), opacity 0.5s var(--ease-out);
}
.footer__icon svg { width: 24px; height: 24px; }
.footer__icon[data-icon="0"] { transition-delay: 0s; }
.footer__icon[data-icon="1"] { transition-delay: 0.1s; }
.footer__icon[data-icon="2"] { transition-delay: 0.2s; }
.footer__icon.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.footer__icon:hover {
  color: var(--white);
  transform: translateY(-3px) scale(1.15);
}

.footer__copy {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
  font-weight: 500;
}

/* ---------------------------------------------------------------
   10. Scroll reveal helper
   --------------------------------------------------------------- */
/* Generic reveal (section titles, DYK carousel) */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }

/* Showcase title — slides in from left */
.showcase__title {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.showcase__title.is-visible { opacity: 1; transform: none; }

/* DYK section title — scale reveal */
.dyk__title {
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.dyk__title.is-visible { opacity: 1; transform: none; }

/* Founder title — slides from right */
.founder__title {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.founder__title.is-visible { opacity: 1; transform: none; }
/* Pillars title — slides from left */
.pillars .section-title {
  opacity: 0;
  transform: translateX(-28px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
}
.pillars .section-title.is-visible { opacity: 1; transform: none; }

/* ---------------------------------------------------------------
   8. Keyframes
   --------------------------------------------------------------- */
@keyframes phone-rise {
  0%   { opacity: 0;   transform: translateY(220px) scale(0.78); filter: drop-shadow(0 4px 12px rgba(6,40,48,0.1)); }
  30%  { opacity: 1; }
  100% { opacity: 1;   transform: translateY(0)    scale(1);    filter: drop-shadow(0 26px 50px rgba(6,40,48,0.36)); }
}
@keyframes phone-glow {
  0%   { box-shadow: 0 0 0 0 rgba(21,150,176,0); }
  50%  { box-shadow: 0 0 60px 20px rgba(21,150,176,0.22); }
  100% { box-shadow: 0 0 0 0 rgba(21,150,176,0); }
}
@keyframes float {
  0%, 100% { transform: translate(0, -50%)            rotate(var(--r, 0deg)) scale(1.1); }
  50%       { transform: translate(0, calc(-50% - 9px)) rotate(var(--r, 0deg)) scale(1.1); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
/* Pillar icon pop-in with slight overshoot */
@keyframes icon-pop {
  0%   { transform: scale(0.7); opacity: 0; }
  65%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
/* Feature bullet pulse when switching */
@keyframes bullet-pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.5); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
/* Founder background dot drift */
@keyframes dot-drift {
  0%, 100% { transform: translateY(0) rotate(var(--r, -25deg)); }
  50%       { transform: translateY(-14px) rotate(calc(var(--r, -25deg) + 8deg)); }
}
/* Avatar border glow on reveal */
@keyframes avatar-glow {
  0%   { box-shadow: 0 0 0 0 rgba(21, 150, 176, 0); }
  40%  { box-shadow: 0 0 0 10px rgba(21, 150, 176, 0.28); }
  100% { box-shadow: 0 0 0 0 rgba(21, 150, 176, 0); }
}
/* Dot progress bar sweep */
@keyframes dot-progress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
/* Slide reveal from left */
@keyframes reveal-left {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: none; }
}
/* Slide reveal from right */
@keyframes reveal-right {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: none; }
}
/* Scale reveal */
@keyframes reveal-scale {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------
   9. Responsive
   --------------------------------------------------------------- */
@media (min-width: 1440px) {
  :root { --maxw: 1240px; }
}

/* Hide mobile-only showcase elements on desktop */
@media (min-width: 901px) {
  .showcase__dots,
  .showcase__feature-label { display: none; }
}

/* Tablet & below: unpin the showcase, stack columns */
@media (max-width: 900px) {
  .pillars__grid { grid-template-columns: 1fr; gap: 44px; max-width: 420px; margin: 48px auto 0; }

  .showcase-pin { height: auto; }
  .showcase { position: static; min-height: 0; padding: 28px 0 32px; }

  /* Hide feature text list on mobile — cards tell the story */
  .showcase__grid { display: block; }
  .showcase__grid > .container,
  .showcase .container { padding: 0; }
  .features { display: none; }
  .showcase__title { padding: 0 var(--gutter); }

  /* ---- Mobile card carousel ---- */
  .stack {
    order: 0;
    padding-left: 0;
    min-height: 0;
    overflow: hidden;
    display: block;
    width: 100%;
  }
  .stack__inner {
    position: relative;
    height: auto;
    width: 100%;
    max-width: 100vw;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    display: flex;
    gap: 14px;
    /* No side padding — cards start from screen edge */
    padding: 8px 0 20px;
    box-sizing: border-box;
  }
  .stack__inner::-webkit-scrollbar { display: none; }

  /* Center-snap: offset first/last card so active card sits centered */
  .stack__inner > .card:first-child { margin-left: calc(50vw - min(40vw, 150px)); }
  .stack__inner > .card:last-child  { margin-right: calc(50vw - min(40vw, 150px)); }

  /* Cards inside the mobile scroll track — full size, snappable */
  .stack__inner > .card {
    position: static;
    width: min(80vw, 300px);
    height: 420px;
    flex-shrink: 0;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    box-shadow: var(--shadow-card);
    scroll-snap-align: center;
  }

  /* Hide the duplicate mobile track (not used in manual mode) */
  .mobile-track { display: none; }

  :root { --card-gap: 12px; }

  /* ---- Mobile dots + feature label ---- */
  .showcase__feature-label {
    text-align: center;
    padding: 16px var(--gutter) 0;
  }

  .showcase__dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 0 var(--gutter);
  }

  .showcase__dot {
    width: 8px; height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    transition: width 0.35s var(--ease), background 0.35s var(--ease);
    flex-shrink: 0;
  }

  .showcase__dot.is-active {
    width: 24px;
    background: var(--gold);
  }

  .showcase__label-title {
    color: var(--gold);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 6px;
    transition: opacity 0.3s var(--ease);
  }

  .showcase__label-desc {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.92rem;
    margin: 0;
    line-height: 1.5;
    transition: opacity 0.3s var(--ease);
  }
}

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .header__inner { height: 64px; }
  .hero { padding-top: 64px; }

  /* Tighten all section vertical padding on mobile */
  .pillars { padding: 44px 0 52px; }
  .dyk { padding: 44px 0 52px; }
  .founder { padding: 44px 0 40px; }

  .stage__phone { width: clamp(210px, 56vw, 300px); }
  .packet { width: clamp(66px, 17vw, 96px); }
  .hero__copy { margin: -90px auto 0; }

  .packet--1.is-settled { left: 0%;  top: 52%; }
  .packet--2.is-settled { left: 10%; top: 28%; }
  .packet--3.is-settled { right: 10%; left: auto; top: 25%; }
  .packet--4.is-settled { right: 0%;  left: auto; top: 50%; }

  /* Mobile emerge end-positions */
  @keyframes emerge-1 {
    0%   { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.06); opacity: 0; }
    18%  { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.35); opacity: 1; }
    100% { left: 0%; top: 52%; transform: translate(0, -50%) rotate(-16deg) scale(1.1); opacity: 1; }
  }
  @keyframes emerge-2 {
    0%   { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.06); opacity: 0; }
    18%  { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.35); opacity: 1; }
    100% { left: 10%; top: 28%; transform: translate(0, -50%) rotate(-8deg) scale(1.1); opacity: 1; }
  }
  @keyframes emerge-3 {
    0%   { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.06); opacity: 0; }
    18%  { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.35); opacity: 1; }
    100% { right: 10%; left: auto; top: 25%; transform: translate(0, -50%) rotate(10deg) scale(1.1); opacity: 1; }
  }
  @keyframes emerge-4 {
    0%   { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.06); opacity: 0; }
    18%  { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.35); opacity: 1; }
    100% { right: 0%; left: auto; top: 50%; transform: translate(0, -50%) rotate(15deg) scale(1.1); opacity: 1; }
  }

  .stack__inner { width: min(360px, 100%); height: 440px; }

  .dyk__carousel { padding: 36px 24px 32px; }
  .dyk__img-wrap { width: 160px; height: 160px; }
  .dyk__text { font-size: 1rem; }

  .founder { padding: 56px 0 48px; }

  .footer__inner { flex-direction: column; gap: 16px; text-align: center; }
}

/* ---------------------------------------------------------------
   10. Reduced motion
   --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .stage__phone { opacity: 1; }
  .packet { opacity: 1 !important; animation: none !important; }
  .stage .packet--1 { left: 3%;  top: 43%; transform: translate(0,-50%) rotate(-16deg) scale(1.1); }
  .stage .packet--2 { left: 19%; top: 34%; transform: translate(0,-50%) rotate(-8deg) scale(1.1); }
  .stage .packet--3 { right: 20%; left: auto; top: 25%; transform: translate(0,-50%) rotate(10deg) scale(1.1); }
  .stage .packet--4 { right: 5%; left: auto; top: 45%; transform: translate(0,-50%) rotate(15deg) scale(1.1); }
  .packet.is-settled { z-index: 2; }
  .reveal { opacity: 1; transform: none; }
}
