/* One grid, fluid type, Safari edges and scroll-linked accents. Loaded last:
   it replaces the per-iteration indents and vw-only mobile sizes with one left
   edge and clamp() scales that hold from 320px to 4K. */
:root{
 --gutter:clamp(20px,5vw,96px);
 --edge-left:max(var(--gutter),env(safe-area-inset-left));
 --edge-right:max(var(--gutter),env(safe-area-inset-right));
 --display:clamp(52px,9.5vw + 24px,210px);
 --display-xl:clamp(76px,13vw + 34px,260px);
 --title:clamp(50px,5.2vw + 38px,132px);
 --lead:clamp(26px,3.4vw + 14px,70px);
 --body:clamp(19px,1.25vw + 14px,36px);
 --list:clamp(17px,.9vw + 13.5px,29px);
}

/* Safari 26 bars. Safari ignores theme-color and paints each bar from the
   fixed or sticky box it finds 4px inside that screen edge. A viewport-sized,
   childless, transparent fixed box counts as a dimming layer: its colour is
   read once, on its first frame, and kept, so a bare fixed canvas latched the
   dark intro into both bars for the whole page. The canvas therefore sits in a
   fixed host Safari skips (hidden, with a child, taller than 1.05 viewports)
   while the canvas itself stays visible and runs edge to edge under both bars.
   With no box at an edge Safari shows the page there, and its fallback is the
   html/body background, which follows the section tone (page-tone.js).
   Safe-area insets pad text and controls only, never the backgrounds. */
:root{--page-light:#f1e1f5;--safe-top:env(safe-area-inset-top,0px);--nav-h:56px}
html{overscroll-behavior-y:none;scroll-padding-top:calc(var(--safe-top) + var(--nav-h))}
html,body{background:#080808;transition:background-color .3s}
html[data-tone="paper"],html[data-tone="paper"] body{background:var(--page-light)}
html[data-tone="purple"],html[data-tone="purple"] body{background:var(--purple)}
html.menu-open,html.menu-open body{background:var(--ink)}
.spectral-wave-layer{position:fixed;top:0;left:0;right:0;height:120lvh;z-index:1;visibility:hidden;pointer-events:none}
.spectral-wave{position:absolute;inset:0 0 auto;width:100%;height:100lvh;visibility:visible}

/* Header: one full-width bar on the grid edges, just below the status bar,
   with no plate. On phones a wash in the current tone, fading in at the top
   and out at the bottom, keeps the wordmark legible over passing large type
   without a seam under the status bar; it never reaches above the bar.
   Desktop keeps a transparent bar. Wordmark, MENU and
   the icon share one centre line: both labels are trimmed to their cap
   height, and every control is at least 44px tall. */
@property --nav-tone{syntax:'<color>';inherits:false;initial-value:#080808}
.navigation{inset:var(--safe-top) 0 auto;height:var(--nav-h);padding:0 var(--edge-right) 0 var(--edge-left);gap:24px;line-height:1;mix-blend-mode:normal;filter:none;backdrop-filter:none;color:var(--paper);--nav-tone:#080808;transition:opacity .35s,transform .35s,color .3s,--nav-tone .3s}
html[data-tone="paper"] .navigation{color:var(--ink);--nav-tone:var(--page-light)}
html[data-tone="purple"] .navigation{color:var(--ink);--nav-tone:var(--purple)}
.wordmark{display:block;padding:16px 0;font-size:18px;font-weight:600;letter-spacing:-.03em;line-height:1;text-box:trim-both cap alphabetic}
.navigation nav a{padding:17px 0;line-height:1}
.navigation nav a::after{bottom:12px}
.menu-label{display:block;text-box:trim-both cap alphabetic}
.menu-icon{position:relative;display:block;flex:none;width:.75em;height:.75em;transition:transform .5s cubic-bezier(.22,1,.36,1)}
.menu-icon::before,.menu-icon::after{content:'';position:absolute;left:0;top:50%;width:100%;height:1.5px;margin-top:-.75px;background:currentColor}
.menu-icon::after{transform:rotate(90deg)}
@media (min-width:651px){:root{--nav-h:84px}}
@media (hover:hover) and (pointer:fine) and (min-width:651px){
 .navigation a.spectral-magnet{display:inline-block;transform:translate3d(var(--magnet-x,0px),var(--magnet-y,0px),0);transition:transform 260ms cubic-bezier(.22,1,.36,1)}
}

/* Mobile menu: a full-screen layer under the header bar (100lvh, under both
   Safari bars) on the same left edge. The bar never moves: the icon turns from
   + to x in place and the links rise in with a transition-delay stagger.
   Closed, the layer is visibility:hidden, so it takes no focus and Safari does
   not read it as a bar colour. The 1px overhang keeps the layer scrollable, so
   overscroll-behavior holds the page still (app.js also blocks stray touches). */
@media (max-width:650px){
 .navigation{background:linear-gradient(color-mix(in srgb,var(--nav-tone) 0%,transparent),color-mix(in srgb,var(--nav-tone) 86%,transparent) 30%,color-mix(in srgb,var(--nav-tone) 86%,transparent) 64%,color-mix(in srgb,var(--nav-tone) 0%,transparent));}
 .wordmark{font-size:16px;padding:17px 0}
 .navigation .menu-toggle{display:inline-flex;align-items:center;gap:10px;min-width:44px;min-height:44px;padding:0;font-size:12px;letter-spacing:.06em;line-height:1}
 .navigation.menu-open,html[data-tone] .navigation.menu-open{color:var(--paper)}
 .navigation.menu-open .menu-icon{transform:rotate(135deg)}
 .navigation nav{position:fixed;inset:0 0 auto;height:100lvh;z-index:-1;display:flex;flex-direction:column;align-items:flex-start;gap:0;padding:calc(var(--safe-top) + var(--nav-h) + clamp(16px,5svh,48px)) var(--edge-right) calc(40px + env(safe-area-inset-bottom)) var(--edge-left);background:var(--ink);color:var(--paper);font-size:clamp(34px,10.5vw,48px);font-weight:400;letter-spacing:-.045em;overflow-y:auto;overscroll-behavior:contain;opacity:0;visibility:hidden;transition:opacity .28s cubic-bezier(.4,0,.2,1),visibility 0s linear .28s}
 .navigation nav::before{content:'';position:absolute;top:0;left:0;width:1px;height:calc(100% + 1px);pointer-events:none}
 .navigation.menu-open nav{opacity:1;visibility:visible;transition:opacity .4s cubic-bezier(.22,1,.36,1),visibility 0s}
 .navigation nav a{padding:.18em 0;opacity:0;translate:0 .45em;transition:opacity .2s ease-out,translate .2s ease-out}
 .navigation nav a::after{display:none}
 .navigation.menu-open nav a{opacity:1;translate:0 0;transition:opacity .5s cubic-bezier(.22,1,.36,1) calc(90ms + var(--i,0) * 55ms),translate .7s cubic-bezier(.16,1,.3,1) calc(90ms + var(--i,0) * 55ms)}
 .navigation nav a:nth-child(2){--i:1}
 .navigation nav a:nth-child(3){--i:2}
 .navigation nav a:nth-child(4){--i:3}
 .navigation nav a:nth-child(5){--i:4}
}
.chart-position{font-variant-numeric:tabular-nums}
.paper-section,.purple-interruption{padding-left:var(--edge-left);padding-right:var(--edge-right)}
.intro-meta{left:var(--edge-left);right:var(--edge-right);bottom:calc(36px + env(safe-area-inset-bottom))}
.site-footer{padding-left:var(--edge-left);padding-right:var(--edge-right);padding-bottom:calc(34px + env(safe-area-inset-bottom))}
.no-js-note{padding-bottom:calc(15px + env(safe-area-inset-bottom))}

/* Headings: flush left on the shared edge, fluid sizes, balanced wrapping. */
.statement span:nth-child(n),.purple-interruption h2 span:nth-child(n),.section-title span:not(.period),.contact h2>span{padding-left:0}
.statement,.purple-interruption h2,.contact h2{font-size:var(--display);line-height:.88;letter-spacing:-.07em}
.section-title,.chart-heading .section-title,.playlist-presence>.section-title{font-size:var(--title);line-height:.92}
.about>.section-title{font-size:var(--display-xl);line-height:.88}
h1,h2,h3,.statement,.about-intro,.about-closing,.chart-heading p,.identity-bottom p{text-wrap:balance}

/* Text and indices start on the same edge as meta lines and headings. */
.about-body,.about-groups,.about-closing,.chart-index,.playlist-groups,.archive-index,.contact-links,.contact>.section-footnote{margin-left:0}
.about-intro{font-size:var(--lead)}
.about-body{font-size:var(--body)}
.about-closing{font-size:clamp(30px,3.6vw + 16px,76px)}
.about-group li{font-size:var(--list);padding-left:0}
.about-group li::before{left:-.85em}
.identity-bottom{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr)}
.identity-bottom p{font-size:clamp(17px,1vw + 13px,30px);justify-self:start}
.chart-entry h3{font-size:clamp(19px,1.6vw + 14px,42px)}
.playlist-group h3{font-size:clamp(34px,3.4vw + 22px,66px)}
.playlist-group li{font-size:clamp(21px,1.2vw + 17px,34px)}
.archive-index strong{font-size:clamp(23px,2.6vw + 13px,56px)}
.contact-entry a{font-size:clamp(18px,2.4vw + 11px,50px)}
@media(max-width:650px){
 .intro-meta{bottom:calc(26px + env(safe-area-inset-bottom))}
 .site-footer{padding-bottom:calc(30px + env(safe-area-inset-bottom))}
 .identity-bottom{grid-template-columns:auto minmax(0,1fr)}
 .identity-bottom p,.identity-label{grid-column:2;justify-self:start;text-align:left;min-width:0}
}

/* Text entrances (text-motion.js), transform/opacity only. Where scroll-driven
   animations exist (Safari 26, Chrome) each line follows the view timeline of
   its mask and each block its own, so text moves with the finger, momentum
   scroll included. Elsewhere a one-shot class runs the same keyframes with a
   --i stagger. Scroll-linked entrances finish within 150-160px of entering,
   so text never rests half-faded mid-screen. The mask clip covers ascenders
   and descenders; the negative margins keep the original line spacing.
   Nothing animates with reduced motion. */
.motion-line{display:block;overflow:clip;padding:.1em 0 .2em;margin:-.1em 0 -.2em;view-timeline:--motion-line block}
.motion-line-inner{display:block}
.reveal{--reveal-distance:10px;--reveal-duration:.74s;--reveal-stagger:60ms}
.reveal-label{--reveal-distance:4px;--reveal-duration:.62s;--reveal-stagger:40ms}
.reveal-artist,.reveal-number{--reveal-distance:8px}
.reveal-line{--reveal-duration:.9s;--reveal-stagger:90ms}
@media (prefers-reduced-motion:no-preference){
 @supports (animation-timeline:view()){
  .reveal-ready .reveal:not(.reveal-final){animation:reveal-rise linear both;animation-timeline:view();animation-range:entry 0% entry 160px}
  .reveal-ready .reveal-line:not(.reveal-final){animation-name:reveal-line;animation-timeline:--motion-line;animation-range:entry 0% entry 150px}
 }
 @supports not (animation-timeline:view()){
  .reveal-ready .reveal:not(.is-revealed):not(.reveal-final){opacity:0;translate:0 var(--reveal-distance)}
  .reveal-ready .reveal-line:not(.is-revealed):not(.reveal-final){opacity:1;translate:0 105%}
  .reveal-ready .reveal.is-revealed{animation:reveal-rise var(--reveal-duration) cubic-bezier(.2,.72,.2,1) both;animation-delay:calc(var(--i,0) * var(--reveal-stagger))}
  .reveal-ready .reveal-line.is-revealed{animation-name:reveal-line;animation-timing-function:cubic-bezier(.16,1,.3,1)}
 }
}
@keyframes reveal-rise{from{opacity:0;translate:0 var(--reveal-distance,10px)}to{opacity:1;translate:0 0}}
@keyframes reveal-line{from{translate:0 105%}to{translate:0 0}}

/* The live canvas sits between a section's paper and its content, so mobile
   sections must not form their own stacking context around it. */
@media (pointer:coarse),(max-width:650px){
 .spectral-wave-host{contain:none}
 .spectral-wave-host.mobile-sweep-section{isolation:auto}
 .spectral-wave-host.mobile-sweep-section::after{z-index:2}
 .spectral-wave-host.mobile-sweep-section>:not(.spectral-wave){z-index:3}
 /* A full-width gradient sweeping over a live canvas costs overdraw on phones. */
 .mobile-sweep-section::after{display:none!important}
}
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){.spectral-sweep-section::after{height:min(85svh,100%)}}

/* Photos and cards: a soft rise as they enter and a slow drift while they
   cross the viewport. Scroll-driven, so no script, frames or will-change. */
@media (prefers-reduced-motion:no-preference) and (hover:hover) and (pointer:fine){
 @supports (animation-timeline:view()){
  .artist-object,.identity-mark,.about-group,.chart-index,.playlist-group,.archive-index,.contact-entry{animation:spectral-rise linear both,spectral-drift linear both;animation-timeline:view(),view();animation-range:entry 0% entry 260px,cover 0% cover 100%}
  .artist-object{--drift:34px}
  .identity-mark{--drift:22px}
 }
}
@keyframes spectral-rise{from{opacity:0;scale:.97}to{opacity:1;scale:1}}
@keyframes spectral-drift{from{translate:0 var(--drift,16px)}to{translate:0 calc(var(--drift,16px)*-1)}}
