/* ==========================================================================
   Grey Sky Capital: philosophy page (philosophy.html)
   --------------------------------------------------------------------------
   Technical Summary
   - Two parts: a slate-900 intro band (same measuring grid as the product
     intro) and the founders' letter on paper.
   - Why / Who / What: a slim sticky bar under the nav jumps between the three
     parts and marks the one in view. Each part opens with a big display word.
   - Why: the letter, handwritten in Kalam (--font-hand, letter only;
     DESIGN-SYSTEM.md) on wrinkled paper in the site's paper greys. Wrinkles,
     fibres and grain are inline SVG noise; darker edges and fold creases are
     gradients; two more sheets are fanned beneath; a printed letterhead. Each paragraph inks in line by line as it is read. The
     three decisions open with the homepage's pen scribble (motion.js); the
     closing line is in rust, the text-safe accent on paper.
   - Sign-off: the founders' photos taped on as two prints (lime and azure
     tape), their names signed in Kalam, roles, then "Meet the full team".
   - Who: founder cards from GSC.founders: 16:10 photo, role, name, ruled
     points, quote, LinkedIn.
   - The Grey Sky verse: an animated sky. Smart Foundation is a rocket, Smart
     Core the sun, satellites orbit it, Smart Treasury is a station. Every
     colour is a GSCD-2.1 token: each live strategy wears its own accent
     (Core lime, Foundation pink, Satellite yellow, Flexi Cap flare, Treasury
     azure); planned satellites are paper with a dashed outline. Under every
     body, SVG tags: PMS (azure-ink), AIF (flare), GIFT City (ink); Live (lime,
     blinking dot), Soon (dashed), Planned (dotted, muted). Nothing below the sky.
     All motion stops under reduced motion; a button pauses it otherwise.
   - Motion: the sheet settles once, then ink follows the reader; none under
     reduced motion or without JS.
   ========================================================================== */

/* Kalam (400, 700; latin + latin-ext; SIL Open Font License), self-hosted,
   for the founders' letter only (DESIGN-SYSTEM.md, Typography). */
@font-face {
  font-family: 'Kalam'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/kalam-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Kalam'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/kalam-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Kalam'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/kalam-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Kalam'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/kalam-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------- Why / Who / What */
.pnav {
  position: sticky; top: var(--nav-h); z-index: 40; margin-top: var(--nav-h);
  background: rgb(242 244 242 / .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--paper-300);
}
.pnav__inner { display: flex; gap: clamp(8px, 3vw, 40px); }
.pnav__link {
  position: relative; display: inline-flex; align-items: baseline; gap: 8px; min-height: 52px; padding-top: 16px;
  font-size: 17px; font-weight: 600; color: var(--ink-muted); text-decoration: none;
  transition: color .25s var(--ease);
}
.pnav__no { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .1em; color: var(--ink-muted); }
.pnav__link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink-head);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.pnav__link:hover, .pnav__link[aria-current="true"] { color: var(--ink-head); }
.pnav__link[aria-current="true"]::after { transform: scaleX(1); }
.pnav__link[aria-current="true"] .pnav__no { color: var(--rust); }
html { scroll-padding-top: calc(var(--nav-h) + 64px); }

.part__head { display: grid; gap: 14px; margin-bottom: clamp(36px, 5vw, 64px); max-width: 820px; }
.part__no { color: var(--rust); }
.part__title {
  margin: 0 0 0 -0.045em; color: var(--ink-head);
  font-size: var(--hero-size); line-height: var(--hero-lh); letter-spacing: var(--hero-tr); font-weight: 700;
}
.part__sub { margin: 0; font-size: var(--d2-size); line-height: var(--d2-lh); letter-spacing: var(--d2-tr); font-weight: 700; color: var(--ink-head); }
.part__lede { margin: 0; max-width: 62ch; color: var(--ink-body); }

/* ---------------------------------------------------------------- Who */
.who { background: var(--paper-100); padding: var(--space-chapter) 0; }
/* One line on who runs the money, above the founders */
.who__proof { display: grid; gap: clamp(24px, 3vw, 40px); margin-bottom: clamp(48px, 6vw, 80px); }
.who__claim { margin: 0; max-width: 22ch; font-size: clamp(30px, 4vw, 56px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; color: var(--ink-head); }
.who__claim span { display: block; color: var(--moss); }
.who__team { justify-self: start; }
.who__tag { margin: 0; font-family: var(--font-mono); font-size: var(--eyebrow-size); font-weight: 500; letter-spacing: var(--eyebrow-tr); text-transform: uppercase; color: var(--ink-muted); }
.who__founders { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 48px 40px; }
.wfounder { display: flex; flex-direction: column; gap: 14px; }
.wfounder__photo { aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-200); border: 1px solid var(--paper-300); }
.wfounder__photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.wfounder:hover .wfounder__photo img { transform: scale(1.03); }
.wfounder__role { margin: 8px 0 0; }
.wfounder__name { margin: 0; font-size: var(--d2-size); line-height: var(--d2-lh); letter-spacing: var(--d2-tr); font-weight: 700; color: var(--ink-head); }
.wfounder__points { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--paper-300); }
.wfounder__points li { padding: 10px 0; border-top: 1px solid var(--paper-300); font-size: var(--body-size); line-height: var(--body-lh); color: var(--ink-body); }
.wfounder__link { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; color: var(--rust); text-decoration: none; }
.wfounder__link:hover { color: var(--ink-head); }

/* ---------------------------------------------------------------- Letter
   A sheet of paper on the desk, in the site's own paper greys. It has been
   handled: crumpled and smoothed out (a lit SVG relief, multiplied over the
   sheet), fibres and grain, edges a shade darker, a faint thumb mark, two fold
   creases, and two more sheets fanned beneath. All textures are inline SVG
   noise, no files. */
.letter {
  background: var(--paper-200); padding: clamp(56px, 6vw, 88px) 0 var(--space-chapter);
  overflow: hidden;   /* the fanned sheets never cause a sideways scroll */
}
.sheet { position: relative; max-width: 820px; margin: 0 auto; }
.sheet::before, .sheet::after {
  content: ''; position: absolute; inset: 0; border-radius: 3px;
  background: var(--paper-100) radial-gradient(ellipse at center, transparent 50%, rgb(200 208 205 / .6) 100%);
  box-shadow: 0 1px 2px rgb(13 18 21 / .06), 0 8px 24px rgb(13 18 21 / .06);
  transition: transform 1.2s var(--ease);
}
.sheet::before { transform: rotate(-2.2deg) translate(-10px, 14px); }
.sheet::after  { transform: rotate(1.4deg) translate(12px, 6px); }

.sheet__paper {
  position: relative; z-index: 1; isolation: isolate; border-radius: 3px;
  padding: clamp(28px, 7vw, 88px) clamp(22px, 7vw, 84px) clamp(36px, 6vw, 72px);
  background-color: var(--paper-100);
  background-image:
    /* fold creases at a third and two thirds: a shadow edge with a lit edge below */
    linear-gradient(180deg, transparent calc(33.3% - 14px), rgb(13 18 21 / .06) calc(33.3% - 1px), rgb(255 255 255 / .7) 33.3%, transparent calc(33.3% + 16px)),
    linear-gradient(180deg, transparent calc(66.6% - 14px), rgb(13 18 21 / .06) calc(66.6% - 1px), rgb(255 255 255 / .7) 66.6%, transparent calc(66.6% + 16px)),
    /* handled: edges a shade darker, one corner more, a faint thumb mark */
    radial-gradient(ellipse 120% 90% at 50% 45%, transparent 60%, rgb(200 208 205 / .5) 90%, rgb(110 124 130 / .22) 100%),
    radial-gradient(circle at 90% 6%, rgb(200 208 205 / .5), transparent 20%),
    radial-gradient(ellipse 9% 6% at 84% 92%, rgb(110 124 130 / .08), transparent 70%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='.012 .09' numOctaves='2' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .43  0 0 0 0 .49  0 0 0 0 .51  0 0 -1.6 0 .9'/></filter><rect width='100%25' height='100%25' filter='url%28%23f%29' opacity='.22'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .05  0 0 0 0 .07  0 0 0 0 .08  0 0 0 .08 0'/></filter><rect width='100%25' height='100%25' filter='url%28%23n%29'/></svg>");
  box-shadow: inset 0 0 50px rgb(110 124 130 / .12), 0 1px 1px rgb(13 18 21 / .05), 0 12px 28px -6px rgb(13 18 21 / .14), 0 40px 80px -24px rgb(13 18 21 / .18);
  transition: transform 1.2s var(--ease), opacity 1.2s var(--ease);
}
/* Wrinkles: a crumpled relief lit from the top left, multiplied over the paper,
   under the writing */
.sheet__paper::after {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='900'><filter id='w' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='.0055 .008' numOctaves='5' seed='4' stitchTiles='stitch'/><feDiffuseLighting lighting-color='white' surfaceScale='3.4' diffuseConstant='1'><feDistantLight azimuth='235' elevation='56'/></feDiffuseLighting><feComponentTransfer><feFuncR type='linear' slope='1.2'/><feFuncG type='linear' slope='1.2'/><feFuncB type='linear' slope='1.2'/></feComponentTransfer></filter><rect width='100%25' height='100%25' filter='url%28%23w%29'/></svg>") 0 0 / 900px 900px;
  mix-blend-mode: multiply; opacity: .55;
}

/* The sheet arrives once: it settles onto the desk and the sheets beneath fan out */
.js .sheet:not(.is-in) .sheet__paper { transform: translateY(28px) rotate(-.6deg); opacity: 0; }
.js .sheet:not(.is-in)::before, .js .sheet:not(.is-in)::after { transform: none; }

/* Letterhead: printed, in the brand's own lock-up and type (never Kalam) */
.sheet__head {
  display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 20px 32px;
  margin-bottom: clamp(28px, 4vw, 48px);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.4;
}
.sheet__brand { display: flex; align-items: center; gap: 12px; }
.sheet__mark { width: 58px; height: auto; flex: none; mix-blend-mode: multiply; }
.sheet__word { display: flex; flex-direction: column; gap: 5px; }
.sheet__grey { font-weight: 700; font-size: 25px; line-height: .82; letter-spacing: -.03em; color: var(--ink-head); white-space: nowrap; }
.sheet__cap { font-family: var(--font-mono); font-weight: 500; font-size: 11px; line-height: 1; letter-spacing: 1.17em; color: var(--ink-muted); }
.sheet__addr {
  display: grid; justify-items: end; gap: 2px; font-style: normal; text-align: right;
  font-family: var(--font-mono); font-size: 11px; line-height: 1.5; letter-spacing: .04em; color: var(--ink-muted);
}
.sheet__head .sheet__re {
  grid-column: 1 / -1; margin: clamp(8px, 2vw, 20px) 0 0;
  font-family: var(--font-mono); font-size: var(--eyebrow-size); font-weight: 500; letter-spacing: var(--eyebrow-tr); text-transform: uppercase; color: var(--rust);
}
@media (max-width: 560px) {
  .sheet__head { grid-template-columns: 1fr; }
  .sheet__addr { justify-items: start; text-align: left; }
}

.letter__body {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: .85em;   /* a long phrase can never widen the page */
  font-family: var(--font-hand); font-weight: 400;
  font-size: clamp(21px, .6vw + 18px, 26px); line-height: 1.6; color: var(--ink-body);
}
.letter__body p { margin: 0; }
.letter__decision .mk { font-weight: 700; }
@media (max-width: 560px) { .letter__decision .mk { white-space: normal; } }   /* "We would rather be good than big." wraps on phones; its pen line follows each line */
.letter__body .letter__close {
  margin-top: .5em;
  font-size: 1.45em; line-height: 1.2; font-weight: 700;
  color: var(--rust); transform: rotate(-1.5deg); transform-origin: left center;
}

/* Ink as you read, line by line. philosophy.js wraps every word in .ink-w and sets
   --ink (0..1) from the line's position against the reading line: ink-muted before,
   written word by word in its own colour as the line crosses it, muted again when
   scrolled back. Ink-muted reads at 5.78:1 on the paper, so unwritten words stay
   readable (WCAG 1.4.3). A short transition smooths the steps between scroll frames.
   Off without JS and under reduced motion (the words are never wrapped). */
.js .letter__body.is-inking .ink-w {
  color: color-mix(in srgb, currentColor calc(var(--ink, 0) * 100%), var(--ink-muted));
  transition: color .22s linear;
}
@media (prefers-reduced-motion: reduce) {
  .js .letter__body.is-inking .ink-w { color: inherit !important; transition: none; }
}

/* Sign-off: two photos taped to the page */
.letter__sign { margin-top: clamp(20px, 3vw, 36px); display: grid; gap: 18px; }
.letter__photos { display: flex; align-items: flex-start; padding: 10px 0 4px 6px; }
.polaroid {
  position: relative; margin: 0; width: clamp(120px, 18vw, 158px); padding: 8px 8px 0;
  background: var(--paper-100); border: 1px solid var(--paper-300);
  box-shadow: 0 2px 4px rgb(13 18 21 / .08), 0 14px 26px -10px rgb(13 18 21 / .28);
  transition: transform .5s var(--ease);
}
.polaroid img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; object-position: 50% 22%; filter: saturate(.92) contrast(1.02); }
.polaroid figcaption { padding: 4px 2px 8px; text-align: center; font-family: var(--font-hand); font-size: 19px; color: var(--ink-body); }
.polaroid--a { transform: rotate(-4deg); z-index: 1; }
.polaroid--b { transform: rotate(3deg) translate(-14px, 12px); }
.polaroid:hover { transform: rotate(0) translateY(-4px); z-index: 2; }
.polaroid__tape {
  position: absolute; top: -10px; left: 50%; width: 64px; height: 20px; margin-left: -32px;
  background: rgb(196 242 90 / .55); transform: rotate(-3deg);
  box-shadow: 0 1px 1px rgb(13 18 21 / .06);
}
.polaroid--b .polaroid__tape { transform: rotate(4deg); background: rgb(127 168 255 / .45); }

.letter__people { display: flex; flex-wrap: wrap; gap: 6px 28px; list-style: none; margin: 0; padding: 0; }
.letter__person { display: grid; gap: 2px; }
.letter__name { font-family: var(--font-hand); font-size: 30px; font-weight: 700; line-height: 1.15; color: var(--ink-head); transform: rotate(-2deg); transform-origin: left bottom; }
.letter__role { font-family: var(--font-mono); font-size: var(--eyebrow-size); letter-spacing: var(--eyebrow-tr); text-transform: uppercase; color: var(--ink-muted); }


@media (max-width: 560px) {
  .sheet::before { transform: rotate(-1.4deg) translate(-4px, 10px); }
  .sheet::after  { transform: rotate(1deg) translate(5px, 5px); }
}
@media (prefers-reduced-motion: reduce) {
  .js .sheet:not(.is-in) .sheet__paper { transform: none; opacity: 1; }
  .sheet::before, .sheet::after, .sheet__paper, .polaroid { transition: none; }
}

/* ---------------------------------------------------------------- The Grey Sky verse */
.verse { background: var(--paper-100); padding: var(--space-chapter) 0; border-top: 1px solid var(--paper-300); }
.verse > .wrap { display: grid; gap: clamp(28px, 3vw, 40px); }
.verse__head { display: grid; gap: 18px; }
.verse__lede { max-width: 62ch; }
.verse__lede b { color: var(--ink-head); font-weight: 600; }

/* Scene */
.vscene { position: relative; overflow: hidden; background: var(--paper-200); border: 1px solid var(--paper-300); border-radius: 20px; }
.vscene__svg { display: block; width: 100%; height: auto; }
/* Phones: philosophy.js redraws the sky in portrait (viewBox 640 x 1360): the sun
   in the middle, the satellites on a tall orbit, the rocket and the station side
   by side at the bottom, and larger names (the tags' 17px) with their tags stacked, so the whole
   sky fits the screen width and stays readable. */
.vscene.is-portrait .vs-lbl { font-size: 17px; }   /* the tags' size: long names fit the narrow sky */
.vscene.is-portrait .vs-tag { font-size: 17px; }
.vscene.is-portrait .vtag text { font-size: 17px; }
.vscene.is-portrait .vs-comet { display: none; }
.vscene__motion {
  position: absolute; top: 12px; right: 12px; z-index: 1; min-height: 32px; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--paper-100); color: var(--ink-head); border: 1px solid var(--paper-300); border-radius: 999px; padding: 7px 12px;
}
.vscene__motion:focus-visible, .vnode:focus-visible { outline: 3px solid var(--azure-ink); outline-offset: 3px; }
.vnode { cursor: pointer; }
.vnode:focus:not(:focus-visible) { outline: none; }   /* mouse clicks only: keyboard focus keeps the outline above (WCAG 2.4.7) */
.vscene .vnode:focus-visible .vs-halo { opacity: 1; stroke: var(--azure-ink); }   /* azure-ink halo, 6:1 on the sky (WCAG 1.4.11) */

.vscene .vs-stroke { stroke: var(--ink-head); fill: none; stroke-linecap: round; stroke-linejoin: round; }
.vscene .vs-faint { opacity: .6; }
.vscene .vs-star { fill: var(--ink-head); }
.vscene .vs-moon { fill: var(--yellow); }
.vscene .vs-orbit { stroke: var(--ink-head); stroke-width: 1.4; stroke-dasharray: 6 9; fill: none; opacity: .55; }
.vscene .vs-traj { stroke: var(--ink-head); stroke-width: 2.2; stroke-dasharray: 10 10; fill: none; animation: vs-march 1.6s linear infinite; }
.vscene .vs-tag { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .1em; fill: var(--rust); text-anchor: middle; }
.vscene .vs-lbl { font-family: var(--font-mono); font-size: 13px; font-weight: 500; letter-spacing: .06em; fill: var(--ink-head); text-anchor: middle; text-transform: uppercase; }
.vscene .vs-halo { fill: none; stroke: var(--lime); stroke-width: 5; opacity: 0; }
.vscene .vs-shade { fill: var(--ink-head); opacity: .14; }
.vscene .vs-window { fill: var(--azure); }
.vscene .vs-cloud { fill: var(--paper-300); }
.vscene .vs-cloud2 { fill: var(--paper-100); }

/* Smart Core: the sun */
.vscene .vs-glow { fill: var(--yellow); opacity: .28; transform-box: fill-box; transform-origin: center; animation: vs-breathe 4s ease-in-out infinite; }
.vscene .vs-rays { transform-box: fill-box; transform-origin: center; animation: vs-spin 80s linear infinite; }
.vscene .vs-ray { fill: var(--yellow); }
.vscene .vs-sun { fill: var(--lime); }
/* Smart Foundation: the rocket */
.vscene .vs-lift { animation: vs-launch 2.6s cubic-bezier(.2, .7, .2, 1) both, vs-bob 5s ease-in-out 2.6s infinite; }
.vscene .vs-flame { fill: var(--flare); transform-box: fill-box; transform-origin: top center; animation: vs-flick .22s ease-in-out infinite alternate; }
.vscene .vs-nozzle { fill: var(--ink-muted); }
.vscene .vs-fin { fill: var(--flare); }
.vscene .vs-body { fill: var(--pink); }
/* Smart Treasury: the station */
.vscene .vs-float { animation: vs-bob 6s ease-in-out infinite; }
.vscene .vs-panel { fill: var(--azure); }
.vscene .vs-dome { fill: var(--paper-300); }
.vscene .vs-hull { fill: var(--azure); }
.vscene .vs-beacon { fill: var(--flare); animation: vs-blink 1.4s steps(2, end) infinite; }
/* Satellites (drawn by philosophy.js) */
.vscene .vs-disc { fill: var(--acc, var(--paper-100)); }
.vscene .vnode[data-accent="yellow"] { --acc: var(--yellow); }
.vscene .vnode[data-accent="flare"]  { --acc: var(--flare); }
.vscene .vnode[data-planned] .vs-disc { fill: var(--paper-100); }
.vscene .vnode[data-planned] .vs-rim { stroke-dasharray: 5 5; }
.vscene .vs-ring { fill: var(--lime); }
.vscene .vs-detail { fill: var(--ink-head); opacity: .22; }
/* Ambient */
.vscene .vs-drift { animation: vs-drift 26s ease-in-out infinite alternate; }
.vscene .vs-drift2 { animation: vs-drift 38s ease-in-out infinite alternate-reverse; }
.vscene .vs-comet { animation: vs-comet 13s linear infinite; }
.vscene .vs-tw { animation: vs-twinkle 3.2s ease-in-out infinite; }
.vscene.is-paused, .vscene.is-paused * { animation-play-state: paused !important; }

@keyframes vs-spin { to { transform: rotate(360deg); } }
@keyframes vs-breathe { 50% { transform: scale(1.08); opacity: .75; } }
@keyframes vs-pulse { 50% { stroke-width: 9; opacity: .45; } }
@keyframes vs-march { to { stroke-dashoffset: -20; } }
@keyframes vs-launch { from { transform: translateY(150px); } to { transform: translateY(0); } }
@keyframes vs-bob { 50% { transform: translateY(-9px); } }
@keyframes vs-flick { to { transform: scaleY(1.25); } }
@keyframes vs-blink { 50% { opacity: .15; } }
@keyframes vs-drift { to { transform: translateX(46px); } }
@keyframes vs-twinkle { 50% { opacity: .2; } }
@keyframes vs-comet { 0% { transform: translate(1260px, -40px); opacity: 0; } 4% { opacity: 1; } 22% { transform: translate(700px, 250px); opacity: 0; } 100% { transform: translate(700px, 250px); opacity: 0; } }

/* Tags under every body (drawn by philosophy.js): format, then status */
.vscene .vtag rect { stroke-width: 1; }
.vscene .vtag text { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .06em; text-anchor: middle; }
.vscene .vtag--pms rect { fill: var(--azure-ink); }
.vscene .vtag--pms text { fill: var(--paper-100); }
.vscene .vtag--aif rect { fill: var(--flare); }
.vscene .vtag--aif text { fill: var(--ink-head); }
.vscene .vtag--gift rect { fill: var(--ink-head); }
.vscene .vtag--gift text { fill: var(--paper-100); }
.vscene .vtag--live rect { fill: var(--lime); }
.vscene .vtag--live text { fill: var(--ink-head); }
.vscene .vtag__dot { fill: var(--ink-head); animation: vs-blink 1.4s steps(2, end) infinite; }
.vscene .vtag--soon rect { fill: var(--paper-100); stroke: var(--ink-muted); stroke-dasharray: 4 3; }
.vscene .vtag--soon text { fill: var(--ink-head); }
.vscene .vtag--planned rect { fill: var(--paper-200); stroke: var(--grey-500); stroke-dasharray: 1.5 3; }
.vscene .vtag--planned text { fill: var(--ink-muted); }
/* Live bodies are links: the halo shows on hover and focus */
.vscene a.vnode:hover .vs-halo, .vscene a.vnode:focus-visible .vs-halo { opacity: 1; animation: vs-pulse 1.8s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .vscene * { animation: none !important; }
}

/* ---------------------------------------------------------------- Trivia: why "Grey Sky"
   A pinned stretch of scroll (philosophy.js, greySky). The sticky sky takes its colour
   from --gsky-bg, mixed in JS from tokens: paper-100 -> an azure tint (blue sky) ->
   slate-900 (black sky) -> paper-300 (grey sky). JS also sets --gsky-ink and the layer
   levels: --sun, --set (the sun going down), --fair, --night, --rain, --over, --mark.
   Only illustration fills (sun, clouds, stars); copy stays ink or grey-100. */
.gsky { position: relative; background: var(--paper-300); color: var(--ink-head); border-top: 1px solid var(--paper-300); }   /* a rule above: the trivia is its own block, as What is from Who */
.gsky__sticky { position: relative; overflow: hidden; padding: var(--space-chapter) 0; }
.gsky__inner { position: relative; z-index: 1; display: grid; gap: clamp(16px, 2vw, 24px); }
.gsky__eyebrow { color: currentColor; opacity: .72; }
.gsky__title { margin: 0 0 0 -0.045em; font-size: var(--d1-size); line-height: var(--d1-lh); letter-spacing: var(--d1-tr); font-weight: 700; color: currentColor; }
.gsky__stages { display: grid; min-height: 0; }
.gsky__stage { margin: 0; }
.gsky__line { max-width: 20ch; font-size: clamp(28px, 3.8vw, 52px); line-height: 1.14; letter-spacing: -.02em; font-weight: 600; }
.gsky__line b { font-weight: 800; }
.gsky__quote { margin: 0 0 24px; max-width: 13ch; font-size: clamp(38px, 6vw, 84px); line-height: 1.02; letter-spacing: -.035em; font-weight: 700; }
.gsky__u { position: relative; display: inline; }
.gsky__scribble { position: absolute; left: -1%; bottom: -.3em; width: 102%; height: .34em; overflow: visible; }
.gsky__scribble path { fill: none; stroke: var(--rust); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.gsky__after { margin: 0; max-width: 52ch; font-size: var(--lead-size); line-height: var(--lead-lh); }
.gsky__dial { display: flex; gap: 22px; list-style: none; margin: clamp(8px, 2vw, 24px) 0 0; padding: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.gsky__dial li { position: relative; padding-bottom: 6px; opacity: .7; transition: opacity .4s var(--ease); }   /* at .7 the resting labels keep 5.4:1 on every sky (WCAG 1.4.3) */
.gsky__dial li::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }

/* Weather, absent in the static block except the settled grey */
.gsky__weather { position: absolute; inset: 0; pointer-events: none; }
.gsky__defs { position: absolute; }
.gsky__sun, .gsky__stars, .gsky__moon, .gsky__rain, .gsky__flash, .gsky__fair { display: none; }
.gsky__cloud { position: absolute; display: block; overflow: visible; }
.gsky__overcast .gsky__cloud { fill: var(--paper-200); opacity: .7; }
.gsky__cloud--o1 { width: 46vw; height: 21vw; left: -8vw; top: -6vw; }
.gsky__cloud--o2 { width: 40vw; height: 18vw; right: -10vw; top: -2vw; }
.gsky__cloud--o3 { width: 30vw; height: 14vw; left: 34vw; top: -8vw; }
.gsky__cloud--o4 { width: 34vw; height: 15vw; right: 4vw; bottom: -5vw; }
.gsky__cloud--o5 { width: 28vw; height: 13vw; left: -6vw; bottom: 8vw; }
.gsky__overcast .gsky__cloud--o3, .gsky__overcast .gsky__cloud--o5 { fill: var(--grey-100); }
.gsky__mark { position: absolute; right: clamp(16px, 8vw, 120px); top: 50%; width: clamp(110px, 17vw, 250px); height: auto; mix-blend-mode: multiply; opacity: .5; transform: translateY(-50%); }

/* Live: pinned and driven by scroll */
.gsky.is-live { height: 360vh; height: 360svh; background: none; }
.gsky.is-live .gsky__sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; padding: calc(var(--nav-h) + 8px) 0 24px;
  display: flex; align-items: center;
  background: var(--gsky-bg, var(--paper-300)); color: var(--gsky-ink, var(--ink-head));
}
.gsky.is-live .gsky__stage { grid-area: 1 / 1; opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.gsky.is-live[data-stage="0"] .gsky__stage[data-i="0"],
.gsky.is-live[data-stage="1"] .gsky__stage[data-i="1"],
.gsky.is-live[data-stage="2"] .gsky__stage[data-i="2"],
.gsky.is-live[data-stage="3"] .gsky__stage[data-i="3"] { opacity: 1; transform: none; }
.gsky.is-live .gsky__scribble path { stroke-dashoffset: 1; transition: stroke-dashoffset 1s .5s cubic-bezier(.6, .1, .3, 1); }
.gsky.is-live .gsky__scribble path + path { transition-delay: 1.1s; }
.gsky.is-live[data-stage="3"] .gsky__scribble path { stroke-dashoffset: 0; }
.gsky.is-live[data-stage="0"] .gsky__dial [data-d="0"],
.gsky.is-live[data-stage="1"] .gsky__dial [data-d="1"],
.gsky.is-live[data-stage="3"] .gsky__dial [data-d="2"] { opacity: 1; }
.gsky.is-live[data-stage="0"] .gsky__dial [data-d="0"]::after,
.gsky.is-live[data-stage="1"] .gsky__dial [data-d="1"]::after,
.gsky.is-live[data-stage="3"] .gsky__dial [data-d="2"]::after { transform: scaleX(1); }
.gsky.is-dark .gsky__scribble path { stroke: var(--flare); }

.gsky.is-live .gsky__sun, .gsky.is-live .gsky__stars, .gsky.is-live .gsky__moon,
.gsky.is-live .gsky__rain, .gsky.is-live .gsky__flash, .gsky.is-live .gsky__fair { display: block; }
/* Blue sky: a sun that sets as night comes, and a few fair clouds drifting by */
.gsky__sun {
  position: absolute; right: 14%; top: 16%; width: clamp(90px, 11vw, 170px); aspect-ratio: 1; border-radius: 50%;
  background: var(--yellow); box-shadow: 0 0 0 clamp(10px, 1.4vw, 20px) rgb(255 234 61 / .28);
  opacity: var(--sun, 0); transform: translateY(calc(var(--set, 0) * 70vh));
}
.gsky__fair { position: absolute; inset: 0; opacity: var(--fair, 0); transform: translateX(calc(var(--p, 0) * -18vw)); }
.gsky__fair .gsky__cloud { fill: var(--paper-100); }
.gsky__cloud--f1 { width: 22vw; height: 10vw; left: 52vw; top: 12vh; }
.gsky__cloud--f2 { width: 15vw; height: 7vw; left: 80vw; top: 34vh; }
.gsky__cloud--f3 { width: 18vw; height: 8vw; left: 64vw; bottom: 12vh; }
/* Black sky: stars, a crescent moon, rain and one flash of lightning */
.gsky__stars { position: absolute; inset: 0; width: 100%; height: 100%; opacity: var(--night, 0); }
.gsky__stars circle { fill: var(--grey-100); }
/* The night's stars twinkle once and its rain falls for 5 s, each time the black sky comes in (WCAG 2.2.2) */
.gsky.is-live[data-stage="1"] .gsky__stars circle { animation: gsky-twinkle 3.2s ease-in-out 1; }
.gsky__moon {
  position: absolute; left: 70%; top: 14%; width: clamp(48px, 6vw, 84px); aspect-ratio: 1; border-radius: 50%;
  box-shadow: inset -14px 8px 0 0 var(--grey-100); transform: rotate(-20deg); opacity: var(--night, 0);
}
.gsky__rain {
  position: absolute; inset: -20% 0 0; opacity: calc(var(--rain, 0) * .9);
  background: repeating-linear-gradient(104deg, transparent 0 22px, rgb(200 208 205 / .16) 22px 23px);
  background-size: 260px 260px;
}
.gsky.is-live[data-stage="1"] .gsky__rain { animation: gsky-rain .55s linear 9; }
.gsky__flash { position: absolute; inset: 0; background: var(--grey-100); opacity: 0; }
.gsky__flash.is-on { animation: gsky-flash 1.1s ease-out; }
/* Grey sky: banks of cloud roll in from above and settle; the Grey Sky mark settles with them */
.gsky.is-live .gsky__overcast { position: absolute; inset: 0; opacity: var(--over, 0); transform: translateY(calc((1 - var(--over, 0)) * -14vh)); }
/* The banks drift a little as they settle, once, in under 5 s (WCAG 2.2.2) */
.gsky.is-live[data-stage="2"] .gsky__overcast .gsky__cloud, .gsky.is-live[data-stage="3"] .gsky__overcast .gsky__cloud { animation: gsky-drift 4.8s ease-out 1 both; }
.gsky.is-live[data-stage="2"] .gsky__overcast .gsky__cloud--o2, .gsky.is-live[data-stage="2"] .gsky__overcast .gsky__cloud--o4,
.gsky.is-live[data-stage="3"] .gsky__overcast .gsky__cloud--o2, .gsky.is-live[data-stage="3"] .gsky__overcast .gsky__cloud--o4 { animation-name: gsky-drift-back; }
.gsky.is-live .gsky__mark { opacity: calc(var(--mark, 0) * .55); transform: translateY(calc(-50% + (1 - var(--mark, 0)) * 30px)); transition: opacity .6s var(--ease); }

@keyframes gsky-twinkle { 50% { opacity: .25; } }
@keyframes gsky-rain { to { background-position: -60px 260px; } }
@keyframes gsky-flash { 0% { opacity: 0; } 5% { opacity: .5; } 10% { opacity: 0; } 16% { opacity: .32; } 24%, 100% { opacity: 0; } }
@keyframes gsky-drift { to { transform: translateX(3vw); } }
@keyframes gsky-drift-back { from { transform: translateX(3vw); } to { transform: none; } }

@media (max-width: 760px) {
  .gsky__mark { top: auto; bottom: 10vh; transform: none; }
  .gsky.is-live .gsky__mark { transform: translateY(calc((1 - var(--mark, 0)) * 30px)); }
  .gsky__sun { right: 8%; top: 12%; }
  .gsky__cloud--f1 { width: 40vw; height: 18vw; left: 40vw; }
  .gsky__cloud--f2, .gsky__cloud--f3 { width: 30vw; height: 14vw; }
}
@media (prefers-reduced-motion: reduce) {
  .gsky__stars circle, .gsky__rain, .gsky.is-live .gsky__overcast .gsky__cloud, .gsky.is-live[data-stage] .gsky__stars circle,
  .gsky.is-live[data-stage] .gsky__rain, .gsky.is-live[data-stage] .gsky__overcast .gsky__cloud { animation: none; }
  .gsky__flash.is-on { animation: none; }
}
