/* One story, two reading layouts. Desktop keeps its original stage. */
.mobile-only{display:none}
picture.story-picture{display:contents}
/* Source metadata must not become empty flex items when picture is flattened. */
picture.story-picture>source{display:none}
.mobile-notice-continue{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:56px;margin-top:28px;padding:16px 18px;background:#080808;color:#fff;font:13px/1.4 monospace;text-transform:uppercase;letter-spacing:.03em}
.mobile-notice-continue:hover{color:#fff;background:#333}
.mobile-notice-continue:focus-visible{outline:2px solid #080808;outline-offset:4px}
.mobile-notice h2:focus{outline:none}
.mobile-notice-book{margin-top:64px;background:transparent;color:#080808;border:1px solid #dedede}

/* Only the welcome dialog can scroll until the visitor enters the story. */
html.mobile-gate-open{height:100%;overflow:hidden;overscroll-behavior:none;background:#fff}
html.mobile-gate-open body{position:fixed;inset:0;width:100%;height:100%!important;min-height:0;overflow:hidden;overscroll-behavior:none;background:#fff}
html.mobile-gate-open :is(#viewport,.skip,.timeline,.music-toggle,.page-grain,.cursor-trail,.site-loader){display:none!important}

@media (max-width:767px), (max-height:500px) and (pointer:coarse){
 html{scroll-behavior:smooth;scroll-padding-top:0}
 body{height:auto!important;overflow-x:clip}
 body:not(:has(footer)) #viewport,#viewport{position:relative;inset:auto;width:100%;height:auto;overflow:clip;touch-action:pan-y}
 #track{display:block;width:100%;height:auto;transform:none!important;will-change:auto}
 #track>.panel{display:block;position:relative;width:100%;height:auto;min-height:0;overflow:visible;padding:72px 24px 24px 80px;scroll-margin-top:0}
 .mobile-only{display:block}
 .ruler,.walking-character,.hero-atmosphere,.story-photo-effects,.cursor-trail,.portrait-brush{display:none!important}
 .page-grain{animation:none;will-change:auto;opacity:.025}
 #track .story-photo-ready{opacity:1!important}
 #track .panel :is(header,.prose,.school-lead,.photo-strip,.university-layout,.university-quote,.memory-window,.memory-column,.covenant-layout,.covenant-opening,.covenant-columns,.career-layout,.career-photos,.meeting-quote,.portrait-art,.ending-logo,.ending-links){position:relative;inset:auto;width:100%;max-width:none;height:auto;transform:none!important}
 #track .panel header{margin:0 0 32px}
 #track .panel h2{font-size:clamp(64px,19vw,96px);line-height:.95;letter-spacing:-.065em}
 #track .childhood h2{font-size:clamp(34px,10.4vw,68px);white-space:nowrap;letter-spacing:-.06em}
 #track .panel header p{font-size:clamp(25px,7vw,36px);line-height:1.1;letter-spacing:-.035em;margin:20px 0 0}
 #track .panel .prose{width:100%!important;font-size:17px;line-height:1.58;letter-spacing:-.015em}
 #track .panel .prose p+p{margin-top:24px}
 #track .panel :is(.photo,.memory-photo){display:block;position:relative;inset:auto;width:100%;height:auto;max-width:100%;object-fit:contain;opacity:1!important}
 /* These two exports are squeezed in the source; retain their corrected desktop proportions. */
 #track .career .photo-fill{aspect-ratio:528.297/383.676;object-fit:fill}
 #track .wedding .photo-fill{aspect-ratio:1;object-fit:fill}
 #track .panel :is(.birth-copy,.childhood-copy,.forty-copy){margin-top:28px}
 #track .panel :is(.photo-strip,.career-photos,.memory-column){display:flex;flex-direction:column;gap:20px;will-change:auto}
 #track .panel .school-lead{font-size:clamp(26px,7vw,36px);line-height:1.18;letter-spacing:-.035em;margin:36px 0 28px}
 #track .panel .school-lead p+p{margin-top:24px}
 #track .panel :is(.university-layout,.covenant-layout,.covenant-opening,.covenant-columns,.career-layout){display:flex;flex-direction:column;gap:28px;align-items:stretch;justify-content:flex-start;padding:0}
 #track .panel .university-intro{display:block}
 #track .panel .design-quote{font:italic clamp(54px,15vw,90px)/.98 'Instrument Serif',Georgia,serif;letter-spacing:-.03em;white-space:normal}
 #track .panel .university-quote{margin:16px 0 20px}
 #track .memories{padding-top:40px}
 #track .memory-window{overflow:visible;mask-image:none;-webkit-mask-image:none}
 #track .panel .career-opening{display:block}
 #track>.meeting{display:flex;align-items:center;min-height:100vh;min-height:100svh;padding-top:72px;padding-bottom:72px}
 #track .meeting-quote{max-width:5.5em!important}
 #track .wedding{display:flex;flex-direction:column;gap:20px;padding-top:0}
 #track .marriage .prose+.prose{margin-top:28px}
 #track .gratitude{padding-top:56px}
 #track>.portrait{display:none}

 /* Let the opening breathe before the timeline appears. */
 #track>.intro{display:flex;flex-direction:column;justify-content:space-between;min-height:88svh;padding:40px 24px 32px;background:#080808;color:#fff}
 #track .intro .masthead{position:relative;inset:auto;width:100%;font:10px/1.4 monospace;letter-spacing:.08em}
 #track .intro h1{position:relative;inset:auto;width:100%;transform:none;margin:80px 0;display:flex;flex-direction:column;gap:8px}
 #track .intro h1 img{position:relative;inset:auto;width:100%;height:auto;max-width:100%}
 #track .intro h1 .williams{width:92%;align-self:flex-end}
 .mobile-story-begin{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;color:#aaa;text-decoration:none;font:10px/1.4 monospace;text-transform:uppercase;letter-spacing:.04em}
 .mobile-story-begin span:last-child{color:#fff}
 #track>.bio{display:flex;align-items:center;justify-content:center;min-height:70svh;padding:72px 28px 96px;background:#080808;color:#fff}
 #track .bio>p{width:100%;max-width:22ch;font-size:clamp(26px,7.3vw,38px);line-height:1.17;letter-spacing:-.035em;text-align:center}

 /* The desktop ruler turned vertically: moving ticks, fixed orange playhead. */
 .timeline[data-orientation="vertical"]{position:fixed;inset:5dvh auto auto 0;width:76px;height:90dvh;z-index:6;touch-action:none}
 .timeline[data-orientation="vertical"] .timeline-playhead{left:0;top:var(--playhead);width:48px;height:0;border-left:0;border-top:1px solid #f05a24}
 .timeline[data-orientation="vertical"] .timeline-playhead i{left:0;top:-5px;width:6px;height:9px;clip-path:polygon(0 0,100% 50%,0 100%)}
 .timeline[data-orientation="vertical"] .timeline-playhead>.timeline-label{left:0;top:12px;width:76px;height:16px;transform:none;font-size:9px;letter-spacing:.02em}

 #track>.signature{padding:clamp(144px,20svh,200px) 24px 110px;text-align:center}
 /* The seated finale replaces the bare signature on phones. */
 #track .signature .ending-logo{display:none}
 #track .mobile-ending-portrait{max-width:360px;margin:0 auto 40px}
 #track .ending-logo :is(svg,img){height:auto;aspect-ratio:675.476/491.334}
 #track .ending-logo svg>path{mask:none}
 .mobile-ending-book{display:flex;align-items:center;justify-content:center;min-height:56px;padding:14px 10px;background:#080808;color:#fff;text-decoration:none;font:11px/1.5 monospace;text-transform:uppercase}
 #track .ending-links{display:flex;flex-direction:column;gap:12px;margin:24px 0 0;font:12px/1.5 monospace;letter-spacing:.02em}
 #track .ending-links>*{display:flex;align-items:center;justify-content:center;min-height:44px;visibility:visible!important;opacity:1!important;transform:none!important;white-space:normal}
 .mobile-back-top{display:inline-flex;align-items:center;justify-content:center;min-height:44px;margin-top:28px;color:#777;text-decoration:none;font:10px/1.4 monospace}
 /* Keep sound out of the reading column: a compact button in the ruler's gutter. */
 .music-toggle{left:max(16px,env(safe-area-inset-left));right:auto;bottom:max(12px,env(safe-area-inset-bottom));width:44px;min-height:44px;padding:0;justify-content:center}
 .music-toggle .music-label{display:none}
}

/* A quiet response to a thumb press, using the same easing as the text. */
.mobile-notice-continue,.mobile-ending-book,.mobile-back-top{transition:transform .2s cubic-bezier(.22,1,.36,1),opacity .2s ease}
.mobile-notice-continue:active,.mobile-ending-book:active,.mobile-back-top:active{transform:translateY(2px);opacity:.78}
@media(prefers-reduced-motion:no-preference){
 .mobile-notice[open] h2{animation:mobile-welcome-title .7s cubic-bezier(.22,1,.36,1) both}
 .mobile-notice[open] #mobile-notice-copy{animation:mobile-welcome-copy .55s .1s cubic-bezier(.22,1,.36,1) both}
}
@keyframes mobile-welcome-title{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:translateY(0)}}
@keyframes mobile-welcome-copy{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){
 .mobile-notice-continue,.mobile-ending-book,.mobile-back-top{transition:none}
 .mobile-notice-continue:active,.mobile-ending-book:active,.mobile-back-top:active{transform:none}
}
