/* ─────────────────────────────────────────────────────────────
   ankitmaharjan.com.np: a portfolio laid out as a trek
   Palette: survey-map paper + the five prayer-flag colours
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #f2ede3;
  --bg-2: #e8e1d2;
  --paper: #faf7f0;
  --ink: #1c201e;
  --ink-2: #474c48;
  --muted: #7b7d75;
  --line: rgba(28, 32, 30, .14);
  --line-strong: rgba(28, 32, 30, .28);
  --contour: 150, 98, 58;          /* rgb triplet, read by the canvas */
  --contour-alpha: .32;

  /* Prayer flags: sky, wind, fire, water, earth */
  --blue: #2457a8;
  --white: #fbfaf5;
  --red: #c4372c;
  --green: #2c7a47;
  --yellow: #dea31a;

  --accent: var(--red);
  --accent-ink: #fff;

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-deva: "Tiro Devanagari Hindi", "Noto Serif Devanagari", serif;

  --gutter: 16px;
  --wrap: 1120px;
  --rail: 0px;          /* space reserved for the altimeter */
  --trail-h: 58px;
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1316;
    --bg-2: #141b1f;
    --paper: #161e22;
    --ink: #ebe6da;
    --ink-2: #bcb8ad;
    --muted: #7f8a8b;
    --line: rgba(235, 230, 218, .12);
    --line-strong: rgba(235, 230, 218, .26);
    --contour: 128, 178, 196;
    --contour-alpha: .26;
    --blue: #5b8fe0;
    --white: #e9e6dd;
    --red: #ff6a57;
    --green: #4fb675;
    --yellow: #f1bf3f;
    --accent-ink: #1a0d0b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1316;
  --bg-2: #141b1f;
  --paper: #161e22;
  --ink: #ebe6da;
  --ink-2: #bcb8ad;
  --muted: #7f8a8b;
  --line: rgba(235, 230, 218, .12);
  --line-strong: rgba(235, 230, 218, .26);
  --contour: 128, 178, 196;
  --contour-alpha: .26;
  --blue: #5b8fe0;
  --white: #e9e6dd;
  --red: #ff6a57;
  --green: #4fb675;
  --yellow: #f1bf3f;
  --accent-ink: #1a0d0b;
  color-scheme: dark;
}

@media (min-width: 720px)  { :root { --gutter: 32px; } }
@media (min-width: 1180px) { :root { --rail: 96px; } }

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  font-optical-sizing: auto;
  padding-bottom: var(--trail-h);
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

/* Faint survey grid behind everything */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 120px 120px;
  opacity: .35;
  z-index: -1;
}

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
img, svg { display: block; }
kbd {
  font-family: var(--font-mono);
  font-size: .72em;
  padding: .1em .45em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink-2);
}
kbd + kbd { margin-left: .2em; }
::selection { background: var(--yellow); color: #1c201e; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg);
  padding: 10px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--rail));
  margin: 0 auto;
  padding-left: calc(var(--gutter) + var(--rail));
  padding-right: var(--gutter);
}

/* ── Top bar ──────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.topbar.scrolled { border-bottom-color: var(--line); }

.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-weight: 500; font-size: 15px;
}
.brand svg { width: 26px; height: 26px; }
.brand b { color: var(--red); }

.topnav { display: none; gap: 4px; margin-left: auto; }
.topnav a {
  text-decoration: none;
  font-size: 15px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  transition: background .2s, color .2s;
}
.topnav a:hover { background: var(--bg-2); color: var(--ink); }
.topnav a[aria-current="true"] { color: var(--ink); background: var(--bg-2); }
@media (min-width: 820px) { .topnav { display: flex; } }

.tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topnav + .tools { margin-left: 8px; }
@media (max-width: 819px) { .topnav + .tools { margin-left: auto; } }

.kbd-btn, .icon-btn {
  font: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.kbd-btn { padding: 5px 8px 5px 12px; font-size: 14px; }
.kbd-btn kbd { font-size: 11px; }
.icon-btn { width: 36px; height: 36px; justify-content: center; }
.kbd-btn:hover, .icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}
@media (max-width: 480px) { .kbd-btn kbd { display: none; } .kbd-btn { padding: 5px 12px; } }

/* ── Altimeter (desktop instrument) ───────────────────────── */
.altimeter {
  display: none;
  position: fixed; z-index: 20;
  left: 24px; top: 50%;
  transform: translateY(-50%);
  width: 64px;
  font-family: var(--font-mono);
  text-align: center;
  color: var(--ink-2);
}
@media (min-width: 1180px) { .altimeter { display: grid; justify-items: center; gap: 10px; } }

.alt-label { font-size: 11px; letter-spacing: .2em; color: var(--muted); }
.alt-track {
  position: relative;
  width: 6px; height: 34vh; min-height: 180px;
  border-radius: 6px;
  background: var(--line);
  overflow: hidden;
}
.alt-fill {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 15.8%;
  background: linear-gradient(to top, var(--green), var(--yellow) 55%, var(--red));
  background-size: 100% 34vh;
  background-position: bottom;
  border-radius: 6px;
  transition: height .15s linear;
}
/* tick for EBC; the full track is sea level → Everest summit */
.alt-summit {
  position: absolute; left: -3px; right: -3px;
  bottom: 60.6%;                     /* 5,364 / 8,849 */
  height: 1px; background: var(--ink-2);
}
.alt-readout { font-size: 18px; font-weight: 500; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.alt-readout small { font-size: 11px; margin-left: 2px; color: var(--muted); }
.alt-camp { font-size: 10.5px; line-height: 1.3; max-width: 76px; color: var(--ink-2); min-height: 2.6em; }
.alt-o2 sub { font-size: .8em; }
.alt-o2 { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: 96px 0 56px;
  overflow: hidden;
  isolation: isolate;
}
.topo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: -1;
  /* fade the map out behind the text column */
  -webkit-mask-image: linear-gradient(100deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.45) 35%, #000 70%);
          mask-image: linear-gradient(100deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.45) 35%, #000 70%);
}
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 120px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  z-index: -1;
  pointer-events: none;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-2);
  margin: 0 0 22px;
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.name {
  display: grid;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.4rem, 11vw, 8.25rem);
  line-height: .9;
  letter-spacing: -.045em;
}
.name > span { grid-area: 1 / 1; transition: opacity .5s var(--ease), transform .6s var(--ease), filter .5s; }
.name-deva {
  font-family: var(--font-deva);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.05;
  font-size: .92em;
  opacity: 0;
  transform: translateY(.15em);
  filter: blur(6px);
}
.name.deva .name-latin { opacity: 0; transform: translateY(-.15em); filter: blur(6px); }
.name.deva .name-deva { opacity: 1; transform: none; filter: none; }

.script-toggle {
  font: inherit;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  background: none; border: 0; padding: 4px 0;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 4px;
}
.script-toggle span { font-family: var(--font-deva); font-size: 1.15em; }
.script-toggle:hover { color: var(--ink); }

.lede {
  max-width: 34ch;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  line-height: 1.45;
  color: var(--ink-2);
  margin: 22px 0 30px;
}
.lede em { font-style: normal; color: var(--ink); background: linear-gradient(transparent 62%, color-mix(in srgb, var(--yellow) 45%, transparent) 0); }

.hero-row {
  display: grid;
  gap: 28px;
  align-items: end;
}
@media (min-width: 860px) { .hero-row { grid-template-columns: minmax(300px, 380px) 1fr; gap: 48px; } }

.clock {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 14.5px;
  color: var(--ink-2);
}
.clock-top { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.tz { color: var(--red); }
.clock-time {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 6px;
}
.clock-status b { color: var(--ink); font-weight: 600; }
.clock-diff { margin-top: 2px; }
.clock-bs { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-strong); font-size: 13px; color: var(--muted); }
.clock-bs [lang="ne"] { font-family: var(--font-deva); font-size: 1.2em; color: var(--ink); }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hint { flex-basis: 100%; margin: 6px 0 0; font-size: 14px; color: var(--muted); max-width: 46ch; }
.hint b { font-family: var(--font-mono); color: var(--ink-2); }

.btn {
  font: inherit;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 15.5px; font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .2s var(--ease), background .2s, color .2s, border-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--red); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: color-mix(in srgb, var(--bg) 60%, transparent); }
.btn-ghost:hover { border-color: var(--ink); }

/* ── Camps (sections) ─────────────────────────────────────── */
.camp {
  position: relative;
  padding: clamp(80px, 12vw, 150px) 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 40px;
}
.camp-head { margin-bottom: clamp(36px, 6vw, 64px); max-width: 760px; }
.camp-meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 14px;
}
.camp-alt {
  color: var(--ink);
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-weight: 500;
}
.camp h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 1;
  letter-spacing: -.035em;
}
.camp-name {
  display: block;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}
.camp-note { margin: 18px 0 0; color: var(--ink-2); max-width: 58ch; }

/* reveal on scroll (only hide when JS is running) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* About */
.about { display: grid; gap: 40px; }
@media (min-width: 900px) { .about { grid-template-columns: 1.4fr 1fr; gap: 64px; } }
.about-text p { margin: 0 0 1em; color: var(--ink-2); max-width: 60ch; }
.about-text .big { font-size: clamp(1.3rem, 2.6vw, 1.75rem); line-height: 1.35; color: var(--ink); letter-spacing: -.01em; }

.field-notes {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 6px 20px;
  align-self: start;
}
.field-notes > div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.field-notes > div:last-child { border-bottom: 0; }
.field-notes dt { font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding-top: 3px; }
.field-notes dd { margin: 0; font-size: 15.5px; }

/* Work / expeditions */
.expeditions { display: grid; gap: 18px; }
.expedition {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  transition: border-color .3s, transform .4s var(--ease), box-shadow .4s;
}
.expedition:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 18px 40px -28px rgba(0,0,0,.35); }
@media (min-width: 820px) {
  .expedition { grid-template-columns: 90px 1fr auto; gap: 28px; padding: 30px 32px; }
}
.exp-index { font-family: var(--font-mono); font-size: 13px; color: var(--red); padding-top: 6px; }
.expedition h3 { margin: 0; font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.15; letter-spacing: -.02em; }
.exp-sub { margin: 4px 0 18px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.exp-grid { display: grid; gap: 14px 28px; }
@media (min-width: 640px) { .exp-grid { grid-template-columns: 1fr 1fr; } }
.exp-grid h4 { margin: 0 0 4px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.exp-grid p { margin: 0; font-size: 15.5px; color: var(--ink-2); }
.exp-gain {
  margin: 18px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--green);
  background: color-mix(in srgb, var(--green) 9%, transparent);
  border-radius: 0 8px 8px 0;
  font-size: 15px;
}
.exp-gain span { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--green); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 16px 0 0; }
.tags li { font-family: var(--font-mono); font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-2); }
.exp-links { display: flex; gap: 14px; align-items: flex-start; font-family: var(--font-mono); font-size: 14px; }
.exp-links a { text-decoration: none; border-bottom: 1px solid var(--line-strong); padding-bottom: 1px; white-space: nowrap; }
.exp-links a:hover { color: var(--red); border-color: var(--red); }

/* Toolkit / pack list */
.pack { display: grid; gap: 18px; }
@media (min-width: 760px) { .pack { grid-template-columns: repeat(3, 1fr); } }
.pack-col { border-top: 3px solid var(--ink); padding-top: 16px; }
.pack-col:nth-child(2) { border-color: var(--ink-2); }
.pack-col:nth-child(3) { border-top-style: dashed; border-color: var(--muted); }
.pack-col h3 { margin: 0 0 14px; font-size: 1.25rem; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pack-col h3 span { font-family: var(--font-mono); font-size: 12px; font-weight: 400; color: var(--muted); }
.pack-col ul { list-style: none; margin: 0; padding: 0; }
.pack-col li { padding: 9px 0; border-bottom: 1px dashed var(--line); display: flex; align-items: center; gap: 10px; }
.pack-col li::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--c, var(--ink-2)); flex: none; }
.pack-col li:nth-child(5n+1) { --c: var(--blue); }
.pack-col li:nth-child(5n+2) { --c: var(--muted); }
.pack-col li:nth-child(5n+3) { --c: var(--red); }
.pack-col li:nth-child(5n+4) { --c: var(--green); }
.pack-col li:nth-child(5n+5) { --c: var(--yellow); }

/* Trail log */
.log { list-style: none; margin: 0; padding: 0; position: relative; }
.log::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; border-left: 2px dashed var(--line-strong); }
.log li { position: relative; display: grid; gap: 4px 32px; padding: 0 0 36px 34px; }
.log li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--ink);
}
.log li:first-child::before { background: var(--red); border-color: var(--red); }
@media (min-width: 760px) { .log li { grid-template-columns: 170px 1fr; } }
.log-when { font-family: var(--font-mono); font-size: 13px; color: var(--muted); padding-top: 3px; }
.log h3 { margin: 0; font-size: 1.25rem; letter-spacing: -.01em; }
.log h3 span { font-weight: 400; color: var(--ink-2); }
.log p { margin: 4px 0 0; color: var(--ink-2); max-width: 60ch; }

/* Now */
.now { max-width: 760px; }
.now ul { list-style: none; margin: 0; padding: 0; }
.now li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.now li span { font-family: var(--font-mono); font-size: 13px; color: var(--muted); padding-top: 4px; }
.now-stamp { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); margin-top: 16px; }

/* Contact */
.camp-final { padding-top: clamp(120px, 16vw, 200px); overflow: hidden; }
.flags { position: absolute; left: 0; right: 0; top: 24px; height: 110px; pointer-events: none; }
.flags svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.flag {
  position: absolute;
  width: 26px; height: 32px;
  margin-left: -13px;
  transform-origin: 50% 0;
  border-radius: 1px;
  animation: flutter 3.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -.37s);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.flag::after {
  /* a hint of the printed wind-horse */
  content: "";
  position: absolute; inset: 8px 7px;
  border: 1px solid rgba(0,0,0,.16);
  border-radius: 50%;
}
@keyframes flutter {
  0%, 100% { transform: rotate(-3deg) skewY(0deg); }
  50% { transform: rotate(4deg) skewY(-5deg); }
}
@media (prefers-reduced-motion: reduce) { .flag { animation: none; } }

.contact { display: grid; gap: 22px; }
.mail {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 6.4vw, 4.4rem);
  letter-spacing: -.035em;
  line-height: 1.05;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 3px no-repeat;
  transition: background-size .5s var(--ease), color .3s;
  justify-self: start;
}
.mail:hover { background-size: 100% 3px; color: var(--red); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.summit-note { color: var(--muted); max-width: 52ch; margin: 10px 0 0; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0 36px; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer p { margin: 0; }
.footer-mono { font-family: var(--font-mono); font-size: 12.5px; }

/* ── Trail (bottom elevation-profile nav) ─────────────────── */
.trail {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  height: var(--trail-h);
  display: flex; align-items: stretch; gap: 16px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.trail-now {
  display: none;
  flex: none;
  flex-direction: column; justify-content: center;
  width: 150px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink-2);
}
.trail-now b { font-weight: 500; color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
@media (min-width: 640px) { .trail-now { display: flex; } }

.trail-map { position: relative; flex: 1; min-width: 0; margin: 6px 0 6px; }
.trail-map svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.trail-ridge { fill: color-mix(in srgb, var(--ink) 7%, transparent); stroke: none; }
.trail-route { fill: none; stroke: var(--line-strong); stroke-width: 2; vector-effect: non-scaling-stroke; }
.trail-done { fill: none; stroke: var(--red); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.trail-ahead { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; opacity: .7; }

.trail-stops { position: absolute; inset: 0; }
.trail-stop {
  position: absolute;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  display: grid; place-items: center;
  text-decoration: none;
}
.trail-stop::before {
  content: "";
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--ink-2);
  transition: transform .2s, background .2s, border-color .2s;
}
.trail-stop.passed::before { background: var(--red); border-color: var(--red); }
.trail-stop:hover::before, .trail-stop:focus-visible::before { transform: scale(1.35); }
.trail-stop span {
  position: absolute; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(4px);
  white-space: nowrap;
  font-family: var(--font-mono); font-size: 11.5px;
  padding: 4px 8px; border-radius: 6px;
  background: var(--ink); color: var(--bg);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.trail-stop:hover span, .trail-stop:focus-visible span { opacity: 1; transform: translateX(-50%); }
.trail-stop.summit::before { border-style: dashed; background: transparent; }
.trail-stop:first-child span { left: 0; transform: translateY(4px); }
.trail-stop:first-child:hover span, .trail-stop:first-child:focus-visible span { transform: none; }
.trail-stop:last-child span { left: auto; right: 0; transform: translateY(4px); }
.trail-stop:last-child:hover span, .trail-stop:last-child:focus-visible span { transform: none; }

.trail-hiker {
  position: absolute;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--yellow);
  border: 2px solid var(--ink);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--yellow) 30%, transparent);
  pointer-events: none;
  left: 0; top: 0;
}

/* ── Command palette ──────────────────────────────────────── */
.palette {
  width: min(560px, calc(100vw - 2 * var(--gutter)));
  margin: 14vh auto auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.5);
}
.palette::backdrop { background: rgba(10, 14, 16, .45); backdrop-filter: blur(3px); }
.palette[open] { animation: pop .22s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.palette-input {
  width: 100%;
  font: inherit; font-size: 17px;
  padding: 18px 20px;
  border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink);
  outline: none;
}
.palette-input:focus-visible { outline: none; }
.palette-list { list-style: none; margin: 0; padding: 8px; max-height: min(50vh, 380px); overflow-y: auto; }
.palette-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15.5px;
}
.palette-list li small { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.palette-list li[aria-selected="true"] { background: var(--bg-2); }
.palette-list li[aria-selected="true"] small { color: var(--red); }
.palette-list .empty { color: var(--muted); cursor: default; }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* ── Toast + yeti ─────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--trail-h) + 16px); z-index: 50;
  transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink); color: var(--bg);
  font-size: 14.5px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.footprint {
  position: fixed; z-index: 40;
  width: 22px; height: 34px;
  pointer-events: none;
  color: var(--ink);
  opacity: 0;
  animation: step 4.5s var(--ease) forwards;
}
@keyframes step {
  8% { opacity: .55; }
  70% { opacity: .55; }
  100% { opacity: 0; }
}

/* ── 404 page ─────────────────────────────────────────────── */
.lost { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 40px var(--gutter); }
.lost h1 { font-size: clamp(3rem, 12vw, 8rem); margin: 0; letter-spacing: -.05em; line-height: .9; }
.lost p { color: var(--ink-2); max-width: 44ch; margin: 18px auto 28px; }
.lost .camp-meta { justify-content: center; }
