/* Layout: a sticky full-screen stage. Vertical scroll drives a car sideways through a canvas city.
   One card per stop: top-left panel on wide screens, bottom sheet under the road on narrow ones.
   Single deliberate look: the world changes palette per district, the cards stay paper and ink. */
:root {
  --paper: #ffffff;
  --glass: rgba(255, 255, 255, 0.93);
  --ink: #171717;
  --ink-soft: #55535e;
  --line: #e4e2ea;
  --highlight: #f7e26b;
  --sign-green: #0f6b45;
  --sign-brown: #6b3f22;
  --sign-num: #ffd23f;
  --blue: #a9cdf2;
  --clay: #e8b48c;
  --sage: #b9c9a9;
  --indigo: #a3a4d6;
  --night: #0e1020;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--night);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--highlight); color: var(--ink); }
a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- Without script: a readable stack of cards ---------- */
#world { display: none; }
.hud { display: none; }
.cards { display: grid; gap: 16px; padding: 24px 16px; max-width: 640px; margin: 0 auto; }
.stop { background: var(--paper); border-radius: 18px; padding: 22px 22px 20px; }

/* ---------- With script: the drive ---------- */
.js #track { position: relative; }
.js #stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--night);
}
.js #world { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.js .hud { display: flex; }
.js .cards { display: block; position: absolute; inset: 0; padding: 0; max-width: none; margin: 0; pointer-events: none; z-index: 2; }

.js .stop {
  position: absolute;
  left: clamp(16px, 4.5vw, 72px);
  top: calc(76px + env(safe-area-inset-top, 0px));
  width: min(480px, 44vw);
  max-height: calc(var(--car-top, 70vh) - 96px - env(safe-area-inset-top, 0px));
  overflow-y: auto;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  backdrop-filter: blur(12px) saturate(1.15);
  border-radius: 20px;
  padding: 22px 26px 20px;
  box-shadow: 0 22px 60px -22px rgba(8, 10, 28, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  opacity: 0;
  transform: translate3d(0, 22px, 0) scale(0.975);
  transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  scrollbar-width: thin;
}
.js .stop.is-active { opacity: 1; transform: none; pointer-events: auto; }

.js.is-narrow .stop {
  left: 16px;
  right: 16px;
  width: auto;
  top: var(--sheet-top, 50vh);
  max-height: calc(100svh - var(--sheet-top, 50vh) - 14px - env(safe-area-inset-bottom, 0px));
  padding: 16px 18px 14px;
  border-radius: 16px;
  font-size: 14px;
}

/* ---------- HUD ---------- */
.hud {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 3;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) clamp(16px, 3vw, 32px) 0;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.brand, .route ol, .tally {
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  box-shadow: 0 8px 24px -14px rgba(8, 10, 28, 0.6);
}
.brand {
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 8px 14px;
  white-space: nowrap;
}
.route ol { list-style: none; margin: 0; padding: 5px 8px; display: flex; align-items: center; gap: 2px; }
.route button {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
}
.route button:hover { color: var(--ink); }
.route .pip { width: 9px; height: 9px; border-radius: 50%; background: #c6c3d0; transition: transform 0.25s, background 0.25s; flex: none; }
.route .sub .pip { width: 7px; height: 7px; }
.route button[aria-current="step"] { color: var(--ink); }
.route button[aria-current="step"] .pip { background: var(--ink); transform: scale(1.3); }
.route .lbl { display: none; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 1180px) { .route .lbl:not(.sr) { display: inline; } }

.tally {
  margin: 0;
  padding: 7px 13px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tally-star { color: #d9a400; }
.tally.pop { animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
.tally.all { background: var(--highlight); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }

@media (max-width: 560px) {
  .brand { padding: 7px 11px; font-size: 11px; letter-spacing: 0.12em; }
  .route ol { padding: 4px 5px; gap: 0; }
  .route button { padding: 5px 4px; }
  .tally { padding: 6px 10px; font-size: 11px; }
}
@media (max-width: 380px) { .route .sub + .sub { display: none; } }

/* ---------- Card type ---------- */
.sign {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 4px 10px 4px 9px;
  background: var(--sign-green);
  color: #fff;
  border-radius: 6px;
  box-shadow: 0 0 0 2px #fff inset, 0 0 0 1px var(--sign-green);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sign b { color: var(--sign-num); font-weight: 700; letter-spacing: 0.04em; text-transform: none; font-size: 12.5px; }
.sign--brown { background: var(--sign-brown); box-shadow: 0 0 0 2px #fff inset, 0 0 0 1px var(--sign-brown); }
.sign--brown b { color: #fff; }

h1, h2 { text-wrap: balance; margin: 0; }
h1 { font-weight: 700; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.15; }
mark { background: var(--highlight); color: var(--ink); padding: 0 8px; display: inline-block; transform: rotate(-1.2deg); }
h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(23px, 2.2vw, 31px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.lede { color: var(--ink-soft); margin: 0 0 14px; font-size: 1em; max-width: 60ch; }
strong { font-weight: 600; color: var(--ink); background: linear-gradient(transparent 62%, rgba(247, 226, 107, 0.85) 62%); }

.hero-top { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.hero-top .sign { margin-bottom: 8px; }
.avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 3px var(--highlight), 0 0 0 5px var(--ink); }
.tagline { font-weight: 800; font-size: clamp(22px, 2.3vw, 32px); line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 12px; }
.tagline .o { color: transparent; -webkit-text-stroke: 1.3px var(--ink); }
.route-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.kbd-arrow { position: relative; width: 18px; height: 28px; flex: none; border: 2px solid var(--ink); border-radius: 10px; }
.kbd-arrow::after { content: ''; position: absolute; left: 50%; top: 5px; width: 4px; height: 6px; margin-left: -2px; border-radius: 2px; background: var(--ink); animation: wheel 1.6s ease-in-out infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(9px); opacity: 0; } 100% { opacity: 0; } }

.facts { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 9px; }
.facts li { position: relative; padding-left: 24px; font-size: 0.95em; line-height: 1.5; }
.facts li::before { content: ''; position: absolute; left: 0; top: 0.68em; width: 14px; height: 4px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 1.5px var(--highlight); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.chips li { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }

.steps { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.steps li { counter-increment: s; padding: 8px 8px 0 0; font-family: var(--display); font-weight: 700; font-size: 14px; border-right: 1px solid var(--line); padding-left: 8px; }
.steps li:first-child { padding-left: 0; }
.steps li:last-child { border-right: 0; }
.steps li::before { content: '0' counter(s); display: block; font-family: var(--mono); font-weight: 500; font-size: 10.5px; color: var(--ink-soft); }

/* CREW framework steps: the letter leads, the skill sits under it */
.steps--crew { margin-top: 12px; }
.steps--crew li { font-family: var(--body); font-weight: 500; font-size: 12.5px; line-height: 1.3; }
.steps--crew li::before { content: attr(data-l); font-family: var(--display); font-weight: 900; font-size: 22px; line-height: 1.1; color: var(--ink); }
@media (max-width: 720px) {
  .steps--crew { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 8px; }
  .steps--crew li:nth-child(2) { border-right: 0; }
  .steps--crew li:nth-child(3) { padding-left: 0; }
}

/* Case cards on Showcase Row carry the case colour from the original portfolio */
.stop--case { background: color-mix(in srgb, var(--case) 26%, #fff 74%); }
.js .stop--case { background: color-mix(in srgb, var(--case) 22%, rgba(255, 255, 255, 0.95) 78%); }
.kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 2px; }
.shot-btn { appearance: none; display: block; width: 100%; margin: 2px 0 12px; padding: 0; border: 0; background: none; border-radius: 10px; cursor: zoom-in; }
.shot-btn:hover .shot { box-shadow: 0 0 0 3px var(--highlight), 0 0 0 4px var(--ink); }
.shot { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 10px; box-shadow: 0 0 0 1px rgba(23, 23, 23, 0.12); }
.js .shot-btn { display: none; }
@media (min-height: 940px) and (min-width: 721px) { .js .shot-btn { display: block; } }

/* Enlarged image: grows out of the screen it came from, click again to shrink it back */
.zoom {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
  background: rgba(8, 10, 24, 0);
  transition: background 0.4s ease;
  cursor: zoom-out;
}
.zoom.is-open { background: rgba(8, 10, 24, 0.82); }
.zoom img {
  display: block;
  max-width: min(1200px, 100%);
  max-height: calc(100svh - 120px);
  border-radius: 12px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  transform-origin: 0 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease;
}
.zoom-cap {
  margin: 0;
  color: #ffffff;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.zoom.is-open .zoom-cap { opacity: 0.85; }
.zoom:focus-visible { outline: none; }
.case-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; padding-top: 12px; border-top: 1px solid rgba(23, 23, 23, 0.14); }
.case-grid dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 3px; }
.case-grid dd { margin: 0; font-size: 0.9em; line-height: 1.5; }
.note { font-family: var(--mono); font-size: 10.5px; color: var(--ink-soft); margin: 12px 0 0; }

/* Destination */
.contact { display: grid; gap: 8px; margin-bottom: 14px; }
.contact-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.contact-row .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); width: 64px; }
.contact-row a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; min-width: 0; }
.contact-row a:hover { text-decoration: underline; }
.copy { margin-left: auto; appearance: none; border: 1px solid var(--ink); background: var(--ink); color: #fff; font: 600 11px var(--body); letter-spacing: 0.04em; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.copy:hover { background: #fff; color: var(--ink); }
.log summary { cursor: pointer; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.log ol { list-style: none; margin: 10px 0 8px; padding: 0; display: grid; gap: 6px; }
.log li { font-size: 0.88em; line-height: 1.4; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; }
.log li span { font-family: var(--mono); font-size: 10.5px; color: var(--ink-soft); padding-top: 2px; font-variant-numeric: tabular-nums; }
.quals { font-size: 0.82em; color: var(--ink-soft); margin: 6px 0 0; }

@media (max-width: 720px) {
  .case-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .avatar { width: 64px; height: 64px; }
  .log li { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

@media (max-height: 820px) and (min-width: 721px) {
  .js .stop { width: min(560px, 46vw); padding: 18px 22px 16px; font-size: 14px; top: calc(66px + env(safe-area-inset-top, 0px)); }
  .js .stop h2 { font-size: clamp(21px, 2vw, 27px); margin-bottom: 8px; }
  .js .stop .lede { margin-bottom: 10px; }
  .js .stop .facts { gap: 6px; margin-bottom: 10px; }
  .js .stop .sign { margin-bottom: 8px; }
  .js .stop .avatar { width: 64px; height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .stop { transition: opacity 0.2s linear; transform: none; }
  .kbd-arrow::after, .tally.pop { animation: none; }
}
