/* ==========================================================================
   Ruibin Jin Yao — a living Starry Night
   1. Tokens          2. Base & type       3. Stage (the painting)
   4. Navigation      5. Hero              6. Sections & dissolves
   7. About           8. Journey           9. Atlas
   10. Work           11. Palette          12. Contact & footer
   13. Sheets         14. Draft mode       15. Motion preferences
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces-var.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces-var-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument-sans-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument-sans-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument-sans-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument-sans-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
/* Small supplements (tools/make_font_subsets.py) so a Mac and a Windows PC draw the same glyphs:
   arrows (neither text font has them) and the few Chinese characters on the site (else Songti vs SimSun). */
@font-face { font-family: 'RJY Arrows'; src: url('../fonts/rjy-arrows.woff2') format('woff2'); font-weight: 400 600; font-display: swap; unicode-range: U+2190-2199; }
@font-face { font-family: 'Noto Serif SC Sub'; src: url('../fonts/noto-serif-sc-sub.woff2') format('woff2'); font-weight: 300 500; font-display: swap; }

:root {
  /* sampled from the painting */
  --abyss: #050a2e;          /* deepest sea */
  --midnight: #0a1550;       /* ultramarine night */
  --cobalt: #203d8a;         /* the swirling sky */
  --cornflower: #436aac;
  --periwinkle: #8e9ccb;     /* the violet sea */
  --foam: #cfdcef;           /* whitecaps */
  --teal: #5fb3b8;
  --gold: #f2c14e;           /* starlight */
  --ember: #e8892b;          /* star cores */
  --moon: #f3e3a8;
  --umber: #8a6a4f;          /* driftwood */
  --ivory: #f3eadb;          /* text */
  --ivory-2: rgba(243, 234, 219, 0.78);
  --ivory-3: rgba(243, 234, 219, 0.64);
  --line: rgba(242, 193, 78, 0.55);
  --line-faint: rgba(243, 234, 219, 0.14);
  --veil-rgb: 5, 10, 46;

  --serif: 'Fraunces', 'RJY Arrows', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: 'Instrument Sans', 'RJY Arrows', 'Helvetica Neue', 'Segoe UI', Arial, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;

  /* fluid type scale: each step grows smoothly from a 360px phone to a 1440px screen.
     Fraunces (serif) for the expressive headings, Instrument Sans for body text and details. */
  --t-2xs: clamp(0.72rem, 0.7rem + 0.0889vw, 0.78rem);     /* tracked capitals: menu, buttons */
  --t-xs: clamp(0.7812rem, 0.7625rem + 0.08333vw, 0.8375rem);
  --t-sm: clamp(0.9rem, 0.8729rem + 0.1204vw, 0.9812rem);
  --t-md: clamp(1rem, 0.9583rem + 0.1852vw, 1.125rem);
  --t-lg: clamp(1.181rem, 1.102rem + 0.3519vw, 1.419rem);
  --t-xl: clamp(1.375rem, 1.198rem + 0.787vw, 1.906rem);
  --t-2xl: clamp(1.688rem, 1.375rem + 1.389vw, 2.625rem);
  --t-3xl: clamp(2.125rem, 1.5rem + 2.778vw, 4rem);
  --t-4xl: clamp(2.625rem, 1.458rem + 5.185vw, 6.125rem);

  --gutter: clamp(20px, 5vw, 72px);
  --measure: 62ch;
  --nav-h: 76px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

/* The site is a night painting in both colour schemes; light mode uses the same night palette. */
@media (prefers-color-scheme: light) { :root { color-scheme: dark; } }

/* 2. Base & type ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px;
  /* Windows (and Linux) scrollbars take up room and are drawn by the browser: tint them to the night sky.
     A Mac's overlay scrollbars are unaffected. */
  scrollbar-color: rgba(242, 193, 78, .4) #050a2e; }
body {
  margin: 0;
  background: var(--abyss);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: var(--t-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: rgba(242, 193, 78, 0.35); color: #fff; }
:focus-visible { outline: 1.5px solid var(--gold); outline-offset: 4px; border-radius: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 100; background: var(--ivory); color: var(--abyss); padding: 10px 16px; font-weight: 600; text-decoration: none; border-radius: 3px; transition: top .2s; }
.skip:focus { top: 16px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 360; font-variation-settings: 'opsz' 96, 'SOFT' 100, 'WONK' 0; margin: 0; line-height: 1.08; letter-spacing: -0.005em; }
p { margin: 0 0 1em; }
.serif { font-family: var(--serif); }
.muted { color: var(--ivory-2); }

/* Thin gold link underline that draws itself on hover — the site's one link treatment */
.link {
  color: var(--ivory); text-decoration: none;
  background-image: linear-gradient(var(--line), var(--line));
  background-size: 100% 1px; background-position: 0 100%; background-repeat: no-repeat;
  padding-bottom: 2px; transition: background-size .35s var(--ease), color .2s;
}
.link:hover { color: #fff; background-image: linear-gradient(var(--gold), var(--gold)); }

/* 3. Stage — the living painting fixed behind the whole page --------------- */
.stage { position: fixed; inset: 0; height: 100lvh; z-index: 0; overflow: hidden; pointer-events: none;
  /* a soft preview of the painting while the living one loads (main.js aligns it with the painting) */
  background: var(--abyss) url("../painting/painting-blur.jpg") 50% 30% / cover no-repeat; }
.stage__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage__still { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; opacity: 0; transition: opacity 1.6s var(--ease); transform-origin: 0 0; will-change: transform; }
.stage__canvas { opacity: 0; transition: opacity 1.2s var(--ease); }
.is-gl .stage__canvas { opacity: 1; }
.is-still .stage__still { opacity: 1; }
.stage__loader { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 18px 6px rgba(242, 193, 78, .45); animation: loaderPulse 1.6s ease-in-out infinite; transition: opacity .6s; }
.is-gl .stage__loader, .is-still .stage__loader { opacity: 0; visibility: hidden; animation: none; transition: opacity .6s, visibility 0s .6s; }
@keyframes loaderPulse { 50% { transform: scale(.55); opacity: .5; } }
/* CSS star glows for the still fallback */
.stage__glows { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s; }
.is-still .stage__glows { opacity: 1; }
.stage__glows span { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(255, 226, 150, .38), rgba(242, 193, 78, .12) 45%, transparent 70%); animation: glowPulse 5s ease-in-out infinite; mix-blend-mode: screen; }
@keyframes glowPulse { 50% { opacity: .45; } }

/* 4. Navigation ------------------------------------------------------------ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 40; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  transition: background-color .5s var(--ease), height .4s var(--ease), opacity .8s;
}
.nav::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(var(--veil-rgb), .62), rgba(var(--veil-rgb), 0)); opacity: .8; transition: opacity .5s; pointer-events: none; }
.nav.is-scrolled { height: 60px; }
.nav.is-scrolled::before { opacity: 1; background: rgba(var(--veil-rgb), .82); }
.nav__brand { position: relative; display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-style: italic; font-size: 1.25rem; font-variation-settings: 'opsz' 36, 'SOFT' 100; letter-spacing: .01em; }
.nav__brand svg { width: 18px; height: 18px; color: var(--gold); }
.nav__brand-name { opacity: 0; transform: translateY(4px); transition: opacity .5s, transform .5s var(--ease); font-size: 1rem; font-style: normal; color: var(--ivory-2); }
.nav.is-scrolled .nav__brand-name { opacity: 1; transform: none; }
.nav__list { position: relative; display: flex; gap: clamp(14px, 2vw, 30px); list-style: none; margin: 0; padding: 0; }
.nav__link {
  position: relative; display: inline-block; padding: 10px 0;
  font-size: var(--t-2xs); font-weight: 500; letter-spacing: .2em; text-transform: uppercase; text-decoration: none;
  color: var(--ivory-2); transition: color .3s;
}
.nav__link::after { /* hand-drawn stroke revealed on hover */
  content: ''; position: absolute; left: -2px; right: -2px; bottom: 3px; height: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6' preserveAspectRatio='none'%3E%3Cpath d='M1 4.2C18 2.1 34 4.6 52 3.1S83 1.9 99 3.4' fill='none' stroke='%23F2C14E' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  clip-path: inset(0 100% 0 0); transition: clip-path .45s var(--ease);
}
.nav__link::before { /* tiny star */
  content: ''; position: absolute; top: 3px; left: 50%; width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 6px 2px rgba(242, 193, 78, .7); opacity: 0; transform: scale(.4); transition: opacity .3s, transform .3s var(--ease);
}
.nav__link:hover, .nav__link[aria-current="true"] { color: var(--ivory); }
.nav__link:hover::after, .nav__link[aria-current="true"]::after { clip-path: inset(0 0 0 0); }
.nav__link:hover::before, .nav__link[aria-current="true"]::before { opacity: 1; transform: scale(1); }
.nav__toggle { display: none; position: relative; background: none; border: 0; padding: 10px; margin-right: -10px; cursor: pointer; }
.nav__brand { order: 0; }
.nav__menu { order: 1; margin-left: auto; }
/* pause / play the moving painting */
.nav__motion {
  position: relative; order: 2; flex: none; width: 34px; height: 34px; margin-left: clamp(14px, 2vw, 26px); padding: 0; border-radius: 50%;
  border: 1px solid var(--line-faint); background: rgba(var(--veil-rgb), .35); color: var(--ivory-2); cursor: pointer;
  display: grid; place-items: center; transition: border-color .3s, color .3s, background-color .3s;
}
.nav__motion:hover { color: var(--ivory); border-color: var(--line); background: rgba(var(--veil-rgb), .6); }
.nav__motion svg { width: 14px; height: 14px; }
.is-paused .stage__glows span, .is-paused .hero__cue i::after { animation-play-state: paused; }
.nav__toggle span { display: block; width: 24px; height: 1.5px; background: var(--ivory); margin: 5px 0; transition: transform .35s var(--ease), opacity .2s; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 1080px) {
  .nav__toggle { display: block; order: 3; }
  .nav__motion { order: 2; margin-left: auto; margin-right: 12px; }
  .nav__menu {
    position: fixed; inset: 0; z-index: -1; display: flex; flex-direction: column; justify-content: center;
    padding: 96px var(--gutter) 48px; background: rgba(var(--veil-rgb), .9);
    opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility 0s .4s;
  }
  .nav__menu.is-open { opacity: 1; visibility: visible; transition: opacity .4s var(--ease); }
  .nav__list { flex-direction: column; gap: 6px; }
  .nav__link { font-family: var(--serif); font-size: clamp(2rem, 8vw, 3rem); font-weight: 340; letter-spacing: 0; text-transform: none; color: var(--ivory); padding: 6px 0; font-variation-settings: 'opsz' 96, 'SOFT' 100; }
  .nav__link::before { left: -18px; top: 50%; margin-top: -1.5px; }
  .nav__link::after { bottom: 4px; }
  .nav__menu-foot { margin-top: 40px; font-size: var(--t-sm); color: var(--ivory-2); }
}
@media (min-width: 1081px) { .nav__menu-foot { display: none; } }

/* 5. Hero ---------------------------------------------------------------- */
.hero { position: relative; z-index: 1; min-height: 100vh; min-height: 100svh; }
.hero__scrim { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 60% 55% at 84% 70%, rgba(4, 8, 40, .58), rgba(4, 8, 40, .22) 55%, transparent 75%); opacity: 0; transition: opacity 2s var(--ease); }
.hero__text {
  position: absolute; right: var(--gutter); bottom: max(72px, 9vh); width: min(64vw, 900px);
  text-align: right; z-index: 2;
  pointer-events: none;   /* the box is larger than its text: let the star doorways underneath be clicked */
}
.hero__name .line > span, .hero__tagline, .hero__intro, .cta { pointer-events: auto; }
.hero__name {
  margin: 0; font-family: var(--serif); font-weight: 340; font-size: clamp(3.4rem, min(7.6vw, 12.5vh), 8.6rem); line-height: .9;
  letter-spacing: .055em; margin-right: -.055em; font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 0;
  text-shadow: 0 2px 34px rgba(3, 8, 40, .65), 0 0 2px rgba(3, 8, 40, .4);
}
.hero__name .line { display: block; overflow: hidden; padding: .02em 0; }
.hero__name .line > span { display: inline-block; }
.hero__tagline {
  width: fit-content; margin: 1.1rem 0 .55rem auto; font-family: var(--serif); font-style: italic; font-weight: 320;
  font-size: clamp(1.25rem, 1.9vw, 1.9rem); line-height: 1.25; color: var(--moon);
  font-variation-settings: 'opsz' 48, 'SOFT' 100; text-shadow: 0 1px 18px rgba(3, 8, 40, .7);
}
.hero__intro { width: fit-content; margin: 0 0 1.9rem auto; max-width: 34ch; font-size: clamp(.95rem, 1.05vw, 1.0625rem); line-height: 1.55; color: var(--ivory); text-shadow: 0 1px 14px rgba(3, 8, 40, .9); }
.hero__ctas { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 30px; }
/* the featured websites, as three small stars under the calls to action */
.hero__featured { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 18px; margin-top: 1.4rem; pointer-events: auto; }
.hero__featured-label { font-family: var(--serif); font-style: italic; font-size: var(--t-xs); color: var(--ivory-3); font-variation-settings: 'opsz' 14, 'SOFT' 100; text-shadow: 0 1px 10px rgba(3, 8, 40, 1); }
.hstar { display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; font-size: var(--t-2xs); letter-spacing: .08em; text-transform: uppercase; color: var(--ivory-2); text-decoration: none; text-shadow: 0 1px 10px rgba(3, 8, 40, 1); transition: color .3s; }
.hstar svg { width: 13px; height: 13px; color: var(--hue, var(--gold)); filter: drop-shadow(0 0 4px var(--hue, var(--gold))); transform-box: fill-box; transform-origin: center; transition: transform .6s var(--ease-out); animation: hstarTwinkle 3.8s ease-in-out infinite; }
.hstar:nth-child(3) svg { animation-delay: 1.2s; }
.hstar:nth-child(4) svg { animation-delay: 2.5s; }
.hstar.is-wip svg { filter: none; opacity: .75; }
.hstar.is-wip svg path { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-dasharray: 2 2; }
.hstar small { font-size: .625rem; letter-spacing: .06em; color: var(--ivory-3); }
.hstar:hover, .hstar:focus-visible { color: #fff; }
.hstar:hover svg, .hstar:focus-visible svg { transform: rotate(45deg) scale(1.35); }
@keyframes hstarTwinkle { 0%, 100% { opacity: .85; } 50% { opacity: 1; filter: drop-shadow(0 0 7px var(--hue, var(--gold))); } }
.is-paused .hstar svg { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .hstar svg { animation: none; } }
.cta {
  position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 8px 0 12px;
  font-size: var(--t-2xs); font-weight: 500; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; color: var(--ivory);
  text-shadow: 0 1px 12px rgba(3, 8, 40, .95);
}
.cta svg.cta__star { width: 10px; height: 10px; color: var(--gold); flex: none; transition: transform .5s var(--ease); filter: drop-shadow(0 0 4px rgba(242, 193, 78, .8)); }
.cta svg.cta__stroke { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 7px; overflow: visible; transform-origin: 0 50%; }
.cta svg.cta__stroke path { stroke: var(--gold); stroke-width: 1.1; fill: none; stroke-linecap: round; opacity: .75; transition: opacity .3s; vector-effect: non-scaling-stroke; }
.cta:hover svg.cta__star, .cta:focus-visible svg.cta__star { transform: rotate(72deg) scale(1.25); }
.cta:hover svg.cta__stroke { animation: redraw .7s var(--ease); }
.cta:hover svg.cta__stroke path { opacity: 1; }
@keyframes redraw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

.hero__cue { position: absolute; left: var(--gutter); bottom: 26px; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 14px; font-size: var(--t-2xs); letter-spacing: .04em; color: var(--ivory-2); text-decoration: none; z-index: 2; text-shadow: 0 1px 10px rgba(3, 8, 40, 1); }
.hero__cue:hover { color: var(--ivory); }
.hero__cue i { display: block; width: 1px; height: 46px; background: linear-gradient(to bottom, transparent, var(--gold)); position: relative; overflow: hidden; }
.hero__cue i::after { content: ''; position: absolute; left: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px 2px rgba(242, 193, 78, .7); animation: cueDrop 2.8s var(--ease) infinite; }
@keyframes cueDrop { 0% { top: -6px; opacity: 0; } 25% { opacity: 1; } 80% { top: 46px; opacity: .2; } 100% { top: 46px; opacity: 0; } }

.hero__skip { position: absolute; right: var(--gutter); bottom: 26px; z-index: 3; background: none; border: 0; padding: 6px 0; font-size: var(--t-2xs); letter-spacing: .08em; color: var(--ivory-3); cursor: pointer; transition: opacity .6s, color .2s; }
.hero__skip:hover { color: var(--ivory); }
.intro-done .hero__skip { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .6s, visibility 0s .6s; }

/* star portals: the painted star itself reacts (in the WebGL painting); these are only an
   invisible hit area, a little larger than the star, and the label that appears beside it */
.hotspots { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hotspot {
  position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; pointer-events: auto;
  background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.hotspot[hidden] { display: none; }
.hotspot:focus-visible { outline: none; }
.hotspot__label {
  position: absolute; left: 50%; top: 100%; transform: translate(calc(-50% + var(--shift, 0px)), 6px); white-space: nowrap; pointer-events: none;
  font-family: var(--serif); font-style: italic; font-weight: 380; font-size: var(--t-md); line-height: 1.2; letter-spacing: .01em;
  font-variation-settings: 'opsz' 24, 'SOFT' 100; color: var(--ivory);
  text-shadow: 0 1px 14px rgba(3, 8, 40, 1), 0 0 5px rgba(3, 8, 40, .95), 0 0 1px rgba(3, 8, 40, 1);
  /* hidden labels are also taken out of rendering (visibility), so they cost nothing while the painting animates */
  opacity: 0; visibility: hidden; transition: opacity .45s var(--ease), transform .6s var(--ease-out), visibility 0s linear .45s;
}
.hotspot__label.is-above { transform: translate(calc(-50% + var(--shift, 0px)), -6px); }
.hotspot__text { position: relative; display: inline-flex; align-items: center; gap: 9px; padding-bottom: 6px; }
.hotspot__text::before {
  content: ''; width: 10px; height: 10px; flex: none; filter: drop-shadow(0 0 4px rgba(242, 193, 78, .9));
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23F2C14E' d='M12 1.5l1.6 7.3 7.4 1.6-7.4 1.6L12 19.5l-1.6-7.5L3 10.4l7.4-1.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.hotspot__text::after {
  content: ''; position: absolute; left: 19px; right: 0; bottom: 0; height: 1px; transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--gold), rgba(242, 193, 78, .15)); transform: scaleX(.15); opacity: 0;
  transition: transform .7s var(--ease-out), opacity .4s;
}
.hotspot:hover .hotspot__label, .hotspot:focus-visible .hotspot__label { opacity: 1; visibility: visible; transition-delay: 0s; transform: translate(calc(-50% + var(--shift, 0px)), 0); }
.hotspot:hover .hotspot__text::after, .hotspot:focus-visible .hotspot__text::after { transform: scaleX(1); opacity: .9; }
.hotspot:focus-visible .hotspot__text::after { height: 1.5px; opacity: 1; background: var(--gold); }
/* touch screens have no hover: show the labels quietly once the opening is over */
.is-touch.intro-done .hotspot__label { opacity: .9; visibility: visible; transition-delay: 0s; transform: translate(calc(-50% + var(--shift, 0px)), 0); }

/* a star becomes a portal: the page steps aside while the painting carries the visitor in */
html.is-portal main, html.is-portal .footer, html.is-portal .nav, html.is-portal .draft-badge { opacity: 0 !important; pointer-events: none !important; transition: opacity .32s var(--ease) !important; }
html.is-arriving main, html.is-arriving .footer, html.is-arriving .nav { transition: opacity .55s var(--ease) !important; }
.stage__veil { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .5s var(--ease); }
.is-portal-still .stage__veil { opacity: 1; transition: opacity .55s .12s var(--ease); }
.is-portal-still .stage__still { transition: transform .7s cubic-bezier(.6, 0, .25, 1), opacity 1.6s var(--ease); }
.stage__glows span { transition: transform .6s var(--ease), opacity .5s; }
.stage__glows span.is-lit { animation: none; opacity: 1; transform: translate(-50%, -50%) scale(1.2); background: radial-gradient(circle, rgba(255, 238, 178, .62), rgba(242, 193, 78, .24) 45%, transparent 70%); }

/* intro choreography */
.hero__name .line > span, .hero__tagline, .hero__intro, .hero__ctas, .hero__featured, .hero__cue, .nav { opacity: 0; }
.hero__name .line > span { transform: translateY(105%); }
.intro-name .hero__name .line > span { opacity: 1; transform: none; transition: transform 1.6s var(--ease-out), opacity 1.2s; }
.intro-name .hero__name .line:nth-child(2) > span { transition-delay: .18s; }
.intro-name .hero__scrim { opacity: 1; }
.intro-tagline .hero__tagline { opacity: 1; transition: opacity 1.4s var(--ease); }
.intro-rest .hero__intro, .intro-rest .hero__ctas, .intro-rest .hero__featured, .intro-rest .hero__cue, .intro-rest .nav { opacity: 1; transition: opacity 1.2s var(--ease); }
.intro-rest .hero__featured { transition-delay: .5s; }
.intro-rest .hero__ctas { transition-delay: .25s; }
.intro-rest .hero__cue { transition-delay: .6s; }
.no-js .hero__name .line > span, .no-js .hero__tagline, .no-js .hero__intro, .no-js .hero__ctas, .no-js .hero__featured, .no-js .nav { opacity: 1; transform: none; }

@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  .hero__scrim { background: linear-gradient(to bottom, rgba(4, 8, 40, .68), rgba(4, 8, 40, .12) 36%, transparent 52%, rgba(4, 8, 40, .2) 66%, rgba(4, 8, 40, .82)); }
  .hero__text { position: absolute; inset: 0; width: auto; text-align: left; }
  .hero__head { position: absolute; left: var(--gutter); right: var(--gutter); top: calc(var(--nav-h) + 4vh); }
  .hero__foot { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 84px; }
  .hero__name { font-size: clamp(3rem, 14.5vw, 5.6rem); }
  .hero__intro, .hero__tagline { margin-left: 0; }
  .hero__intro { max-width: 30ch; }
  .hero__ctas { justify-content: flex-start; flex-direction: column; align-items: flex-start; gap: 4px; }
  .hero__featured { justify-content: flex-start; margin-top: 1rem; gap: 4px 14px; }
  .hero__featured-label { width: 100%; }
  .hero__cue { bottom: 20px; }
  .hero__cue span { display: none; }
  .hero__skip { bottom: 20px; }
}

/* 6. Sections & dissolves ------------------------------------------------- */
.sec { position: relative; z-index: 1; padding: clamp(96px, 14vh, 160px) var(--gutter); --veil: .82; --veil-edge: .58; }
/* The veil that keeps the words readable over the moving painting. It opens a little where one
   section meets the next, so the painting's zoom and colour changes show while scrolling. */
.sec::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(var(--veil-rgb), var(--veil-edge)) 0, rgba(var(--veil-rgb), var(--veil)) min(18vh, 22%),
    rgba(var(--veil-rgb), var(--veil)) max(calc(100% - 18vh), 78%), rgba(var(--veil-rgb), var(--veil-edge)) 100%);
}
.sec--first { padding-top: 44vh; }
.sec--first::before {
  background: linear-gradient(to bottom, rgba(var(--veil-rgb), 0) 0, rgba(var(--veil-rgb), var(--veil)) 40vh,
    rgba(var(--veil-rgb), var(--veil)) max(calc(100% - 18vh), 78%), rgba(var(--veil-rgb), var(--veil-edge)) 100%);
  -webkit-mask: url('../img/dissolve.png') top / 100% 44vh no-repeat, linear-gradient(#000, #000) 0 43.5vh / 100% 100% no-repeat;
  mask: url('../img/dissolve.png') top / 100% 44vh no-repeat, linear-gradient(#000, #000) 0 43.5vh / 100% 100% no-repeat;
}
.sec__inner { max-width: 1180px; margin: 0 auto; position: relative; }
.sec__head { display: grid; grid-template-columns: minmax(0, 1fr); gap: min(18px, 2.4vh); margin-bottom: clamp(32px, min(7vw, 9vh), 88px); max-width: 860px; }
.sec__kicker { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-style: italic; font-size: var(--t-lg); color: var(--gold); font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.sec__kicker svg { width: 12px; height: 12px; }
.sec__title { font-size: clamp(2.625rem, min(1.458rem + 5.185vw, 12.4vh), 6.125rem); font-weight: 320; letter-spacing: -.01em; line-height: 1; }
.sec__lede { font-size: clamp(1.05rem, .95rem + .4vw, 1.25rem); color: var(--ivory-2); max-width: 54ch; margin: 6px 0 0; line-height: 1.55; }

/* brush divider drawn between groups */
.brush-rule { display: block; width: min(360px, 60%); height: 10px; margin: 0; color: var(--line); }

/* reveal on scroll (one gentle move, only when entering) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 1.1s var(--ease), transform 1.2s var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* 7. About ------------------------------------------------------------------- */
.about__tagline {
  margin: 4px 0 0; font-family: var(--serif); font-style: italic; font-weight: 340; font-size: var(--t-xl); line-height: 1.3;
  color: var(--moon); font-variation-settings: 'opsz' 36, 'SOFT' 100;
}
.about__intro { max-width: 980px; }
.about__lead { font-family: var(--serif); font-weight: 320; font-size: clamp(1.5rem, 1.02rem + 1.55vw, 2.4rem); line-height: 1.24; letter-spacing: -.005em; margin: 0 0 22px; font-variation-settings: 'opsz' 72, 'SOFT' 100; max-width: 34ch; }
.about__more { margin: 0; font-family: var(--serif); font-weight: 330; font-size: var(--t-lg); line-height: 1.45; color: var(--ivory-2); max-width: 46ch; font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.about__body { margin-top: clamp(56px, 8vw, 104px); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(40px, 6vw, 110px); align-items: start; }
.about__ch + .about__ch { margin-top: clamp(48px, 6vw, 80px); }
.about__h { display: flex; align-items: baseline; gap: 14px; margin: 0 0 18px; font-size: var(--t-2xl); font-weight: 340; line-height: 1.12; }
.about__no { flex: none; min-width: 2ch; font-style: italic; font-weight: 380; font-size: var(--t-md); color: var(--gold); font-variation-settings: 'opsz' 14, 'SOFT' 100; }
.about__ch p { margin: 0 0 .85em; max-width: 62ch; color: var(--ivory-2); font-size: var(--t-md); line-height: 1.65; }
.about__ch p:last-child { margin-bottom: 0; }
.drives { list-style: none; margin: 22px 0 26px; padding: 0; display: grid; gap: 18px; }
.drives li { display: grid; grid-template-columns: 58px minmax(0, 1fr); column-gap: 16px; row-gap: 3px; align-items: start; }
.drives__dab { grid-row: span 2; width: 54px; height: 20px; margin-top: .2em; }
.drives__dab svg { display: block; width: 100%; height: 100%; }
.drives__t { font-family: var(--serif); font-size: var(--t-lg); line-height: 1.25; color: var(--ivory); font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.drives__d { grid-column: 2; color: var(--ivory-2); font-size: var(--t-sm); line-height: 1.55; }
p.about__closing {
  display: flex; gap: 14px; align-items: flex-start; margin-top: 30px; max-width: 32ch;
  font-family: var(--serif); font-style: italic; font-weight: 340; font-size: var(--t-xl); line-height: 1.35; color: var(--moon); font-variation-settings: 'opsz' 36, 'SOFT' 100;
}
.about__closing-star { flex: none; width: 14px; margin-top: .42em; color: var(--gold); }
.about__closing-star svg { display: block; width: 14px; height: 14px; }
.glance {
  padding: clamp(22px, 2.4vw, 32px); border: 1px solid var(--line-faint); border-radius: 8px;
  background: rgba(var(--veil-rgb), .55);
}
@media (min-width: 901px) and (min-height: 880px) { .glance { position: sticky; top: 96px; } .glance.is-tall { position: static; } }   /* stays in view while the chapters scroll, when the window is tall enough to show all of it (sections.js checks) */
.glance__title { margin: 0 0 20px; font-family: var(--serif); font-style: italic; font-weight: 360; font-size: var(--t-lg); color: var(--gold); font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.glance dl { margin: 0; display: grid; gap: 16px; }
.glance dt { font-size: var(--t-2xs); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ivory-3); }
.glance dd { margin: 5px 0 0; font-family: var(--serif); font-size: var(--t-md); line-height: 1.38; color: var(--ivory); font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.glance .zh { font-family: 'Noto Serif SC Sub', 'Songti SC', 'STSong', 'Noto Serif CJK SC', 'Source Han Serif SC', 'SimSun', serif; }
/* the résumé at the foot of At a Glance */
.glance__cv {
  display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 12px 18px 12px 12px; border-radius: 999px;
  border: 1px solid rgba(242, 193, 78, .5); background: rgba(242, 193, 78, .07); color: var(--ivory); text-decoration: none;
  transition: background .3s var(--ease), border-color .3s var(--ease), transform .4s var(--ease-out);
}
.glance__cv:hover { background: rgba(242, 193, 78, .16); border-color: var(--gold); transform: translateY(-1px); }
.glance__cv:focus-visible { outline: 1.5px solid var(--gold); outline-offset: 3px; }
.glance__cv-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: #0a1550; }
.glance__cv-icon svg { width: 16px; height: 16px; }
.glance__cv:hover .glance__cv-icon svg { animation: cvNudge .7s var(--ease-out); }
@keyframes cvNudge { 40% { transform: translateY(2px); } }
@media (prefers-reduced-motion: reduce) { .glance__cv:hover .glance__cv-icon svg { animation: none; } }
.glance__cv-text { display: grid; gap: 1px; line-height: 1.25; }
.glance__cv-text b { font-weight: 500; font-size: var(--t-sm); }
.glance__cv-text small { font-size: var(--t-2xs); color: var(--ivory-3); letter-spacing: .04em; }
.flag { display: inline-block; margin-left: .45em; line-height: 0; vertical-align: -.06em; }
.flag + .flag { margin-left: .3em; }
.flag svg { display: block; height: .8em; width: auto; border-radius: 2px; box-shadow: 0 0 0 1px rgba(243, 234, 219, .25); }
.about__photo { margin: 0 0 24px; }
.about__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; filter: saturate(.92); }
.edu { margin-top: clamp(64px, 9vw, 120px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0; border-top: 1px solid var(--line-faint); }
.edu__item { padding: 28px 28px 8px 0; }
.edu__item + .edu__item { padding-left: 28px; border-left: 1px solid var(--line-faint); }
.edu__when { font-size: var(--t-xs); color: var(--ivory-3); margin-bottom: 8px; }
.edu__item h3 { font-size: var(--t-xl); margin-bottom: 6px; }
.edu__item p { margin: 0; color: var(--ivory-2); font-size: var(--t-sm); }
.edu__item .gold { color: var(--gold); }
.offclock { margin-top: 56px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 26px; }
.offclock h3 { font-size: var(--t-lg); font-style: italic; color: var(--moon); margin-right: 8px; font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.offclock span { position: relative; font-size: var(--t-sm); color: var(--ivory-2); }
.offclock span + span::before { content: ''; position: absolute; left: -15px; top: 50%; width: 3px; height: 3px; border-radius: 50%; background: var(--gold); opacity: .7; }
@media (max-width: 900px) {
  .about__body { grid-template-columns: 1fr; }
  .glance { order: -1; }                            /* the quick facts first on phones */
  .edu { grid-template-columns: 1fr; }
  .edu__item + .edu__item { padding-left: 0; border-left: 0; border-top: 1px solid var(--line-faint); }
}

/* 8. Journey (constellation timeline) ------------------------------------ */
.filters { display: flex; flex-wrap: wrap; gap: 8px 6px; margin: 0 0 18px; }
.chip {
  border: 1px solid var(--line-faint); background: transparent; border-radius: 999px; padding: 6px 14px; cursor: pointer;
  font-size: var(--t-xs); color: var(--ivory-2); transition: border-color .25s, color .25s, background-color .25s;
}
.chip:hover { color: var(--ivory); border-color: rgba(243, 234, 219, .4); }
.chip[aria-pressed="true"] { color: var(--abyss); background: var(--ivory); border-color: var(--ivory); }
.chip .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.filters--years .chip { font-variant-numeric: tabular-nums; }
.journey { margin-top: 26px; }
.journey__sky { position: relative; width: 100%; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(242, 193, 78, .35) transparent; }
.journey__svg { width: 100%; min-width: 1060px; height: auto; overflow: visible; }
.journey__path { fill: none; stroke: var(--gold); stroke-width: 1; opacity: .5; stroke-linecap: round; }
.journey__path-glow { fill: none; stroke: var(--gold); stroke-width: 6; opacity: .06; }
.jstar { cursor: pointer; outline: none; }
.jstar .halo { fill: url(#starGlow); opacity: .55; transition: opacity .4s, transform .5s var(--ease); transform-box: fill-box; transform-origin: center; }
.jstar .core { fill: var(--moon); transition: fill .3s; }
.jstar .ring { fill: none; stroke: var(--gold); stroke-width: 1; opacity: 0; transition: opacity .3s; }
.jstar text { font-family: var(--sans); font-size: 12px; fill: var(--ivory-2); transition: fill .3s; pointer-events: none; }
.jstar .when { fill: var(--ivory-3); font-size: 11px; }
.jstar:hover .halo, .jstar:focus .halo { opacity: 1; transform: scale(1.35); }
.jstar:hover text, .jstar:focus text { fill: var(--ivory); }
.jstar:focus-visible .ring, .jstar.is-active .ring { opacity: 1; }
.jstar.is-active .halo { opacity: 1; transform: scale(1.5); }
.jstar.is-active .core { fill: #fff; }
.jstar.is-dim { opacity: .18; }
.jstar.is-upcoming .core { fill: none; stroke: var(--moon); stroke-width: 1; stroke-dasharray: 2 2; }
.jstar.is-upcoming .halo { opacity: .2; }
.journey__year text { font-family: var(--serif); font-style: italic; font-size: 15px; fill: var(--ivory-3); font-variation-settings: 'opsz' 14, 'SOFT' 100; }
.journey__year line { stroke: var(--line-faint); }
.journey__lane { font-size: 11px; fill: var(--ivory-3); letter-spacing: .04em; }
.journey__detail { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 80px); padding-top: clamp(28px, 4vw, 48px); margin-top: 18px; border-top: 1px solid var(--line-faint); min-height: 280px; }
.jd__when { font-size: var(--t-sm); color: var(--gold); margin-bottom: 10px; }
.jd__title { font-size: clamp(1.9rem, 1.1rem + 2.1vw, 3rem); margin-bottom: 12px; }
.jd__org { color: var(--ivory-2); margin: 0 0 4px; }
.jd__place { color: var(--ivory-3); font-size: var(--t-sm); margin: 0; }
.jd__summary { font-family: var(--serif); font-size: var(--t-lg); line-height: 1.45; font-variation-settings: 'opsz' 24, 'SOFT' 100; margin-bottom: 18px; }
.jd__list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.jd__list li { position: relative; padding-left: 20px; color: var(--ivory-2); font-size: var(--t-sm); line-height: 1.55; }
.jd__list li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px rgba(242, 193, 78, .6); }
.jd__photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 6px 0 16px; max-width: 680px; }
.jd__photos.is-one { grid-template-columns: minmax(0, 1fr); max-width: 460px; }
.jd__photo { position: relative; padding: 0; border: 0; border-radius: 6px; overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; background: rgba(243, 234, 219, .05); }
.jd__photos.is-one .jd__photo { aspect-ratio: auto; }
.jd__photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease-out); }
.jd__photos.is-one .jd__photo img { height: auto; }
.jd__photo:hover img, .jd__photo:focus-visible img { transform: scale(1.04); }
.jd__photo:focus-visible { outline: 1.5px solid var(--gold); outline-offset: 2px; }
.jd__photo-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 9px 7px; text-align: left; background: linear-gradient(to top, rgba(3, 8, 40, .88), rgba(3, 8, 40, 0)); font-size: var(--t-xs); line-height: 1.3; color: var(--ivory); }
@media (max-width: 700px) {
  .jd__photos:not(.is-one) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jd__photos > .jd__photo:first-child:nth-last-child(2n+3) { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
  .jd__photos:not(.is-one) .jd__photo-cap { padding: 16px 8px 6px; font-size: 12px; }
  .jd__photos > .jd__photo:first-child:nth-last-child(2n+3) .jd__photo-cap { padding: 20px 9px 7px; font-size: var(--t-xs); }
}
.jd__nav { display: flex; gap: 18px; margin-top: 22px; }
.jd__nav button { background: none; border: 0; padding: 4px 0; cursor: pointer; font-size: var(--t-sm); color: var(--ivory-2); }
.jd__nav button:hover { color: var(--ivory); }
.jd__nav button:disabled { opacity: .3; cursor: default; }
.journey-list { display: none; list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; }
.journey-list::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(to bottom, transparent, var(--line) 8%, var(--line) 92%, transparent); }
.jl-item { position: relative; padding: 0 0 26px; }
.jl-item::before { content: ''; position: absolute; left: -24px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--moon); box-shadow: 0 0 10px 2px rgba(242, 193, 78, .55); }
.jl-item.is-upcoming::before { background: transparent; border: 1px dashed var(--moon); box-shadow: none; }
.jl-item.is-dim { display: none; }
.jl-item button { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; width: 100%; }
.jl-item .when { display: block; font-size: var(--t-xs); color: var(--gold); }
.jl-item .title { display: block; font-family: var(--serif); font-size: var(--t-lg); line-height: 1.25; font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.jl-item .org { display: block; font-size: var(--t-sm); color: var(--ivory-2); }
.jl-item .more { display: none; padding-top: 12px; }
.jl-item.is-open .more { display: block; }
@media (max-width: 900px) {
  .journey__sky, .journey__detail { display: none; }
  .journey-list { display: block; }
}

/* connected stars (cross links used across all detail views) */
.links-head { font-size: var(--t-xs); color: var(--ivory-3); margin: 22px 0 10px; letter-spacing: .02em; }
.connect { display: flex; flex-wrap: wrap; gap: 8px; }
.connect a, .connect button {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px;
  border: 1px solid var(--line-faint); background: rgba(243, 234, 219, .02); text-decoration: none; cursor: pointer;
  font-size: var(--t-xs); color: var(--ivory-2); transition: border-color .25s, color .25s, background-color .25s;
}
.connect a:hover, .connect button:hover { border-color: var(--line); color: var(--ivory); background: rgba(242, 193, 78, .06); }
.connect i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px rgba(242, 193, 78, .7); flex: none; }
.connect i.t-c { background: var(--teal); box-shadow: 0 0 6px rgba(95, 179, 184, .8); }
.connect i.t-s { background: var(--periwinkle); box-shadow: 0 0 6px rgba(142, 156, 203, .8); }
.connect i.t-j { background: var(--moon); box-shadow: 0 0 6px rgba(243, 227, 168, .8); }

/* 9. Atlas -------------------------------------------------------------- */
.sec--world { --veil: .85; }
.atlas { position: relative; }
.atlas__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; margin-bottom: 18px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0; padding: 0; font-size: var(--t-xs); color: var(--ivory-2); }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 9px; border-radius: 2px; display: inline-block; }
.legend .l-visited { background: var(--gold); box-shadow: 0 0 8px rgba(242, 193, 78, .7); }
.legend .l-current { background: var(--teal); box-shadow: 0 0 8px rgba(95, 179, 184, .8); }
.legend .l-wish { background: #4e5c9c; box-shadow: 0 0 6px rgba(142, 156, 203, .6); }
.legend .l-none { background: #1a2457; border: 1px solid rgba(243, 234, 219, .18); }
.atlas__search { position: relative; }
.atlas__search input {
  -webkit-appearance: none; appearance: none;   /* Safari otherwise draws its own search field */
  width: min(260px, 70vw); padding: 9px 14px 9px 34px; border-radius: 999px; border: 1px solid var(--line-faint);
  background: rgba(5, 10, 46, .55); color: var(--ivory); font: inherit; font-size: var(--t-sm);
}
.atlas__search input::placeholder { color: var(--ivory-3); }
/* the browser's own clear button and suggestion arrow differ by system (blue x on a Mac, grey x and a
   drop-down arrow on Windows): one gold clear button everywhere, no arrow */
.atlas__search input::-webkit-search-decoration, .atlas__search input::-webkit-calendar-picker-indicator { display: none !important; -webkit-appearance: none; }
.atlas__search input::-webkit-search-cancel-button {
  -webkit-appearance: none; width: 14px; height: 14px; margin-left: 6px; cursor: pointer; opacity: .75;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 3l8 8M11 3l-8 8' stroke='%23f2c14e' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.atlas__search input::-webkit-search-cancel-button:hover { opacity: 1; }
.atlas__search svg { position: absolute; left: 12px; top: 50%; width: 14px; height: 14px; margin-top: -7px; color: var(--ivory-3); }
.map {
  position: relative; width: 100%; aspect-ratio: 1.9 / 1; min-height: 300px; border-radius: 4px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, rgba(20, 38, 110, .55), rgba(5, 10, 46, .2) 70%);
  border: 1px solid var(--line-faint);
  touch-action: pan-x pan-y;   /* one finger scrolls (the page, or the map sideways on phones); two fingers zoom the map */
}
.map-frame { position: relative; }
.map-scroll { position: relative; }
.map__swipe { display: none; }
.map svg { width: 100%; height: 100%; }
.map__loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ivory-3); font-size: var(--t-sm); }
.map .graticule { fill: none; stroke: rgba(243, 234, 219, .05); stroke-width: .6; vector-effect: non-scaling-stroke; }
.map .sphere { fill: none; stroke: rgba(242, 193, 78, .18); stroke-width: 1; vector-effect: non-scaling-stroke; }
.country { fill: #16205a; stroke: rgba(207, 220, 239, .22); stroke-width: .5; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .35s, opacity .6s; }
.country:hover { fill: #26357e; }
.country.s-wishlist { fill: #3f4c8f; filter: url(#glowSoft); }
.country.s-wishlist:hover { fill: #5363ab; }
.country.s-visited, .country.s-home { fill: var(--gold); stroke: rgba(255, 240, 200, .8); filter: url(#glowGold); }
.country.s-visited:hover, .country.s-home:hover { fill: #ffd56e; }
.country.s-current { fill: var(--teal); stroke: rgba(220, 255, 255, .85); filter: url(#glowTeal); animation: currentPulse 3.2s ease-in-out infinite; }
@keyframes currentPulse { 50% { fill: #86d2d6; } }
.country.is-selected, .country.is-linked { stroke: #fff; stroke-width: 1.6; }
.country.s-visited.is-linked, .country.s-home.is-linked { fill: #ffd56e; }
.country.s-current.is-linked { fill: #7fd3d8; }
.country.is-faded { opacity: .35; }
.country.is-replay-off { fill: #16205a; filter: none; animation: none; }
.map__dust { position: absolute; inset: 0; pointer-events: none; }
.map__tip { position: absolute; z-index: 3; pointer-events: none; padding: 6px 10px; border-radius: 3px; background: rgba(5, 10, 46, .92); border: 1px solid var(--line-faint); font-size: var(--t-xs); white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .15s; }
.map__tip b { font-weight: 600; }
.map__tip span { color: var(--ivory-3); margin-left: 8px; }
.map__controls { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.map__controls button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-faint); background: rgba(5, 10, 46, .78); cursor: pointer; display: grid; place-items: center; font-size: 18px; line-height: 1; color: var(--ivory); }
.map__controls button:hover { border-color: var(--line); }
.map__controls svg { width: 14px; height: 14px; }
.atlas__below { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 72px); margin-top: 34px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; margin: 0; }
.stats div { border-top: 1px solid var(--line-faint); padding-top: 12px; }
.stats dt { font-size: var(--t-xs); color: var(--ivory-3); order: 2; }
.stats dd { margin: 0 0 2px; font-family: var(--serif); font-size: var(--t-2xl); font-weight: 320; line-height: 1.05; font-variation-settings: 'opsz' 72, 'SOFT' 100; }
.stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.atlas__note { margin-top: 18px; font-size: var(--t-sm); color: var(--ivory-3); font-style: italic; }
.atlas__visited { margin-top: 22px; }
.atlas__years { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.atlas__years .replay { display: inline-flex; align-items: center; gap: 8px; }
.atlas__years .replay svg { width: 10px; height: 10px; }
.achievements { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.ach { display: flex; align-items: center; gap: 12px; font-size: var(--t-xs); color: var(--ivory-3); }
.ach svg { width: 34px; height: 34px; flex: none; }
.ach svg circle { fill: var(--ivory-3); }
.ach svg line { stroke: rgba(243, 234, 219, .2); stroke-width: 1; }
.ach.is-earned { color: var(--ivory); }
.ach.is-earned svg circle { fill: var(--gold); filter: drop-shadow(0 0 3px rgba(242, 193, 78, .9)); }
.ach.is-earned svg line { stroke: var(--line); }
.ach small { display: block; color: var(--ivory-3); }
@media (max-width: 900px) {
  .map { aspect-ratio: 1.45 / 1; }
  .atlas__below { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 10. Work — constellations ------------------------------------------------ */
.sec--work { --veil: .82; }
.sky { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.cons { position: relative; }
.cons__name { font-size: var(--t-xl); margin: 0 0 4px; }
.cons__note { font-size: var(--t-xs); color: var(--ivory-2); margin: 0 0 6px; }
.cons svg { width: 100%; height: auto; overflow: visible; }
.cons .edge { stroke: var(--line); stroke-width: .9; fill: none; stroke-linecap: round; opacity: .55; stroke-dasharray: var(--len, 400); stroke-dashoffset: var(--len, 400); transition: stroke-dashoffset 2.4s var(--ease); }
.cons.is-drawn .edge { stroke-dashoffset: 0; }
.cons .edge.is-hot { opacity: 1; stroke: var(--gold); }
.wstar { cursor: pointer; outline: none; }
.wstar .halo { opacity: 0; transition: opacity 1.4s var(--ease), transform .5s var(--ease); transform-box: fill-box; transform-origin: center; }
.cons.is-drawn .wstar .halo { opacity: .7; }
.wstar .core { fill: #fff8e6; }
.wstar .ring { fill: none; stroke: var(--gold); stroke-width: 1; opacity: 0; transition: opacity .3s; }
.wstar text { font-family: var(--sans); font-size: 12.5px; fill: var(--ivory-2); transition: fill .3s, opacity .3s; pointer-events: none; }
.cons svg.is-compact { max-width: 440px; }
.cons svg.is-compact .wstar text { font-size: 14px; fill: var(--ivory); }
.wstar:hover .halo, .wstar:focus .halo { opacity: 1; transform: scale(1.4); }
.wstar:hover text, .wstar:focus text { fill: var(--ivory); }
.wstar:focus-visible .ring { opacity: 1; }
.wstar.is-wip .core { fill: none; stroke: #fff8e6; stroke-width: 1.1; stroke-dasharray: 2.5 2.5; }
.wstar.is-wip:hover .core, .wstar.is-wip:focus .core { fill: rgba(255, 248, 230, .25); }
.wip { display: inline-block; padding: 2px 9px; margin-right: 8px; border: 1px solid var(--line-faint); border-radius: 999px; font-family: var(--sans); font-style: normal; font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ivory-2); vertical-align: 2px; white-space: nowrap; }
.ix-when .wip { margin-right: 10px; }

/* Featured projects — one big star per website ------------------------------ */
.featured { margin: 0 0 clamp(56px, 8vw, 96px); }
.featured__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; border-bottom: 1px solid var(--line-faint); padding-bottom: 12px; margin-bottom: clamp(28px, 4vw, 44px); }
.featured__head h3 { font-size: var(--t-xl); margin: 0; }
.featured__lede { margin: 0; font-size: var(--t-xs); color: var(--ivory-2); }
.feat-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
/* four websites: two by two, so no card is left alone on a row */
@media (min-width: 641px) { .feat-row:has(> li:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: clamp(36px, 5vw, 64px); } }
.feat {
  --hue: var(--gold);
  position: relative; display: block; padding: 84px 0 0; text-decoration: none; color: inherit; outline: none; border-radius: 6px;
}
.feat__star { position: absolute; left: 50%; top: 0; width: 120px; height: 120px; margin-left: -60px; margin-top: -12px; pointer-events: none; z-index: 2; }
.fstar { display: block; width: 100%; height: 100%; overflow: visible; }
.fstar__halo { opacity: .55; transform-box: fill-box; transform-origin: center; transition: opacity .6s var(--ease), transform .8s var(--ease-out); }
.fstar__spark { transform-box: fill-box; transform-origin: center; animation: fstarBreathe 4.6s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(255, 244, 208, .8)); transition: transform .6s var(--ease-out); }
.fstar__core { filter: drop-shadow(0 0 4px #fff); }
.fstar__fx { opacity: 0; transition: opacity .5s var(--ease); }
.feat:hover .fstar__fx, .feat:focus-visible .fstar__fx { opacity: 1; }
.feat:hover .fstar__halo, .feat:focus-visible .fstar__halo { opacity: 1; transform: scale(1.45); }
.feat:hover .fstar__spark, .feat:focus-visible .fstar__spark { transform: scale(1.18) rotate(45deg); }
@keyframes fstarBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.09); } }
/* the sun: rays grow out and the whole star turns slowly */
.fstar--sun .ray { stroke-width: 1.4; stroke-linecap: round; transform-box: view-box; transform-origin: 0 0; stroke-dasharray: 30; stroke-dashoffset: 30; transition: stroke-dashoffset .7s var(--ease-out); }
.fstar--sun .ray:nth-child(2n) { transition-delay: .08s; }
.fstar--sun .ray:nth-child(3n) { transition-delay: .16s; }
.feat:hover .fstar--sun .ray, .feat:focus-visible .fstar--sun .ray { stroke-dashoffset: 0; }
.feat:hover .fstar--sun .fstar__fx, .feat:focus-visible .fstar--sun .fstar__fx { animation: fstarTurn 14s linear infinite; transform-box: view-box; transform-origin: 0 0; }
@keyframes fstarTurn { to { transform: rotate(360deg); } }
/* the ripple: rings spread out from the star, like rain on water */
.fstar--ripple .ring { fill: none; stroke-width: 1.2; transform-box: view-box; transform-origin: 0 0; opacity: 0; }
.feat:hover .fstar--ripple .ring, .feat:focus-visible .fstar--ripple .ring { animation: fstarRipple 2.4s var(--ease-out) infinite; }
.feat:hover .fstar--ripple .ring-1, .feat:focus-visible .fstar--ripple .ring-1 { animation-delay: .8s; }
.feat:hover .fstar--ripple .ring-2, .feat:focus-visible .fstar--ripple .ring-2 { animation-delay: 1.6s; }
@keyframes fstarRipple { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(3.6); opacity: 0; } }
/* the orbit: a small moon circles the star — days going by */
.fstar--orbit .orbit { fill: none; stroke-width: .8; stroke-dasharray: 3 4; opacity: .7; }
.fstar--orbit .moon-arm { transform-box: view-box; transform-origin: 0 0; }
.feat:hover .fstar--orbit .moon-arm, .feat:focus-visible .fstar--orbit .moon-arm { animation: fstarTurn 5.45s linear infinite; }
.fstar--orbit .moon { filter: drop-shadow(0 0 3px #fff4d0); }
.fstar--flow .loop { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 4 6; opacity: .85; }
.feat:hover .fstar--flow .loop, .feat:focus-visible .fstar--flow .loop { animation: fstarFlow 1.1s linear infinite; }
.feat:hover .fstar--flow .loop-b, .feat:focus-visible .fstar--flow .loop-b { animation-direction: reverse; }
@keyframes fstarFlow { to { stroke-dashoffset: -20; } }
.feat__cover {
  position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 4px;
  border: 1px solid var(--line-faint); background: #06113f;
  box-shadow: 0 22px 50px -20px rgba(2, 5, 25, .9); transition: transform .7s var(--ease-out), border-color .4s var(--ease), box-shadow .7s var(--ease);
}
.feat__cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; transform: scale(1.02); transition: transform 1.2s var(--ease-out), filter .6s var(--ease); filter: saturate(.92) brightness(.94); }
.feat:hover .feat__cover, .feat:focus-visible .feat__cover { transform: translateY(-6px); border-color: var(--hue); box-shadow: 0 30px 60px -22px rgba(2, 5, 25, .95), 0 0 0 1px rgba(255, 255, 255, .04), 0 0 40px -10px var(--hue); }
.feat:hover .feat__cover img, .feat:focus-visible .feat__cover img { transform: scale(1.08); filter: none; }
.feat__cover.is-blank { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: radial-gradient(ellipse 80% 70% at 50% 100%, #0d1b5e, #050a2e 70%); }
.feat__strokes { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: 220px; }
.feat__strokes span { display: block; height: 26px; opacity: .9; }
.feat__strokes span:nth-child(2) { width: 150px; height: 22px; margin-left: 24px; }
.feat__strokes span:nth-child(3) { width: 90px; height: 18px; margin-left: 10px; }
.feat__strokes svg { display: block; width: 100%; height: 100%; }
.feat__blank { font-family: var(--serif); font-style: italic; font-size: var(--t-md); color: var(--ivory-2); font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.feat__body { display: block; padding: 18px 2px 0; }
.feat__kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--t-2xs); letter-spacing: .06em; text-transform: uppercase; color: var(--ivory-3); margin-bottom: 8px; }
.feat__status { display: inline-flex; align-items: center; gap: 7px; color: var(--ivory); }
.feat__tags { display: block; width: 100%; }
.feat__status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--hue); box-shadow: 0 0 8px var(--hue); }
.feat.is-wip .feat__status::before { background: transparent; border: 1px solid var(--hue); box-shadow: none; }
.feat__title { display: block; font-family: var(--serif); font-size: var(--t-xl); line-height: 1.12; color: var(--ivory); font-variation-settings: 'opsz' 36, 'SOFT' 50; transition: color .3s; }
.feat:hover .feat__title, .feat:focus-visible .feat__title { color: #fff; }
.feat__tagline { display: block; margin-top: 8px; font-size: var(--t-sm); line-height: 1.5; color: var(--ivory-2); max-width: 40ch; }
.feat__go { display: inline-block; margin-top: 12px; font-size: var(--t-xs); color: var(--hue); opacity: .75; transform: translateX(-4px); transition: opacity .3s, transform .5s var(--ease-out); }
.feat:hover .feat__go, .feat:focus-visible .feat__go { opacity: 1; transform: none; }
.feat:focus-visible { outline: 1.5px solid var(--gold); outline-offset: 10px; }
/* flight into a star: a disc of the project's colour grows from it, then fades over the chapter */
.portal-disc { position: fixed; z-index: 70; width: 12px; height: 12px; margin: -6px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, #fff8e6 0%, var(--c, var(--gold)) 22%, #050a2e 70%); transform: scale(0); opacity: 1; transition: transform .6s cubic-bezier(.6, 0, .4, 1), opacity .7s var(--ease); will-change: transform, opacity; }
.portal-disc.is-grown { transform: scale(calc(var(--R, 2000px) / 12px)); }
.portal-disc.is-gone { opacity: 0; }
.chapter__tagline { display: block; font-family: var(--serif); font-style: italic; font-size: var(--t-lg); color: var(--moon); margin-bottom: 6px; font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.chapter__actions { margin: 0 0 clamp(36px, 5vw, 60px); }
.chapter__cover { margin: 22px 0 0; border-radius: 4px; overflow: hidden; border: 1px solid var(--line-faint); box-shadow: 0 30px 70px -30px rgba(2, 5, 25, .95); }
.chapter__cover img { display: block; width: 100%; height: auto; }
.chapter__soon { margin: 0; font-size: var(--t-sm); color: var(--ivory-2); }
@media (max-width: 900px) {
  .feat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .feat-row { grid-template-columns: 1fr; gap: 44px; }
  .feat { padding-top: 72px; }
  .feat__star { width: 104px; height: 104px; margin-left: -52px; }
}
@media (prefers-reduced-motion: reduce) {
  .fstar__spark { animation: none; }
  .feat:hover .fstar--sun .fstar__fx, .feat:hover .fstar--orbit .moon-arm, .feat:hover .fstar--ripple .ring, .feat:hover .fstar--flow .loop { animation: none; }
  .feat:hover .fstar--ripple .ring { opacity: .6; transform: scale(2); }
  .feat:hover .fstar--orbit .moon-arm { transform: rotate(135deg); }
}
.is-paused .fstar__spark, .is-paused .fstar__fx, .is-paused .moon-arm, .is-paused .ring, .is-paused .loop { animation-play-state: paused; }

.index { margin-top: clamp(56px, 8vw, 96px); }
.index__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-bottom: 1px solid var(--line-faint); padding-bottom: 12px; }
.index__head h3 { font-size: var(--t-xl); }
/* All projects: grouped by constellation; each title is written on a stroke of its colour */
.ix-groups, .ix-list { list-style: none; margin: 0; padding: 0; }
.ix-group { padding-top: clamp(24px, 3vw, 36px); }
.ix-group__name {
  display: flex; align-items: center; gap: 12px; margin: 0 0 8px;
  font-family: var(--serif); font-style: italic; font-weight: 360; font-size: var(--t-lg); color: var(--moon); font-variation-settings: 'opsz' 24, 'SOFT' 100;
}
.ix-group__dab { flex: none; width: 44px; height: 16px; }
.ix-group__dab svg { display: block; width: 100%; height: 100%; }
.ix-group__count { margin-left: auto; font-family: var(--sans); font-style: normal; font-size: var(--t-xs); color: var(--ivory-3); }
.ix-row {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto 24px; align-items: center; gap: 16px;
  width: 100%; padding: 6px 0; background: none; border: 0; border-radius: 6px; text-align: left; cursor: pointer; color: inherit;
}
.ix-num { font-family: var(--serif); font-style: italic; font-size: var(--t-sm); color: var(--ivory-3); font-variation-settings: 'opsz' 14, 'SOFT' 100; transition: color .3s var(--ease); }
.ix-title { position: relative; min-width: 0; }
.ix-paint { position: absolute; left: 0; top: 0; pointer-events: none; transform-origin: 0 50%; transition: transform .5s var(--ease-out), filter .4s var(--ease); }
.ix-paint svg { display: block; width: 100%; height: 100%; }
.ix-text {
  position: relative; display: inline-block; max-width: 100%; padding: .32em 2.6em .36em .8em;
  font-family: var(--serif); font-size: var(--t-lg); line-height: 1.3; color: #0b1240; font-variation-settings: 'opsz' 24, 'SOFT' 50;
  transition: transform .5s var(--ease-out);
}
.ix-when { font-size: var(--t-xs); color: var(--ivory-3); white-space: nowrap; text-align: right; }
.ix-go { color: var(--gold); opacity: 0; transform: translateX(-6px); transition: opacity .3s var(--ease), transform .5s var(--ease-out); }
.ix-row:hover .ix-paint, .ix-row:focus-visible .ix-paint { transform: scaleX(1.035); filter: brightness(1.08) saturate(1.12); }
.ix-row:hover .ix-text, .ix-row:focus-visible .ix-text { transform: translateX(5px); }
.ix-row:hover .ix-num, .ix-row:focus-visible .ix-num { color: var(--gold); }
.ix-row:hover .ix-go, .ix-row:focus-visible .ix-go { opacity: 1; transform: none; }
.ix-row:focus-visible { outline: 1.5px solid var(--gold); outline-offset: 4px; }
@media (max-width: 900px) {
  .sky { grid-template-columns: 1fr; }
  .cons svg:not(.is-compact) { max-width: 620px; }
}
@media (max-width: 700px) {
  .ix-row { grid-template-columns: 30px minmax(0, 1fr); gap: 4px 10px; align-items: start; padding: 7px 0; }
  .ix-num { padding-top: .6em; }
  .ix-text { font-size: var(--t-md); padding: .42em 2em .46em .75em; }
  .ix-when { grid-column: 2; text-align: left; padding-left: .8em; }
  .ix-go { display: none; }
}

/* case study chapter */
.chapter__eyebrow { font-size: var(--t-sm); color: var(--gold); margin: 0 0 14px; }
.chapter__title { font-size: clamp(2.2rem, 1.4rem + 3vw, 4.2rem); line-height: 1.02; max-width: 18ch; margin-bottom: 18px; }
.chapter__meta { color: var(--ivory-2); margin: 0 0 clamp(32px, 5vw, 56px); }
.chapter__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 28px clamp(28px, 5vw, 72px); }
.chapter__grid > h3 { font-family: var(--serif); font-style: italic; font-size: var(--t-lg); color: var(--moon); font-weight: 340; padding-top: 2px; font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.chapter__grid > div { color: var(--ivory-2); }
.chapter__grid > div p { margin: 0; max-width: 60ch; }
.chapter__tools { display: flex; flex-wrap: wrap; gap: 8px; }
.chapter__tools span { padding: 4px 12px; border: 1px solid var(--line-faint); border-radius: 999px; font-size: var(--t-xs); color: var(--ivory); }
.chapter__images { display: grid; gap: 18px; }
.chapter__images figure { margin: 0; }
.chapter__images img { width: 100%; border-radius: 2px; }
.chapter__images figcaption { font-size: var(--t-xs); color: var(--ivory-3); margin-top: 6px; }
.chapter__shot { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 3px; overflow: hidden; }
.chapter__shot img { display: block; width: 100%; height: auto; transition: transform .7s var(--ease-out); }
.chapter__shot:hover img, .chapter__shot:focus-visible img { transform: scale(1.02); }
.chapter__shot:focus-visible { outline: 1.5px solid var(--gold); outline-offset: 3px; }
/* researched background, with its sources */
.chapter__bg { display: grid; gap: 12px; }
.chapter__bg > p { font-size: var(--t-sm); color: var(--ivory-2, inherit); line-height: 1.6; }
.chapter__bg > p.chapter__bg-note { font-size: var(--t-xs); color: var(--ivory-3); }
.chapter__bg-note { font-size: var(--t-xs); color: var(--ivory-3); font-style: italic; }
.chapter__src { font-size: var(--t-xs); color: var(--ivory-3); }
.chapter__src a { color: var(--ivory-3); text-decoration: underline; text-decoration-color: rgba(243, 234, 219, .3); text-underline-offset: 2px; }
.chapter__src a:hover { color: var(--gold); }
/* related documents */
.docs { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.docs:empty { display: none; }
.doc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--line-faint); border-radius: 8px; background: rgba(var(--veil-rgb), .35); }
.doc__kind { padding: 3px 8px; border-radius: 4px; background: rgba(242, 193, 78, .12); color: var(--gold); font-size: var(--t-2xs); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.doc__text { display: grid; gap: 2px; }
.doc__text b { font-weight: 500; color: var(--ivory); font-size: var(--t-sm); }
.doc__text small { color: var(--ivory-3); font-size: var(--t-xs); }
.doc__go { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ivory); font-size: var(--t-xs); text-decoration: none; white-space: nowrap; }
.doc__go:hover { background: rgba(242, 193, 78, .14); }
.doc.is-request .doc__go { border-style: dashed; }
.docs__ask { font-size: var(--t-sm); color: var(--ivory-3); margin: 0; }
@media (max-width: 560px) { .doc { grid-template-columns: minmax(0, 1fr) auto; } .doc__kind { grid-column: 1 / -1; justify-self: start; } }
@media (max-width: 760px) { .chapter__grid { grid-template-columns: 1fr; gap: 10px; } .chapter__grid > div { margin-bottom: 18px; } }

/* 10b. Constellation — how it all connects -------------------------------- */
.sec--graph { --veil: .78; --veil-edge: .5; }
.graph__wrap { position: relative; }
.graph__scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: rgba(242, 193, 78, .35) transparent; }
/* Phones and tablets: the map and the star chart keep their full width and are swiped sideways
   (no shrinking to fit). The scrollbar is hidden; the edges fade to show there is more. */
@media (max-width: 960px), (hover: none) and (pointer: coarse) {
  .graph__scroll, .map-scroll {
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter);
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%);
  }
  .graph__scroll::-webkit-scrollbar, .map-scroll::-webkit-scrollbar { display: none; }
}
@media (max-width: 760px) {
  /* only once the map sits in its swipe frame — the placeholder before it loads stays fluid */
  .map-scroll > .map { width: 940px; max-width: none; aspect-ratio: 1.9 / 1; min-height: 0; }
  .map__swipe {
    display: flex; align-items: center; gap: 8px; position: absolute; left: 50%; bottom: 14px; z-index: 3; margin: 0; transform: translateX(-50%);
    padding: 6px 14px; border-radius: 999px; background: rgba(var(--veil-rgb), .82); border: 1px solid var(--line-faint);
    font-size: var(--t-xs); color: var(--ivory-2); white-space: nowrap; pointer-events: none; transition: opacity .6s var(--ease);
  }
  .map__swipe::before, .map__swipe::after { content: '‹'; color: var(--gold); font-size: 1.1em; line-height: 1; }
  .map__swipe::after { content: '›'; }
  .map-frame.is-swiped .map__swipe { opacity: 0; }
  .map__controls { bottom: 52px; right: 10px; }
}
.graph { width: 100%; min-width: 960px; height: auto; overflow: visible; }
/* phones and tablets: the chart keeps nearly its drawn size (1240 wide), so the labels stay legible */
@media (max-width: 960px) { .graph { min-width: 1160px; } }
.graph:focus { outline: none; }
.graph__row { font-family: var(--serif); font-style: italic; font-size: 15px; fill: var(--ivory-3); font-variation-settings: 'opsz' 14, 'SOFT' 100; }
.graph__horizon { fill: none; stroke: rgba(207, 220, 239, .22); stroke-width: 1; }
.graph__edge { fill: none; stroke: var(--gold); stroke-width: .8; opacity: .16; transition: opacity .35s, stroke-width .35s; }
.graph.is-hidden .graph__edge { opacity: 0; }
.graph:not(.is-hidden) .graph__edge { transition: opacity 2.2s var(--ease), stroke-width .35s; }
.graph.is-tracing .graph__edge { opacity: .05; transition: opacity .35s; }
.graph.is-tracing .graph__edge.is-on { opacity: .95; stroke-width: 1.3; }
.gnode { cursor: pointer; outline: none; transition: opacity .35s; }
.gnode__halo { opacity: .55; transition: opacity .35s; }
.gnode__core { fill: #fff6dc; }
.gnode--c .gnode__core { fill: var(--gold); }
.gnode--j .gnode__core { fill: var(--moon); }
.gnode--w .gnode__core { fill: #fff8e6; }
.gnode__ring { fill: none; stroke: var(--gold); stroke-width: 1; opacity: 0; transition: opacity .3s; }
.gnode__label { font-family: var(--sans); font-size: 11.5px; fill: var(--ivory-2); transition: fill .3s, opacity .3s; pointer-events: none; }
.gnode--c .gnode__label { font-family: var(--serif); font-size: 16px; fill: var(--ivory); font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.gnode--s .gnode__label { font-size: 12px; fill: var(--ivory); letter-spacing: .02em; }
.gnode__when { font-family: var(--serif); font-style: italic; font-size: 10.5px; fill: var(--ivory-3); pointer-events: none; }
.graph.is-tracing .gnode { opacity: .22; }
.graph.is-tracing .gnode.is-on { opacity: 1; }
.graph.is-tracing .gnode.is-on .gnode__label { fill: var(--ivory); }
.gnode.is-self .gnode__ring, .gnode:focus-visible .gnode__ring { opacity: 1; }
.gnode.is-self .gnode__halo { opacity: 1; }
.graph__info { min-height: 3.2em; margin: 18px 0 0; max-width: 90ch; color: var(--ivory-2); font-size: var(--t-sm); }
.graph__info a { margin-left: 10px; white-space: nowrap; }
.graph__hint { display: none; font-size: var(--t-xs); color: var(--ivory-3); margin: 6px 0 0; }
@media (max-width: 960px) { .graph__hint { display: block; } }

/* 10c. Memories: the albums under the World map ------------------------- */
.albums { margin-top: clamp(44px, 6vw, 76px); scroll-margin-top: 90px; }
.albums[hidden] { display: none; }
.albums__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 16px; }
.albums__title { display: inline-flex; align-items: center; gap: 10px; font-size: var(--t-xl); }
.albums__title svg { width: 14px; height: 14px; color: var(--gold); filter: drop-shadow(0 0 6px rgba(242, 193, 78, .6)); }
.albums__lede { margin: 0; font-size: var(--t-sm); color: var(--ivory-3); }
.albums__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 18px); }
.album {
  position: relative; display: block; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; isolation: isolate;
  color: var(--ivory); text-decoration: none; background: rgba(243, 234, 219, .05); border: 1px solid var(--line-faint);
  transition: transform .5s var(--ease-out), border-color .35s var(--ease), box-shadow .5s var(--ease);
}
.album__img, .album__img img { position: absolute; inset: 0; width: 100%; height: 100%; }
.album__img img { object-fit: cover; filter: saturate(.92) brightness(.9); transition: transform .9s var(--ease-out), filter .4s var(--ease); }
.album::after { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(to top, rgba(3, 8, 40, .92) 0, rgba(3, 8, 40, .5) 34%, rgba(3, 8, 40, 0) 64%); }
.album__text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: grid; gap: 4px; padding: 14px 14px 13px; }
.album__name { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: var(--t-lg); line-height: 1.15; font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.album__flag { flex: none; width: 22px; height: auto; border-radius: 2px; box-shadow: 0 1px 6px rgba(0, 0, 0, .45); }
.album__meta { font-size: var(--t-xs); color: var(--ivory-2); letter-spacing: .02em; }
.album:hover, .album:focus-visible { transform: translateY(-3px); border-color: var(--line); box-shadow: 0 14px 30px rgba(0, 0, 0, .35); }
.album:hover img, .album:focus-visible img { transform: scale(1.05); filter: none; }
.album:focus-visible { outline: 1.5px solid var(--gold); outline-offset: 3px; }
@media (max-width: 520px) {
  .albums__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .album__text { padding: 11px 11px 10px; }
  .albums__grid > li:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* an odd one out spans the row */
  .albums__grid > li:last-child:nth-child(odd) .album { aspect-ratio: 16 / 9; }
}
.lightbox figcaption p { max-width: 60ch; margin: 8px auto 0; color: var(--ivory-2); }

/* 11. Palette ----------------------------------------------------------------- */
/* Bands of paint. Pointing at one (or focusing it from the keyboard, or keeping it open with a click or
   tap) widens it: the stroke stays where it is and the skill appears beside it; the others dim.
   sections.js keeps the state in classes (.is-hover beats .is-kbd, which beats .is-open) and sets
   --pal-idle (a closed band), --pal-open (an open band) and --pal-need (the height the longest
   description needs, so none is ever cut off). The strokes are painted at their real size (brush.js). */
.palette { display: block; }
.pal__hint { margin: 0 0 14px; font-size: var(--t-xs); color: var(--ivory-3); }
.pal { display: flex; gap: clamp(6px, .8vw, 12px); height: max(clamp(460px, 66vh, 620px), var(--pal-need, 0px)); list-style: none; margin: 0; padding: 0; }
.pal__item {
  position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; border-radius: 6px; cursor: pointer;
  background-color: #070c34;
  background-image: repeating-linear-gradient(0deg, rgba(243, 234, 219, .02) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(243, 234, 219, .015) 0 1px, transparent 1px 3px);
  box-shadow: inset 0 0 0 1px rgba(243, 234, 219, .06);
  transition: flex-grow .75s var(--ease-out), opacity .45s var(--ease), filter .45s var(--ease), box-shadow .45s var(--ease);
}
.pal__item:focus-visible { outline: 1.5px solid var(--pig); outline-offset: 3px; }
.pal__paint { position: absolute; top: 0; bottom: 0; left: 0; width: min(100%, var(--pal-idle, 100%)); pointer-events: none; }
.pal__paint svg { display: block; width: 100%; height: 100%; }
.pal__label {
  position: absolute; left: calc(min(100%, var(--pal-idle, 100%)) / 2); bottom: 18px; transform: translateX(-50%) rotate(180deg); writing-mode: vertical-rl;
  max-height: calc(100% - 36px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 14px 8px; border-radius: 999px; background: rgba(var(--veil-rgb), .72); color: var(--ivory);
  font-family: var(--serif); font-style: italic; font-size: var(--t-md); letter-spacing: .01em; font-variation-settings: 'opsz' 24, 'SOFT' 100;
  transition: opacity .35s var(--ease);
}
.pal__more {
  position: absolute; top: 0; bottom: 0; left: var(--pal-idle, 50%); width: calc(var(--pal-open, 400px) - var(--pal-idle, 120px));
  display: flex; flex-direction: column; justify-content: center; padding: 0 clamp(18px, 2vw, 28px) 0 clamp(8px, 1vw, 14px);
  opacity: 0; transform: translateX(-14px); pointer-events: none; transition: opacity .45s var(--ease), transform .65s var(--ease-out);
}
.pal__in { padding: 28px 0; }
.pal__name { margin: 0 0 12px; font-size: var(--t-xl); line-height: 1.15; }
.pal__text { margin: 0 0 16px; color: var(--ivory-2); font-size: var(--t-sm); line-height: 1.55; }
.pal__tools { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; }
.pal__tools li { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--pig); background: rgba(var(--veil-rgb), .4); color: var(--ivory); font-size: var(--t-xs); font-weight: 500; letter-spacing: .01em; }
.pal__more .links-head { margin-top: 0; }

.pal__item.is-hover,
.pal:not(.has-hover) .pal__item.is-kbd,
.pal:not(.has-hover):not(.has-kbd) .pal__item.is-open { flex-grow: 4.6; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pig) 30%, transparent); }
.pal__item.is-hover .pal__more,
.pal:not(.has-hover) .pal__item.is-kbd .pal__more,
.pal:not(.has-hover):not(.has-kbd) .pal__item.is-open .pal__more { opacity: 1; transform: none; pointer-events: auto; transition-delay: .15s; }
.pal__item.is-hover .pal__label,
.pal:not(.has-hover) .pal__item.is-kbd .pal__label,
.pal:not(.has-hover):not(.has-kbd) .pal__item.is-open .pal__label { opacity: 0; }
/* the other colours step back */
.pal.has-hover .pal__item:not(.is-hover),
.pal.has-kbd:not(.has-hover) .pal__item:not(.is-kbd),
.pal.has-open:not(.has-hover):not(.has-kbd) .pal__item:not(.is-open) { opacity: .4; filter: saturate(.5) brightness(.8); }
.pal__item.is-flash { animation: palFlash 1.8s var(--ease); }
@keyframes palFlash { 25% { box-shadow: inset 0 0 0 2px var(--pig), 0 0 28px var(--pig); } }

/* phones and narrow screens: the colours stack, and a tap opens one below its stroke */
@media (max-width: 899px) {
  .pal { flex-direction: column; height: auto; gap: 8px; }
  .pal__item { flex: none; display: grid; grid-template-rows: 64px 0fr; transition: grid-template-rows .55s var(--ease-out), opacity .45s var(--ease), filter .45s var(--ease); }
  .pal__item.is-open, .pal__item.is-kbd { grid-template-rows: 64px 1fr; }
  .pal__paint { bottom: auto; width: 100%; height: 64px; }
  .pal__label { position: relative; grid-row: 1; left: auto; bottom: auto; align-self: center; justify-self: start; transform: none; writing-mode: horizontal-tb; margin-left: 12px; max-width: calc(100% - 24px); padding: 6px 14px; opacity: 1 !important; }
  .pal__more { position: relative; grid-row: 2; top: auto; bottom: auto; left: auto; width: auto; min-height: 0; overflow: hidden; display: block; padding: 0 16px; opacity: 1; transform: none; pointer-events: auto; }
  .pal__in { padding: 14px 0 18px; }
  .pal__name { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.palette-aux { margin-top: clamp(64px, 9vw, 110px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); }
.langs { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.langs li { display: grid; grid-template-columns: calc(var(--t-2xl) * 3.9) minmax(0, 1fr); gap: 4px 18px; align-items: center; border-top: 1px solid var(--line-faint); padding-top: 16px; }
.langs .native { font-family: var(--serif); font-size: var(--t-2xl); line-height: 1; font-variation-settings: 'opsz' 72, 'SOFT' 100; }
.langs .native.zh { font-family: 'Noto Serif SC Sub', 'Songti SC', 'STSong', 'Noto Serif CJK SC', 'Source Han Serif SC', 'SimSun', serif; font-weight: 400; }
.langs__about { display: grid; gap: 2px; }
.langs .en { color: var(--ivory-2); font-size: var(--t-sm); }
.langs .level { font-family: var(--serif); font-style: italic; font-size: var(--t-md); color: var(--gold); font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.langs .note { font-size: var(--t-xs); color: var(--ivory-3); }
.creds h3, .langs-wrap h3, .courses h3 { font-size: var(--t-xl); margin-bottom: 18px; }
/* certificates: each one as an image card */
.certs { margin-top: clamp(56px, 8vw, 96px); }
.certs__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 14px; }
.certs__head h3 { font-size: var(--t-xl); }
.certs__head .muted { font-size: var(--t-xs); }
.certs__grid { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 248px), 1fr)); gap: clamp(14px, 1.8vw, 22px); }
.cert[hidden] { display: none; }
.cert { display: grid; gap: 10px; align-content: start; }
.cert__img {
  position: relative; display: block; width: 100%; padding: 0; aspect-ratio: 16 / 11; border-radius: 8px; cursor: zoom-in;
  border: 1px solid var(--line-faint); background: linear-gradient(160deg, rgba(243, 234, 219, .07), rgba(243, 234, 219, .02));
  transition: border-color .35s var(--ease), transform .5s var(--ease-out), box-shadow .5s var(--ease);
}
/* the whole certificate always shows: contained in the frame, the shadow follows the paper (not the letterbox) */
.cert__img img { position: absolute; top: 10px; left: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; filter: drop-shadow(0 5px 12px rgba(0, 0, 0, .38)); }
.cert__img:hover, .cert__img:focus-visible { border-color: var(--line); transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 0, 0, .3); }
.cert__img:focus-visible { outline: 1.5px solid var(--gold); outline-offset: 3px; }
.cert__meta { display: grid; gap: 3px; }
.cert__title { margin: 0; font-family: var(--serif); font-size: var(--t-md); line-height: 1.3; color: var(--ivory); font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.cert__by { margin: 0; font-size: var(--t-xs); color: var(--ivory-3); }
.cert__verify { justify-self: start; font-size: var(--t-xs); color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(242, 193, 78, .35); }
.cert__verify:hover { border-bottom-color: var(--gold); }
.certs__also { margin-top: clamp(28px, 4vw, 44px); }
.certs__also h4 { font-family: var(--serif); font-style: italic; font-size: var(--t-lg); color: var(--moon); font-weight: 340; margin-bottom: 10px; font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.certs__also ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px 32px; }
.certs__also li { display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line-faint); font-size: var(--t-sm); }
.certs__also .i { font-size: var(--t-xs); color: var(--ivory-3); }
.courses { margin-top: clamp(56px, 8vw, 96px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.courses h4 { font-family: var(--serif); font-style: italic; font-size: var(--t-lg); color: var(--moon); font-weight: 340; margin-bottom: 10px; font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.courses ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--t-sm); color: var(--ivory-2); }
.tools-all { margin-top: 0; display: grid; gap: 8px; font-size: var(--t-sm); color: var(--ivory-2); }
.tools-all b { font-weight: 500; color: var(--ivory); margin-right: 8px; }
@media (max-width: 1000px) { .courses { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .palette-aux { grid-template-columns: 1fr; } }

/* 12. Contact & footer ---------------------------------------------------- */
.sec--contact { --veil: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding-top: 30vh; padding-bottom: clamp(56px, 10vh, 120px); }
.sec--contact::before {
  background: linear-gradient(to bottom, rgba(var(--veil-rgb), .5) 0, rgba(var(--veil-rgb), 0) 30vh),
              radial-gradient(ellipse 60% 64% at 86% 74%, rgba(4, 8, 40, .7), rgba(4, 8, 40, .26) 60%, transparent 80%);
}
.sec--contact .sec__inner { width: 100%; }
.contact { display: flex; justify-content: flex-end; }
.contact__words { width: min(46vw, 600px); text-align: right; }
.contact__words .sec__kicker { justify-content: flex-end; text-shadow: 0 1px 12px rgba(3, 8, 40, 1), 0 0 3px rgba(3, 8, 40, .9); }
.contact__title { font-size: clamp(2.8rem, min(1.2rem + 5vw, 11vh), 6.4rem); line-height: .95; margin: 10px 0 22px; text-shadow: 0 2px 40px rgba(3, 8, 40, .75); letter-spacing: .01em; }
.contact__text { font-family: var(--serif); font-style: italic; font-weight: 320; font-size: clamp(1.2rem, 1.6vw, 1.6rem); line-height: 1.3; color: var(--moon); margin: 0 0 12px auto; max-width: 44ch; text-shadow: 0 1px 18px rgba(3, 8, 40, .9); font-variation-settings: 'opsz' 48, 'SOFT' 100; }
.contact__sub { color: var(--ivory); margin: 0 0 24px auto; max-width: 40ch; text-shadow: 0 1px 14px rgba(3, 8, 40, 1); }
/* email and phones */
.cdetails { margin: 0; display: grid; gap: 12px; }
.cdetails div { display: grid; grid-template-columns: max-content max-content; justify-content: end; align-items: baseline; column-gap: 18px; row-gap: 6px; }
.cdetails dt { grid-column: 1; font-size: var(--t-xs); color: var(--ivory-2); letter-spacing: .04em; text-shadow: 0 1px 10px rgba(3, 8, 40, 1); }
.cdetails dd { grid-column: 2; margin: 0; display: flex; align-items: baseline; justify-content: flex-end; gap: 10px; }
.cdetails a { font-family: var(--serif); font-size: clamp(1.15rem, 1.4vw, 1.375rem); font-variation-settings: 'opsz' 24, 'SOFT' 100; color: var(--ivory); text-decoration: none; text-shadow: 0 1px 14px rgba(3, 8, 40, 1); background-image: linear-gradient(var(--line), var(--line)); background-size: 100% 1px; background-position: 0 100%; background-repeat: no-repeat; padding-bottom: 2px; }
.cdetails a:hover { background-image: linear-gradient(var(--gold), var(--gold)); color: #fff; }
.cdetails__where { font-size: var(--t-xs); color: var(--ivory-2); text-shadow: 0 1px 10px rgba(3, 8, 40, 1); }
.cdetails__copy { border: 1px solid var(--line-faint); background: rgba(5, 10, 46, .5); border-radius: 999px; padding: 3px 10px; font-size: var(--t-xs); color: var(--ivory-2); cursor: pointer; align-self: center; }
.cdetails__copy:hover { color: var(--ivory); border-color: var(--line); }
.cdetails__save { margin: 16px 0 0; display: flex; justify-content: flex-end; }
.cdetails__save .btn { font-size: var(--t-xs); padding: 7px 14px; background: rgba(var(--veil-rgb), .45); text-shadow: none; }
.cdetails__save .btn span { display: inline-flex; }
.cdetails__save svg { width: 14px; height: 14px; color: var(--gold); }
.sec--contact .ph { margin-left: auto; max-width: 40ch; text-align: left; }

/* the constellation drawn in the page (phones, tablets, or when the painted stars are covered) */
.cconst-wrap { position: relative; display: inline-block; text-align: left; margin-top: 30px; }
.is-sky .cconst-wrap { display: none; }
.cconst { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cconst li:nth-child(5n+2) { padding-left: 48px; }
.cconst li:nth-child(5n+3) { padding-left: 14px; }
.cconst li:nth-child(5n+4) { padding-left: 64px; }
.cconst li:nth-child(5n+5) { padding-left: 28px; }
.cconst a { display: inline-flex; align-items: baseline; gap: 12px; padding: 9px 0; text-decoration: none; color: var(--ivory); }
.cconst__star { position: relative; top: 2px; }
.cconst__star svg { width: 16px; height: 16px; color: #ffe6a3; filter: drop-shadow(0 0 5px rgba(242, 193, 78, .95)); transition: transform .5s var(--ease); }
.cconst__name { font-size: .82rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; text-shadow: 0 1px 12px rgba(3, 8, 40, 1); }
.cconst__handle { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--moon); font-variation-settings: 'opsz' 24, 'SOFT' 100; text-shadow: 0 1px 12px rgba(3, 8, 40, 1); }
.cconst a:hover .cconst__star svg, .cconst a.is-lit .cconst__star svg { transform: rotate(72deg) scale(1.3); }
.cconst a:hover .cconst__handle, .cconst a.is-lit .cconst__handle { color: #fff; }
.cconst__lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.cconst__lines path { fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linecap: round; opacity: .85; filter: drop-shadow(0 0 3px rgba(242, 193, 78, .7)); transition: opacity .3s, stroke-width .3s; }
.cconst__lines path.is-hot { opacity: 1; stroke-width: 2; stroke: #ffd56e; }

/* the links pinned to the painted stars (desktop), joined by a gold line */
.skylinks { position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .9s var(--ease); }
.skylinks.is-visible { opacity: 1; }
.sec--contact:not(.is-sky) .skylinks { visibility: hidden; }
.skylinks__lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.skylinks__lines path { fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; opacity: .9; filter: drop-shadow(0 0 4px rgba(242, 193, 78, .8)); transition: opacity .3s, stroke-width .3s, stroke .3s; }
.skylinks__lines path.is-hot { opacity: 1; stroke-width: 2.4; stroke: #ffd56e; }
.skylinks.is-drawing.is-visible .skylinks__lines path { stroke-dasharray: calc(var(--len) * 1.08px); animation: drawLine 1.4s var(--ease) both; }
.skylinks__lines path:nth-child(2) { animation-delay: .3s; }
.skylinks__lines path:nth-child(3) { animation-delay: .6s; }
.skylinks__lines path:nth-child(4) { animation-delay: .9s; }
.skylinks__lines path:nth-child(5) { animation-delay: 1.2s; }
@keyframes drawLine { from { stroke-dashoffset: calc(var(--len) * 1.08px); } to { stroke-dashoffset: 0; } }
.skylink { position: absolute; left: 0; top: 0; width: 0; height: 0; text-decoration: none; --r: 30px; }
.skylinks.is-visible .skylink { pointer-events: auto; }
.skylink::before { content: ''; position: absolute; left: calc(var(--r) * -1); top: calc(var(--r) * -1); width: calc(var(--r) * 2); height: calc(var(--r) * 2); border-radius: 50%; }
.skylink:focus-visible { outline: none; }
.skylink__label {
  position: absolute; left: 0; top: 0; display: grid; gap: 2px; padding: 8px 14px 9px; white-space: nowrap; border-radius: 4px;
  background: rgba(5, 10, 46, .72); border: 1px solid rgba(242, 193, 78, .32); box-shadow: 0 8px 28px rgba(2, 5, 24, .4);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); transition: border-color .3s, background-color .3s;
}
.skylink__name { font-size: .82rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ivory); }
.skylink__handle { font-family: var(--serif); font-style: italic; font-size: 1.06rem; line-height: 1.25; color: var(--moon); font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.skylink:hover .skylink__label, .skylink.is-lit .skylink__label { border-color: rgba(242, 193, 78, .9); background: rgba(5, 10, 46, .86); }
.skylink:focus-visible .skylink__label { outline: 1.5px solid var(--gold); outline-offset: 3px; }
@media (max-width: 760px) {
  .sec--contact { justify-content: flex-end; padding-top: 40vh; }
  .sec--contact::before { background: linear-gradient(to bottom, rgba(var(--veil-rgb), .5) 0, rgba(var(--veil-rgb), 0) 22vh, rgba(var(--veil-rgb), 0) 30%, rgba(var(--veil-rgb), .8) 46%, rgba(var(--veil-rgb), .92)); }
  .contact { justify-content: flex-start; }
  .contact__words { width: auto; text-align: left; }
  .contact__words .sec__kicker { justify-content: flex-start; }
  .contact__text, .contact__sub { margin-left: 0; }
  .cdetails div { justify-content: start; grid-template-columns: max-content minmax(0, 1fr); }
  .cdetails dd { justify-content: flex-start; flex-wrap: wrap; min-width: 0; }
  .cdetails a { overflow-wrap: anywhere; }
  .cdetails__save { justify-content: flex-start; }
  .sec--contact .ph { margin-left: 0; }
}
.footer { position: relative; z-index: 1; padding: 28px var(--gutter) 34px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; font-size: var(--t-xs); color: var(--ivory-3); background: rgba(var(--veil-rgb), .72); }
.footer a { color: var(--ivory-2); }

/* 13. Sheets (country drawer, case-study chapter) ------------------------- */
.sheet { position: fixed; inset: 0; z-index: 60; visibility: hidden; }
.sheet.is-open { visibility: visible; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(2, 5, 24, .55); opacity: 0; transition: opacity .45s var(--ease); }
.sheet.is-open .sheet__backdrop { opacity: 1; }
.sheet__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(600px, 100%); overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, #0a1550, #050a2e 40%);
  border-left: 1px solid var(--line-faint); padding: 80px clamp(24px, 4vw, 48px) 56px;
  transform: translateX(104%); transition: transform .6s var(--ease-out);
  box-shadow: -30px 0 80px rgba(0, 0, 0, .35);
}
.sheet.is-open .sheet__panel { transform: none; }
.sheet--chapter .sheet__panel { width: 100%; max-width: none; border-left: 0; padding: clamp(88px, 12vh, 140px) var(--gutter) 96px; transform: translateY(32px); opacity: 0; transition: transform .7s var(--ease-out), opacity .5s var(--ease); background: radial-gradient(ellipse 80% 60% at 80% 0%, #0d1b5e, #050a2e 70%); }
.sheet--chapter.is-open .sheet__panel { transform: none; opacity: 1; }
.sheet--chapter .sheet__body { max-width: 1040px; margin: 0 auto; }
.sheet__close { position: fixed; top: 18px; right: 18px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-faint); background: rgba(5, 10, 46, .8); cursor: pointer; display: grid; place-items: center; }
.sheet:not(.sheet--chapter) .sheet__close { position: absolute; }
.sheet__close:hover { border-color: var(--line); }
.sheet__close svg { width: 14px; height: 14px; }
.cp__flag { width: 56px; height: auto; border-radius: 3px; box-shadow: 0 2px 12px rgba(0, 0, 0, .4); margin-bottom: 18px; }
.cp__status { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-xs); color: var(--ivory-2); margin-bottom: 10px; }
.cp__status i { width: 8px; height: 8px; border-radius: 50%; }
.cp__name { font-size: var(--t-3xl); margin-bottom: 10px; }
.cp__head { font-family: var(--serif); font-style: italic; font-size: var(--t-lg); color: var(--moon); font-variation-settings: 'opsz' 24, 'SOFT' 100; margin-bottom: 26px; }
.cp__jump { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-faint); background: rgba(5, 10, 46, .5); color: var(--ivory-2); font-size: var(--t-xs); cursor: pointer; transition: color .25s, border-color .25s; }
.cp__head + .cp__jump { margin-top: -12px; }
.cp__jump:hover { color: var(--ivory); border-color: var(--line); }
.cp__status-star { display: inline-flex; color: var(--gold); }
.cp__status-star svg { width: 11px; height: 11px; }
.cp--album .cp__status { position: relative; margin-top: 4px; }
.cp h3 { font-family: var(--sans); font-size: var(--t-xs); font-weight: 500; color: var(--ivory-3); letter-spacing: .02em; margin: 28px 0 10px; }
.cp p { color: var(--ivory-2); }
/* places in a country: the province/state map, then each place with its photos */
.cp__map { margin: 22px 0 4px; border: 1px solid var(--line-faint); border-radius: 3px; background: radial-gradient(ellipse 90% 80% at 50% 40%, rgba(32, 61, 138, .28), rgba(5, 10, 46, .2) 70%); }
.cp__map:empty { display: none; }
.cpmap { display: block; width: 100%; height: auto; }
.cpmap__world path { fill: rgba(142, 156, 203, .07); stroke: rgba(243, 234, 219, .1); stroke-width: .5; }
.cpmap__regions path { fill: rgba(32, 61, 138, .55); stroke: rgba(243, 234, 219, .26); stroke-width: .6; stroke-linejoin: round; transition: fill .3s; }
.cpmap__regions path.is-lit { fill: rgba(242, 193, 78, .32); stroke: var(--gold); stroke-width: 1; filter: url(#cpGlow); cursor: pointer; }
.cpmap__regions path.is-lit:hover { fill: rgba(242, 193, 78, .5); }
.cpmap__star { cursor: pointer; }
.cpmap__star path { fill: var(--gold); stroke: rgba(5, 10, 46, .6); stroke-width: .6; }
.cpmap__star .halo { fill: rgba(242, 193, 78, .2); transform-box: fill-box; transform-origin: center; animation: cpHalo 3.2s ease-in-out infinite; }
.cpmap__star:hover .halo { fill: rgba(242, 193, 78, .38); }
@keyframes cpHalo { 50% { transform: scale(1.45); opacity: .45; } }
.cpmap__labels text { font-family: var(--sans); font-size: 11px; letter-spacing: .02em; fill: var(--ivory); paint-order: stroke; stroke: rgba(5, 10, 46, .88); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.cpmap__labels text.is-region { font-family: var(--serif); font-style: italic; font-size: 12px; fill: var(--moon); }
.cp__places > h3 { margin-top: 26px; }
.cp__region { border-top: 1px solid var(--line-faint); padding-top: 14px; margin-top: 14px; }
.cp__region:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.cp__region-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; font-size: var(--t-xl); font-weight: 360; margin-bottom: 8px; font-variation-settings: 'opsz' 48, 'SOFT' 100; }
.cp__region-kind { font-family: var(--sans); font-size: var(--t-xs); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ivory-3); }
.cp__place { margin: 8px -10px 14px; padding: 6px 10px; border-radius: 3px; }
.cp__place-name { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-family: var(--serif); font-size: var(--t-lg); font-weight: 400; line-height: 1.2; font-variation-settings: 'opsz' 24, 'SOFT' 100; }
.cp__place-star { display: inline-flex; color: var(--gold); filter: drop-shadow(0 0 4px rgba(242, 193, 78, .7)); }
.cp__place-star svg { width: 12px; height: 12px; }
.cp__place-note { font-size: var(--t-sm); margin: 0 0 10px; }
.cp__place-story { font-size: var(--t-sm); margin: 0 0 10px; }
.cp__region.is-flash, .cp__place.is-flash { animation: placeFlash 1.8s var(--ease); }
@keyframes placeFlash { 0%, 35% { background: rgba(242, 193, 78, .14); box-shadow: inset 2px 0 0 var(--gold); } 100% { background: transparent; box-shadow: inset 2px 0 0 transparent; } }
.cp .cp__soon { font-family: var(--serif); font-style: italic; color: var(--moon); margin: 14px 0 0; font-variation-settings: 'opsz' 24, 'SOFT' 100; }
/* a place's photos: the first one large, the others in a grid; captions on the photos */
.cp__gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 6px 0 8px; }
.cp__gallery.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cp__gallery.is-one { grid-template-columns: minmax(0, 1fr); }
.cp__shot {
  position: relative; display: block; padding: 0; border: 0; border-radius: 6px; overflow: hidden; cursor: zoom-in;
  aspect-ratio: 1; background: rgba(243, 234, 219, .04);
}
.cp__shot.is-big { grid-column: span 2; grid-row: span 2; }
.cp__shot.is-wide2 { grid-column: span 2; aspect-ratio: 2 / 1; }
.cp__shot.is-wide3 { grid-column: span 3; aspect-ratio: 3 / 1; }
.cp__gallery.is-one .cp__shot { aspect-ratio: 3 / 2; }
.cp__shot[hidden] { display: none; }
.cp__shot img { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(.94) brightness(.95); transition: transform .7s var(--ease-out), filter .4s var(--ease); }
.cp__shot:hover img, .cp__shot:focus-visible img { transform: scale(1.05); filter: none; }
.cp__shot:focus-visible { outline: 1.5px solid var(--gold); outline-offset: 2px; }
.cp__shot-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; text-align: left; pointer-events: none;
  background: linear-gradient(to top, rgba(3, 8, 40, .85), rgba(3, 8, 40, 0));
  font-size: var(--t-xs); line-height: 1.3; color: var(--ivory);
  opacity: 0; transform: translateY(6px); transition: opacity .35s var(--ease), transform .45s var(--ease-out);
}
.cp__shot.is-big .cp__shot-cap, .cp__gallery.is-one .cp__shot-cap,
.cp__shot:hover .cp__shot-cap, .cp__shot:focus-visible .cp__shot-cap { opacity: 1; transform: none; }
@media (hover: none) { .cp__shot-cap { opacity: 1; transform: none; } }
.cp__more { margin: 2px 0 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-faint); background: rgba(5, 10, 46, .5); color: var(--ivory-2); font-size: var(--t-xs); cursor: pointer; }
.cp__more:hover { color: var(--ivory); border-color: var(--line); }
.cp__count { margin-left: auto; font-family: var(--sans); font-size: var(--t-xs); color: var(--ivory-3); font-weight: 400; }
.cp__place-name.is-own { margin: 0 0 4px; display: flex; }
/* the photo across the top of a country's chapter */
.cp__cover {
  position: relative; margin: -80px calc(-1 * clamp(24px, 4vw, 48px)) 0; height: clamp(210px, 34vh, 300px); overflow: hidden;
}
.cp__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cp__cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(10, 21, 80, .15) 0, rgba(10, 21, 80, 0) 35%, rgba(10, 21, 80, .55) 72%, #0a1550 100%); }
.cp.has-cover .cp__flag { position: relative; margin-top: -30px; }
.cp__trip { border-top: 1px solid var(--line-faint); padding-top: 12px; margin-top: 12px; }
.cp__trip b { font-weight: 500; }
.cp__trip span { color: var(--ivory-3); font-size: var(--t-sm); margin-left: 8px; }
.cp__empty { padding: 18px 0 0; color: var(--ivory-2); }
.cp__edit { margin-top: 30px; padding-top: 20px; border-top: 1px dashed rgba(242, 193, 78, .35); }
.cp__edit p { font-size: var(--t-xs); color: var(--ivory-3); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(242, 193, 78, .06); color: var(--ivory); cursor: pointer; font-size: var(--t-sm); text-decoration: none; }
.btn:hover { background: rgba(242, 193, 78, .14); }
.btn--ghost { border-color: var(--line-faint); background: transparent; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn--primary, .btn--primary:hover { background: var(--gold); color: var(--abyss); border-color: var(--gold); font-weight: 600; }
.btn--primary:hover { background: #ffd56a; }
.lightbox { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(2, 5, 24, .92); padding: 5vh 5vw; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: grid; gap: 10px; }
.lightbox img { max-height: 80vh; max-width: 100%; width: auto; height: auto; margin: 0 auto; border-radius: 4px; transition: opacity .35s var(--ease); }
.lightbox img.is-loading { opacity: .25; }
.lightbox figcaption .link { color: var(--gold); }
.lightbox figcaption { text-align: center; color: var(--ivory-2); font-size: var(--t-sm); }
.lightbox__nav { position: fixed; top: 50%; width: 48px; height: 48px; margin-top: -24px; border-radius: 50%; border: 1px solid var(--line-faint); background: rgba(5, 10, 46, .8); color: var(--ivory); cursor: pointer; display: grid; place-items: center; transition: border-color .25s, background .25s; }
.lightbox__nav:hover { border-color: var(--line); background: rgba(10, 21, 80, .9); }
.lightbox__nav svg { width: 16px; height: 16px; }
.lightbox__nav--prev { left: max(14px, 2vw); }
.lightbox__nav--next { right: max(14px, 2vw); }
.lightbox__count { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); font-size: var(--t-xs); letter-spacing: .1em; color: var(--ivory-3); }
@media (max-width: 640px) {
  .lightbox__nav { top: auto; bottom: 10px; margin-top: 0; }
  .lightbox__count { bottom: 26px; }
}
html.is-locked, html.is-locked body { overflow: hidden; }

/* 14. Draft mode: placeholders for information still to be supplied --------- */
.ph { display: none; }
.is-draft .ph {
  display: block; border: 1px dashed rgba(242, 193, 78, .55); color: var(--gold); background: rgba(242, 193, 78, .05);
  font-size: var(--t-xs); padding: 8px 12px; border-radius: 3px; margin: 6px 0 12px; font-style: normal;
}
.is-draft .ph::before { content: 'To add: '; font-weight: 600; }
.why-badge { position: fixed; right: 12px; bottom: 12px; z-index: 70; max-width: min(560px, calc(100vw - 24px)); margin: 0; padding: 8px 12px; border-radius: 6px; background: rgba(5, 10, 46, .9); border: 1px solid var(--line-faint); color: var(--ivory); font-size: var(--t-xs); line-height: 1.45; }
.draft-badge { position: fixed; left: 16px; bottom: 16px; z-index: 70; padding: 8px 14px; border-radius: 999px; background: var(--gold); color: var(--abyss); font-size: var(--t-xs); font-weight: 600; box-shadow: 0 4px 18px rgba(0, 0, 0, .3); text-decoration: none; }

/* 15. Motion preferences ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .hero__name .line > span { transform: none; }
}
