/* apple.css: the "Apple" layer. Calm, quiet, generous, and it moves with your scrolling. Loaded last; uses the look variables so every look keeps its colours.
   Scroll-driven parts use native CSS scroll timelines (compositor-smooth, zero JavaScript) and simply do nothing in browsers without them. */

/* ---- type: the system font (SF Pro on Apple devices, Segoe UI Variable on Windows), tighter headings, quieter small caps ---- */
:root{--glass:saturate(1.5) blur(18px)}
html:not([data-look="terminal"]){                      /* the Terminal look keeps its own monospace type */
  --hud:-apple-system,BlinkMacSystemFont,"SF Pro Display","Segoe UI Variable Display","Segoe UI",Inter,system-ui,sans-serif;
  --body:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI Variable Text","Segoe UI",Inter,system-ui,sans-serif;
  --mono:var(--body);
}
body{font-feature-settings:"ss01","cv11";-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
.pghead h1{font-size:clamp(26px,3vw,34px);font-weight:700;letter-spacing:-.025em;line-height:1.1}
.pghead p{font-size:14.5px;letter-spacing:-.005em}
header{letter-spacing:.04em}
.ttl,h3.ttl{letter-spacing:.06em}

/* ---- glass: bars and rails are frosted, not solid ---- */
@supports (backdrop-filter:blur(1px)){
  #nav,#navR{backdrop-filter:var(--glass);-webkit-backdrop-filter:var(--glass)}
  .moremenu,#hcPanel,.dialog,.wsmodal>.wsm{backdrop-filter:var(--glass);-webkit-backdrop-filter:var(--glass)}
}

/* ---- quiet controls: hairlines, soft hover, a gentle press ---- */
button.ghost,.ghost{border-color:rgb(var(--tint) / .14)}
button.ghost:hover,.ghost:hover{background:rgb(var(--tint) / .06)}
.panel{border-color:rgb(var(--tint) / .08)}

/* ---- scrolling that responds ---- */
@supports (animation-timeline:scroll()){
  /* 1. Large title that collapses into a frosted bar as the page scrolls (like iOS large titles) */
  .pv>.pghead{position:sticky;top:0;z-index:6;margin:0 -16px;padding:10px 16px 8px;transform-origin:left center;
    animation:pgBar linear both;animation-timeline:scroll(nearest block);animation-range:0 120px}
  .pv>.pghead h1{transform-origin:left center;animation:pgTitle linear both;animation-timeline:scroll(nearest block);animation-range:0 120px}
  .pv>.pghead p{animation:pgSub linear both;animation-timeline:scroll(nearest block);animation-range:0 90px}
  @keyframes pgBar{from{background-color:transparent;box-shadow:0 1px 0 transparent;backdrop-filter:blur(0)}
                   to{background-color:color-mix(in srgb,var(--bg) 78%,transparent);box-shadow:0 1px 0 rgb(var(--tint) / .09);backdrop-filter:var(--glass)}}
  @keyframes pgTitle{to{transform:scale(.78) translateY(2px)}}
  @keyframes pgSub{to{opacity:0;transform:translateY(-6px)}}

  /* 3. Panels settle into place as they scroll into view (they start a touch low and slightly small) */
  .pv>.panel,.pv>.card,.pv>.grp,.pv .stats>*,.pv .kpis>*{animation:cardSettle linear both;animation-timeline:view();animation-range:entry 0% entry 38%}
  @keyframes cardSettle{from{transform:translateY(26px) scale(.985)}}
}

/* people who prefer less motion get none of it */
@media (prefers-reduced-motion:reduce){
  .pv>.pghead,.pv>.pghead h1,.pv>.pghead p,.pv::before,.pv>.panel,.pv>.card,.pv>.grp,.pv .stats>*,.pv .kpis>*{animation:none!important}
}
