/* =====================================================================
   Harrison Wheeler — Portfolio
   Shared stylesheet. Dark theme site + light theme case-study overlay.
   Design tokens align with the Figma file (lavender accent on near-black).
   ===================================================================== */

/* ── GT America (brand typeface) ─────────────────────────────────── */
@font-face {
  font-family: 'GT America';
  src: url('../fonts/GT-America-Standard-Regular.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'GT America';
  src: url('../fonts/GT-America-Standard-Regular-Italic.otf') format('opentype');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'GT America';
  src: url('../fonts/GT-America-Standard-Medium.otf') format('opentype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'GT America';
  src: url('../fonts/GT-America-Standard-Bold.otf') format('opentype');
  font-weight: 700; font-style: normal; font-display: swap;
}
/* ── Reckless (variable, serif display) — wavy marquee headline ── */
@font-face {
  font-family: 'Reckless';
  src: url('../fonts/RecklessCollectionVF-TRIAL.ttf') format('truetype-variations');
  font-weight: 100 900; font-style: normal; font-display: swap;
}

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Surfaces */
  --bg:            #0d0c11;
  --surface:       #16151c;
  --surface-2:     #1f1d26;
  --border:        #2a2833;
  --border-soft:   #211f29;

  /* Text */
  --text:          #ece9f1;
  --text-muted:    #a39fb0;
  --text-dim:      #75717f;

  /* Accent (lavender, from Figma / M3 primary) */
  --primary:       #d0bcff;
  --primary-hover: #e3d6ff;
  --on-primary:    #381e72;
  --light-pink:    #ffd8e4;

  /* Type */
  --font:  'GT America', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono:  'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --max:        1320px;
  --gap:        120px;
  --radius:     16px;
  --radius-sm:  10px;
}

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;   /* clip (not hidden) so it doesn't break position: sticky */
}

/* Subtle grid background — hero only (see .hero::before) */

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

.container { max-width: var(--max); margin: 0 auto; padding-inline: 32px; }

/* Small uppercase mono label used above section headings */
.eyebrow {
  font-family: 'IBM Plex Mono', var(--mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 18px;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 400;
  padding: 11px 22px;
  border-radius: 100px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
/* Hero CTA — largest button on the page */
.btn-hero {
  border-style: none;
  background-color: var(--primary);       /* lighter purple */
  color: var(--on-primary);               /* even darker purple */
  border-radius: 48px;
  padding: 1rem 2rem;
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 500;
}
.btn-hero:hover { background-color: var(--primary-hover); transform: translateY(-1px); }

/* ── Nav ────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: transparent;
}
/* Blurred backdrop lives on a pseudo so it can fade to 0 at the bottom (no hard line). */
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(13, 12, 17, .82);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  opacity: 0; transition: opacity .3s ease;
}
/* Fade the backdrop in once the user scrolls past the viewport (toggled in main.js) */
.nav.scrolled::before { opacity: 1; }
.nav-inner {
  max-width: var(--max); margin: 0 auto; padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: -.01em; font-size: .98rem; color: var(--text);
}
.nav-logo-img { width: 24px; height: auto; display: block; }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a { font-family: var(--mono); font-size: .95rem; font-weight: 400; letter-spacing: .02em; color: #fff; transition: color .2s; }
.nav-links a:hover { color: var(--primary); }
.nav-links a.active { color: var(--primary); }
.nav-links a.nav-ext { display: inline-flex; align-items: center; gap: 5px; }
.nav-ext-icon { width: 11px; height: 11px; opacity: .6; flex: 0 0 auto; }
.nav-links a.nav-ext:hover .nav-ext-icon { opacity: 1; }

/* Mobile menu toggle */
.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 40px; height: 40px; padding: 8px; color: var(--text);
}
.nav-toggle span { display: block; height: 2px; background: currentColor; border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav-toggle span + span { margin-top: 5px; }
.nav.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Sections ───────────────────────────────────────────────────── */
.section { padding-block: var(--gap); }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; }
.section-head { margin-bottom: 40px; }

/* ── Hero ───────────────────────────────────────────────────────── */
.hero {
  padding-top: 150px; padding-bottom: 60px; position: relative;
  /* hero tint dissolves into the page bg — no hard edge */
  background: linear-gradient(#131217 0%, #131217 55%, var(--bg) 100%);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(#000 60%, transparent 100%);
          mask-image: linear-gradient(#000 60%, transparent 100%);
  opacity: .5;
  pointer-events: none;
}
.hero > .container { position: relative; z-index: 2; }
.hero-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; align-items: center; }
.hero h1 {
  text-align: left;
  font-size: clamp(3rem, 7.5vw, 5.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.03em;
  margin-bottom: 24px;
}
.hero p.lede { font-family: 'Merriweather', serif; font-size: 1.25rem; font-weight: 300; line-height: 1.5; color: var(--light-pink); max-width: 26em; margin-bottom: 30px; }
.hero-photo { position: relative; }
.hero-photo img {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2);
}
/* White pill — text editable in assets/hello.md */
.hello-pill {
  position: absolute;
  top: -12px;
  right: -16px;
  display: inline-flex;
  align-items: center;
  padding: 10px 24px;
  background: #fff;
  color: #141218;
  border-radius: 100px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  transform: rotate(3deg);
  z-index: 5;
  transition: transform 0.4s ease;
}
.hero-photo:hover .hello-pill { transform: rotate(-2deg) scale(1.04); }
/* Circular rotating text badge */
.badge-circle {
  position: absolute; left: -44px; bottom: -44px; z-index: 2;
  width: 160px; height: 160px; pointer-events: none;
}
.badge-circle svg { width: 100%; height: 100%; animation: badge-spin 28s linear infinite; }
.badge-circle text {
  fill: #EFB8C8;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: 'Inter', system-ui, sans-serif;
  font-style: normal;
}
@keyframes badge-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .badge-circle svg { animation: none; } }

/* Home hero content fades up on load (matches the About hero — story-hero-up keyframes) */
.hero-grid > div:first-child > *,
.hero-photo {
  animation: story-hero-up .75s cubic-bezier(.22, 1, .36, 1) both;
}
.hero-grid > div:first-child > *:nth-child(1) { animation-delay: .06s; }
.hero-grid > div:first-child > *:nth-child(2) { animation-delay: .16s; }
.hero-grid > div:first-child > *:nth-child(3) { animation-delay: .26s; }
.hero-photo { animation-delay: .55s; }   /* image comes in after the left-side text */
/* The hero "Get in touch" button slides in from the left instead of up */
.hero-grid > div:first-child > .btn-hero { animation-name: hero-cta-left; }
@keyframes hero-cta-left {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: none; }
}

/* ── Curved marquee headline ────────────────────────────────────── */
.arc { padding-block: 40px 80px; overflow: hidden; }
.arc svg { width: 100%; height: auto; display: block; }
.arc text { fill: #FFD8E4; font-family: 'Reckless', Georgia, serif; font-weight: 400; letter-spacing: .01em; }

/* ── Belief statement ───────────────────────────────────────────── */
.belief p.big {
  font-size: clamp(1.5rem, 3.2vw, 2.4rem); font-weight: 700; letter-spacing: -.02em;
  line-height: 1.3; max-width: 22em; margin-bottom: 28px;
}
.belief p.body { font-family: 'Merriweather', Georgia, serif; font-weight: 300; line-height: 1.6; color: var(--text-muted); max-width: 40em; margin-bottom: 16px; }
.belief-more { margin-top: 14px; }

/* Career timeline beside the belief statement.
   Left column pins while the timeline scrolls past it. */
.belief-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 80px; align-items: start; }
.belief-text { position: sticky; top: 120px; }
.timeline { display: flex; flex-direction: column; gap: 96px; padding-block: 24px; }
.timeline-group {
  text-align: center;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .6s ease, transform .6s ease;
}
.timeline-group.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .timeline-group { opacity: 1; transform: none; transition: none; }
}
.timeline-year {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em;
  color: var(--primary); margin-bottom: 20px;
}
.timeline-item {
  display: inline-flex; align-items: center; gap: 16px; text-align: left;
}
.timeline-logo {
  width: 56px; height: 56px; flex: 0 0 auto; overflow: hidden;
  border-radius: var(--radius-sm); background: var(--surface);
  border: 1px solid var(--border);
}
.timeline-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.timeline-item strong { display: block; font-size: .95rem; font-weight: 700; }
.timeline-item em { display: block; font-style: normal; font-size: .9rem; color: var(--text-muted); }

/* ── Card grids ─────────────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
/* Leadership + Projects are two groups under one "Select work" header — keep them tight */
#leadership { padding-bottom: 56px; }
#projects { padding-top: 0; }
.card {
  position: relative; display: flex; flex-direction: column;
  border-radius: 0; overflow: visible;
  background: transparent; border: none;
  transition: transform .2s;
  cursor: pointer;
  will-change: transform;
}
.card { transform: translateY(var(--py, 0px)); }
.card:hover { transform: translateY(calc(var(--py, 0px) - 3px)); }
.card:hover h3 { color: #ffd8e4; }
.card-media { aspect-ratio: 16/10; background: linear-gradient(135deg, #2a2833, #3a3747); position: relative; border-radius: 4px; overflow: hidden; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media--placeholder { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #3a2a3f, #2a3347 55%, #1f2a3a); }
.card-media-tag { font-family: 'IBM Plex Mono', monospace; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: #ffd8e4; border: 1px solid rgba(255,216,228,.35); border-radius: 999px; padding: 7px 16px; }
.card-body { padding: 16px 0 8px; text-align: left; }
.card .eyebrow { display: none; }
.card h3 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; margin-bottom: 10px; transition: color .2s; }
.card .meta { font-family: 'Merriweather', Georgia, serif; font-weight: 300; font-size: 16px; color: var(--text-muted); }
.news-all { color: var(--primary); font-weight: 600; text-decoration: none; }
.news-all:hover { text-decoration: underline; }

/* ── Community / events ─────────────────────────────────────────── */
/* Full-bleed photo strip that drifts horizontally as the page scrolls */
/* Full-bleed photo strip that auto-scrolls left forever (marquee) */
.community-strip {
  width: 100vw; margin-left: calc(50% - 50vw); margin-bottom: 36px;
  overflow: hidden;
}
/* main.js wraps the track in .community-marquee and appends a clone for a seamless loop */
.community-marquee { display: flex; width: max-content; animation: comm-marquee 70s linear infinite; }
@keyframes comm-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .community-marquee { animation: none; }
  .community-strip { overflow-x: auto; }
}

/* Big centered display-serif header (Community, Select work, …) */
.section-head.head-display { text-align: center; }
.section-head.head-display h2 {
  font-family: 'Reckless', Georgia, serif; font-weight: 400;
  font-size: clamp(3rem, 7.5vw, 5.25rem); line-height: 1;
  letter-spacing: -.01em; color: var(--text); margin: 0;
}
.section-head.head-display.head-gt h2 {
  font-family: 'GT America', system-ui, sans-serif; font-weight: 700; letter-spacing: -.02em;
}
/* Merriweather subtext that sits under a section header */
.head-sub {
  font-family: 'Merriweather', Georgia, serif; font-weight: 300;
  font-size: 1.12rem; line-height: 1.6; color: var(--text-muted);
  max-width: 40em; margin: 18px auto 0; text-align: center;
}
/* Section subtext under Community / Select work uses the light-pink accent */
.head-sub.prose { color: var(--light-pink); }

/* Parallax header — pins to the top, then the following content scrolls up
   over it (z-index + opaque bg) while the header fades (opacity/translateY in main.js). */
.phead-wrap { position: relative; }
/* Select work sits directly in <main> (not inside a .section), so give it the
   same leading gap a section would have. Community's wrap is inside a .section. */
main > .phead-wrap { padding-top: var(--gap); }
.phead { position: sticky; top: 96px; z-index: 1; padding-bottom: clamp(80px, 12vh, 150px); }
.phead [data-phead] { will-change: opacity, transform; }
.phead-body { position: relative; z-index: 2; background: var(--bg); }
/* Grid pattern behind the case-study cards — over the solid bg, behind the cards.
   Opacity driven by main.js: fades in as the section enters, out as it leaves. */
.cs-grid {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 100vw; height: 100%; z-index: -1; pointer-events: none; opacity: 0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(transparent 0, #000 7%, #000 90%, transparent 100%);
          mask-image: linear-gradient(transparent 0, #000 7%, #000 90%, transparent 100%);
}
@media (prefers-reduced-motion: reduce) {
  .phead { position: static; padding-bottom: 0; }
  .phead [data-phead] { opacity: 1 !important; transform: none !important; }
}

/* Fade in + up on scroll into view (.in toggled by main.js) */
[data-reveal-up] {
  opacity: 0; transform: translateY(30px);
  transition: opacity .75s cubic-bezier(.22, 1, .36, 1), transform .75s cubic-bezier(.22, 1, .36, 1);
}
[data-reveal-up].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal-up] { opacity: 1; transform: none; } }
.community-track { display: flex; flex: 0 0 auto; align-items: flex-start; gap: 24px; width: max-content; padding-right: 24px; padding-block: 48px 12px; }
.community-photo { margin: 0; flex: 0 0 auto; }
/* Alternate heights + vertical offsets so the strip isn't a straight line */
.community-photo:nth-child(odd) { transform: translateY(-28px); }
.community-photo:nth-child(even) { transform: translateY(20px); }
.community-photo:nth-child(even) img { height: 280px; }
.community-photo:nth-child(3n) img { height: 300px; }
.community-photo figcaption {
  margin-top: 10px;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted);
}
.community-photo img {
  height: 340px; width: auto; display: block;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  object-fit: cover;
}
.event-list li { padding: 14px 0; border-top: 1px solid var(--border-soft); color: var(--text-muted); font-size: .95rem; }

/* Community labeled groups — Talks / Writing / Events */
.community-groups { margin-top: 16px; }
.cg-group {
  display: grid; grid-template-columns: 180px 1fr; gap: 32px;
  padding: 30px 0; border-top: 1px solid var(--border);
}
.cg-group:last-child { border-bottom: 1px solid var(--border); }
.cg-label {
  font-family: 'Merriweather', Georgia, serif; font-size: 1.5rem; font-weight: 400;
  letter-spacing: 0; color: var(--light-pink); padding-top: 0;
}
.cg-list { display: flex; flex-direction: column; }
.cg-item {
  margin: 0; color: var(--text); font-size: 1.5rem; line-height: 1.4; text-align: left;
  padding: 16px 0; border-top: 1px solid var(--border-soft);
}
.cg-item:first-child { border-top: 0; padding-top: 0; }
.cg-item a, .cg-item > span { display: inline-block; transition: transform .35s cubic-bezier(.22, 1, .36, 1), color .2s ease; }
.cg-item a { color: inherit; text-decoration: none; }
.cg-item a:hover, .cg-item > span:hover { transform: translateX(24px); }
.cg-item a:hover { color: var(--primary); }
@media (max-width: 860px) {
  .cg-group { grid-template-columns: 1fr; gap: 14px; }
  .cg-item { text-align: left; }
}

/* ── CTA band ───────────────────────────────────────────────────── */
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
/* Larger buttons under "Let's work together" */
.cta-actions .btn { font-size: 1.05rem; padding: 15px 32px; }
.cta-section { padding-bottom: clamp(120px, 18vh, 200px); }

/* ── Footer ─────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border-soft); padding-block: 36px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer small { color: var(--text-dim); font-size: .85rem; }
.footer-nav { display: flex; gap: 24px; }
.footer-nav a { font-family: 'IBM Plex Mono', var(--mono); font-size: .85rem; color: var(--text-muted); }
.footer-nav a:hover { color: var(--text); }
/* Icon-ready: drop a brand-icon <svg> or <img> inside each footer link (it'll size
   to 20px and inherit the link color); the aria-label keeps it accessible. */
.footer-nav a:has(svg), .footer-nav a:has(img) { display: inline-flex; align-items: center; }
.footer-nav a svg, .footer-nav a img { width: 20px; height: 20px; display: block; fill: currentColor; }

/* ── Generic page header (About / listing pages) ────────────────── */
.page-head { padding-top: 140px; padding-bottom: 20px; }
.page-head h1 { font-size: clamp(2.1rem, 4.5vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: 18px; }
.page-head p { color: var(--text-muted); max-width: 42em; font-size: 1.05rem; }
.prose { max-width: 44em; }
.prose p { color: var(--text-muted); margin-bottom: 18px; }
.prose h2 { font-size: 1.4rem; font-weight: 700; margin: 40px 0 14px; color: var(--text); letter-spacing: -.01em; }

/* =====================================================================
   CASE STUDY OVERLAY  (light theme sheet that slides over the site)
   Also used as the standalone case-study page body via .cs-standalone
   ===================================================================== */
.cs-overlay {
  position: fixed; inset: 0; z-index: 500;
  /* Light scrim so the dark grid page genuinely PEEKS through at the top */
  background: rgba(8, 7, 11, .35);
  opacity: 0; visibility: hidden;
  transition: opacity .4s ease, visibility .4s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cs-overlay.open { opacity: 1; visibility: visible; }

.cs-sheet {
  --cs-bg: #ffffff;
  --cs-text: #17151b;
  --cs-muted: #5c5866;
  --cs-border: #e7e5ea;
  --cs-accent: #5b3df5;

  position: relative;
  width: 100%;                 /* full-width, edge to edge */
  max-width: none;
  margin-top: 9vh;             /* the peek of the page behind it */
  min-height: 91vh;
  padding-top: 64px;           /* breathing room at the top of the overlay */
  background: var(--cs-bg);    /* plain white — no grid */
  color: var(--cs-text);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -18px 70px rgba(0,0,0,.55);
  font-family: var(--font);

  /* Slide UP from the bottom of the viewport */
  transform: translateY(100vh);
  transition: transform .5s cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
}
.cs-overlay.open .cs-sheet { transform: translateY(0); }

/* ── Fixed mini-header inside the case-study overlay ────────────── */
.cs-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 540;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 24px 14px;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  border-bottom: 1px solid #e7e5ea;
  transform: translateY(-100%);
  transition: transform .3s ease;
}
.cs-topbar.visible { transform: translateY(0); }
.cs-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f1f0f3; border: 1px solid #e7e5ea; border-radius: 100px;
  padding: 8px 16px; font-size: .85rem; font-weight: 600; color: #17151b;
  font-family: inherit; cursor: pointer; white-space: nowrap;
  transition: background .2s;
}
.cs-back:hover { background: #e4e2e8; }
.cs-topbar-title {
  font-size: .9rem; font-weight: 600; color: #17151b;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Reading progress along the topbar's bottom edge */
.cs-progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: transparent;
}
.cs-progress span {
  display: block; height: 100%; width: 0;
  background: #5b3df5;
}

.cs-close {
  position: absolute; top: 24px; left: 28px;
  width: 42px; height: 42px; border-radius: 100px;
  background: #f1f0f3; border: 1px solid var(--cs-border);
  display: grid; place-items: center; cursor: pointer; color: #17151b; z-index: 6;
  transition: background .2s, transform .2s;
}
.cs-close:hover { background: #e4e2e8; transform: scale(1.05); }

/* 3-column grid: [TOC nav] [centered content] [empty].
   The empty third column visually centers the content; selected
   elements bleed right into it on wide screens. */
.cs-layout {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 720px) minmax(180px, 1fr);
  justify-content: center;
  gap: 64px;
  padding: 8px 48px 110px;
}
/* Sticky table of contents */
.cs-toc { position: sticky; top: 84px; align-self: start; height: max-content; }
.cs-toc ul { display: flex; flex-direction: column; gap: 4px; }
.cs-toc a {
  display: block; padding: 6px 0; font-size: 1rem; color: var(--cs-muted);
  border-left: 2px solid transparent; padding-left: 12px; transition: color .2s, border-color .2s;
}
.cs-toc a:hover { color: var(--cs-text); }
.cs-toc a.active { color: var(--cs-text); border-color: transparent; font-weight: 600; }

.cs-main { min-width: 0; }
.cs-main h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin-bottom: 18px; }
.cs-deck { font-family: 'Merriweather', Georgia, serif; font-weight: 300; font-size: 1.15rem; line-height: 1.6; color: var(--cs-muted); max-width: 36em; margin-bottom: 36px; }
/* ── Hero carousel ──────────────────────────────────────────────── */
.cs-carousel { position: relative; margin: 0 0 56px; outline: none; }
/* Bleed right into the empty third column; off-slides are clipped */
@media (min-width: 1080px) {
  .cs-carousel { margin-right: calc(-240px - 64px); }
}
.cs-carousel-viewport { overflow: hidden; border-radius: 4px; }
.cs-carousel-track { display: flex; gap: 16px; transition: transform .45s cubic-bezier(.22, 1, .36, 1); will-change: transform; }
.cs-slide {
  flex: 0 0 auto;
  height: clamp(300px, 52vh, 500px);
  width: auto;
  background: #e9e7ee;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
/* image/video slides size their width to the media's natural proportions */
.cs-slide img, .cs-slide video { height: 100%; width: auto; object-fit: contain; display: block; }
/* placeholder slides (no image) keep a 16:9 footprint so they don't collapse */
.cs-slide:has(.cs-slide-tag) { aspect-ratio: 16 / 9; }
.cs-slide-tag {
  position: absolute; left: 14px; bottom: 12px;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .14em;
  color: #8c8896;
}
.cs-figure {
  aspect-ratio: 16/9; max-width: 42em; margin: 8px 0 24px;
  background: #e9e7ee; border: 1px solid var(--cs-border); border-radius: 4px;
  display: grid; place-items: center; overflow: hidden;
}
.cs-figure span {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .14em;
  color: #8c8896; text-transform: uppercase;
}
.cs-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cs-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
  max-width: 42em; margin: 8px 0 24px;
}
.cs-grid .cs-figure { aspect-ratio: 1/1; margin: 0; max-width: none; }
@media (max-width: 560px) { .cs-grid { grid-template-columns: 1fr; } }

.cs-carousel--portrait .cs-slide { aspect-ratio: auto; height: clamp(360px, 60vh, 560px); }
.cs-carousel--portrait .cs-slide:has(.cs-slide-tag) { aspect-ratio: 9 / 16; }
@media (max-width: 560px) { .cs-carousel--portrait .cs-slide { height: clamp(320px, 64vh, 480px); } }

.cs-car-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 100px;
  background: rgba(255,255,255,.92); border: 1px solid var(--cs-border);
  color: #17151b; font-size: 1.5rem; line-height: 1;
  cursor: pointer; display: grid; place-items: center; z-index: 4;
  box-shadow: 0 4px 16px rgba(0,0,0,.14);
  transition: background .2s, transform .2s, opacity .2s;
}
.cs-car-btn:hover:not(:disabled) { background: #fff; transform: translateY(-50%) scale(1.06); }
.cs-car-btn.prev { left: 16px; }
.cs-car-btn.next { right: 16px; }
.cs-car-btn:disabled { opacity: .3; cursor: default; }

.cs-main h2 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin: 52px 0 18px; scroll-margin-top: 80px; }
.cs-main h3 { font-size: 1.05rem; font-weight: 700; margin: 28px 0 8px; }
.cs-main p { font-family: 'Merriweather', Georgia, serif; font-weight: 400; line-height: 1.75; color: #36333c; margin-bottom: 16px; max-width: 42em; }
.cs-main ul.bullets { font-family: 'Merriweather', Georgia, serif; font-weight: 400; line-height: 1.7; list-style: disc; padding-left: 22px; margin-bottom: 16px; color: #36333c; max-width: 42em; }
.cs-main ul.bullets li { margin-bottom: 6px; }
.cs-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 8px 0 24px; }
/* blocks of exactly 4 stat cards stack 2×2 instead of a cramped single row */
.cs-metrics:has(.cs-metric:nth-child(4):last-child) { grid-template-columns: repeat(2, 1fr); }
.cs-metric { background: #f6f5f8; border: 1px solid var(--cs-border); border-radius: 12px; padding: 20px; }
.cs-metric .num { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; color: var(--cs-accent); }
.cs-metric .lbl { font-size: .85rem; color: var(--cs-muted); margin-top: 4px; }
.cs-note { color: #9b97a3; font-size: .85rem; margin-top: 36px; }
.cs-diagram { margin: 30px 0 8px; }
.cs-diagram svg { width: 100%; height: auto; display: block; }
.cs-diagram figcaption { font-size: .82rem; color: var(--cs-muted); margin-top: 14px; text-align: center; }

/* ── Case-study tables ──────────────────────────────────────────── */
.cs-table {
  width: 100%;
  border-collapse: separate;  /* needed for border-radius to apply */
  border-spacing: 0;
  margin: 28px 0 36px;
  font-size: .92rem;
  border: 1px solid var(--cs-border);
  border-radius: 12px;
  overflow: hidden;
}
.cs-table caption {
  caption-side: bottom;
  text-align: left;
  padding-top: 10px;
  font-size: .78rem;
  color: #9b97a3;
}
.cs-table th {
  text-align: left;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--cs-muted);
  background: #f6f5f8;
  padding: 12px 16px;
  border-bottom: 1px solid var(--cs-border);
}
.cs-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--cs-border);
  color: var(--cs-text);
  vertical-align: top;
}
.cs-table tbody tr:last-child td { border-bottom: none; }
.cs-table tbody tr:hover { background: #faf9fb; }
.cs-table td:first-child { font-weight: 600; }

body.cs-lock { overflow: hidden; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 860px) {
  /* Full-screen menu; options pinned to the bottom of the viewport */
  .nav.open { -webkit-backdrop-filter: none; backdrop-filter: none; }  /* don't trap the fixed overlay */
  .nav-links {
    position: fixed; inset: 0; z-index: 1;
    flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 2px;
    background: var(--bg);
    padding: 88px 24px max(44px, 8vh);
    transform: translateX(-100%); transition: transform .34s cubic-bezier(.22, 1, .36, 1);
    will-change: transform; backface-visibility: hidden;
  }
  .nav.open .nav-links { transform: translateX(0); }
  .nav-links a { padding: 14px 8px; font-size: 1.5rem; }
  .nav-logo, .nav-toggle { position: relative; z-index: 2; }   /* stay above the overlay */
  .nav-toggle { display: block; }
  .nav-inner { padding-inline: 20px; }   /* align logo + menu icon to the page gutters */
  html:has(.nav.open) { overflow: hidden; }   /* lock page scroll while menu is open */

  /* Scale the wavy "on a path" arc text 2x on mobile (section clips the overflow) */
  .arc svg { width: 200%; margin-left: -50%; }

  .hero { padding-top: 120px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-photo { max-width: 280px; order: -1; }
  .hello-pill { top: -14px; right: -8px; font-size: .85rem; padding: 12px 18px; }
  .badge-circle { width: 120px; height: 120px; left: -28px; bottom: -28px; }

  .card-grid { grid-template-columns: 1fr; }
  .belief-grid { grid-template-columns: 1fr; gap: 48px; }
  .belief-text { position: static; }
  .timeline { gap: 44px; }
  .timeline-group { text-align: left; }
  .community-photo img { height: 220px; }
  .community-photo:nth-child(even) img { height: 185px; }
  .community-photo:nth-child(3n) img { height: 200px; }
  .community-photo:nth-child(odd) { transform: translateY(-14px); }
  .community-photo:nth-child(even) { transform: translateY(10px); }
  .community-track { gap: 16px; padding-right: 16px; padding-block: 28px 8px; }

  :root { --gap: 80px; }
  .container { padding-inline: 20px; }

  .cs-sheet { margin-top: 24px; border-radius: 18px 18px 0 0; padding-top: 20px; }
  .cs-layout { grid-template-columns: 1fr; gap: 24px; padding: 8px 22px 72px; }
  .cs-toc { display: none; }
  .cs-carousel { margin-right: 0; }
  /* Main carousels: each slide fills the viewport width so the (landscape) image isn't cut off */
  .cs-carousel:not(.cs-carousel--portrait) .cs-slide { flex: 0 0 100%; width: 100%; height: auto; aspect-ratio: auto; }
  .cs-carousel:not(.cs-carousel--portrait) .cs-slide img,
  .cs-carousel:not(.cs-carousel--portrait) .cs-slide video { width: 100%; height: auto; object-fit: contain; }
  .cs-carousel:not(.cs-carousel--portrait) .cs-slide:has(.cs-slide-tag) { aspect-ratio: 16 / 9; }
  .cs-car-btn { width: 40px; height: 40px; }
  /* Close button sits ABOVE the text on mobile (in normal flow, not floated) */
  .cs-close { position: static; margin: 0 0 18px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   MY STORY  — scroll-driven vertical timeline + Asia globe
   (story.html). Reuses the dark theme tokens above.
   ===================================================================== */

/* ── Page intro ─────────────────────────────────────────────────── */
.story-head {
  position: relative;
  max-width: none; padding: 128px 0 96px; text-align: left;
  /* tint dissolves into the page bg — no hard edge (matches the homepage hero) */
  background: linear-gradient(#131217 0%, #131217 55%, var(--bg) 100%);
}
/* Subtle grid backdrop fading toward the bottom (matches the homepage hero). */
.story-head::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(#000 60%, transparent 100%);
          mask-image: linear-gradient(#000 60%, transparent 100%);
  opacity: .5; pointer-events: none;
}
.story-head-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; max-width: var(--max); margin: 0 auto; padding-inline: 32px; position: relative; z-index: 1; }
/* Radial halftone tucked behind the photo, lower-right of the hero header */
.hero-halftone {
  position: absolute; z-index: -1;
  right: clamp(-300px, -13vw, -120px); top: 40vh;   /* bleeds past the right edge so it peeks out around the photo */
  width: clamp(440px, 58vw, 820px); height: auto;
  opacity: .55; pointer-events: none;
}
@media (max-width: 860px) { .hero-halftone { display: none; } }
.story-head .eyebrow { margin-bottom: 14px; }
.story-head h1 {
  font-size: clamp(3rem, 7.5vw, 5.25rem); font-weight: 800;
  letter-spacing: -.03em; line-height: 1.05; margin-bottom: 24px;
}
.story-tagline {
  font-family: var(--font); font-weight: 700;
  font-size: clamp(2.2rem, 5.5vw, 3.8rem); line-height: 1.1; letter-spacing: -.03em;
  color: var(--text); max-width: 15em; margin: 0 0 26px;
}
.story-intro {
  max-width: 42em; margin: 0;
  font-family: 'Merriweather', Georgia, serif; font-weight: 300;
  color: var(--light-pink); font-size: 1.15rem; line-height: 1.7;
}
.story-intro + .story-intro { margin-top: 18px; }
/* Placeholder image in the right column */
.story-head-media {
  height: calc(100vh - 132px); border-radius: 4px; overflow: hidden;   /* fills the hero down to the bottom edge */
  position: sticky; top: 100px; align-self: start;   /* stay pinned while the text/prose scroll, until the timeline */
}
.story-head-media img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }

/* Hero content fades up from below on load (About page) */
@keyframes story-hero-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}
.story-head-text > *, .story-head-media {
  animation: story-hero-up .75s cubic-bezier(.22, 1, .36, 1) both;
}
.story-head-text > *:nth-child(1) { animation-delay: .05s; }
.story-head-text > *:nth-child(2) { animation-delay: .13s; }
.story-head-text > *:nth-child(3) { animation-delay: .21s; }
.story-head-text > *:nth-child(4) { animation-delay: .27s; }
@keyframes story-hero-right {
  from { opacity: 0; transform: translateX(48px); }
  to   { opacity: 1; transform: none; }
}
.story-head-media { animation: story-hero-right .8s cubic-bezier(.22, 1, .36, 1) .17s both; }

/* About / "what I've built" prose block under the intro */
.story-about { padding-top: 82px; }   /* match the story-head → story-about gap to the story-about → story-band gap (≈90px) */
.story-about h2:first-child { margin-top: 0; }
.story-about p { font-family: 'Merriweather', Georgia, serif; font-weight: 300; }
/* Condensed facts list with bold accent leads + dividers */
.about-list { margin-top: 8px; }
.story-about .about-item {
  margin: 0; max-width: none;
  padding: 22px 0; border-top: 1px solid var(--border-soft);
  font-family: var(--font); font-weight: 400; color: var(--text);
  font-size: clamp(1.05rem, 1.5vw, 1.22rem); line-height: 1.5;
}
.story-about .about-item:first-child { border-top: 0; padding-top: 0; }
.about-item strong { color: var(--primary); font-weight: 700; }
/* Company logo lockup — small 1:1 squares, 2px rounded */
.logo-lockup { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.logo-chip {
  width: 60px; aspect-ratio: 1 / 1; border-radius: 2px; overflow: hidden;
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  display: grid; place-items: center;
}
.logo-chip img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Centered "My story" band that opens the timeline */
.story-band { text-align: center; padding-block: 90px 10px; }
.story-band h2 {
  font-size: clamp(3rem, 7.5vw, 5.25rem); font-weight: 700; line-height: 1; letter-spacing: -.02em;
}
.story-lead {
  max-width: 40em; margin: 28px auto 0; text-align: center;
  font-family: 'Merriweather', Georgia, serif;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem); font-weight: 400; line-height: 1.5;
}

/* ── The rail ───────────────────────────────────────────────────── */
.timeline-rail { position: relative; max-width: var(--max); margin: 0 auto; padding: 60px 32px 60px; }
/* Continuous central spine */
.timeline-rail::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; transform: translateX(-50%);
  background: var(--border);
}

.tl-row {
  position: relative;
  display: grid; grid-template-columns: 1fr 132px 1fr;
  align-items: center; column-gap: 24px;
  margin-bottom: 168px;
}
.tl-row:last-child { margin-bottom: 0; }

/* Hold the 1996 chapter: its row stays pinned/centred while you scroll through
   the tall wrapper, so the Street View chapter lingers before the next year. */
.tl-hold { position: relative; height: 220vh; margin-top: 130px; }
.tl-hold-sticky { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; }
.tl-hold-sticky > .tl-row { width: 100%; margin-bottom: 0; }
/* Pin all three to row 1 — without this, the reverse (descending-column)
   rows wrap the image and text onto separate tracks. */
.tl-media { grid-column: 1; grid-row: 1; }
.tl-card  { grid-column: 3; grid-row: 1; }
.tl-row.reverse .tl-media { grid-column: 3; }
.tl-row.reverse .tl-card  { grid-column: 1; }

/* Year, pinned to the top of the row on the spine. Its solid background
   masks the line behind it, so the spine appears to break at each year. */
.tl-node { grid-column: 2; grid-row: 1; align-self: center; justify-self: center; display: flex; flex-direction: column; align-items: center; }
.tl-year {
  position: relative;
  font-size: calc(clamp(1.2rem, 2vw, 1.6rem) + 24px); font-weight: 800; letter-spacing: -.01em;
  color: var(--primary); background: var(--bg); padding: 8px 16px;
}

/* Media well (image, or the Street View iframe on the first block) */
.tl-media {
  aspect-ratio: 16 / 11; border-radius: 4px; overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #2a2833, #3a3747);
  position: relative;
}
.tl-media img, .tl-media iframe { width: 100%; height: 100%; object-fit: cover; display: block; border: 0; }
/* Once a real photo loads, the well conforms to the image's own dimensions
   (no fixed ratio, no cropping). story.js adds .has-photo when it loads. */
.tl-media.has-photo { aspect-ratio: auto; background: none; }
.tl-media.has-photo img { height: auto; object-fit: contain; }
/* Cap the width of portrait/vertical photos so they don't run too tall */
.tl-media.is-portrait { max-width: 340px; justify-self: center; }

/* Street View backdrop for the 1996 chapter — black base + (placeholder) Street
   View, full-bleed and fixed; opacity is driven by scroll in story.js. */
.sv-bg {
  position: fixed; inset: 0; z-index: -1;
  /* placeholder "street scene" gradient — replaced by a real SV image when added */
  background: linear-gradient(180deg, #1b2233 0%, #2c3850 44%, #3a475f 70%, #222a39 100%);
  opacity: 0; pointer-events: none; will-change: opacity;
}
.sv-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sv-bg::after {                       /* light scrim + vignette so card text stays legible */
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(150% 140% at 50% 38%, transparent 28%, rgba(0,0,0,.6) 100%),
    linear-gradient(180deg, rgba(0,0,0,.28), rgba(0,0,0,.5));
}
.sv-bg-tag {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 1;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-dim);
}
.tl-media .tl-media-label {
  position: absolute; left: 14px; bottom: 12px;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted); pointer-events: none;
}
.tl-media.is-streetview { background: #000; }

/* Keyless Street View launcher (first timeline block) */
.tl-streetview {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  text-decoration: none; color: var(--text);
  background:
    radial-gradient(120% 90% at 50% 130%, rgba(208,188,255,.22), transparent 60%),
    linear-gradient(180deg, #1a1922, #0e0d13);
  transition: transform .2s ease, border-color .2s ease;
}
.tl-streetview:hover { border-color: var(--primary); transform: translateY(-2px); }
.tl-streetview .sv-pin { color: var(--primary); line-height: 0; filter: drop-shadow(0 0 12px rgba(208,188,255,.5)); }
.tl-streetview .sv-cta {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .06em; color: var(--primary);
  border: 1px solid var(--border); border-radius: 100px; padding: 8px 18px;
  background: rgba(208,188,255,.06); transition: background .2s ease;
}
.tl-streetview:hover .sv-cta { background: rgba(208,188,255,.16); }

/* Text card */
.tl-place {
  font-family: var(--mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--primary); margin-bottom: 12px;
}
.tl-card h3 { font-size: clamp(1.2rem, 2.2vw, 1.65rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 14px; }
.tl-body { font-family: 'Merriweather', Georgia, serif; font-weight: 300; color: var(--text); line-height: 1.8; max-width: 34em; }

/* Smaller blurred copy of the row's image, sitting behind the text and
   drifting on scroll (parallax). story.js sets --tl-card-img to the row's
   own photo; until one loads, the gradient placeholder shows. */
.tl-card { position: relative; isolation: isolate; }
.tl-card::before {
  content: "";
  position: absolute; z-index: -1;
  top: 50%; left: 50%;
  transform: translate(-50%, calc(-50% + var(--tl-parallax, 0px)));
  width: 74%; aspect-ratio: 16 / 11;   /* matches the larger media well */
  border-radius: 14px;
  background: var(--tl-card-img, linear-gradient(135deg, #3a3747, #262430 55%, #18171f));
  background-size: cover; background-position: center;
  filter: blur(14px);
  opacity: .55;
  pointer-events: none;
  will-change: transform;
}

/* ── Reveal on scroll (fade in entering, fade out leaving) ───────── */
[data-reveal] {
  opacity: 0;
  transition: opacity .7s cubic-bezier(.22,1,.36,1);
  will-change: opacity;
}
[data-reveal].in { opacity: 1; }

/* ── 2025 finale: scroll-driven Asia globe journey ──────────────── */
/* Full-page blackout that fades in/out as the journey runs (opacity set in JS) */
.globe-blackout {
  position: fixed; inset: 0; background: #000;
  opacity: 0; pointer-events: none; z-index: 90; will-change: opacity;
}

/* Tall section provides the scroll distance; the stage is pinned inside it. */
.globe-scrolly { position: relative; height: 500vh; }
.globe-stage {
  position: sticky; top: 0; z-index: 100;
  height: 100vh; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  text-align: center;
}

/* Globe canvas covers the viewport (square sized to its larger edge) so the
   zoomed-in globe spans the full width. Apparent size + vertical position are
   driven by camera altitude and --globe-shift in JS (shift drops the whole
   globe below the 2025 header in the zoomed-out state so it's never clipped). */
.globe-wrap {
  position: absolute; left: 50%; top: 50%;
  width: max(100vw, 100vh); height: max(100vw, 100vh);
  max-width: none;
  transform: translate(-50%, calc(-50% + var(--globe-shift, 0px)));
}
#globe { width: 100%; height: 100%; }
.globe-wrap canvas { display: block; }

/* City labels on the globe (HTML elements) — IBM Plex Mono, shown only while zoomed in */
.globe-label {
  font-family: 'IBM Plex Mono', var(--mono);
  font-size: 12px; font-weight: 500; letter-spacing: .06em;
  color: var(--primary); white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .95);
  pointer-events: none; user-select: none;
  opacity: 0; transition: opacity .4s ease;
}
.globe-wrap.labels-on .globe-label { opacity: 1; }

/* Intro / 2025 header — pinned at the top of the stage, above the globe */
.globe-intro { position: relative; z-index: 3; max-width: 40em; padding: 11vh 24px 0; }
.globe-intro .story-finale-year {
  font-size: calc(clamp(1.2rem, 2vw, 1.6rem) + 24px); font-weight: 800; letter-spacing: -.01em;
  color: var(--primary); margin-bottom: 16px;
}
.globe-intro h2 { font-size: clamp(1.2rem, 2.2vw, 1.65rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 14px; }
.globe-intro .globe-sub { font-family: 'Merriweather', Georgia, serif; font-weight: 300; color: var(--text-muted); max-width: 34em; margin: 0 auto 18px; }
.globe-scrollcue { font-family: var(--mono); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-dim); }

/* Current-city label during the journey */
.globe-place {
  position: absolute; left: 0; right: 0; bottom: 13%; z-index: 3;
  font-family: var(--mono); font-size: clamp(1rem, 2.4vw, 1.55rem);
  letter-spacing: .14em; text-transform: uppercase; color: var(--primary);
  opacity: 0; transition: opacity .35s ease; pointer-events: none;
  text-shadow: 0 0 18px rgba(0,0,0,.85);
}
.globe-place.show { opacity: 1; }

/* "Let's work together" — pulls up from the bottom of the stage over the docked
   half-globe (translate driven by --cta-up in story.js; 1 = hidden below, 0 = up). */
.globe-cta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  padding: 0 24px max(14vh, 96px);
  transform: translateY(calc(var(--cta-up, 1) * 115%));
  will-change: transform;
  /* no background box — keep legible over the globe with a soft shadow */
  text-shadow: 0 2px 24px rgba(0, 0, 0, .7);
}

.globe-fallback { display: none; padding: 40px 24px; }
.globe-wrap.no-webgl #globe { display: none; }
.globe-wrap.no-webgl .globe-fallback { display: block; }

/* Static fallback (reduced motion / no WebGL): no pinning, normal flow */
.globe-scrolly.is-static { height: auto; }
.globe-scrolly.is-static .globe-stage { position: static; height: auto; padding: 70px 0 90px; }
.globe-scrolly.is-static .globe-wrap {
  position: relative; left: auto; top: auto; transform: none;
  width: 100%; max-width: 680px; height: 520px; margin: 28px auto 0;
}
.globe-scrolly.is-static .globe-place { display: none; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .timeline-rail { padding: 40px 20px; }
  .timeline-rail::before { display: none; }   /* drop the detached/floating spine on mobile */
  .tl-row { grid-template-columns: 1fr; column-gap: 0; row-gap: 14px; padding-left: 0; margin-bottom: 104px; }
  .tl-hold { height: 170vh; }
  /* stack as: year → photo → text (no spine to attach to) */
  .tl-media, .tl-card, .tl-node { grid-column: 1 !important; grid-row: auto !important; }
  .tl-node  { position: static; left: auto; top: auto; transform: none; justify-self: start; align-items: flex-start; order: 0; }
  .tl-media { order: 1; }
  .tl-card  { padding-top: 0; order: 2; }
  .tl-card::before { display: none; }   /* drop the blurred parallax backdrop on mobile (it overflowed the card) */
  .tl-year { padding: 2px 0; background: none; }
  .story-head-grid { grid-template-columns: 1fr; gap: 32px; padding-inline: 20px; }
  .story-head-media { aspect-ratio: 4 / 5; height: auto; max-width: 320px; align-self: auto; justify-self: center; order: -1; position: static; }
  .footer-inner { justify-content: center; text-align: center; }
  .footer-nav { justify-content: center; width: 100%; }
  .globe-scrolly.is-static .globe-wrap { width: 100%; height: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
