/* Self-hosted fonts (SIL Open Font License, see assets/fonts/LICENSE-*.txt).
   Space Grotesk for display and headings, Inter for reading text, DM Mono for labels. */
@font-face { font-family: "Space Grotesk"; src: url("../assets/fonts/space-grotesk-latin-wght.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/inter-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("../assets/fonts/dm-mono-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("../assets/fonts/dm-mono-latin-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: dark;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --space: #02050a;
  --ink: #f4f1ec;
  --quiet: #c7c9cc;
  --gold: #d9b790;
  --mono: "DM Mono", "SFMono-Regular", Consolas, monospace;
  --display: "Space Grotesk", "Avenir Next", Avenir, Arial, sans-serif;
  /* where the video sits inside the viewport (matches object-position) */
  --video-x: .52;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--space); color: var(--ink); font-family: var(--display); -webkit-font-smoothing: antialiased; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.entrance {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100svh;
  height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--space);
  container-type: size;
}
.entrance[hidden] { display: none; }

/* Everything that zooms when a portal is entered. */
.stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  transform-origin: 50% 50%;
}

.hero-video, .hero-still {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 50%;
}
.hero-video { z-index: 0; }
.hero-still { z-index: 0; display: none; }
.video-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(2, 5, 10, .22) 0%, rgba(2, 5, 10, .08) 34%, transparent 62%);
}

/* A box exactly covering the rendered 16:9 video (object-fit: cover), so portal coordinates are
   video coordinates and stay pinned to the planet at every viewport size. */
.video-space {
  --vs-w: max(100cqw, calc(100cqh * 16 / 9));
  --vs-h: max(100cqh, calc(100cqw * 9 / 16));
  /* no z-index: a stacking context here would stop the portal glow (mix-blend-mode: screen)
     from blending with the video underneath */
  position: absolute;
  left: calc((100cqw - var(--vs-w)) * var(--video-x));
  top: calc((100cqh - var(--vs-h)) * .5);
  width: var(--vs-w);
  height: var(--vs-h);
  pointer-events: none;
}
.portal-nav { position: absolute; inset: 0; }

/* ---------------------------------------------------------------- portals */
.portal {
  --open: 0;
  --fade: 1;
  --flare: 1;
  --lip: 1;
  position: absolute;
  display: block;
  pointer-events: auto;
  color: inherit;
  text-decoration: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
/* generous hit area around the crack */
.portal::before {
  content: "";
  position: absolute;
  inset: -14px;
  min-width: 64px;
  min-height: 64px;
}
.portal-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}
.portal-lip.is-closed { opacity: calc((1 - var(--open)) * var(--fade) * var(--lip)); }
.portal-lip.is-open { opacity: calc(var(--open) * var(--fade) * var(--lip)); }
.portal-glow { mix-blend-mode: screen; filter: brightness(var(--flare)); }
.portal-glow.is-closed { opacity: calc((1 - var(--open)) * var(--fade)); }
.portal-glow.is-open { opacity: calc(var(--open) * var(--fade)); }
.portal-aperture { overflow: visible; opacity: var(--fade); }
.portal-rim { fill: none; stroke: rgba(2, 4, 10, .78); stroke-width: 5; stroke-linejoin: round; }

@keyframes portal-shimmer {
  0%, 100% { filter: brightness(var(--flare)); }
  50% { filter: brightness(calc(var(--flare) * .84)); }
}
.portal .portal-glow.is-closed { animation: portal-shimmer 3.6s ease-in-out infinite; animation-delay: var(--shimmer-delay, 0s); }

.portal-label {
  --shift: 0px;
  position: absolute;
  width: max-content;
  transform: translate(calc(-50% + var(--shift)), 3px);
  opacity: 0;
  color: var(--ink);
  font: 10px/1.2 var(--mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  text-shadow: 0 0 2px rgba(2, 5, 10, .95), 0 0 8px rgba(2, 5, 10, .9), 0 1px 14px rgba(2, 5, 10, .85);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 250ms ease, transform 250ms ease;
}
.portal.is-active .portal-label { opacity: 1; transform: translate(calc(-50% + var(--shift)), 0); }
.portal:focus-visible .portal-label { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(244, 241, 236, .45); }

/* the dive */
.entrance.is-diving .introduction { opacity: 0; transition: opacity 200ms ease; }
.entrance.is-diving .portal .portal-glow.is-closed { animation: none; }
.entrance.is-diving .portal-label { opacity: 0; transition-duration: 160ms; }
.entrance.is-diving { pointer-events: none; }

.streaks {
  position: fixed;
  z-index: 3;
  left: 0;
  top: 0;
  display: none;
  pointer-events: none;
  mix-blend-mode: screen;
  object-fit: fill;
}
.streaks.is-playing { display: block; }

/* the About-me star: glow layers from Blender, screen-blended like the portal glows.
   Fades are CSS vars on the layers themselves, never opacity/z-index on an ancestor. */
.star {
  --hot: 0;
  position: absolute;
  display: block;
  pointer-events: auto;
  color: inherit;
  text-decoration: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.star-glow {
  position: absolute;
  max-width: none;
  pointer-events: none;
  user-select: none;
  mix-blend-mode: screen;
}
.star-glow.is-idle { opacity: calc(1 - var(--hot)); animation: star-twinkle 5.3s ease-in-out infinite; }
.star-glow.is-hot { opacity: var(--hot); }
@keyframes star-twinkle {
  0%, 100% { filter: brightness(1); }
  23% { filter: brightness(.8); }
  41% { filter: brightness(1.06); }
  58% { filter: brightness(.88); }
  77% { filter: brightness(1); }
}
.star-label {
  position: absolute;
  width: max-content;
  transform: translate(-50%, 3px);
  opacity: 0;
  color: var(--ink);
  font: 10px/1.2 var(--mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  text-shadow: 0 0 2px rgba(2, 5, 10, .95), 0 0 8px rgba(2, 5, 10, .9), 0 1px 14px rgba(2, 5, 10, .85);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 250ms ease, transform 250ms ease;
}
.star.is-active .star-label { opacity: 1; transform: translate(-50%, 0); }
.star:focus-visible .star-label { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(244, 241, 236, .45); }
/* screens without hover (phones, and tablets / landscape phones on the desktop layout): always say what it is */
@media (hover: none) {
  .star-label { opacity: 1; transform: translate(-50%, 0); }
}
.entrance.is-diving .star-label, .entrance.is-flaring .star-label, .entrance.is-flaring .portal-label { opacity: 0; transition-duration: 160ms; }
.entrance.is-diving .star-glow { opacity: 0; transition: opacity 200ms ease; }
.entrance.is-flaring { pointer-events: none; }

.flare {
  position: fixed;
  z-index: 5;
  left: 0;
  top: 0;
  display: none;
  pointer-events: none;
  mix-blend-mode: screen;
  object-fit: cover;
}
.flare.is-playing { display: block; }

/* ---------------------------------------------------------------- shared controls */
.music-toggle {
  position: fixed;
  z-index: 6;
  right: max(32px, env(safe-area-inset-right));
  bottom: max(30px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 0 0 0 12px;
  border: 0;
  background: transparent;
  color: rgba(244, 241, 236, .72);
  cursor: pointer;
  font: 10px/1 var(--mono);
  letter-spacing: .2em;
  transition: color 180ms ease;
}
.music-toggle:hover, .music-toggle:focus-visible { color: var(--ink); }
/* Track credit, above the music button while the music plays. */
.music-credit {
  position: fixed;
  z-index: 6;
  right: max(32px, env(safe-area-inset-right));
  bottom: calc(max(30px, env(safe-area-inset-bottom)) + 44px);
  max-width: min(320px, calc(100vw - 40px));
  margin: 0;
  color: rgba(244, 241, 236, .55);
  font: 10px/1.4 var(--mono);
  letter-spacing: .08em;
  text-align: right;
  pointer-events: none;
  text-shadow: 0 0 2px rgba(2, 5, 10, .9), 0 0 10px rgba(2, 5, 10, .85);
  opacity: 0;
  transition: opacity 400ms ease;
}
.music-credit.is-playing { opacity: 1; }
.music-credit span { display: block; white-space: nowrap; }
.music-credit span:first-child { color: rgba(244, 241, 236, .8); }
.music-toggle:focus-visible { outline: 1px solid rgba(244, 241, 236, .72); outline-offset: 5px; }
.music-toggle svg { width: 18px; height: 18px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.music-toggle .speaker { fill: currentColor; stroke: none; }
.music-toggle .sound-waves { opacity: 0; transition: opacity 180ms ease; }
.music-toggle .sound-off { opacity: 1; transition: opacity 180ms ease; }
.music-toggle.is-playing .sound-waves { opacity: 1; }
.music-toggle.is-playing .sound-off { opacity: 0; }

.introduction {
  position: absolute;
  z-index: 3;
  top: 53%;
  left: clamp(24px, 5.7vw, 86px);
  width: min(48vw, 620px);
  transform: translateY(-50%);
  pointer-events: none;
}
.introduction h1 {
  display: flex;
  flex-direction: column;
  margin: 0;
  color: var(--ink);
  font-size: clamp(68px, 8vw, 118px);
  font-weight: 400;
  letter-spacing: -.075em;
  line-height: .88;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .23);
}
.introduction h1 span + span { margin-top: .08em; }
.role-line {
  margin: 27px 0 0 5px;
  color: var(--quiet);
  font: 12px/1.5 var(--mono);
  letter-spacing: .23em;
  text-transform: uppercase;
}

.video-fallback .hero-video { display: none; }
.video-fallback .hero-still { display: block; }

/* ---------------------------------------------------------------- case study */
.case-view {
  position: fixed;
  z-index: 4;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--space);
  overscroll-behavior: contain;
}
.case-view[hidden] { display: none; }
.view-case, .view-case body { height: auto; min-height: 100%; }
.view-case { overflow-x: hidden; overflow-y: auto; }   /* the viewport scrolls */
.view-case body { overflow: visible; overflow-x: clip; }   /* clip, not auto: body must not become a scroll box, or sticky stops working */
.view-case, .case-view { scroll-padding-top: 88px; }   /* focus and jumps land below the pinned back bar */

.case-study {
  --accent: #c7c9cc;
  /* Reading palette: headings in full ink, paragraphs a step softer so long passages don't glare
     on the near-black background, and metadata quieter again. Three steps, each still AA or better. */
  --body: #d4d1cb;
  --quiet: #a2a6ac;
  position: relative;
  isolation: isolate;   /* lets the starfield sit at z -1: above this background, below the planet */
  min-height: 100dvh;
  padding: clamp(24px, 4vw, 44px) clamp(24px, 5.7vw, 86px) 140px;
  background:
    radial-gradient(60% 50% at 85% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    var(--space);
  outline: none;
  overflow: clip;   /* clip, not hidden: hidden would make this a scroll box and break the sticky headings */
}
/* decorative accent-lit planet edge on the right: what each portal's glimpse looks onto */
.case-study::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: -18vh;
  right: -34vw;
  width: max(78vw, 100vh);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 38%, color-mix(in srgb, var(--accent) 34%, #1a1d24) 0%, color-mix(in srgb, var(--accent) 12%, #07090e) 38%, #04060a 64%);
  box-shadow:
    inset 18px 0 40px -18px color-mix(in srgb, var(--accent) 70%, white),
    -30px 0 120px -40px color-mix(in srgb, var(--accent) 45%, transparent);
  opacity: .9;
  /* Lights the hero, then fades out before the reading column starts, so text never sits on the glow. */
  -webkit-mask-image: linear-gradient(to bottom, #000 22%, transparent 62%);
  mask-image: linear-gradient(to bottom, #000 22%, transparent 62%);
}
.case-study > * { position: relative; z-index: 1; }
/* Back to entrance stays pinned top-left while you read, above the space layers and sections.
   The bar itself lets clicks through; only the button takes them. */
.case-study > .back-bar {
  position: sticky;
  z-index: 20;
  top: 0;
  margin: 0 0 -12px;
  padding: max(14px, env(safe-area-inset-top)) 0 12px;
  pointer-events: none;
}
.back-bar .back-link { pointer-events: auto; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px 0 12px;
  border: 1px solid rgba(244, 241, 236, .2);
  border-radius: 999px;
  background: rgba(2, 5, 10, .55);
  color: rgba(244, 241, 236, .85);
  font: 500 11px/1 var(--mono);
  letter-spacing: .18em;
  text-decoration: none;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease, transform 220ms cubic-bezier(.2, .7, .2, 1);
}
.back-link:hover, .back-link:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, rgba(2, 5, 10, .7)); color: var(--ink); }
.back-link:hover svg { transform: translateX(-3px); }
.back-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.back-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 220ms ease; }

.case-hero { max-width: 980px; padding: clamp(56px, 12vh, 140px) 0 clamp(48px, 8vh, 96px); }
.case-hero h1 {
  margin: 0;
  font-size: clamp(54px, 9vw, 128px);
  font-weight: 400;
  letter-spacing: -.07em;
  line-height: .9;
}
.case-lede { max-width: 34em; margin: 30px 0 0 3px; color: var(--body); font-size: clamp(19px, 1.7vw, 23px); line-height: 1.5; letter-spacing: -.005em; }

/* Reading system. One clear step per level, so a skimmer can run down the headings and the bold
   lead-ins, and a reader gets a comfortable line (about 65 characters) with generous leading.
     h2 section  26-30px display, sticky beside its text on wide screens
     h3 item     19px display
     body        17px Inter, 1.7 line height, softened colour
     caption     14.5px Inter, quiet
     label       12px mono caps, quiet (kickers, dates, tags) */
.case-section {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 37em);
  gap: 18px clamp(32px, 5vw, 72px);
  max-width: 1060px;
  padding: clamp(44px, 6vh, 64px) 0;
  border-top: 1px solid rgba(244, 241, 236, .09);
}
.case-section h2 {
  position: sticky;
  top: 92px;   /* below the pinned Back to entrance bar */
  align-self: start;
  margin: 0;
  color: var(--ink);
  font: 500 clamp(24px, 2.1vw, 30px)/1.15 var(--display);
  letter-spacing: -.02em;
  text-wrap: balance;
}
.case-body { min-width: 0; font-family: var(--text); font-size: 17px; line-height: 1.7; color: var(--body); }
.case-body :where(p, ul, ol, figure) { margin: 0; }
.case-body > * + * { margin-top: 1.1em; }   /* one rhythm between every block in a section */
.case-body p { color: var(--body); font-size: 17px; line-height: 1.7; text-wrap: pretty; }
.case-section[hidden] { display: none; }
.case-body ul, .case-body ol { padding-left: 1.3em; color: var(--body); font-size: 17px; line-height: 1.7; }
.case-body li { padding-left: .25em; }
.case-body li + li { margin-top: .55em; }
.case-body li::marker { color: var(--accent); }
.case-body strong { color: var(--ink); font-weight: 600; }
.case-body code {
  padding: .1em .35em;
  border-radius: 3px;
  background: rgba(244, 241, 236, .07);
  font: .84em/1 var(--mono);
}
/* Inline links: accent-tinted and highlighted, with a bar that floods the whole word on hover.
   Links that leave the site get an arrow. */
.case-body :is(p, li) a:not(.about-projects a) {
  padding: .05em .3em;
  margin: 0 -.05em;
  border-radius: 4px;
  background:
    linear-gradient(var(--accent), var(--accent)) left bottom / 100% 2px no-repeat,
    color-mix(in srgb, var(--accent) 13%, transparent);
  color: color-mix(in srgb, var(--accent) 45%, #fff);
  font-weight: 600;
  text-decoration: none;
  transition: background-size 260ms cubic-bezier(.2, .7, .2, 1), color 200ms ease, box-shadow 260ms ease;
}
.case-body :is(p, li) a:not(.about-projects a):hover, .case-body :is(p, li) a:not(.about-projects a):focus-visible {
  background-size: 100% 100%, auto;
  color: #07090d;
  box-shadow: 0 8px 26px -8px color-mix(in srgb, var(--accent) 80%, transparent);
}
.case-body :is(p, li) a:not(.about-projects a)[target="_blank"]::after {
  content: "\2197" / "";
  display: inline-block;
  margin-left: .2em;
  font-size: .9em;
  transition: transform 220ms ease;
}
.case-body :is(p, li) a:not(.about-projects a)[target="_blank"]:hover::after { transform: translate(2px, -2px); }
.case-body a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.case-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 0 0 1.1em !important;
  padding: 0 !important;
  list-style: none;
}
.case-stack li {
  margin: 0 !important;
  padding: 4px 8px;
  border: 1px solid rgba(244, 241, 236, .16);
  border-radius: 3px;
  color: var(--quiet);
  font: 12px/1.4 var(--mono);
  letter-spacing: .04em;
}
.case-stack li::marker { content: none; }
.case-stack li { display: inline-flex; align-items: center; gap: 7px; }
.case-stack svg { flex: none; width: 13px; height: 13px; color: var(--ink); opacity: .82; }

/* ---------------------------------------------------------------- screenshots
   The Screens section spans the full width so the gallery has room to orbit. Without JavaScript
   (or with a single shot) the figures stay a plain list. */
.case-section[data-section="screens"] { grid-template-columns: minmax(0, 1fr); }
.case-section[data-section="screens"] h2 { position: static; }
.case-section[data-section="screens"] .case-body > p { max-width: 37em; }
.case-gallery { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.case-gallery[data-count="1"] { max-width: 760px; }
.case-shot-item { margin: 0; }
.case-shot {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 236, .12);
  border-radius: 8px;
  background: #0b0f16;
}
.case-shot img { display: block; width: 100%; height: auto; }
.case-shot-item[data-shape="phone"] .case-shot { max-width: 240px; }
.case-shot:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.case-shot-item figcaption { margin-top: 12px; color: var(--quiet); font-size: 14.5px; line-height: 1.6; }

/* Solar-system gallery (src/case-page.js): the chosen screenshot is the sun and every shot is a
   planet on the orbit. Click a planet, or use the arrows, to bring it to the centre. */
.orbit-stage { position: relative; height: 600px; }
.orbit-ring {
  position: absolute;
  inset: 44px 64px;
  border: 1px dashed color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: 50%;
  pointer-events: none;
}
.orbit-ring.is-inner { inset: 21% 23%; border: 1px solid rgba(244, 241, 236, .06); }
.orbit-sun {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(560px, 54%);
  height: 340px;
  transform: translate(-50%, -50%);
  border-radius: 14px;
  cursor: zoom-in;
}
.orbit-sun::before {   /* corona */
  content: "";
  position: absolute;
  z-index: -1;
  inset: -22% -12%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 30%, transparent), transparent 78%);
  pointer-events: none;
}
.orbit-sun img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 10px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .85), 0 0 70px -12px color-mix(in srgb, var(--accent) 55%, transparent);
  transition: opacity 240ms ease, transform 360ms cubic-bezier(.2, .7, .2, 1);
}
.orbit-sun.is-phone { height: 410px; }
.orbit-sun.is-swapping img { opacity: 0; transform: scale(.95); }
.orbit-sun:hover img { transform: scale(1.015); }
.orbit-sun:focus-visible { outline: 2px solid var(--accent); outline-offset: 8px; }
.orbit-planets { position: absolute; inset: 0; pointer-events: none; }
.orbit-planet {
  position: absolute;
  left: 0;
  top: 0;
  width: 112px;
  height: 70px;
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 10px;
  background: #0b0f16;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .85);
  cursor: pointer;
  pointer-events: auto;
  transition: border-color 200ms ease, box-shadow 200ms ease, filter 200ms ease;
  will-change: transform;
}
.orbit-planet[data-shape="phone"] { width: 50px; height: 104px; }
.orbit-planet img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; pointer-events: none; }
.orbit-planet:hover, .orbit-planet:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent), 0 12px 34px -8px color-mix(in srgb, var(--accent) 65%, transparent);
  filter: brightness(1.15);
}
.orbit-planet[aria-pressed="true"] {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent), 0 0 30px color-mix(in srgb, var(--accent) 60%, transparent);
}
.orbit-meta { display: flex; align-items: center; gap: 18px; max-width: 780px; margin: 6px auto 0; }
.case-body .orbit-caption { flex: 1; min-height: 4.4em; margin: 0; color: var(--body); font-size: 15.5px; line-height: 1.55; text-align: center; }
.orbit-count { display: block; margin-bottom: 6px; color: var(--accent); font: 500 12px/1 var(--mono); letter-spacing: .16em; }
.orbit-step {
  display: grid;
  flex: none;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, transform 220ms cubic-bezier(.2, .7, .2, 1), box-shadow 220ms ease;
}
.orbit-step:hover, .orbit-step:focus-visible {
  outline: none;
  background: var(--accent);
  color: #07090d;
  transform: scale(1.08);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent), 0 10px 30px -8px color-mix(in srgb, var(--accent) 80%, transparent);
}
.orbit-step svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.case-body .orbit-hint { margin: 12px 0 0; color: var(--quiet); font: 11px/1.4 var(--mono); letter-spacing: .14em; text-align: center; text-transform: uppercase; }

@media (max-width: 760px) {
  .orbit-stage { height: auto; }
  .orbit-ring { display: none; }
  .orbit-sun { position: relative; left: auto; top: auto; width: 100%; height: 280px; transform: none; }
  .orbit-planets {
    position: relative;
    inset: auto;
    display: flex;
    gap: 10px;
    padding: 18px 4px 8px;
    overflow-x: auto;
    pointer-events: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .orbit-planet { position: relative; flex: none; width: 96px; height: 60px; scroll-snap-align: center; transform: none !important; opacity: 1 !important; }
  .orbit-planet[data-shape="phone"] { width: 44px; height: 92px; }
  .orbit-meta { gap: 12px; }
  .orbit-step { width: 46px; height: 46px; }
  .case-body .orbit-caption { font-size: 15px; }
}

/* ---------------------------------------------------------------- page space (src/case-page.js)
   Planets, moons, a ringed world, asteroids, comets and distant stars drift past as you scroll,
   kept to the edges so they never sit behind the text. The starfield is a fixed canvas below the
   hero planet; the bodies sit above it, under the content. */
.case-study > .case-space { position: absolute; inset: 0; z-index: auto; pointer-events: none; }
.case-stars { position: fixed; z-index: -1; inset: 0; width: 100vw; height: 100vh; pointer-events: none; }
.sb { position: absolute; z-index: 0; will-change: transform; }
.sb-body { position: relative; width: var(--s); height: var(--s); border-radius: 50%; }
.sb-moon .sb-body {
  background:
    radial-gradient(circle at 62% 58%, rgba(0, 0, 0, .28) 0 8%, transparent 9%),
    radial-gradient(circle at 38% 70%, rgba(0, 0, 0, .22) 0 5%, transparent 6%),
    radial-gradient(circle at 70% 32%, rgba(0, 0, 0, .2) 0 6%, transparent 7%),
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--tint) 28%, #cfd2d8) 0%, color-mix(in srgb, var(--tint) 18%, #5d626c) 40%, #15181e 66%, #07090d 78%);
  box-shadow: inset -12px -8px 26px rgba(0, 0, 0, .6), 0 0 50px -12px color-mix(in srgb, var(--tint) 45%, transparent);
}
.sb-gas .sb-body {
  background:
    radial-gradient(circle at 30% 30%, transparent 28%, rgba(2, 5, 10, .55) 60%, rgba(2, 5, 10, .94) 74%),
    repeating-linear-gradient(168deg,
      color-mix(in srgb, var(--tint) 55%, #2a2230) 0 6%,
      color-mix(in srgb, var(--tint) 25%, #14121a) 6% 11%,
      color-mix(in srgb, var(--tint) 42%, #3a2c2a) 11% 15%);
  box-shadow: inset 14px 10px 40px -14px color-mix(in srgb, var(--tint) 70%, white), 0 0 140px -30px color-mix(in srgb, var(--tint) 55%, transparent);
}
.sb-ringed .sb-body {
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--tint) 40%, #e0cfae), color-mix(in srgb, var(--tint) 25%, #4a3f36) 45%, #0e0d10 74%);
  box-shadow: inset -8px -8px 22px rgba(0, 0, 0, .6);
}
/* The ring is drawn twice from the same ellipse: ::before sits behind the planet (so its far half
   shows only above the globe), ::after sits in front but is clipped to the near (lower) half. The
   clip is in the ring's own rotated frame, so the split follows the tilt. */
.sb-ringed .sb-body::before, .sb-ringed .sb-body::after {
  content: "";
  position: absolute;
  inset: 38% -58%;
  border: 2px solid color-mix(in srgb, var(--tint) 50%, rgba(244, 241, 236, .7));
  border-radius: 50%;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--tint) 16%, transparent), 0 0 24px color-mix(in srgb, var(--tint) 30%, transparent);
  transform: rotate(-16deg);
}
.sb-ringed .sb-body::before { z-index: -1; }
.sb-ringed .sb-body::after { z-index: 1; clip-path: inset(50% -20px -20px -20px); }
.sb-nebula .sb-body {
  height: calc(var(--s) * .7);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--tint) 45%, transparent), transparent);
  filter: blur(28px);
  opacity: .45;
}
.sb-belt .sb-body { height: calc(var(--s) * .45); border-radius: 0; }
.sb-rock {
  position: absolute;
  border-radius: 46% 54% 40% 60% / 55% 45% 60% 40%;
  background: radial-gradient(circle at 35% 30%, #9a948e, #3a3632 60%, #151312);
  box-shadow: inset -2px -2px 4px rgba(0, 0, 0, .6);
}
.sb-comet .sb-body { height: 2px; border-radius: 0; transform: rotate(var(--rot)); }
.sb-tail {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--tint) 40%, rgba(244, 241, 236, .8)));
  animation: sb-comet 14s linear infinite;
}
.sb-tail::after {   /* head */
  content: "";
  position: absolute;
  right: -3px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px 4px color-mix(in srgb, var(--tint) 60%, white);
}
@keyframes sb-comet {
  0% { opacity: 0; transform: translateX(-60px); }
  12%, 80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(90px); }
}
.sb-star .sb-body {
  background: radial-gradient(circle, #fff 0 6%, color-mix(in srgb, var(--tint) 50%, white) 9%, transparent 34%);
  animation: sb-twinkle 4.5s ease-in-out infinite;
}
.sb-star .sb-body::before, .sb-star .sb-body::after {   /* spikes */
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9), transparent);
  transform: translate(-50%, -50%);
}
.sb-star .sb-body::after { width: 1px; height: 100%; background: linear-gradient(transparent, rgba(255, 255, 255, .9), transparent); }
@keyframes sb-twinkle { 0%, 100% { opacity: .55; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.08); } }
@media (max-width: 1180px) { .sb { opacity: .6; } }
@media (max-width: 760px) { .sb { opacity: .42; } }
@media (prefers-reduced-motion: reduce) { .sb-tail, .sb-star .sb-body { animation: none; } }

/* ---------------------------------------------------------------- about page */
/* Buttons: pill-shaped and lit in the page's accent. A glassy sheen sweeps left to right on hover
   and back right to left when the pointer leaves (the same transition, reversed). At most a 1px lift;
   no pulse, glow or halo. */
.about-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 36px 0 0 3px; }
.about-btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px 0 20px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 9%, rgba(2, 5, 10, .6));
  color: var(--ink);
  font: 500 13px/1 var(--mono);
  letter-spacing: .14em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 200ms ease, background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.about-btn::before {   /* sheen: parked off the left edge, crosses on hover, returns on leave */
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .16) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 650ms cubic-bezier(.3, .6, .3, 1);
  pointer-events: none;
}
.about-btn:hover::before, .about-btn:focus-visible::before { transform: translateX(120%); }
.about-btn:hover, .about-btn:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, rgba(2, 5, 10, .6));
  transform: translateY(-1px);
}
.about-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.about-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.about-btn.is-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #07090d;
  font-weight: 600;
}
.about-btn.is-primary::before { background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); }
.about-btn.is-primary:hover, .about-btn.is-primary:focus-visible {
  background: color-mix(in srgb, var(--accent) 90%, white);
  color: #07090d;
}
@media (prefers-reduced-motion: reduce) {
  .about-btn, .about-btn::before { transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease; }
  .about-btn::before { display: none; }
  .about-btn:hover, .about-btn:focus-visible { transform: none; }
}

.about-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 18px; }
.about-entry + .about-entry { margin-top: 28px; padding-top: 28px; border-top: 1px solid rgba(244, 241, 236, .08); }
.about-entry h3 { margin: 0; color: var(--ink); font: 500 19px/1.35 var(--display); letter-spacing: -.01em; }
.about-when { color: var(--quiet); font: 12px/1.9 var(--mono); letter-spacing: .06em; white-space: nowrap; }
.case-body .about-entry p { grid-column: 1 / -1; color: var(--body); font-size: 16px; line-height: 1.65; }
.case-body .about-entry p + p, .case-body .about-entry .about-figures + p { margin-top: .5em; }
.case-body .about-entry p.about-role { margin: 0; color: var(--quiet); font-size: 15.5px; }
.about-figures { display: flex; flex-wrap: wrap; gap: 8px 28px; grid-column: 1 / -1; margin: 10px 0 2px; }
.about-figures div { display: flex; flex-direction: column; gap: 2px; }
.about-figures b { color: var(--ink); font: 400 30px/1.1 var(--display); letter-spacing: -.03em; }
.about-figures span { color: var(--quiet); font: 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }

.about-awards { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px !important; padding: 0 !important; list-style: none; }
.about-awards li { margin: 0 !important; padding: 7px 12px; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 3px; color: var(--ink); font: 12px/1.4 var(--mono); letter-spacing: .08em; }
.about-awards li::marker { content: none; }

.about-projects { margin: 0 !important; padding: 0 !important; list-style: none; }
.about-projects li { margin: 0 !important; }
.about-projects li::marker { content: none; }
.about-projects { display: grid; gap: 12px; }
.about-projects a {
  --c: var(--accent);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 18px;
  padding: 20px 20px 20px 24px;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 236, .1);
  border-radius: 14px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--c) 12%, transparent), transparent 60%), rgba(244, 241, 236, .02);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 220ms ease, transform 220ms cubic-bezier(.2, .7, .2, 1), box-shadow 220ms ease;
}
.about-projects a:hover, .about-projects a:focus-visible {
  border-color: var(--c);
  box-shadow: 0 16px 40px -18px color-mix(in srgb, var(--c) 85%, transparent);
  transform: translateY(-2px);
}
.about-projects b { font: 500 20px/1.3 var(--display); letter-spacing: -.01em; }
.about-projects span { grid-column: 1; color: var(--body); font-size: 16px; line-height: 1.55; }
.about-projects i {
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 2;
  place-items: center;
  align-self: center;
  width: 44px;
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
  border-radius: 50%;
  color: var(--ink);
  font: 16px/1 var(--mono);
  font-style: normal;
  transition: background-color 220ms ease, color 220ms ease, transform 220ms ease;
}
.about-projects a:hover i, .about-projects a:focus-visible i { background: var(--c); color: #07090d; transform: translateX(4px); }
.about-projects a:focus-visible { outline: 2px solid var(--c); outline-offset: 3px; }
.about-projects .dot { display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; vertical-align: 2px; }

/* "Get in touch" at the end of each case study: an outlined card, so it reads as the next step. */
.case-section[data-section="contact"] .case-body {
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 20px;
}
.case-section[data-section="contact"] .case-body p { color: var(--ink); font-size: 18px; }
.case-section[data-section="contact"] .about-actions { margin: 22px 0 0; }

.about-group + .about-group { margin-top: 18px; }
.about-group h3 { margin: 0 0 10px; color: var(--quiet); font: 400 12px/1.4 var(--mono); letter-spacing: .18em; text-transform: uppercase; }
.case-body .about-group .case-stack { margin: 0 !important; }

@media (max-width: 760px) {
  .about-actions { margin-top: 26px; }
  .about-actions .about-btn { flex: 1 1 auto; justify-content: center; }
  .about-entry { grid-template-columns: 1fr; }
  .about-when { grid-row: 2; }
}

@media (max-width: 760px) {
  :root { --video-x: .32; }
  .hero-video, .hero-still { object-position: 32% 50%; }
  .video-shade { background: linear-gradient(90deg, rgba(2, 5, 10, .28), rgba(2, 5, 10, .06) 62%, transparent 84%); }
  .music-toggle { right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); font-size: 9px; }
  .music-credit { right: max(20px, env(safe-area-inset-right)); bottom: calc(max(20px, env(safe-area-inset-bottom)) + 44px); max-width: 180px; font-size: 9px; }
  .introduction { top: 49%; left: 24px; width: min(72vw, 300px); }
  .introduction h1 { font-size: clamp(52px, 14vw, 68px); line-height: .93; }
  .introduction h1 span + span { margin-top: .05em; }
  .role-line { margin: 21px 0 0 3px; font-size: 10.5px; letter-spacing: .18em; }
  .case-section { grid-template-columns: 1fr; gap: 16px; padding: 40px 0; }
  .case-section h2 { position: static; font-size: 24px; }
  /* the pinned bar gets a fade, so text slides under it instead of colliding with the button */
  .case-study > .back-bar {
    margin: 0 -24px -10px;
    padding: max(10px, env(safe-area-inset-top)) 24px 16px;
    background: linear-gradient(rgba(2, 5, 10, .98) 72%, rgba(2, 5, 10, 0));
  }
  .case-body, .case-body p, .case-body ul, .case-body ol { font-size: 16.5px; }
  .case-lede { font-size: 19px; }
  .star-label { opacity: 1; transform: translate(-50%, 0); }   /* no hover on phones: always say what it is */
}

@media (max-width: 360px) {
  .introduction h1 { font-size: 50px; }
  .introduction { width: min(76vw, 280px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
  .hero-still { display: block; }
  .portal .portal-glow.is-closed { animation: none; }
  .star-glow.is-idle { animation: none; }
  .portal-label { transition: opacity 120ms linear; transform: translate(calc(-50% + var(--shift)), 0); }
}
