/* FitBud hero: Split Plate photos that drift and change scene, copy on the left, live glass metric cards on the right.
   Loads after styles.css and reuses its tokens, .btn and em. The nav pill itself lives in styles.css. */

.gh { --edge: clamp(12px, 2.2vw, 36px); --pad: clamp(12px, 1.5vw, 24px); --nt: clamp(10px, 1.5vw, 22px); --nh: clamp(54px, 4.4vw, 64px); }
@media (max-width: 640px) { .gh { --nt: 8px; --nh: 52px; } }

/* Hidden only until the entrance starts. Set in <head>, removed by hero.js or after 1.2 s at the latest. The lead stays visible (LCP). */
.hero-pre .gh-bg, .hero-pre .gh-tags, .hero-pre .gh-side, .hero-pre .gh-pills, .hero-pre .gh-eyebrow, .hero-pre .gh-title, .hero-pre .gh-cta, .hero-pre .gnav > * { visibility: hidden; }

/* Liquid glass for the hero cards (blur) and its hairline pills (no blur) */
.glass { background: rgb(16 18 15 / .46); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5); box-shadow: inset 0 1px 1px rgb(255 255 255 / .1); }
.hair { background: rgb(11 12 10 / .5); box-shadow: inset 0 1px 1px rgb(255 255 255 / .08); }
.glass, .hair { position: relative; }
.glass::before, .hair::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.4px; pointer-events: none;
  background: linear-gradient(180deg, rgb(255 255 255 / .45) 0%, rgb(255 255 255 / .15) 20%, transparent 40%, transparent 60%, rgb(255 255 255 / .15) 80%, rgb(255 255 255 / .45) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude; }

/* ---------- Hero ---------- */
.gh {
  --sx1: 64; --sx2: 40;                 /* Split Plate seam: x at the top and bottom, in % */
  --ty: .3;                              /* height of the side names */
  --tx: calc(var(--sx1) - (var(--sx1) - var(--sx2)) * var(--ty));
  --h1: clamp(44px, min(6.1vw, 9.4svh), 110px);
  --num: clamp(34px, min(3.1vw, 5.2svh), 56px);
  --cw: clamp(206px, 16.6vw, 300px);
  --ch: clamp(116px, 15.6svh, 172px);
  --cg: clamp(10px, 1.3svh, 14px);
  position: relative; isolation: isolate; overflow: hidden; display: flex;
  min-height: 100vh; min-height: max(100svh, 580px); background: var(--ink);
}
.gh-bg, .gh-plate, .gh-shot, .gh-shade { position: absolute; inset: 0; }
.gh-bg { z-index: 0; will-change: transform; }
.gh-shot { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); will-change: transform, opacity; }
.gh-plate .gh-shot + .gh-shot { opacity: 0; }
.gh-pa .gh-shot:first-child { object-position: 50% 62%; }
.gh-pb { clip-path: polygon(calc(var(--sx1) * 1%) 0, 100% 0, 100% 100%, calc(var(--sx2) * 1%) 100%); }

/* The seam: a 2 px lime hairline exactly on the diagonal (corner-to-corner gradient of the seam's box) */
.gh-seam { position: absolute; top: 0; bottom: 0; left: calc(var(--sx2) * 1%); width: calc((var(--sx1) - var(--sx2)) * 1%);
  background: linear-gradient(to top left, transparent calc(50% - 1.6px), rgb(197 242 92 / .92) 50%, transparent calc(50% + 1.6px)); }
/* A lime glint that runs down the seam when the scene changes */
.gh-comet { position: absolute; z-index: 1; left: 0; top: 0; width: 3px; height: 240px; margin: -226px 0 0 -1.5px; border-radius: 3px; opacity: 0;
  transform-origin: 50% 226px; will-change: transform, opacity;
  background: linear-gradient(180deg, transparent, rgb(197 242 92 / .7) 72%, #f4ffd9 95%, transparent); }
.gh-comet::after { content: ''; position: absolute; left: -12px; right: -12px; bottom: -18px; height: 60px; background: radial-gradient(closest-side, rgb(197 242 92 / .55), transparent); }
/* Soft light sweep: plain alpha, no blend mode */
.gh-sweep { position: absolute; top: -30%; left: 0; width: 34%; height: 160%; opacity: 0; will-change: transform, opacity;
  background: linear-gradient(90deg, transparent, rgb(255 244 214 / .08) 28%, rgb(255 249 232 / .24) 50%, rgb(255 244 214 / .08) 72%, transparent); }
/* Shade keeps the copy readable over any frame */
.gh-shade { background:
  linear-gradient(90deg, rgb(11 12 10 / .94) 0%, rgb(11 12 10 / .85) 27%, rgb(11 12 10 / .52) 42%, rgb(11 12 10 / .2) 56%, rgb(11 12 10 / .18) 72%, rgb(11 12 10 / .42) 100%),
  linear-gradient(0deg, rgb(11 12 10 / .8), transparent 32%),
  linear-gradient(180deg, rgb(11 12 10 / .5), transparent 20%); }

/* Side names on the plate */
.gh-tags { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.gh-tag { position: absolute; top: calc(var(--ty) * 100%); margin-top: -16px; height: 32px; display: inline-flex; align-items: center; gap: 8px;
  padding: 0 14px 0 12px; border-radius: 999px; font: 600 13.5px/1 var(--body); color: var(--paper); white-space: nowrap; }
.gh-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.gh-tag[data-s="1"] { opacity: 0; }
.gh-tl { right: calc(100% - var(--tx) * 1% + 18px); }
.gh-tr { left: calc(var(--tx) * 1% + 18px); }

/* ---------- Layout: copy | photo | cards ---------- */
.gh-in { position: relative; z-index: 2; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px;
  padding: calc(var(--nt) + var(--nh) + clamp(18px, 3.4svh, 48px)) calc(var(--edge) + var(--pad)) clamp(26px, 4.6svh, 56px); }

.gh-eyebrow { display: inline-flex; align-items: center; gap: 9px; margin-bottom: clamp(16px, 2.8svh, 30px); padding: 8px 15px 8px 10px; border-radius: 999px;
  font: 700 12.5px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--ember); }
.gh-dot { width: 16px; height: 16px; border-radius: 50%; clip-path: circle(50% at 50% 50%);
  background: radial-gradient(circle, var(--ember) 0 3.6px, rgb(255 91 41 / .26) 4.2px 8px); }
.gh-eb { clip-path: inset(0); }

.gh-title { font: 750 var(--h1)/.96 var(--display); letter-spacing: -.032em; }
.gh-ln { display: block; overflow: hidden; padding: .08em .1em .07em 0; margin: -.08em 0 -.07em; }
.gh-ln > span { display: inline-block; }
.gh-lead { margin-top: clamp(14px, 2.8svh, 30px); max-width: 31em; text-wrap: pretty; font-size: clamp(16px, 1.32vw, 20px); line-height: 1.5; color: #dedcd4; }
.gh-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(20px, 3.6svh, 40px); }
.gh-cta .btn-ghost { background: rgb(11 12 10 / .3); }
.gh a:focus-visible, .gh button:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

/* ---------- Cards ---------- */
.gh-side { width: var(--cw); display: flex; flex-direction: column; gap: 8px; }
.gh-side-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gh-illus { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px 7px 9px; border-radius: 999px;
  font: 650 10.5px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: rgb(247 245 239 / .92); background: rgb(11 12 10 / .62); }
.gh-illus-b { display: none; align-self: flex-start; }
.gh-illus::after { content: ''; order: -1; width: 5px; height: 5px; border-radius: 50%; border: 1.3px solid currentColor; }
.gh-pause[hidden] { display: none; }
.gh-pause { display: grid; place-items: center; width: 44px; height: 44px; margin: -4px -4px -4px 0; padding: 0; border: 0; border-radius: 50%; color: var(--paper); cursor: pointer; background: none; box-shadow: none; }
.gh-pause::before { display: none; }
.gh-pause span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; position: relative; background: rgb(11 12 10 / .5); box-shadow: inset 0 0 0 1.4px rgb(255 255 255 / .22); }
.gh-pause svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.gh-pause .i-play { display: none; fill: currentColor; stroke-width: 1.4; }
.gh-pause[aria-pressed="true"] .i-play { display: block; }
.gh-pause[aria-pressed="true"] .i-pause { display: none; }

.gh-metrics { display: grid; gap: var(--cg); grid-auto-rows: minmax(var(--ch), auto); }
.gh-card { display: flex; flex-direction: column; min-width: 0; padding: 15px 16px 15px 18px; border-radius: 20px; color: var(--paper); }
.gh-lab { display: flex; align-items: center; gap: 8px; font: 650 11px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: rgb(247 245 239 / .9); transition: color .6s; }
.gh-lab svg, .gh-tick svg, .gh-chk svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.gh-lab svg { width: 15px; height: 15px; stroke-width: 1.8; flex: none; }
.gh-card.on .gh-lab { color: var(--lime); }
.gh-num { margin-top: auto; padding-top: 10px; font: 300 var(--num)/1 var(--display); letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gh-num small { font: 400 .42em/1 var(--display); letter-spacing: 0; margin-left: .08em; color: rgb(247 245 239 / .86); }
.gh-card:last-child .gh-num small { margin-left: .5em; font-family: var(--body); font-size: max(12px, .36em); font-weight: 600; }
.gh-sub { margin-top: 9px; font: 650 10.5px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: rgb(247 245 239 / .86); }

/* Protein ring */
.gh-ring { position: absolute; right: 14px; bottom: 14px; width: calc(var(--num) * 1.08); height: calc(var(--num) * 1.08); transform: rotate(-90deg); }
.gh-ring circle { fill: none; stroke-width: 3.4; }
.gh-ring .trk { stroke: rgb(247 245 239 / .14); }
.gh-ring .val { stroke: var(--lime); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 18; }
/* Workout: rolling digit, set pips, check badge */
.gh-rw { display: inline-block; height: 1em; overflow: hidden; vertical-align: top; }
.gh-roll { display: flex; flex-direction: column; transform: translateY(-50%); }
.gh-of { font: 400 .42em/1 var(--display); letter-spacing: 0; margin-left: .3em; color: rgb(247 245 239 / .86); }
.gh-pips { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 4px; }
.gh-pips i { width: 11px; height: 4px; border-radius: 2px; background: var(--lime); overflow: hidden; }
.gh-pips i:last-child { background: rgb(247 245 239 / .18); }
.gh-pips b { display: block; height: 100%; background: var(--lime); transform-origin: 0 50%; }
.gh-tick { position: absolute; right: 13px; top: 12px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--lime); color: var(--ink); }
.gh-tick svg { width: 14px; height: 14px; stroke-width: 3; }
/* Sleep bars */
.gh-bars { position: absolute; right: 16px; bottom: 16px; display: flex; align-items: flex-end; gap: 3px; height: calc(var(--num) * .66); }
.gh-bars i { width: 4px; height: calc(var(--h) * 100%); border-radius: 2px; background: rgb(247 245 239 / .34); transform-origin: 50% 100%; }
.gh-bars i:last-child { background: var(--lime); }
/* Dose check: the question flips to "Taken on time" */
.gh-ask { display: flex; align-items: center; gap: 8px; margin-top: 8px; font: 500 13px/1.2 var(--body); letter-spacing: 0; text-transform: none; color: rgb(247 245 239 / .9); }
.gh-chk { --k: 1; --d: 1; position: relative; flex: none; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgb(247 245 239 / .55); color: var(--ink); }
.gh-chk::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--lime); transform: scale(var(--k)); opacity: var(--k); }
.gh-chk svg { position: absolute; inset: 0; width: 100%; height: 100%; stroke-width: 2.8; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--d)); }
.gh-flip { position: relative; display: grid; min-width: 0; }
.gh-flip > span { grid-area: 1 / 1; white-space: nowrap; }
.gh-flip > span:first-child { opacity: 0; transform: translateY(-60%); }   /* "Did you take it?" is the first beat, "Taken on time" the resting line */

/* ---------- Pill row along the bottom (large screens only) ---------- */
.gh-pills { display: none; list-style: none; position: absolute; z-index: 3; left: calc(var(--edge) + var(--pad)); right: calc(var(--edge) + var(--pad)); bottom: clamp(18px, 3svh, 32px); gap: 10px; }
.gh-pill { position: relative; flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 44px; padding: 0 16px 0 13px; border-radius: 999px;
  font: 600 14.5px/1 var(--body); color: var(--muted); white-space: nowrap; transition: color .4s, background-color .4s; }
.gh-pill svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: color .4s; }
.gh-pill.is-on { color: var(--paper); background: rgb(36 40 33 / .72); }
.gh-pill.is-on svg { color: var(--lime); }
.gh-prog { position: absolute; left: 18px; right: 18px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--lime); transform: scaleX(0); transform-origin: 0 50%; }
@media (min-width: 900px) and (min-height: 720px) {
  .gh-pills { display: flex; }
  .gh { --ch: clamp(106px, 14.4svh, 160px); }
  .gh-in { padding-bottom: calc(44px + clamp(18px, 3svh, 32px) + 12px); }
}
@media (max-height: 700px) { .gh-tags { display: none; } }
@media (max-height: 700px) and (min-width: 900px) { .gh { --nt: 8px; --nh: 50px; --ch: 104px; --cg: 8px; --num: clamp(30px, 5svh, 40px); } .gh-card { padding-block: 12px; } }

/* Landscape: the Illustration label sits under the stack, so it stays on screen as long as any card does (portrait shows a second one below the grid) */
@media (orientation: landscape) { .gh-side { flex-direction: column-reverse; } .gh-side-top { align-self: stretch; } }

/* ---------- Under 1200px wide (landscape): tighter three zones ---------- */
@media (max-width: 1199.98px) and (orientation: landscape) {
  .gh-in { gap: 20px; }
  .gh-lead { max-width: 27em; }
}

/* ---------- Portrait: copy, then cards, then the photo fills the rest ---------- */
@media (orientation: portrait), (max-width: 480px) {
  .gh { --sx1: 86; --sx2: 34; --ty: .955; --h1: clamp(38px, min(9.9vw, 7.4svh), 76px); --num: clamp(28px, 4.4vw, 40px); --ch: clamp(94px, 12.6vw, 128px); --cg: 10px; }
  .gh-in { grid-template-columns: minmax(0, 1fr); align-content: start; gap: clamp(18px, 3svh, 36px); padding-bottom: 66px; }
  .gh-side { width: auto; }
  .gh-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gh-tag { top: auto; bottom: 18px; margin: 0; }
  .gh-illus-b { display: inline-flex; }
  .gh-shade { background: linear-gradient(180deg, rgb(11 12 10 / .95) 0%, rgb(11 12 10 / .9) 36%, rgb(11 12 10 / .6) 54%, rgb(11 12 10 / .24) 74%, rgb(11 12 10 / .3) 100%); }
}
@media (orientation: portrait) and (max-width: 600px), (max-width: 480px) {
  .gh-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gh-card { padding: 12px 12px 12px 14px; border-radius: 18px; }
  .gh-lab { font-size: 10px; letter-spacing: .14em; gap: 6px; }
  .gh-lab svg { width: 13px; height: 13px; }
  .gh-sub { font-size: 9.5px; margin-top: 7px; }
  .gh-ask { font-size: 12px; gap: 6px; margin-top: 6px; }
  .gh-chk { width: 16px; height: 16px; }
  .gh-ring { right: 11px; top: 10px; bottom: auto; width: 30px; height: 30px; }
  .gh-pips, .gh-bars { right: 12px; bottom: 12px; }
  .gh-tick { right: 10px; top: 9px; width: 20px; height: 20px; }
  .gh-in { gap: 20px; padding-top: calc(var(--nt) + var(--nh) + 18px); }
  .gh-eyebrow { margin-bottom: 14px; padding-top: 7px; padding-bottom: 7px; }
  .gh-lead { font-size: 16px; margin-top: 14px; }
  .gh-cta { margin-top: 18px; gap: 10px; }
  .gh-cta .btn { flex: 1 1 auto; }
  .gh-cta .btn-app { min-height: 56px; }
  .gh-cta .btn-ghost { display: none; }   /* the nav pill already carries "Get launch news" */
}

@media (orientation: portrait) { .gh-card.glass { background: rgb(16 18 15 / .56); } }
@media (orientation: portrait) and (max-width: 1000px) { .gh-ring { right: 11px; top: 10px; bottom: auto; width: 30px; height: 30px; } }

/* ---------- Landscape phones: copy and CTA in one screen, no card stack (the pause button stays) ---------- */
@media (orientation: landscape) and (max-height: 500px) {
  .gh { --h1: clamp(26px, 8svh, 40px); min-height: 100svh; }
  .gh-eyebrow, .gh-metrics, .gh-illus { display: none; }
  .gh-in { grid-template-columns: minmax(0, 1fr); }
  .gh-side { position: absolute; top: calc(var(--nt) + var(--nh) + 8px); right: calc(var(--edge) + var(--pad)); width: auto; }
}

/* ---------- Reduced motion: still, finished, no transitions ---------- */
@media (prefers-reduced-motion: reduce) {
  .gh-sweep, .gh-comet, .gh-pause { display: none; }
  .gh *, .gnav *, .gh-lab, .btn { transition: none !important; }
}

@media (orientation: portrait) and (min-width: 601px) and (max-width: 743.98px) { .gh-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gh { --h1: clamp(38px, min(9.9vw, 6.4svh), 76px); } .gh-in { gap: 18px; padding-bottom: 28px; } .gh-tags { display: none; } }

/* Laptops 701-800 px tall: compact nav pill so section eyebrows clear it after anchor jumps */
@media (min-width: 900px) and (min-height: 700.02px) and (max-height: 800px) { .gnav, .gh { --nt: 12px; --nh: 56px; } }
