/* Scroll presentation. The underlying cards, icons and palette belong to the app. */
.scroll-story {
  --drop:1; --split:1; --crack:1; --egg:0; --impact:0; --impact-scale:1;
  --intro:1; --opening:0; --micros-title:0; --scores-title:0;
  --nutrients:1; --body:1; --score:1; --fill:1; --flow:1; --source:0;
  --header-height:88px;
  position:relative;
  isolation:isolate;
}
.story-pin { padding:36px 0 24px; display:flex; flex-direction:column; align-items:center; gap:20px; overflow:clip; }
.scroll-story.is-scroll-driven { height:420svh; }
.is-scroll-driven .story-pin { position:sticky; top:var(--header-height); height:calc(100svh - var(--header-height)); gap:12px; overflow:hidden; }
.story-top { position:relative; flex:none; }
.story-titles { position:relative; height:144px; margin-top:14px; }
.story-title { position:absolute; inset:0; margin:0; font-size:clamp(40px,4.7vw,64px); line-height:1.08; font-weight:750; letter-spacing:-.055em; }
.story-title span { color:var(--accent); }
.story-title--intro { opacity:var(--intro); }
.story-title--crack { opacity:var(--opening); }
.story-title--micros { opacity:var(--micros-title); }
.story-title--scores { opacity:var(--scores-title); }
.story-skip { position:absolute; right:0; top:3px; color:var(--muted); font-size:11px; padding:8px 0; text-decoration:none; }
.story-skip span { margin-left:12px; color:var(--accent); }
.story-skip:hover { color:var(--text); }
.story-scene { position:relative; height:360px; min-height:280px; flex:1; max-height:430px; }
.story-canvas { position:relative; width:100%; height:100%; }
.is-scroll-driven .story-scene { min-height:0; }
.is-scroll-driven .story-canvas { position:absolute; top:50%; width:100%; height:var(--canvas-height,100%); transform:translateY(-50%) scale(var(--canvas-scale,1)); transform-origin:center; }
.story-atmosphere { position:absolute; inset:-15% -10%; pointer-events:none; background:radial-gradient(ellipse at 50% 55%,#d8ff7610,transparent 46%),radial-gradient(ellipse at 20% 60%,#5ee39a09,transparent 35%); }
.egg-scene { position:absolute; inset:0; pointer-events:none; opacity:var(--egg); z-index:3; }
.egg-fall { position:absolute; width:clamp(220px,38vh,330px); aspect-ratio:1; left:50%; top:43%; transform:translate(-50%,-50%) translateY(calc(-65px + var(--drop) * 130px)) rotate(calc(-12deg + var(--drop) * 12deg)); }
.egg-shell,.egg-intact { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }
.egg-intact { opacity:max(0,calc(1 - var(--crack) * 8)); }
.egg-shell--left { clip-path:polygon(0 0,50% 0,50% 6%,47% 18%,53% 25%,47% 34%,54% 43%,48% 51%,54% 60%,47% 71%,53% 81%,50% 94%,50% 100%,0 100%); transform:translate(calc(var(--split) * -84px),calc(var(--split) * 18px)) rotate(calc(var(--split) * -32deg)); transform-origin:50% 85%; }
.egg-shell--right { clip-path:polygon(50% 0,100% 0,100% 100%,50% 100%,50% 94%,53% 81%,47% 71%,54% 60%,48% 51%,54% 43%,47% 34%,53% 25%,47% 18%,50% 6%); transform:translate(calc(var(--split) * 84px),calc(var(--split) * 18px)) rotate(calc(var(--split) * 32deg)); transform-origin:50% 85%; }
.egg-crack { position:absolute; inset:0; width:100%; height:100%; opacity:max(0,calc(1 - var(--split) * 8)); overflow:visible; }
.egg-crack path { fill:none; stroke:#442011; stroke-width:.65; stroke-dasharray:1; stroke-dashoffset:calc(1 - var(--crack)); }
.egg-inner { position:absolute; inset:0; opacity:var(--split); transform:translateY(calc(var(--split) * 35px)); }
.egg-white { position:absolute; width:68%; height:37%; left:16%; top:46%; border-radius:48% 54% 46% 58%; border:1px solid #fff7; background:radial-gradient(ellipse at 40% 20%,#fff9,transparent 48%),linear-gradient(130deg,#f5e8c496,#f5eed92b); box-shadow:inset 3px 5px 10px #ffffe236,0 14px 30px #0006; transform:scale(calc(.4 + var(--split) * .6)); }
.egg-yolk { position:absolute; width:32%; aspect-ratio:1.14; left:34%; top:46%; border-radius:50%; background:radial-gradient(ellipse at 34% 26%,#fff9ad 0%,#ffc942 17%,#ffb112 48%,#e97d08 85%); box-shadow:inset -5px -8px 12px #b8600659,2px 9px 18px #b26a0738; }
.egg-shadow { position:absolute; width:170px; height:18px; border-radius:50%; left:50%; top:88%; background:#0009; filter:blur(8px); transform:translateX(-50%) scale(calc(.5 + var(--drop) * .7)); opacity:calc(.3 + var(--drop) * .7); }
.egg-impact { position:absolute; width:200px; height:50px; left:50%; top:81%; border:1px solid #e8bd7080; border-radius:50%; opacity:var(--impact); transform:translateX(-50%) scale(var(--impact-scale)); box-shadow:0 0 25px #e8bd701a; }
.egg-caption { position:absolute; bottom:0; width:100%; text-align:center; font-size:12px; letter-spacing:.04em; color:#b4bdab; opacity:var(--intro); }
.story-connections { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; overflow:visible; }
.story-connections path { fill:none; stroke:var(--accent); stroke-width:1.2; stroke-dasharray:1; filter:drop-shadow(0 0 4px #d8ff7670); }
.connection-source { stroke-dashoffset:calc(1 - var(--source)); opacity:calc(var(--source) * (1 - var(--flow))); }
.connection-organ { stroke-dashoffset:calc(1 - var(--flow)); opacity:var(--body); }
.connection-score { stroke-dashoffset:calc(1 - var(--fill)); opacity:var(--score); }
.nutrient-particle { fill:#5ee39a; filter:drop-shadow(0 0 7px currentColor); }
.particle-a { fill:#e4c56c; }.particle-d { fill:#ff6f6f; }
.scroll-story .onboarding-explainer { height:100%; }
.is-scroll-driven .onboarding-insight { transition:none; }
.scroll-story .onboarding-explainer::before { display:none; }
.scroll-story .onboarding-insights { height:100%; align-items:center; gap:clamp(24px,6vw,90px); grid-template-columns:1fr 1.12fr .9fr; }
.scroll-story .onboarding-insight { min-height:266px; padding:24px; }
.scroll-story .story-nutrients { opacity:var(--nutrients); transform:translate(calc((1 - var(--nutrients)) * 80px),calc((1 - var(--nutrients)) * 20px)); }
.scroll-story .onboarding-key-nutrients { gap:22px; margin-block:10px; }
.scroll-story .onboarding-nutrient-track { height:4px; overflow:visible; }
.scroll-story .onboarding-nutrient-track i { opacity:1; transform:scaleX(var(--nutrients)); transform-origin:left; box-shadow:0 0 12px color-mix(in srgb,var(--insight-color) 60%,transparent); }
.scroll-story .story-body { padding:0 5px; border:0; background:none; box-shadow:none; opacity:var(--body); transform:translateY(calc((1 - var(--body)) * 30px)); }
.scroll-story .story-body::before { display:none; }
.scroll-story .onboarding-body-preview { width:100%; min-height:270px; }
.scroll-story .onboarding-body-preview > img { opacity:.65; }
.scroll-story .onboarding-organ { padding:0; min-width:56px; min-height:62px; border:0; background:none; }
.scroll-story .onboarding-organ > i { box-shadow:0 0 19px color-mix(in srgb,var(--organ-color) 32%,transparent); }
.scroll-story .onboarding-organ[aria-pressed="true"] > i { box-shadow:0 0 26px color-mix(in srgb,var(--organ-color) 55%,transparent); }
.scroll-story .onboarding-organ-track { overflow:visible; width:34px; height:3px; }
.scroll-story .onboarding-organ-track b { transform:scaleX(var(--fill)); transform-origin:left; box-shadow:0 0 8px var(--organ-color); }
.story-organ-reading { display:flex; gap:5px; align-items:baseline; font-size:9px; line-height:1.2; color:#b5c0c8; }
.story-organ-reading strong { font-size:11px; color:var(--organ-color); font-variant-numeric:tabular-nums; }
.scroll-story .organ-selection { font-size:10px; color:var(--muted); min-height:15px; text-align:center; }
.scroll-story .story-score { opacity:var(--score); transform:translateY(calc((1 - var(--score)) * 24px)); }
.scroll-story .onboarding-score-progress { stroke-dasharray:95 100; stroke-dashoffset:calc(95 * (1 - var(--fill))); filter:drop-shadow(0 0 7px #5ee39a60); }
.story-bottom { flex:none; margin-top:auto; }
.story-steps { display:grid; grid-template-columns:repeat(4,1fr); gap:20px; list-style:none; padding:0; margin:0; }
.story-steps li { position:relative; color:#a6b0bf; padding-bottom:14px; font-size:11px; border-bottom:2px solid #ffffff12; }
.story-steps li > span:first-child { margin-right:8px; font-size:9px; color:#778398; }
.story-steps li > i { position:absolute; height:2px; inset:auto 0 -2px; background:var(--accent); transform:scaleX(var(--step,1)); transform-origin:left; box-shadow:0 0 12px #d8ff764a; }
.story-steps li[aria-current="step"] { color:var(--accent); }
.story-footnote { margin-top:14px; display:flex; align-items:center; justify-content:space-between; gap:12px; color:#8793a6; font-size:9px; }
.scroll-cue { color:#b7c0ce; }
.scroll-cue > span { display:inline-block; margin-left:10px; color:var(--accent); }
.scan-section { border-top:1px solid var(--line); padding-block:90px; }
.scan-section .hero-copy h2 { font-size:clamp(46px,5.5vw,76px); line-height:1.08; letter-spacing:-.055em; margin:20px 0 28px; }
.scan-section .hero-copy h2 span { color:var(--accent); }
.scroll-story:not(.is-scroll-driven) .egg-scene,.scroll-story:not(.is-scroll-driven) .story-connections,.scroll-story:not(.is-scroll-driven) .scroll-cue { display:none; }
.scroll-story:not(.is-scroll-driven) .story-scene { height:auto; max-height:none; }
.scroll-story:not(.is-scroll-driven) .story-canvas { height:auto; }
@media(prefers-reduced-motion:no-preference) {
  .is-scroll-driven .egg-fall,.is-scroll-driven .egg-shell { will-change:transform,opacity; }
  .phone .scan-quick-review__item { transition:transform 240ms ease,border-color 240ms ease,background-color 240ms ease; }
  .phone .scan-quick-review__item:hover { transform:translateY(-2px); }
  #review-detail:not([hidden]),.detail-panel:not([hidden]) { animation:detail-appear 320ms cubic-bezier(.2,.7,.2,1) both; }
  @keyframes detail-appear { from { opacity:0; transform:translate3d(0,8px,0); } to { opacity:1; transform:translate3d(0,0,0); } }
}
@media(max-width:900px) {
  .scroll-story .onboarding-insights { gap:30px; }
  .scroll-story .onboarding-insight { padding:18px 12px; }
  .scroll-story .story-body { padding:0; }
}
@media(max-width:720px) {
  .scroll-story { --header-height:72px; }
  .scroll-story.is-scroll-driven { height:380svh; }
  .story-pin { padding:22px 0 18px; }
  .story-top .eyebrow { font-size:8px; letter-spacing:.1em; }
  .story-skip { font-size:9px; padding:0; top:2px; }
  .story-skip span { margin-left:3px; }
  .story-titles { height:100px; margin-top:18px; }
  .story-title { font-size:clamp(26px,8.2vw,48px); }
  .story-scene { min-height:330px; max-height:420px; }
  .egg-fall { width:clamp(200px,65vw,260px); top:38%; }
  .egg-caption { bottom:6px; font-size:11px; }
  .egg-shadow { top:82%; }
  .egg-impact { top:78%; }
  .scroll-story .onboarding-insights { display:grid; grid-template-columns:1.2fr 1fr; grid-template-rows:108px 1fr; gap:18px; }
  .scroll-story .story-nutrients { grid-column:1/-1; min-height:0; height:108px; padding:14px; gap:4px; }
  .scroll-story .story-nutrients > h3 { font-size:11px; align-self:start; }
  .scroll-story .onboarding-key-nutrients { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin:4px 0; }
  .scroll-story .onboarding-key-nutrients > div { display:flex; flex-direction:column; align-items:start; gap:5px; }
  .scroll-story .onboarding-nutrient-name { font-size:9px; gap:4px; }
  .scroll-story .onboarding-key-nutrients strong,.scroll-story .onboarding-key-nutrients strong small { font-size:10px; }
  .scroll-story .onboarding-nutrient-track { width:100%; margin:0; height:3px; }
  .scroll-story .story-nutrients > small { position:absolute; right:14px; top:16px; font-size:8px; }
  .scroll-story .story-body { min-height:0; height:100%; gap:6px; }
  .scroll-story .onboarding-body-preview { min-height:200px; }
  .scroll-story .onboarding-organ { min-width:48px; min-height:56px; }
  .scroll-story .onboarding-organ > i { width:29px; height:29px; }
  .scroll-story .onboarding-organ .body-outline-icon { width:19px; height:19px; }
  .scroll-story .onboarding-organ-track { width:26px; }
  .story-organ-reading { font-size:8px; gap:3px; }.story-organ-reading strong { font-size:9px; }
  .scroll-story .organ-selection { font-size:9px; }
  .scroll-story .story-score { min-height:200px; height:calc(100% - 20px); max-height:250px; padding:16px 12px; gap:12px; }
  .scroll-story .story-score h3 { font-size:12px; }
  .scroll-story .onboarding-score-ring { width:min(100%,110px); }
  .scroll-story .onboarding-score-ring strong { font-size:36px; }
  .scroll-story .onboarding-score-label { font-size:11px; }
  .story-steps { gap:7px; }
  .story-steps li { font-size:9px; padding-bottom:10px; }
  .story-steps li > span:first-child { display:block; font-size:8px; margin:0 0 4px; }
  .story-footnote { font-size:8px; gap:6px; margin-top:10px; }
  .scroll-cue { max-width:100px; }
  .scroll-cue > span { margin-left:3px; }
  .scan-section { padding-block:55px; }
}
@media(max-height:700px) and (min-width:721px) { .story-pin { padding-top:18px; } .story-titles { height:100px; } .story-title { font-size:44px; } }
@media(max-height:740px) and (max-width:720px) {
  .story-pin,.is-scroll-driven .story-pin { padding:14px 0 12px; gap:8px; }
  .story-titles { height:80px; margin-top:12px; }
  .story-scene { min-height:326px; }
  .story-footnote { margin-top:8px; font-size:7px; }
  .story-steps li { padding-bottom:8px; }
}
@media(max-height:619px) {
  .site-header .header-inner { min-height:56px; }
  .scroll-story { --header-height:56px; }
  .is-scroll-driven .story-pin { padding:10px 0; gap:8px; }
  .story-titles { height:66px; margin-top:8px; }
  .story-title { font-size:28px; }
  .story-top .eyebrow { font-size:8px; }
  .story-steps li { font-size:9px; padding-bottom:6px; }
  .story-footnote { margin-top:6px; font-size:8px; }
  .egg-fall { width:clamp(160px,38vh,220px); top:43%; transform:translate(-50%,-50%) translateY(calc(-25px + var(--drop) * 90px)) rotate(calc(-12deg + var(--drop) * 12deg)); }
}
@media(prefers-reduced-motion:reduce) { .scroll-story.is-scroll-driven { height:auto; } .is-scroll-driven .story-pin { position:relative; top:auto; height:auto; } }
