:root {
  /* Design tokens (Figma variables) */
  --surface-background: #0e1116;
  --surface-surface: #181d25;
  --on-surface: #e7eaef;
  --on-surface-alternate: #5b9cff;
  --on-surface-low: #a9b5c6;
  --outline-variant: #ffc370;
  --surface-low: #2d3643;
  --outline: #414e62;
  --sm: 8px;
  --lg: 16px;
  --xs: 4px;
  --xl: 24px;
  --2xl: 32px;
  /* body-md text style: 16px / 21px, -1% tracking */
  --body-md-line: 21px;
  --body-md-tracking: -0.16px;
  --font-mono: "Andale Mono", AndaleMono, ui-monospace, Menlo, monospace;
  /* System sans: only the stat card descriptions on project pages use it */
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hero-image: url("assets/mountains-dark-optimized.jpg");
  /* Darkening layer over the mountain strip at the end of project pages */
  --footer-scrim: rgb(0 0 0 / 0.7);
  /* Fade from the page background into that strip (Figma: solid to clear over the top 27.9%) */
  --footer-fade: linear-gradient(to bottom, var(--surface-background), transparent 27.9%);
}

/* Light theme (Figma "Home - Desktop - Light") */
:root[data-theme="light"] {
  --surface-background: #ffffff;
  --surface-surface: #e7eaef;
  --on-surface: #181d25;
  --on-surface-alternate: #144DA3;
  --on-surface-low: #566781;
  --outline-variant: #bb281b;
  /*--surface-low: #d9dfe3;*/
  --surface-low:#eef2f5;
  --outline: #566781;
  --hero-image: url("assets/mountains-light-optimized.jpg");
  --footer-scrim: rgb(169 181 198 / 0.7);
  /* Longer S-curve fade (1 - smoothstep) so the mountains dissolve into the white page with no visible top edge */
  --footer-fade: linear-gradient(to bottom,
    var(--surface-background) 0%,
    color-mix(in srgb, var(--surface-background) 97%, transparent) 10%,
    color-mix(in srgb, var(--surface-background) 90%, transparent) 20%,
    color-mix(in srgb, var(--surface-background) 78%, transparent) 30%,
    color-mix(in srgb, var(--surface-background) 65%, transparent) 40%,
    color-mix(in srgb, var(--surface-background) 50%, transparent) 50%,
    color-mix(in srgb, var(--surface-background) 35%, transparent) 60%,
    color-mix(in srgb, var(--surface-background) 22%, transparent) 70%,
    color-mix(in srgb, var(--surface-background) 10%, transparent) 80%,
    color-mix(in srgb, var(--surface-background) 3%, transparent) 90%,
    transparent 100%);
}

* { box-sizing: border-box; }

html, body { margin: 0; text-decoration: none;}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface-background);
  color: var(--on-surface);
  font-family: var(--font-mono);
  line-height: normal;
}

p { margin: 0; }

a { color: inherit; text-decoration: none; }

.icon-button {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 4px;
}
.icon-button img { display: block; }

/* Theme toggle (Figma "mode-toggle"): sun in dark mode, moon in light mode */
.theme-toggle { width: 32px; height: 32px; justify-content: center; }
.theme-toggle__moon { margin-top: 1px; }
:root[data-theme="dark"] .theme-toggle__moon,
:root[data-theme="light"] .theme-toggle__sun { display: none; }
.icon-button:focus-visible,
.project a:focus-visible { outline: 2px solid var(--on-surface-alternate); outline-offset: 2px; }

/* Hero */
.hero {
  position: relative;
  /* Fills the viewport above the footer (959px at the 1728x1117 design size); grows if content is taller */
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: var(--hero-image) center / cover no-repeat;
  pointer-events: none;
}

.header {
  position: relative;
  width: 100%;
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--lg);
  padding: var(--lg) var(--xl);
  text-align: center;
  font-size: 16px;
}
.header__actions { width: 100%; display: flex; justify-content: flex-end; gap:32px; padding:16px 0px; }
.header__hint { color: var(--on-surface-alternate); }

/* Project map */
.projects { position: relative; display: flex; justify-content: center; width: 100%; }

.projects__map {
  position: relative;
  width: 1198px;
  height: 541px;
  margin: 0;
  padding: 0;
  list-style: none;
  /* --map-scale is set in index.html so the 1198px map fits viewports narrower than the design */
  zoom: var(--map-scale, 1);
}

.project {
  position: absolute;
  /* --px/--py are set by index.html when the mountain photo is enlarged beyond the design (tall/wide windows) */
  left: var(--px, var(--x));
  top: var(--py, var(--y));
}
.project a { display: flex; align-items: center; border-radius: var(--sm); }
.project img { display: block; flex-shrink: 0; }

.project__label {
  padding: var(--sm);
  border-radius: var(--sm);
  background: var(--surface-surface);
  font-size: 18px;
  white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease;
}
.project a:hover .project__label,
.project a:focus-visible .project__label {
  color: var(--surface-surface);
  background: var(--on-surface);
}

/* Footer: pinned to the bottom of the viewport so it is always visible */
.footer {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  height: 158px;
  padding: var(--xl) 0;
  background: var(--surface-surface);
  border-top: 1px solid var(--outline-variant);
}
.footer__name { font-size: 32px; letter-spacing: -3.2px; }
.footer__coords { font-size: 18px; color: var(--on-surface-low); }
.footer__links { display: flex; gap: var(--lg); align-items: flex-start; }

/* Narrow screens: a compact 441px map (Figma mobile frame) with its own peak positions (--mx/--my);
   --map-scale shrinks it further on phones narrower than 441px */
@media (max-width: 768px) {
  .projects__map {
    width: 441px;
    height: 470px;
  }
  .project {
    left: var(--mx);
    top: var(--my);
  }
}

/* ---------- Home theme switch: sunrise / sunset ----------
   On toggle, a copy of the outgoing photo (.hero__veil) covers the new one and is wiped away by a tall,
   soft-edged mask (moved by index.html): upward from the horizon for sunrise, downward from the sky for
   sunset. A warm glow (.hero__glow) swells and fades at the horizon during the change. */
.hero__veil,
.hero__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero__veil {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  -webkit-mask-size: 100% 300%;
  mask-size: 100% 300%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.hero__veil.is-sunrise {
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 60%);
  mask-image: linear-gradient(to bottom, #000 40%, transparent 60%);
  -webkit-mask-position: 0 0%;
  mask-position: 0 0%;
}
.hero__veil.is-sunset {
  -webkit-mask-image: linear-gradient(to bottom, transparent 40%, #000 60%);
  mask-image: linear-gradient(to bottom, transparent 40%, #000 60%);
  -webkit-mask-position: 0 100%;
  mask-position: 0 100%;
}
.hero__glow {
  opacity: 0;
  background: radial-gradient(ellipse 75% 45% at 50% 60%, rgb(250 143 66 / 0.32), transparent 70%);
  mix-blend-mode: screen;
}

/* ---------- Home load-in animation ----------
   .js-intro (set in <head>) hides things; .hero.is-loaded (set once the photo loads) reveals them:
   the mountains fade in and settle, the tagline follows, then the peaks appear one at a time. */
.js-intro .hero__bg {
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 1.4s ease-out, transform 2.6s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.js-intro .header__tagline,
.js-intro .header__hint {
  opacity: 0;
  transition: opacity 0.9s ease-out 0.5s;
}
.js-intro .project {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s ease-out, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  /* --n (reveal order, lowest peak first) is set by the script in index.html */
  transition-delay: calc(0.9s + var(--n, 0) * 0.14s);
}
.js-intro .hero.is-loaded .hero__bg { opacity: 1; transform: none; }
.js-intro .hero.is-loaded .header__tagline,
.js-intro .hero.is-loaded .header__hint { opacity: 1; }
.js-intro .hero.is-loaded .project { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js-intro .hero__bg,
  .js-intro .header__tagline,
  .js-intro .header__hint,
  .js-intro .project { opacity: 1; transform: none; transition: none; }
}

/* ---------- Project pages (Figma "project-details-fitfuel - Dark") ---------- */

.skip-link {
  position: absolute;
  left: var(--lg);
  top: -100px;
  z-index: 20;
  padding: var(--sm) var(--lg);
  border-radius: var(--sm);
  background: var(--on-surface);
  color: var(--surface-surface);
}
.skip-link:focus { top: var(--lg); }

:where(.topbar, .case) a:focus-visible,
.project-menu summary:focus-visible {
  outline: 2px solid var(--on-surface-alternate);
  outline-offset: 2px;
}

/* Sticky header on project and playbook pages; keep in-page jumps clear of it */
html:has(.topbar) { scroll-padding-top: 96px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--lg);
  padding: var(--lg) var(--xl);
  background: var(--surface-surface);
  border-bottom: 1px solid var(--outline);
  font-size: 16px;
  line-height: var(--body-md-line);
  letter-spacing: var(--body-md-tracking);
}
.topbar__logo { display: flex; align-items: center; border-radius: 4px; }
.topbar__logo img { display: block; }
.topbar__actions { display: flex; align-items: center; gap: var(--lg); }
.topbar__nav { display: flex; align-items: center; gap: 40px; }
.topbar__nav a { color: var(--on-surface-alternate); border-radius: 4px; }
.topbar__nav a:hover { text-decoration: none;}

.project-menu { position: relative; }
.project-menu summary {
  list-style: none;
  cursor: pointer;
  padding: var(--sm) var(--lg);
  border-radius: var(--sm);
  background: var(--surface-surface);
  color: var(--on-surface-alternate);
}
.project-menu summary::-webkit-details-marker { display: none; }
.project-menu summary::after { content: "▾"; margin-left: var(--sm); }
.project-menu[open] summary::after { content: "▴"; }
.project-menu__list {
  position: absolute;
  right: 0;
  top: calc(100% + var(--sm));
  min-width: 320px;
  margin: 0;
  padding: var(--sm);
  list-style: none;
  border-radius: var(--sm);
  border: 1px solid var(--outline);
  background: var(--surface-surface);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.35);
}
.project-menu__list a,
.project-menu__soon {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--lg);
  padding: var(--sm);
  border-radius: 4px;
}
.project-menu__list a:hover { background: var(--surface-low); }
.project-menu__list a[aria-current="page"] { color: var(--on-surface-alternate); }
.project-menu__list a[aria-current="page"]::after { content: "Current"; font-size: 12px; color: var(--on-surface-low); }
.project-menu__soon { color: var(--on-surface-low); }
.project-menu__soon small { font-size: 12px; white-space: nowrap; }

.case { flex: 1; }

/* Hero: title, summary and meta above a rounded cover image */
.case-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--xl);
  padding: 48px var(--xl);
}
.case-hero__inner,
.case-hero__cover { width: 100%; max-width: 1120px; }
.case-hero__title { margin: 0 0 var(--sm); font-size: 48px; font-weight: 400; letter-spacing: -4.8px; }
.case-hero__summary { font-size: 18px; color: var(--on-surface-low); }
.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lg) 48px;
  margin: var(--lg) 0 0;
  font-size: 12px;
}
.case-meta dt { color: var(--on-surface); }
.case-meta dd { margin: var(--xs) 0 0; color: var(--on-surface-low); }
.case-hero__cover {
  display: block;
  height: auto;
  aspect-ratio: 1120 / 568;
  object-fit: cover;
  border-radius: 24px;
}

/* Article card */
.case-wrap { display: flex; justify-content: center; padding: 0 var(--xl); }
.case-body {
  display: flex;
  flex-direction: column;
  gap: 64px;
  width: 100%;
  max-width: 1120px;
  padding: 48px var(--xl) 96px;
  border-radius: var(--lg);
  background: var(--surface-surface);
}
.case-body > * { width: 100%; max-width: 760px; margin-inline: auto; }
.case-body section { scroll-margin-top: var(--xl); }
/* Winding trail of lugged boot prints along the bottom of a section (decorative) */
.case-bootprints {
  display: block;
  width: 100%;
  height: auto;
  margin-top: var(--xl);
  fill: var(--on-surface-low);
}

/* Faint topographic background (reuses the playbook hero's contour lines), soft-edged so the box disappears */
.case-section--topo { position: relative; isolation: isolate; }
.case-section__topo {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.35;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000 35%, transparent 75%);
}
.case-body section:not(:first-child) { padding-top: 64px; border-top: 1px solid var(--outline); }
.case-body h2 { margin: 0 0 var(--xl); font-size: 32px; font-weight: 400; letter-spacing: -3.2px; }
.case-body h3 { margin: 40px 0 var(--lg); font-size: 18px; font-weight: 400; color: var(--on-surface-alternate); }
.case-body p,
.case-checks li,
.case-steps li {
  font-size: 16px;
  line-height: var(--body-md-line);
  letter-spacing: var(--body-md-tracking);
  color: var(--on-surface-low);
}
.case-body p + p { margin-top: var(--lg); }

.case-figure { margin-block: 0; }
.case-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 760 / 517;
  object-fit: cover;
  object-position: 50% 34%;
}

/* Call-to-action link styled as a button (e.g. "View the Prototype") */
.case-button {
  display: inline-flex;
  align-items: center;
  gap: var(--sm);
  margin-top: var(--xl);
  padding: 12px 20px;
  border-radius: var(--sm);
  background: var(--on-surface-alternate);
  color: var(--surface-surface);
  font-size: 16px;
  line-height: var(--body-md-line);
  letter-spacing: var(--body-md-tracking);
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.case-button:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgb(0 0 0 / 0.25); }
.case-button:active { transform: none; box-shadow: none; }
.case .case-button:focus-visible { outline: 2px solid var(--on-surface-alternate); outline-offset: 3px; }

/* Research question → the product decision it could change */
.case-rq {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin: 32px 0;
  padding: var(--xl);
  border-radius: var(--sm);
  background: var(--surface-low);
}
.case-rq > div { position: relative; }
.case-rq > div + div::before {
  content: "\2192" / "";
  position: absolute;
  left: -34px;
  top: 0;
  font-size: 40px;
  line-height: 0;
  color: var(--on-surface-alternate);
}
.case-rq dt { font-size: 14px; color: var(--on-surface-alternate); }
.case-rq dd {
  margin: var(--sm) 0 0;
  font-size: 12px;
  line-height: var(--body-md-line);
  letter-spacing: var(--body-md-tracking);
  color: var(--on-surface-low);
}
.case-rq .case-rq__question { font-size: 12px; line-height: 1.45; letter-spacing: 0; color: var(--on-surface-low); }

/* Interview quotes: big accent quote mark, prominent quote, quieter speaker + source caption */
.case-quotes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--lg);
  margin: 32px 0 0;
}
.case-quote {
  display: flex;
  flex-direction: column;
  gap: var(--xl);
  margin: 0;
  padding: var(--xl);
  border-radius: var(--sm);
  background: var(--surface-low);
}
.case-quote blockquote { margin: 0; }
.case-quote blockquote::before {
  content: "\201C" / "";
  display: block;
  height: 32px;
  font-size: 72px;
  line-height: 1;
  color: var(--on-surface-alternate);
}
.case-quote blockquote p {
  font-size: 18px;
  line-height: 1.45;
  letter-spacing: 0;
  color: var(--on-surface);
}
.case-quote figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: var(--xs) var(--sm);
  margin-top: auto;
  padding-top: var(--lg);
  border-top: 1px solid var(--outline);
  font-size: 12px;
  color: var(--on-surface-low);
}
.case-quote__source { font-style: normal; }
.case-quote__source::before { content: "\00B7" / ""; margin-right: var(--sm); }

/* Research insights: dot meter + big stat + inline summary, with the supporting paragraph below */
.case-insights { display: grid; gap: 40px; margin-top: 32px; }
.case-insight__stat {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sm) var(--lg);
  padding-bottom: var(--lg);
  border-bottom: 1px solid var(--outline);
}
.case-body .case-insight__stat { font-size: 18px; line-height: 1.4; letter-spacing: 0; color: var(--on-surface); padding:8px; }
.case-insight__dots { display: inline-flex; align-items: center; gap: 6px; }
.case-insight__dots i {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--on-surface-low);
  border-radius: 50%;
}
.case-insight__dots i.is-on { background: var(--on-surface-alternate); border-color: var(--on-surface-alternate); }
.case-insight__dots i.is-trainer { border-radius: 2px; }
.case-insight__dots b { margin: 0 2px; font-size: 14px; font-weight: 400; color: var(--on-surface-low); }
.case-insight__stat strong {
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  color: var(--surface-background);
  background-color: var(--on-surface-alternate);
  padding: 4px;
  border-radius: 4px;
}
.case-insight__summary { flex: 1 1 220px; }

.case-checks,
.case-steps { margin: var(--xl) 0 0; padding: 0; list-style: none; display: grid; gap: var(--lg); }
.case-steps { margin-top: var(--xl); }
.case-checks li,
.case-steps li { position: relative; padding-left: 44px; }
.case-checks li { min-height: 28px; padding-top: 3px; }
.case-checks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-background);
  color: var(--on-surface-alternate);
  font-size: 32px;
  letter-spacing: 0;
}
.case-steps { counter-reset: step; }
.case-steps li { counter-increment: step; }
.case-steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  letter-spacing: 0;
  color: var(--on-surface-alternate);
}

/* Page end: more projects over a darkened mountain strip (Figma "Footer") */
.case-end { position: relative; isolation: isolate; }
.case-end::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 237px;
  z-index: -1;
  background:
    linear-gradient(var(--footer-scrim), var(--footer-scrim)),
    var(--hero-image) center 12% / cover no-repeat;
  pointer-events: none;
}
/* The fade sits on its own layer starting 2px above the photo, so the photo's anti-aliased
   top edge is always under solid page color (otherwise it shows as a hairline) */
.case-end::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 239px;
  z-index: -1;
  background: var(--footer-fade);
  pointer-events: none;
}
.case-more {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px var(--xl) 200px;
}
.case-more__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--lg);
  margin-bottom: var(--xl);
}
.case-more h2 { margin: 0; font-size: 32px; font-weight: 400; letter-spacing: -3.2px; }
.case-more__all { font-size: 16px; color: var(--on-surface-alternate); border-radius: 4px; }
.case-more__all:hover { text-decoration: underline; text-underline-offset: 4px; }
.case-more__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--lg);
  margin: 0;
  padding: 0;
  list-style: none;
}
.case-more__item {
  display: flex;
  align-items: center;
  gap: var(--sm);
  height: 100%;
  padding: var(--lg);
  border-radius: var(--sm);
  background: var(--surface-surface);
  font-size: 16px;
}
.case-more__item img { flex-shrink: 0; }
.case-more__item small { margin-left: auto; padding-left: var(--sm); font-size: 12px; color: var(--on-surface-low); white-space: nowrap; }
.case-more__item.is-soon { color: var(--on-surface-low); }
.case-more__item.is-soon img { opacity: 0.5; }

@media (max-width: 768px) {
  /* One row: nav icon left, logo centered, theme toggle right; links and projects move into the mobile menu */
  .topbar { display: grid; grid-template-columns: 1fr auto 1fr; padding: var(--sm) var(--lg); }
  .topbar .menu-button { justify-self: start; }
  .topbar__actions { justify-self: end; }
  .topbar__nav,
  .project-menu { display: none; }
  .case-hero { padding: var(--xl) var(--lg); }
  .case-hero__title { font-size: 40px; letter-spacing: -4px; }
  .case-hero__cover { border-radius: var(--lg); }
  .case-wrap { padding: 0 var(--lg); }
  .case-body { padding: var(--xl) var(--lg) 48px; gap: 48px; }
  .case-body section:not(:first-child) { padding-top: 48px; }
  .case-body h2 { font-size: 26px; letter-spacing: -2.6px; }
  .case-quotes { grid-template-columns: 1fr; }
  .case-rq { grid-template-columns: 1fr; gap: 56px; }
  .case-rq > div + div::before { content: "\2193" / ""; left: 0; top: -38px; }
  .case-more { padding-left: var(--lg); padding-right: var(--lg); }
}

/* ---------- My AI Playbook page ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.topbar__nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }

/* Hero map: inline SVG with contour lines, route, waypoints and compass, all colored by theme tokens */
.playbook-map {
  position: relative;
  width: 100%;
  max-width: 1120px;
  aspect-ratio: 1120 / 568;
  overflow: hidden;
  border-radius: 24px;
  background: var(--surface-surface);
}
.playbook-map__overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.playbook-map__contours { fill: none; stroke: var(--on-surface-low); stroke-width: 1; stroke-linejoin: round; opacity: 0.35; }
.playbook-map__contours .playbook-map__contours-index { stroke-width: 2; }
.playbook-map__grid line { stroke: var(--outline); stroke-width: 1; stroke-dasharray: 2 6; }
.playbook-map__route { fill: none; stroke: var(--on-surface-alternate); stroke-width: 3; stroke-dasharray: 10 8; stroke-linecap: round; }
.playbook-map__start { fill: var(--on-surface-alternate); }
.playbook-map__start-ring { fill: none; stroke: var(--on-surface-alternate); stroke-width: 2; opacity: 0.5; }
.playbook-map__wp { fill: var(--surface-surface); stroke: var(--on-surface-alternate); stroke-width: 3; }
.playbook-map__summit { fill: #fa8f42; stroke: #181d25; stroke-width: 3; }
.playbook-map__label rect { fill: var(--surface-background); stroke: var(--outline); }
.playbook-map__label text,
.playbook-map__compass text { font-family: var(--font-mono); font-size: 14px; fill: var(--on-surface); }
.playbook-map__compass text { text-anchor: middle; }
.playbook-map__compass circle { fill: none; stroke: var(--outline); stroke-width: 1.5; }
.playbook-map__compass path { fill: var(--on-surface-low); }
.playbook-map__compass .playbook-map__compass-n { fill: var(--on-surface-alternate); }
/* Summit coordinates: HTML link (to AllTrails) layered over the map's bottom-right corner */
.playbook-map__coords {
  position: absolute;
  right: var(--xl);
  bottom: var(--lg);
  font-size: 14px;
  color: var(--on-surface-low);
  border-radius: 4px;
}
.playbook-map__coords:hover { color: var(--on-surface); text-decoration: underline; text-underline-offset: 4px; }

/* Tool table */
.case-table-wrap { overflow-x: auto; }
.case-table { width: 100%; border-collapse: collapse; text-align: left; }
.case-table th,
.case-table td {
  padding: var(--lg) var(--md, 12px) var(--lg) 0;
  vertical-align: top;
  border-bottom: 1px solid var(--outline);
  font-size: 16px;
  font-weight: 400;
  line-height: var(--body-md-line);
  letter-spacing: var(--body-md-tracking);
}
.case-table thead th { padding-top: 0; font-size: 12px; letter-spacing: 0; color: var(--on-surface-low); }
.case-table tbody th { width: 22%; color: var(--on-surface); }
.case-table__tool { width: 22%; color: var(--on-surface-alternate); }
.case-table td:last-child { padding-right: 0; color: var(--on-surface-low); }
.case-table tbody tr:last-child > * { border-bottom: 0; }
.case-table em { display: block; margin-top: var(--sm); color: var(--on-surface); font-size:12px; }

.case-steps strong { font-weight: 400; color: var(--on-surface); }

/* Source-validation labels */
.case-labels { display: grid; gap: var(--sm); margin: var(--lg) 0 0; }
.case-labels > div { display: grid; grid-template-columns: 200px 1fr; gap: var(--lg); align-items: baseline; }
.case-labels dt {
  justify-self: start;
  padding: var(--xs) var(--md, 12px);
  border-radius: 100px;
  font-size: 14px;
  background-color: var(--on-surface-alternate);
  color: var(--surface-background);
}
.case-labels dd { margin: 0; font-size: 16px; line-height: var(--body-md-line); letter-spacing: var(--body-md-tracking); color: var(--on-surface-low); }

/* Prompt library categories */
.case-library {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--lg);
  margin: var(--2xl) 0 0;
  padding: 0;
  list-style: none;
}
.case-library > li {
  display: flex;
  flex-direction: column;
  gap: var(--sm);
  padding: var(--xl) var(--lg);
  border-radius: var(--sm);
  background: var(--surface-low);
}
.case-library__num { font-size: 14px; color: var(--on-surface); }
.case-library strong { font-size: 24px; font-weight: 400; letter-spacing: -2.4px; color: var(--on-surface-alternate); }
.case-library ul { display: block; flex-wrap: wrap; gap: var(--xs) var(--sm); margin: var(--sm) 0 0; padding: 0; list-style: none; }
.case-library ul li { font-size: 14px; color: var(--on-surface-low); padding-bottom: 4px; }
/*.case-library ul li:not(:last-child)::after { content: " ·"; }*/

.case-bullets { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--lg); }
.case-bullets li {
  position: relative;
  padding-left: 44px;
  font-size: 16px;
  line-height: var(--body-md-line);
  letter-spacing: var(--body-md-tracking);
  color: var(--on-surface-low);
}
.case-bullets li::before { content: "→"; position: absolute; left: 0; color: var(--on-surface-alternate); }

a.case-more__item { color: var(--on-surface); transition: background-color 150ms ease; }
a.case-more__item:hover { background: var(--surface-low); }
a.case-more__item small { color: var(--on-surface-alternate); }

@media (max-width: 768px) {
  .playbook-map { border-radius: var(--lg); }
  .playbook-map__label { display: none; }
  .playbook-map__coords { right: var(--md, 12px); bottom: var(--sm); font-size: 12px; }
  .case-table thead { display: none; }
  .case-table tr { display: grid; grid-template-columns: auto 1fr; column-gap: var(--lg); padding: var(--lg) 0; border-bottom: 1px solid var(--outline); }
  .case-table tbody tr:last-child { border-bottom: 0; }
  .case-table th, .case-table td { width: auto; padding: 0; border: 0; }
  .case-table td:last-child { grid-column: 1 / -1; margin-top: var(--sm); }
  .case-labels > div { grid-template-columns: 1fr; gap: var(--xs); }
  .case-library { grid-template-columns: 1fr; }
}

/* ---------- Mobile menu (≤768px): nav icon + panel with site links and projects ---------- */

.menu-button,
.mobile-menu { display: none; }
.menu-button {
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-alternate);
}
.menu-button svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.menu-button[aria-expanded="true"] .menu-button__open,
.menu-button[aria-expanded="false"] .menu-button__close { display: none; }

.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 15;
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
  padding: var(--sm) var(--lg) var(--xl);
  background: var(--surface-surface);
  border-bottom: 1px solid var(--outline);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.35);
  text-align: left;
  font-size: 16px;
  line-height: var(--body-md-line);
  letter-spacing: var(--body-md-tracking);
}
.mobile-menu__list { margin: 0; padding: 0; list-style: none; }
.mobile-menu__list a,
.mobile-menu__soon {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--lg);
  padding: 12px var(--sm);
  border-radius: 4px;
}
.mobile-menu nav:first-child a { color: var(--on-surface-alternate); }
.mobile-menu__list a:hover { background: var(--surface-low); }
.mobile-menu__list a:focus-visible { outline: 2px solid var(--on-surface-alternate); outline-offset: -2px; }
.mobile-menu__list a[aria-current="page"] { color: var(--on-surface-alternate); }
.mobile-menu__list a[aria-current="page"]::after { content: "Current"; font-size: 12px; color: var(--on-surface-low); }
.mobile-menu__heading {
  margin-top: var(--sm);
  padding: var(--lg) var(--sm) var(--xs);
  border-top: 1px solid var(--outline);
  font-size: 12px;
  color: var(--on-surface-low);
}
.mobile-menu__soon { color: var(--on-surface-low); }
.mobile-menu__soon small { font-size: 12px; white-space: nowrap; }

@media (max-width: 768px) {
  .menu-button { display: inline-flex; }
  .mobile-menu:not([hidden]) { display: block; }
  /* Home: nav icon left, theme toggle right; the panel drops below that row as a card */
  .header__actions { position: relative; justify-content: space-between; }
  .header .topbar__nav { display: none; }
  .header .mobile-menu { border: 1px solid var(--outline); border-radius: var(--sm); }
}
