/* The flat position is also a complete, navigable fallback before enhancement. */
.scroll-story {
  --machine-width: min(1000px, 92vw, 113svh);
  --hinge: 0deg;
  --scale: 1;
  --closed: 0;
  --lit: 1;
  --ink: #211f1e;
  background: white;
  color: var(--ink);
}
.scroll-story, .scroll-story * { box-sizing: border-box; }
.studio-stage { position: relative; text-align: center; padding: 3rem 0 2rem; }
.intro-type { padding: 0 20px; }
.intro-type .signature-mark { width: clamp(62px,7.2vw,92px); height: auto; margin: 0 auto 18px; }
.signature-by { font: 570 .81rem/1.5 var(--sans); letter-spacing: .025em; color: #56524e; }
.intro-type h1 { margin: 13px 0 9px; font: 640 clamp(54px,8.2vw,124px)/1.02 var(--sans); letter-spacing: -.07em; }
.intro-type h1 em { font: italic 1.11em/.94 var(--serif); letter-spacing: -.083em; color: #302a25; }
.signature-copy { font: 400 clamp(.94rem,1.35vw,1.2rem)/1.55 var(--sans); color: #62615f; }
.open-mac { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; margin-top: 14px; color: #514b46; font: 560 .79rem/1.3 var(--sans); text-decoration: none; }
.open-mac i { position: relative; width: 10px; height: 16px; border-radius: 8px; border: 1px solid #99918c; }
.open-mac i::before { content: ""; position: absolute; width: 2px; height: 4px; top: 3px; left: 3px; border-radius: 2px; background: #a3623c; }
.story-machine { width: var(--machine-width); margin: auto; position: relative; aspect-ratio: 3/2; perspective: 2300px; perspective-origin: 50% 38%; transform: scale(var(--scale)); transform-origin: 50% 94%; }
.machine-foot, .story-lid, .lid-skin { position: absolute; inset: 0; }
.machine-foot, .lid-skin { background: url(laptop.webp) center / 100% 100% no-repeat; filter: grayscale(1); }
.machine-foot { clip-path: polygon(0 86.35%, 100% 86.35%, 100% 100%, 0 100%); }
.closed-metal { position: absolute; inset: 86% 2.2% 6.8%; background: linear-gradient(172deg,#b8b9b9,#e3e3e2 56%,#c6c7c7 90%,#9c9d9e); clip-path: polygon(5.2% 0,94.8% 0,100% 81%,99.8% 95%,.2% 95%,0 81%); opacity: var(--closed); z-index: 2; pointer-events: none; }
.story-lid { opacity: var(--lid-face,1); transform-origin: 50% 86.4%; transform: rotateX(var(--hinge)); pointer-events: none; }
.lid-skin { clip-path: polygon(6% 3%,94% 3%,94% 86.6%,6% 86.6%); }
.story-display { position: absolute; inset: 5.6% 7.61% 17.14%; background: #101111; border-radius: 2% / 3.5%; overflow: hidden; container-type: inline-size; isolation: isolate; text-align: left; }
.story-app { position: absolute; inset: 0; overflow: hidden; opacity: var(--lit); pointer-events: auto; }
.story-app[hidden] { display: none; }
.story-camera { position: absolute; z-index: 3; left: 45%; width: 10%; height: 3.3%; top: -1px; border-radius: 0 0 5px 5px; background: #0b0b0b; pointer-events: none; }
.story-copy { position: absolute; left: 6.7%; width: 43%; top: 50%; transform: translateY(-50%); z-index: 1; }
.story-copy > p:first-child { font: 620 clamp(10px,1.54cqw,15px)/1.35 var(--sans); letter-spacing: .02em; opacity: .8; }
.story-copy h2 { font: 645 clamp(24px,6.25cqw,64px)/.99 var(--sans); margin: .18em 0 .26em; letter-spacing: -.065em; overflow-wrap: normal; }
.story-copy > p:nth-child(3) { font: 440 clamp(12px,2.16cqw,20px)/1.38 var(--sans); max-width: 24ch; opacity: .89; }
.story-copy a { display: inline-flex; align-items: center; min-height: 32px; margin-top: 1.4cqw; font: 620 clamp(10px,1.62cqw,15px)/1.25 var(--sans); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.story-graphic { position: absolute; inset: 0; overflow: hidden; }
.story-dock { width: max-content; max-width: calc(100% - 12px); margin: .4rem auto 0; display: flex; justify-content: center; gap: clamp(1px,.56vw,9px); padding: 6px 9px; border: 1px solid #d9d8d7; border-radius: 20px; background: linear-gradient(#fafafa,#f0efed); box-shadow: inset 0 1px white, 0 5px 14px #24170e08; z-index: 5; }
.story-dock a { position: relative; display: grid; place-items: center; width: clamp(41px,4.1vw,56px); min-height: 44px; outline-offset: 1px; border-radius: 10px; }
.story-dock img { width: clamp(33px,3.35vw,47px); height: auto; border-radius: 23%; box-shadow: 0 2px 4px #1a17152a; transition: transform .2s; }
.story-dock [aria-current=true]::after { content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #40352c; bottom: -4px; }
.story-dock span { position: absolute; bottom: calc(100% + 9px); width: max-content; max-width: 125px; padding: 5px 9px; background: #272421; color: white; border-radius: 6px; font: 520 12px/1.2 var(--sans); opacity: 0; pointer-events: none; }
.story-dock a:focus-visible span { opacity: 1; }
@media(hover:hover) { .story-dock a:hover img { transform: translateY(-4px); } .story-dock a:hover span { opacity: 1; } }
.story-enabled .mast { position: absolute; inset: 0 0 auto; z-index: 2; background: transparent; }
.story-enabled .scroll-story { height: calc(var(--story-travel, 700svh) + 175svh); overflow-anchor: none; }
.story-enabled .studio-stage { position: sticky; top: 0; height: 100svh; padding: 0; overflow: clip; }
.story-enabled .intro-type { position: absolute; width: 100%; top: 39%; transform: translateY(calc(-50% - var(--intro-rise,0px))); opacity: var(--intro,1); z-index: 1; pointer-events: none; }
.story-enabled .intro-type a { pointer-events: auto; }
.story-enabled .story-machine {
  position: absolute; left: 50%; margin-left: calc(-.5 * var(--machine-width));
  bottom: max(12.8svh, calc(50svh - var(--machine-width) / 3));
}
.story-enabled .story-dock { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; bottom: max(2.7svh, calc(50svh - var(--machine-width) / 3 - 58px)); }
.story-enabled [data-phase=intro] .story-machine { pointer-events: none; }
.story-enabled [data-phase=intro] .story-app { pointer-events: none; }
.story-enabled .story-app[data-enter] { animation: page-reveal .32s ease-out; }
@keyframes page-reveal { from {opacity:0} to {opacity:var(--lit)} }

/* ECG Reports: clinical paper, real recorded example screens, and a drawn trace. */
.story-ecg { background: linear-gradient(112deg,#fbf5f1 8%,#fae8e2 69%,#eacbc6); color: #352126; }
.trace-paper { position: absolute; inset: 0; background: linear-gradient(90deg,#ab5b5116 1px,transparent 1px),linear-gradient(#ab5b5116 1px,transparent 1px); background-size: 3.25cqw 3.25cqw; mask-image: linear-gradient(0deg,#000, transparent 84%); }
.trace-paper svg { position: absolute; bottom: 5%; left: 0; width: 100%; height: 24%; }
.trace-paper path { stroke: #bd3348; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; fill: none; stroke-dasharray: 1; stroke-dashoffset: var(--trace,0); }
.story-handset, .story-watch { position: absolute; background: #21191c; overflow: hidden; }
.story-handset { right: 16.5%; top: 8%; height: 79%; aspect-ratio: 603/1311; border: clamp(2px,.54cqw,6px) solid #302d31; border-radius: 16%/7.5%; transform: rotate(-6deg); box-shadow: 1cqw 2cqw 3cqw #6e3c3737; }
.story-watch { right: 6.2%; top: 48%; width: 16%; aspect-ratio: 416/496; border: .55cqw solid #625956; border-radius: 27%; transform: rotate(7deg); box-shadow: .5cqw 1.3cqw 2.3cqw #31191544; }
.story-handset img,.story-watch img { width: 100%; height: 100%; object-fit: cover; }

.story-corewidgets { color: #f4f4f3; background: #151617; }
.music-wall { position: absolute; inset: 0; background: linear-gradient(95deg,#101112f2,#17191b9a 62%,#15171889),url(../corewidgets/wallpaper.jpg) center/cover; }
.story-corewidgets .story-copy h2 { font-size: 5.7cqw; }
.story-corewidgets .story-copy a { color: #ffd574; }
.story-corewidgets .corewidgets-mac-art { position: absolute; top: 51%; left: 49%; width: 46%; transform: translateY(-42%); }
.corewidgets-mac-notch {
  position: absolute; top: 3%; left: 37%; width: 26%; padding: .9cqw 0;
  background: #101112; border: 1px solid #fff2; border-radius: 0 0 1.4cqw 1.4cqw;
  color: #ffd574; text-align: center; font: 630 1.7cqw/1.2 var(--sans);
  transform-origin: center top; transform: scale(var(--notch,1));
}

/* Individual product illustrations. The page turn, mirror, and prints follow the scroll. */
.story-book { color: #352719; background: radial-gradient(ellipse at 75% 55%,#ecd4aa,#eddbbf 43%,#f6eee0); }
.spread { position: absolute; left: 52%; top: 26%; width: 43%; height: 47%; display: flex; perspective: 700px; transform: rotate(-7deg); filter: drop-shadow(.7cqw 1.7cqw 1.5cqw #60432050); }
.leaf,.turn-leaf { width: 50%; height: 100%; background: #fff9eb; border: 1.3cqw solid #fff9eb; border-bottom-width: 2cqw; border-radius: .5cqw; }
.leaf-l { background: url(cove.webp) 28% 50%/auto 105%; box-shadow: inset -1cqw 0 1cqw #21272138; }
.leaf-r { background: url(desk-wide.webp) 72% 53%/cover; box-shadow: inset .5cqw 0 .6cqw #614e3938; }
.turn-leaf { position: absolute; left: 50%; transform-origin: left; transform: rotateY(var(--turn,0deg)); background: url(cove.webp) 79% 50%/auto 105%; box-shadow: inset .5cqw 0 1cqw #483a2944; }
.story-journey { color: #fff5da; background: #282425; }
.story-fresco,.story-fresco img,.greek-coast { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-fresco img { object-position: 63% 45%; }
.story-fresco img:nth-child(2) { opacity: var(--mix,0); }
.story-fresco::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg,#16110ffa 0%,#1c1610b5 39%,transparent 82%); }
.story-ithaca { color: #ffedc0; background: radial-gradient(ellipse at 75% 50%,#315357,#172b31 62%,#18262c); }
.mirror-board { position: absolute; inset: 20% 7% 19% 51%; border: 1px solid #d2b47a75; border-radius: 1.4cqw; background: repeating-linear-gradient(0deg,transparent 0 19%,#e4e3b51c 19.3% 19.8%),repeating-linear-gradient(90deg,transparent 0 19%,#dbdfb51c 19.3% 19.8%); }
.beam { position: absolute; height: .35cqw; background: #ffd389; box-shadow: 0 0 1cqw #ffab3388; }
.beam-in { left: 2%; top: 62%; width: 54%; }
.beam-out { left: 56%; top: 62%; width: 43%; transform-origin: 0 50%; transform: rotate(var(--beam,-90deg)); }
.mirror { position: absolute; left: 56%; top: 62%; width: 24%; height: .85cqw; background: linear-gradient(#fff6db,#9ca9a8); transform: translate(-50%,-35%) rotate(var(--mirror,-45deg)); z-index: 1; }
.receiver { position: absolute; left: 56%; top: 16%; width: 10%; aspect-ratio: 1; border: .37cqw solid #e6c585; border-radius: 50%; transform: translate(-50%,-50%); background: rgb(255 209 130 / var(--mix,0)); }
.story-print { color: #253b32; background: radial-gradient(ellipse at 75% 65%,#c3d7c9,#e6efe6 65%); }
.print-proof { position: absolute; right: 14%; top: 11%; height: 78%; aspect-ratio: 210/297; padding: 2%; background: #fffefa; box-shadow: 1.2cqw 1.9cqw 2.4cqw #36574444; transform: rotate(var(--paper,5deg)); }
.proof-pictures { height: 100%; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 4%; }
.proof-pictures i { background: url(cove.webp) 30% 45%/cover; transform: translateY(var(--lift,0px)); }
.proof-pictures i:nth-child(2) { background-position: 76% 45%; }
.proof-pictures i:nth-child(3) { background: url(desk-wide.webp) 82% 50%/cover; }
.proof-pictures i:nth-child(4) { background: url(island-atlas-mobile.webp) center/cover; }
.story-lexi { color: #18424b; background: #d7ebe6; }
.greek-coast { left: 38%; width: 62%; background: url(cove.webp) center/cover; mask-image: linear-gradient(90deg,transparent,#000 48%); }
.language-card { position: absolute; right: 7%; top: 32%; width: 36%; padding: 5% 4%; border-radius: 1cqw; background: #fffaf0; box-shadow: 1cqw 2cqw 4cqw #223b4355; transform: rotate(var(--paper,-5deg)); }
.language-card span { font: italic 5.5cqw/1.2 var(--serif); }
.language-card em { display: block; margin-top: 1.3cqw; font: 520 2.2cqw/1.3 var(--sans); opacity: var(--translation,1); }
.story-walk-replay { color: #f3f1ec; background: radial-gradient(ellipse at 76% 55%, #443820, #252629 62%, #191b1e); }
.story-walk-replay .story-copy a { color: #ffd574; }
.story-walk-replay .walk-replay-portfolio-art { position: absolute; inset: 9% 4% 9% 49%; }
.story-walk-replay .wr-stage-art { background: transparent !important; }

@media(max-width:650px) {
  .scroll-story { --machine-width: min(99vw,113svh); }
  .story-enabled .scroll-story { height: calc(var(--story-travel, 700svh) + 150svh); }
  .story-enabled .intro-type { top: 34%; }
  .story-enabled .story-dock { bottom: max(6.5svh, calc(50svh - var(--machine-width) / 3 - 80px)); }
  .story-dock { padding: 4px; gap: 0; border-radius: 15px; }
  .story-dock a { width: min(44px,13vw); }
  .story-dock span { display: none; }
  .story-copy > p:nth-child(3) { font-size: max(10px,2.65cqw); }
  .story-copy > p:first-child { font-size: max(8px,2.2cqw); }
  .story-copy a { margin-top: .5cqw; min-height: 23px; font-size: max(9px,2.4cqw); }
  .story-copy h2 { font-size: 6.55cqw; }
  .story-corewidgets .story-copy h2 { font-size: 5.8cqw; }
}
@media(max-width:369px) {
  .story-dock:has([data-scene="walk-replay"]) { display: grid; grid-template-columns: repeat(4, 44px); }
  .story-enabled .story-dock:has([data-scene="walk-replay"]) { bottom: 2.7svh; }
}
@media(max-height:520px) and (min-aspect-ratio:1/1) {
  .intro-type .signature-mark { width: 43px; margin-bottom: 4px; }
  .intro-type h1 { font-size: 54px; margin: 4px 0; }
  .open-mac { margin-top: 0; min-height: 27px; }
  .story-dock { transform-origin: center bottom; }
  .story-enabled .story-dock { transform: translateX(-50%) scale(.84); bottom: 3px; }
}
@media(prefers-reduced-motion:reduce) {
  .scroll-story *, .scroll-story *::before { animation: none!important; transition: none!important; }
  .scroll-story { scroll-behavior: auto; }
}
.intro-type h1 em { margin-left: .045em; }
.lid-skin::after { content: ""; position: absolute; inset: 5.45% 7.58% 17%; background: #0b0b0b; }
.story-corewidgets[data-enter] .corewidgets-mac-notch { animation: expand-notch .46s cubic-bezier(.2,.75,.22,1) both; }
@keyframes expand-notch { from { clip-path: inset(0 41% 96% round 1cqw); } to { clip-path: inset(0 0 0 round 1cqw); } }
.mobile-chapter { display: none; }
@media(max-width:520px) and (min-height:580px) {
  .story-enabled .story-walk-replay .walk-replay-portfolio-art { inset: 6% 13%; }
  .story-enabled .mobile-chapter:not([hidden]) { display: block; position: absolute; bottom: calc(50% + var(--machine-width) / 3 + 1px); width: 100%; padding: 0 22px; }
  .mobile-chapter h2 { font-size: clamp(27px,8.4vw,38px); margin-bottom: 4px; }
  .mobile-chapter p { font-size: 15px; line-height: 1.4; color: #55514d; max-width: 28ch; margin: auto; }
  .mobile-chapter a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; text-underline-offset: 3px; }
  .story-enabled .story-copy { display: none; }
  .story-enabled .story-handset { right: 32%; }
  .story-enabled .story-watch { right: 18%; width: 17%; }
  .story-enabled .spread { left: 15%; width: 70%; top: 18%; height: 62%; }
  .story-enabled .story-fresco::after { background: linear-gradient(0deg,#201a1740,transparent); }
  .story-enabled .mirror-board { inset: 12% 18%; }
  .story-enabled .print-proof { right: 34%; }
  .story-enabled .language-card { right: 26%; width: 45%; }
  .story-enabled .greek-coast { left: 0; width: 100%; }
  .story-enabled .story-corewidgets .corewidgets-mac-art { left: 14%; width: 72%; }
  .story-enabled .corewidgets-mac-notch { left: 33%; width: 34%; font-size: 2.1cqw; }
}
