@import url("tokens.css");

/* ============================================================
   PATAGONIA 2026
   Printed field dossier: cool paper ground, photographs inset as
   plates with paper visible around them, captions and data in the
   margin — never burned onto the image. Type is the loud element.
   Every size, space, radius and colour comes from tokens.css.
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

a { color: var(--ice); text-decoration-color: color-mix(in srgb, var(--ice) 38%, transparent); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--ember-deep);
  outline-offset: 2px;
  border-radius: var(--r-1);
}

::selection { background: var(--ember); color: #fff; }

/* the ruled frame of the sheet: two hairlines at the shell edges, the
   way the references frame a printed page. Off below tablet, where the
   content already runs to the gutters. */
@media (min-width: 64rem) {
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    width: min(100% - 2rem, calc(var(--maxw) + 2 * var(--gutter)));
    margin-inline: auto;
    border-left: 1px solid var(--line-soft);
    border-right: 1px solid var(--line-soft);
    pointer-events: none;
    z-index: 0;
  }
}

/* ---------- type utilities ---------- */

.micro,
.eyebrow {
  font-family: var(--mono);
  font-size: var(--t-micro);
  font-weight: 400;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.4;
}

.eyebrow { color: var(--ember-deep); }

h1, h2, h3, h4 {
  font-family: var(--font);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: var(--lh-snug);
  text-wrap: balance;
}

strong, b { color: var(--ink); font-weight: 600; }
em { font-style: italic; }

/* mono metadata pinned above a page head — the dossier's slug line */
.slugline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--s-3);
}
.slugline span:last-child { margin-left: auto; }

/* ============================================================
   SITE HEADER — slim, sticky, one row.
   ============================================================ */

.site-head {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line);
}

.site-head__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-3) var(--gutter);
  display: flex;
  align-items: center;
  gap: var(--s-5);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  text-decoration: none;
  flex: 0 0 auto;
  padding-block: var(--s-2);
}

.brand__mark {
  font-weight: 800;
  font-size: var(--t-lead);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ink);
  font-stretch: 80%;
}

.brand__meta {
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ink-3);
}

/* on narrow screens the dateline would push the nav off the edge */
@media (max-width: 48rem) {
  .brand__meta { display: none; }
  .site-head__inner { gap: var(--s-3); }
}

.nav {
  display: flex;
  gap: var(--s-1);
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--ink-2);
  font-size: var(--t-small);
  font-weight: 500;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-pill);
  transition: color var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out);
}
.nav a:hover { color: var(--ink); background: var(--surface-hi); }
.nav a[aria-current="page"] { color: var(--surface); background: var(--ink); font-weight: 600; }

/* ============================================================
   PAGE HEAD — type in paper, photograph as an inset plate below it.
   The LUKS / Idyllic move: the image is a rectangle with a margin of
   paper around it, and every caption lives in that margin.
   ============================================================ */

.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-6) var(--gutter) var(--s-5);
  display: flex;
  flex-direction: column;
}

/* the dossier slug, printed above every page head */
.hero::before {
  content: "Patagonia 2026 · N° 001 · Austral spring · ARG + CHL · 50°29′S 73°02′W";
  order: 0;
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero__inner {
  order: 1;
  position: relative;
  z-index: var(--z-base);
  width: 100%;
  padding: 0;
}

.hero__img {
  order: 2;
  position: static;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-3);
  margin-top: var(--s-6);
  background: var(--bg-deep);
  opacity: 1;
}

@media (min-width: 48rem) {
  .hero__img { aspect-ratio: 21 / 9; }
  .hero--short .hero__img { aspect-ratio: 3 / 1; }
}

/* the scrim was there to rescue type burned onto the photograph.
   There is no type on the photograph any more. */
.hero::after { content: none; }

.hero__title {
  font-size: var(--t-display);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: var(--track-display);
  color: var(--ink);
  font-stretch: var(--wdth-display);
  margin-top: var(--s-4);
  max-width: 15ch;
  text-wrap: balance;
}

.hero--short .hero__title { font-size: var(--t-h1); font-stretch: var(--wdth-title); max-width: 20ch; }

/* the signal colour, used once, at display size (3.8:1 — large type only) */
.hot { color: var(--ember); }

.hero__sub {
  margin-top: var(--s-4);
  max-width: 52ch;
  color: var(--ink-2);
  font-size: var(--t-lead);
}

/* the credit is margin furniture now: mono, small, under the plate */
.hero__credit {
  order: 3;
  position: static;
  max-width: 100%;
  margin-top: var(--s-2);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  text-shadow: none;
}
.hero__credit a,
.day__credit a,
.band__credit a {
  display: inline-block;
  padding-block: 0.625rem;   /* 10px of mono type is not a tap target */
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line);
}

/* ---------- stat rail — the single data primitive ----------
   D+ Pyrenees: a row of ruled stat blocks, big value over a mono
   caption. On paper each one gets its own hairline. */

.rail {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4) var(--s-6);
  align-items: flex-start;
}

.rail--tight { gap: var(--s-3) var(--s-5); }

.rail__item { min-width: 0; }

.rail--lg {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0;
  margin-top: var(--s-6);
  border-top: 1px solid var(--line-hard);
}
.rail--lg .rail__item {
  padding: var(--s-3) var(--s-4) var(--s-2) 0;
  border-right: 1px solid var(--line-soft);
}
.rail--lg .rail__item:last-child { border-right: none; }

.rail__v {
  display: block;
  font-size: var(--t-h4);
  font-weight: 700;
  line-height: 1.05;
  color: var(--ink);
  letter-spacing: -0.03em;
  font-stretch: 88%;
  white-space: nowrap;
}
.rail--lg .rail__v { font-size: var(--t-h3); }

.rail__k {
  display: block;
  margin-top: var(--s-1);
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

/* the kicker carries a signal dot — LUKS's orange bullet before the
   flight line */
.hero__inner .eyebrow,
.detail__heroInner .eyebrow {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--ink-3);
}
.hero__inner .eyebrow::before,
.detail__heroInner .eyebrow::before {
  content: "";
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: var(--r-pill);
  background: var(--ember);
  flex: 0 0 auto;
}

/* glass panel — for the handful of chips still sitting on a photograph */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-3);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  padding: var(--s-4) var(--s-5);
  color: var(--ink);
}

/* ============================================================
   SURFACES
   ============================================================ */

.panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  padding: var(--s-5);
}

.well {
  background: var(--bg-deep);
  border-radius: var(--r-3);
  padding: var(--s-5);
}

/* ---------- controls ---------- */

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--t-small);
  font-weight: 500;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-pill);
  transition: color var(--dur-1) var(--ease-out),
              background var(--dur-1) var(--ease-out),
              border-color var(--dur-1) var(--ease-out);
}
.chip:hover { color: var(--ink); border-color: var(--ink-3); }
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
  font-weight: 600;
}
.chip--accent[aria-pressed="true"] { background: var(--ember-deep); border-color: var(--ember-deep); color: #fff; }

/* native selects, restyled to sit in the chip row */
.toolbar select,
select.chip {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--surface);
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 0.75rem) 50%, calc(100% - 0.4375rem) 50%;
  background-size: 0.3125rem 0.3125rem;
  background-repeat: no-repeat;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-size: var(--t-small);
  padding: var(--s-2) var(--s-6) var(--s-2) var(--s-4);
}
.toolbar select:hover { color: var(--ink); border-color: var(--ink-3); }
.toolbar select option,
select.chip option { background: var(--surface); color: var(--ink-2); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--t-small);
  font-weight: 500;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-pill);
  transition: background var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
.btn:hover { background: var(--surface-hi); border-color: var(--ink-3); }
.btn--accent {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
  font-weight: 600;
}
.btn--accent:hover { background: var(--ember-deep); border-color: var(--ember-deep); color: #fff; }

/* ============================================================
   TOOLBAR (catalog filters)
   ============================================================ */

.toolbar {
  position: sticky;
  top: 3.25rem;
  z-index: var(--z-sticky);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line);
}

.toolbar__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-3) var(--gutter);
  display: flex;
  gap: var(--s-2);
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.toolbar__inner::-webkit-scrollbar { display: none; }

/* once there is room, the filter row wraps instead of hiding
   the spot count off the right edge */
@media (min-width: 60rem) {
  .toolbar__inner { flex-wrap: wrap; overflow: visible; row-gap: var(--s-2); }
}

/* result count lives with the results, not in the filter bar */
.results {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-6) var(--gutter) 0;
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
}
.results + .catalog { padding-top: var(--s-4); }

/* identity */

.identity { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.identity__panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--s-4) var(--s-5);
}
.identity__panel .q { margin-right: auto; color: var(--ink); font-weight: 600; }

.identity__btn {
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: var(--s-2) var(--s-4);
  font-size: var(--t-small);
  color: var(--ink-2);
  transition: background var(--dur-1) var(--ease-out);
}
.identity__btn:hover { background: var(--surface-hi); color: var(--ink); }

.identity__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-small);
  color: var(--ink-2);
}
.identity__chip b { color: var(--ink); font-weight: 600; }
.identity__chip button {
  color: var(--ice);
  font-size: var(--t-small);
  text-decoration: underline;
  padding: var(--s-2) var(--s-1);
}

/* ============================================================
   CATALOG — each card is a plate: photograph inset, data in paper
   ============================================================ */

.catalog {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-6) var(--gutter) var(--s-10);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: var(--s-6) var(--s-5);
}

.spot {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--plate-inset);
  transition: transform var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out);
}

.spot:hover {
  transform: translateY(-2px);
  border-color: var(--ink-3);
  box-shadow: var(--e-3);
}

.spot__photo {
  position: relative;
  display: block;
  width: 100%;
  cursor: pointer;
}

.spot__photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-2);
  background: var(--bg-deep);
}

.spot__photo .noimg {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-2);
  background: var(--bg-deep);
  padding: var(--s-5);
  text-align: center;
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ink-3);
}

/* everything that used to be burned onto the photograph now sits
   under it, on paper */
.spot__overlay {
  position: static;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-2) 0;
  background: none;
  pointer-events: auto;
}

.spot__overlay .row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s-2);
}

.spot__coords {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  white-space: nowrap;
}

.spot__statstrip {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--s-4);
  padding-top: var(--s-2);
  border-top: 1px solid var(--line-soft);
  overflow: hidden;
}
.spot__statstrip .rail__v { font-size: var(--t-body); }

.badge {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.125rem var(--s-2);
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.badge--gem { color: var(--ember-deep); border-color: color-mix(in srgb, var(--ember-deep) 45%, transparent); }
.badge--drone-legal { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.badge--drone-illegal { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.badge--drone-permission,
.badge--drone-unclear { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.badge--astro { color: var(--ice); border-color: color-mix(in srgb, var(--ice) 45%, transparent); }

.spot__body {
  padding: var(--s-4) var(--s-2) var(--s-3);
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
}

.spot__names { min-width: 0; flex: 1; }

.spot__name {
  font-size: var(--t-h4);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-stretch: 88%;
  color: var(--ink);
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.spot__name:hover { color: var(--ember-deep); }

.spot__where {
  margin-top: var(--s-1);
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ink-3);
}

.spot__access {
  margin-top: var(--s-2);
  font-size: var(--t-small);
  color: var(--ink-2);
}

.spot__country {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  padding: 0.125rem var(--s-2);
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  color: var(--ink-3);
}

.spot__conf {
  padding: 0 var(--s-2) var(--s-3);
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
  align-items: center;
}

.spot__spec {
  flex: 0 0 100%;
  text-align: right;
  padding-block: var(--s-2);   /* 18px of text is not a tap target */
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ice);
}
.spot__spec:hover { text-decoration: underline; }

.tag {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink-3);
  padding: 0.0625rem var(--s-2);
  white-space: nowrap;
}
.tag--official { border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); }
.tag--corroborated { border-color: var(--line); }
.tag--single { border-color: color-mix(in srgb, var(--warn) 45%, transparent); color: var(--warn); }
.tag--speculative { border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad); }

/* segmented pick control */

.spot__controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: auto;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
}

.pick {
  background: var(--surface-2);
  padding: var(--s-3) var(--s-1);
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.pick:hover { background: var(--surface-hi); color: var(--ink); }
.pick[aria-pressed="true"].pick--select { background: var(--ember); color: #fff; font-weight: 600; }
.pick[aria-pressed="true"].pick--maybe { background: var(--ink); color: var(--surface); font-weight: 600; }
.pick[aria-pressed="true"].pick--skip { background: var(--bg-deep); color: var(--ink-3); }

.spot__partner {
  position: absolute;
  top: calc(var(--plate-inset) + var(--s-2));
  left: calc(var(--plate-inset) + var(--s-2));
  z-index: var(--z-base);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.125rem var(--s-2);
  border-radius: var(--r-pill);
  background: var(--glass-hi);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
}
.spot__partner b { color: var(--ember-deep); }

/* ============================================================
   DETAIL SHEET — BUCK's specimen page: name and coordinates set
   in paper on the left, the photograph as a plate on the right.
   ============================================================ */

.detail {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.detail[hidden] { display: none; }

.detail__hero {
  position: relative;
  min-height: 0;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-7) var(--gutter) var(--s-5);
  display: grid;
  gap: var(--s-5);
  grid-template-columns: 1fr;
  align-items: start;
  background: none;
}

.detail__hero img {
  position: static;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-3);
  background: var(--bg-deep);
  opacity: 1;
  order: -1;
}

.detail__hero::after { content: none; }

.detail__heroInner {
  position: relative;
  z-index: var(--z-base);
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

@media (min-width: 60rem) {
  .detail__hero {
    grid-template-columns: 5fr 7fr;
    gap: var(--s-7);
    padding-top: var(--s-8);
  }
  .detail__hero img { order: 0; aspect-ratio: 5 / 4; position: sticky; top: var(--s-6); }
  .detail__heroInner { order: -1; }
}

.detail__title {
  font-size: var(--t-h1);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: var(--track-display);
  font-stretch: var(--wdth-title);
  color: var(--ink);
  max-width: 18ch;
}

.detail__close {
  position: fixed;
  top: var(--s-4);
  right: var(--s-4);
  z-index: var(--z-toast);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-pill);
  font-size: var(--t-small);
  box-shadow: var(--e-2);
}
.detail__close:hover { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* the credit sits under the plate, in the margin */
.detail__hero .hero__credit {
  grid-column: 1 / -1;
  order: 9;
  margin-top: calc(-1 * var(--s-3));
}
@media (min-width: 60rem) {
  .detail__hero .hero__credit { grid-column: 2; margin-top: calc(-1 * var(--s-4)); }
}

.detail__grid {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-6) var(--gutter) var(--s-10);
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
}
.detail__grid .wide { grid-column: 1 / -1; }

.dcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--s-5);
}

.dcard h3 {
  font-family: var(--mono);
  font-size: var(--t-micro);
  font-weight: 400;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ice);
  margin-bottom: var(--s-3);
}
/* Harder Kulm sets its card labels with a leading tick */
.dcard h3::before { content: ":: "; color: var(--ink-4); }

.dcard p, .dcard li { font-size: var(--t-small); color: var(--ink-2); }
/* bare source URLs are single unbreakable tokens wider than a phone */
.dcard a { overflow-wrap: anywhere; }
.dcard ul { list-style: none; }
.dcard li { padding: var(--s-2) 0; border-bottom: 1px solid var(--line-soft); }
.dcard li:last-child { border-bottom: none; }

/* label column is fixed so values start on one axis and stay readable
   even when the card spans the full grid */
.dcard .kv { display: grid; grid-template-columns: 8rem 1fr; gap: var(--s-3); align-items: baseline; }
.dcard .kv .k {
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ink-3);
}
.dcard .kv .v { color: var(--ink); }
@media (max-width: 30rem) {
  .dcard .kv { grid-template-columns: 1fr; gap: var(--s-1); }
}

.detail__coords {
  margin-top: var(--s-5);
  color: var(--ink-3);
  max-width: 62ch;
}
.detail__coords a { color: var(--ice); white-space: nowrap; }

.detail__controls { display: flex; gap: var(--s-2); margin-top: var(--s-4); }
.detail__controls .pick {
  flex: 0 0 auto;
  min-width: 7rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
}

/* ============================================================
   COMPARE
   ============================================================ */

.compare { max-width: var(--maxw); margin: 0 auto; padding: var(--s-7) var(--gutter) var(--s-10); }

.compare h2 { font-size: var(--t-h2); font-weight: 800; font-stretch: var(--wdth-title); letter-spacing: var(--track-display); }
.compare__cols {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  margin-top: var(--s-6);
}

.compare__col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
}
.compare__col header {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-3);
}
.compare__col header .who { font-weight: 700; color: var(--ink); }

.compare__list { list-style: none; }
.compare__list li {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--t-small);
}
.compare__list li:last-child { border-bottom: none; }
.compare__list .st {
  flex: 0 0 auto;
  align-self: center;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.0625rem var(--s-2);
  border-radius: var(--r-pill);
}
.st--select { background: var(--ember); color: #fff; }
.st--maybe { background: var(--ink); color: var(--surface); }
.st--skip { background: var(--bg-deep); color: var(--ink-3); }

.agree {
  position: relative;
  margin-top: var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
  padding: var(--s-5);
}
.agree { border-color: var(--ember); }
.agree h3 { font-size: var(--t-h4); color: var(--ink); }
.agree ul { list-style: none; margin-top: var(--s-3); }
.agree li { padding: var(--s-1) 0; font-size: var(--t-small); }

/* ============================================================
   DOCK (export bar)
   ============================================================ */

.exportbar {
  position: fixed;
  bottom: var(--s-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-dock);
  width: min(calc(100% - var(--s-6)), 46rem);
  background: var(--glass-hi);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--e-4);
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-5);
  display: flex;
  gap: var(--s-3);
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-2) var(--ease-out);
}

/* stowed while the page head owns the screen (see watchDock in app.js) */
.exportbar.is-stowed {
  transform: translateX(-50%) translateY(calc(100% + var(--s-5)));
  opacity: 0;
  pointer-events: none;
}

.exportbar .sums {
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.exportbar .sums b { color: var(--ink); }
.exportbar .actions { display: flex; gap: var(--s-2); }

/* below the pill's comfortable width it becomes a full-width bar */
@media (max-width: 34rem) {
  .exportbar {
    bottom: 0;
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: var(--s-3) var(--s-4);
    gap: var(--s-2);
  }
  .exportbar .actions { flex: 1 0 100%; justify-content: flex-end; }
  .exportbar .btn { white-space: nowrap; padding: var(--s-2) var(--s-3); }
  .exportbar .sums {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ============================================================
   CONTENT PAGES
   ============================================================ */

.page {
  position: relative;
  z-index: var(--z-base);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-7) var(--gutter) var(--s-10);
}

.page > section + section,
.page > .section + .section {
  margin-top: var(--section);
  border-top: 1px solid var(--line);
  padding-top: var(--s-7);
}

.pagehead {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-8) var(--gutter) 0;
}

.pagehead h1,
.page h2 {
  font-size: var(--t-h1);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: var(--track-display);
  font-stretch: var(--wdth-title);
  color: var(--ink);
  margin-top: var(--s-3);
}

.pagehead .lead,
.page .lead {
  margin-top: var(--s-4);
  font-size: var(--t-lead);
  color: var(--ink-2);
  max-width: var(--maxw-read);
}

.page h3 {
  font-size: var(--t-h3);
  font-weight: 700;
  font-stretch: 88%;
  letter-spacing: -0.02em;
  margin: var(--s-8) 0 var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
}
.page h3:first-child { margin-top: 0; }

/* BUCK sets its section numbers as giant orange display figures.
   These are the numbers the copy already carried, set as furniture. */
.secno {
  font-size: var(--t-h2);
  font-weight: 800;
  font-stretch: 72%;
  letter-spacing: -0.04em;
  line-height: 0.8;
  color: var(--ember);
  flex: 0 0 auto;
}

.page h4 {
  font-family: var(--mono);
  font-size: var(--t-micro);
  font-weight: 400;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ice);
  margin: var(--s-5) 0 var(--s-2);
}
.page h4::before { content: ":: "; color: var(--ink-4); }
.page h4:first-child,
.callout h4:first-child,
.fold h4:first-child,
.panel h4:first-child { margin-top: 0; }

.page p { margin: var(--s-3) 0; max-width: var(--maxw-read); text-wrap: pretty; }
.page ul, .page ol { margin: var(--s-3) 0 var(--s-3) var(--s-5); max-width: var(--maxw-read); }
.page li { margin: var(--s-2) 0; }
.page li::marker { color: var(--ink-4); }

.grid2 {
  display: grid;
  gap: var(--s-6) var(--s-7);
  grid-template-columns: 1fr;
  align-items: start;
}
.grid2 > * { min-width: 0; }
@media (min-width: 60rem) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid2 .span2 { grid-column: 1 / -1; }
}

/* tables */

.page table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--s-4) 0;
  font-size: var(--t-small);
}
.page th {
  text-align: left;
  font-family: var(--mono);
  font-size: var(--t-micro);
  font-weight: 400;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line-hard);
  padding: var(--s-2) var(--s-4) var(--s-2) 0;
  white-space: nowrap;
}
.page td {
  border-bottom: 1px solid var(--line-soft);
  padding: var(--s-3) var(--s-4) var(--s-3) 0;
  vertical-align: top;
}
.page tbody tr:last-child td { border-bottom: none; }
.page td:first-child { color: var(--ink); }

.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--s-2) var(--s-5);
  background: var(--surface);
}
/* columns get a floor and the wrapper scrolls, rather than crushing
   a five-column table into unreadable slivers */
.tablewrap table { margin: 0; min-width: 44rem; }

/* callouts — a tinted plate with a ruled top edge, never a side stripe */

.callout {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--s-5);
  margin: var(--s-5) 0;
  max-width: var(--maxw-read);
}
/* Harder Kulm's cards carry no accent edge at all: a tinted plate, a
   hairline, and the mono :: label doing the signalling */
.callout { background: var(--surface-2); }
.callout--ink { background: var(--surface); border-color: var(--ink-3); }
/* a callout that opens a grid cell aligns with the neighbouring heading */
.grid2 > .callout:first-child,
.grid2 > * > .callout:first-child { margin-top: 0; }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* disclosure */

.fold, .alts {
  border-top: 1px solid var(--line-soft);
  margin: var(--s-4) 0;
  padding-top: var(--s-3);
}
.fold > summary, .alts > summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding-block: var(--s-2);
  transition: color var(--dur-1) var(--ease-out);
}
.fold > summary:hover, .alts > summary:hover { color: var(--ink); }
.fold > summary::-webkit-details-marker,
.alts > summary::-webkit-details-marker { display: none; }
.fold > summary::before, .alts > summary::before {
  content: "+";
  color: var(--ember-deep);
  font-size: var(--t-body);
  line-height: 1;
}
.fold[open] > summary::before, .alts[open] > summary::before { content: "−"; }
.fold__body, .alts > div { padding-top: var(--s-3); }

.src { font-family: var(--mono); font-size: var(--t-micro); color: var(--ink-3); letter-spacing: 0.04em; }

.pagefoot {
  position: relative;
  z-index: var(--z-base);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-6) var(--gutter) var(--s-9);
  border-top: 1px solid var(--line-hard);
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}

.loading {
  grid-column: 1 / -1;
  padding: var(--s-9) var(--gutter);
  text-align: center;
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ============================================================
   ITINERARY — day cards. Photograph on top as a plate, the day's
   numbers underneath it on paper.
   ============================================================ */

.days {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: repeat(auto-fill, minmax(23rem, 1fr));
  align-items: start;
  margin-top: var(--s-5);
}

.day {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--plate-inset);
  display: flex;
  flex-direction: column;
}

.day__hero { position: relative; aspect-ratio: auto; background: none; display: flex; flex-direction: column; }
.day__hero img { order: 0; }
.day__credit { order: 1; }
.day__over { order: 2; }
.day__hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-2);
  background: var(--bg-deep);
}
.day__hero::after { content: none; }

.day__over {
  position: static;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-2) 0;
  color: var(--ink);
}

.day__toprow { display: flex; align-items: baseline; gap: var(--s-3); }

.day__no {
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: var(--track-micro);
  color: var(--ember-deep);
  flex: 0 0 auto;
}

.day__date {
  font-size: var(--t-h4);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-stretch: 88%;
}

.day__sun {
  margin-left: auto;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.day__statrow {
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
  padding-top: var(--s-2);
  border-top: 1px solid var(--line-soft);
}
.day__statrow .rail__v { font-size: var(--t-body); }

.day__credit {
  position: static;
  display: block;
  text-align: right;
  margin-top: var(--s-1);
  padding-right: var(--s-2);
  font-family: var(--mono);
  font-size: 0.5625rem;
  color: var(--ink-3);
}

.day--travel .day__hero { aspect-ratio: auto; }
.day--travel .day__over { background: none; padding: var(--s-3) var(--s-2) var(--s-2); }

.day__body { padding: var(--s-4) var(--s-2); }
.day__body > p { margin: 0 0 var(--s-4); font-size: var(--t-small); color: var(--ink-2); }

.slot {
  display: flex;
  gap: var(--s-4);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--t-small);
}
.slot:last-of-type { border-bottom: none; }
.slot time {
  flex: 0 0 4.5rem;
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ice);
  padding-top: 0.15em;
}

/* picks strip */

.daypicks {
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
}
.daypicks b {
  flex: 0 0 100%;
  font-family: var(--mono);
  font-size: var(--t-micro);
  font-weight: 400;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ember-deep);
  margin-bottom: var(--s-1);
}
.daypick {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0.1875rem var(--s-3) 0.1875rem 0.1875rem;
  transition: border-color var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out);
}
.daypick:hover { border-color: var(--ink-3); background: var(--surface-hi); }
.daypick img, .daypick__ph {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--r-pill);
  object-fit: cover;
  background: var(--bg-deep);
  display: block;
}
.daypick__name { font-size: var(--t-small); color: var(--ink); }
.daypick__who { font-family: var(--mono); font-size: 0.625rem; color: var(--ember-deep); }

/* ============================================================
   LOGISTICS — number row + photo band (plate + paper column)
   ============================================================ */

.numrow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  margin: var(--s-5) 0;
}

.num { background: var(--surface); padding: var(--s-4) var(--s-5); }
.num .v {
  display: block;
  font-size: var(--t-h3);
  font-weight: 800;
  font-stretch: 82%;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1.05;
}
.num .k {
  display: block;
  margin-top: var(--s-1);
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ink-3);
}
.num--accent .v { color: var(--ember-deep); }

.band {
  position: relative;
  margin: var(--section) 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4) var(--s-6);
  align-items: center;
  background: none;
  border-radius: 0;
  overflow: visible;
}
.band img {
  position: static;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-3);
  background: var(--bg-deep);
  opacity: 1;
}
.band::after { content: none; }
.band__inner {
  position: relative;
  z-index: var(--z-base);
  padding: 0;
  max-width: 42ch;
}
.band__inner p { color: var(--ink-2); }
.band__credit {
  position: static;
  grid-column: 1 / -1;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.5625rem;
  color: var(--ink-3);
}

@media (min-width: 60rem) {
  .band { grid-template-columns: 7fr 5fr; }
  .band img { aspect-ratio: 4 / 3; }
}

.status-hot { color: var(--ember-deep); font-weight: 600; }

/* ============================================================
   MOTION
   ============================================================ */

@keyframes riseIn {
  from { opacity: 0; transform: translateY(0.75rem); }
  to { opacity: 1; transform: none; }
}

.spot, .day { animation: riseIn var(--dur-3) var(--ease-out) both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
  .spot:hover, .day:hover { transform: none; }
}

/* ============================================================
   PRINT — the page is already paper; strip the chrome only
   ============================================================ */

@media print {
  body { background: #fff; color: #111; }
  body::before { display: none; }
  .site-head, .toolbar, .exportbar, .noprint, .daypicks { display: none !important; }
  .panel, .day, .spot, .callout, .tablewrap, .numrow, .num, .compare__col {
    background: #fff; border-color: #ccc; box-shadow: none;
  }
  h1, h2, h3, h4, .rail__v, .num .v, strong { color: #111; }
  .days { grid-template-columns: 1fr 1fr; gap: var(--s-3); }
  .day { break-inside: avoid; }
  .alts, .fold { display: none; }
  a { text-decoration: none; color: inherit; }
}

/* ============================================================
   MAP VIEW — two drawn plates
   The plate is the same object as a photo plate: an inset
   rectangle with paper around it and its captions in the margin.
   ============================================================ */

.mapview {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-6) var(--gutter) var(--s-10);
  display: grid;
  gap: var(--s-6);
  grid-template-columns: 1fr;
}

.mapview__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-5);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--line);
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--surface);
}
.seg {
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: var(--s-2) var(--s-4);
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.seg + .seg { border-left: 1px solid var(--line); }
.seg:hover { background: var(--surface-hi); color: var(--ink); }
.seg[aria-pressed="true"] { background: var(--ink); color: var(--surface); }

.mapview__day {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-left: auto;
}
.mapview__day input[type="range"] { width: 11rem; accent-color: var(--ink); min-height: 30px; }

.mapview__plates {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: 1fr;
}
@media (min-width: 64rem) {
  .mapview__plates { grid-template-columns: 1fr 1fr; align-items: start; }
  /* the plate carrying 18 of the 29 pins gets the whole row; 18 markers in
     a third of a screen is where they start colliding */
  .plate--wide { grid-column: 1 / -1; }
}

.plate { margin: 0; }
.plate__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--line-hard);
  margin-bottom: var(--s-3);
}
.plate__name {
  font-weight: 800;
  font-stretch: 84%;
  letter-spacing: -0.02em;
  font-size: var(--t-h4);
  color: var(--ink);
}
.plate__foot { margin-top: var(--s-2); text-align: right; }

.map__plate {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  background: var(--map-ground);
}
.map__svg { display: block; width: 100%; height: auto; }

.map__ground { fill: var(--map-ground); }
.map__park { fill: var(--map-park); stroke: var(--line); stroke-width: 1; stroke-dasharray: 5 4; }
.map__glacier { fill: var(--map-ice); stroke: var(--map-ice-line); stroke-width: 0.9; }
/* hatching is what makes ice read as ice on paper rather than as a second
   shade of nothing */
.map__glacierHatch { stroke: none; }
.map__iceHatch { stroke: var(--map-ice-line); stroke-width: 1.1; opacity: 0.55; }
.map__lake { fill: var(--map-water); stroke: var(--map-water-line); stroke-width: 0.8; }
.map__river { fill: none; stroke: var(--map-river); stroke-width: 1.1; stroke-linecap: round; }
.map__road { fill: none; stroke: var(--map-road); stroke-width: 1.6; stroke-linecap: round; }
.map__frame { fill: none; stroke: var(--line); stroke-width: 1; }

.map__tick { stroke: var(--ink-4); stroke-width: 1; }
.map__tickLabel,
.map__label {
  font-family: var(--mono);
  fill: var(--ink-3);
  font-size: 13px;
  letter-spacing: 0.06em;
}
.map__tickLabel { font-size: 12px; }
.map__label {
  text-transform: uppercase;
  font-size: 15px;
  /* a paper halo keeps a name legible where it crosses its own shape */
  paint-order: stroke fill;
  stroke: var(--map-ground);
  stroke-width: 3.5px;
  stroke-linejoin: round;
}
.map__label--road {
  fill: var(--ink-2);
  font-size: 13px;
  letter-spacing: 0.1em;
}
.map__label--water { fill: var(--ice); }
.map__label--glacier { fill: var(--ink-3); }

.map__hull { fill: none; stroke: var(--map-hull); stroke-width: 1.4; stroke-dasharray: 7 5; opacity: 0.75; }
.map__hullLabel {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--ember-deep);
}
.map__linkLine { stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 4 4; }

/* ---------- pins ---------- */

.map__pins { position: absolute; inset: 0; }

.pin {
  position: absolute;
  translate: -50% -50%;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  padding: 0;
}
.pin:focus-visible { outline: 2px solid var(--ember-deep); outline-offset: 2px; }

/* the marker itself: a dot, with a confidence ring around it */
.pin__dot {
  width: 0.6875rem;
  height: 0.6875rem;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: 0 0 0 2px rgb(251 251 249 / 0.9);
  transition: transform var(--dur-2) var(--ease-out), opacity var(--dur-1) var(--ease-out);
}
.pin.is-corroborated .pin__dot { border-style: solid; }
.pin.is-single .pin__dot { border-style: dashed; }
.pin.is-speculative .pin__dot { border-style: dotted; }

/* pick state is the fill: your decision, visible geographically */
.pin.is-select .pin__dot { background: var(--ember); border-color: var(--ember); }
.pin.is-maybe .pin__dot { background: var(--ink); border-color: var(--ink); }
.pin.is-skip .pin__dot { background: var(--surface); border-color: var(--ink-4); opacity: 0.6; }

.pin__partner {
  position: absolute;
  top: 0.1rem;
  right: 0.1rem;
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--surface);
  background: var(--ice);
}
.pin__partner.is-select { background: var(--ember-deep); }

/* the thumbnail that the dot blooms into */
/* the thumbnail is always 56px and scales with a transform — animating
   width/height here would relayout the pin layer on every hover */
.pin__thumb {
  position: absolute;
  /* the global img rule caps images at their container's width, and the pin
     is only 32px wide — without this the thumbnail renders as an ellipse */
  max-width: none;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--r-pill);
  object-fit: cover;
  opacity: 0;
  transform: scale(0.18);
  border: 2px solid var(--surface);
  box-shadow: var(--e-3);
  transition: transform var(--dur-2) var(--ease-out), opacity var(--dur-1) var(--ease-out);
  pointer-events: none;
}
.pin__thumb--none { background: var(--bg-deep); }

/* variant A — dots that bloom on hover/focus */
[data-markers="dots"] .pin:hover .pin__thumb,
[data-markers="dots"] .pin:focus-visible .pin__thumb {
  transform: scale(1);
  opacity: 1;
}
[data-markers="dots"] .pin:hover .pin__dot,
[data-markers="dots"] .pin:focus-visible .pin__dot { transform: scale(0); }

/* variant B — always-on thumbnails that enlarge */
[data-markers="thumbs"] .pin__thumb { transform: scale(0.46); opacity: 1; }   /* 26px */
[data-markers="thumbs"] .pin__dot { width: 0.5rem; height: 0.5rem; position: absolute; bottom: -0.15rem; right: -0.15rem; z-index: 1; }
[data-markers="thumbs"] .pin:hover .pin__thumb,
[data-markers="thumbs"] .pin:focus-visible .pin__thumb { transform: scale(1.14); }   /* 64px */
[data-markers="thumbs"] .pin:hover,
[data-markers="thumbs"] .pin:focus-visible { z-index: var(--z-sticky); }

/* a bloomed thumbnail must sit above its neighbours, not under them */
.pin:hover, .pin:focus-visible { z-index: var(--z-sticky); }
.pin.is-dim { opacity: 0.22; filter: saturate(0.2); pointer-events: none; }
.pin.is-measured .pin__dot { box-shadow: 0 0 0 3px var(--ember); }

/* ---------- hover plate ---------- */

.mapcard {
  position: absolute;
  z-index: var(--z-sticky);
  width: 15rem;
  background: var(--glass-hi);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  box-shadow: var(--e-3);
  padding: var(--s-3);
  pointer-events: none;
}
.mapcard[hidden] { display: none; }
.mapcard__top { display: flex; gap: var(--s-3); align-items: center; }
.mapcard__thumb {
  width: 3rem;
  height: 3rem;
  border-radius: var(--r-pill);
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--bg-deep);
}
.mapcard__name { font-weight: 700; color: var(--ink); font-size: var(--t-small); line-height: 1.2; }
.mapcard__where { margin-top: 0.15rem; }
.mapcard__stats { margin-top: var(--s-3); color: var(--ink-2); text-transform: none; letter-spacing: 0.02em; }
.mapcard__coord { margin-top: var(--s-1); }

/* ---------- key + not-yet-located ---------- */

.mapview__side {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: 1fr;
}
@media (min-width: 64rem) { .mapview__side { grid-template-columns: 1fr 1fr; } }

.mapkey {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--s-5);
}
.mapkey h3 { color: var(--ice); font-weight: 400; margin-bottom: var(--s-3); }
.mapkey__list { list-style: none; }
.mapkey__list li {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) 0;
  font-size: var(--t-small);
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-soft);
}
.mapkey__list li:last-child { border-bottom: none; }
.key {
  flex: 0 0 auto;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: var(--r-pill);
  border: 2px solid var(--ink);
  background: var(--surface);
}
.key--single { border-style: dashed; }
.key--speculative { border-style: dotted; }
.key--none { border-style: solid; border-color: var(--line); background: var(--bg-deep); }
.mapkey__pair { margin-top: var(--s-3); color: var(--ink-3); text-transform: none; letter-spacing: 0.02em; }

.mapkey__missing { list-style: none; }
.mapkey__missing li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-3);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--line-soft);
}
.mapkey__missing li:last-child { border-bottom: none; }
.mapkey__missing button {
  font-size: var(--t-small);
  color: var(--ink);
  text-align: left;
  padding-block: var(--s-2);
}
.mapkey__missing button:hover { color: var(--ember-deep); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .pin, .pin__dot, .pin__thumb { transition: none; }
}

/* ============================================================
   DETAIL SHEET EDGE NAV (BUCK) + FIELD CARD (safari pass)
   ============================================================ */

.edgenav {
  position: fixed;
  top: 50%;
  translate: 0 -50%;
  z-index: var(--z-toast);
  width: 5.5rem;
  display: grid;
  gap: var(--s-1);
  justify-items: center;
  padding: var(--s-2);
  background: var(--glass-hi);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  box-shadow: var(--e-2);
  transition: transform var(--dur-2) var(--ease-out);
}
.edgenav--prev { left: var(--s-3); }
.edgenav--next { right: var(--s-3); }
.edgenav:hover { transform: translateY(-50%) scale(1.03); }
.edgenav--prev:hover { transform: translate(var(--s-1), -50%) scale(1.03); }
.edgenav img, .edgenav__ph {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--r-1);
  background: var(--bg-deep);
}
.edgenav__name {
  font-size: 0.625rem;
  line-height: 1.15;
  color: var(--ink-2);
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* the sheet is the whole screen on a phone; edge nav would sit on the copy */
@media (max-width: 60rem) { .edgenav { display: none; } }

.dcard--field h3 { display: flex; align-items: center; gap: var(--s-3); }
.dcard--field h3 .btn { margin-left: auto; }
.dcard--field h3 .btn { text-transform: none; letter-spacing: 0; font-family: var(--font); }

/* the ticket itself: stub, perforation, body, real barcode */
.fieldcard {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  border: 1px solid var(--ink);
  border-radius: var(--r-2);
  overflow: hidden;
  background: var(--surface);
  max-width: 34rem;
}
.fc__stub {
  display: grid;
  align-content: space-between;
  justify-items: center;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  background: var(--ink);
  color: var(--surface);
  /* the perforation */
  border-right: 2px dashed var(--surface);
}
.fc__stubLabel,
.fc__stubId {
  writing-mode: vertical-rl;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.fc__stubId { color: var(--ember); }

.fc__body { padding: var(--s-4); }
.fc__head { display: flex; justify-content: space-between; gap: var(--s-4); align-items: flex-start; }
.fc__name {
  font-size: var(--t-h4);
  font-weight: 800;
  font-stretch: 84%;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
  margin-top: var(--s-1);
  max-width: 18ch;
}
.fc__coords { text-align: right; white-space: nowrap; }

.fc__rows {
  margin-top: var(--s-4);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--s-3) var(--s-4);
  border-top: 1px solid var(--line);
  padding-top: var(--s-3);
}
.fc__rows dt {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ink-3);
}
.fc__rows dd { font-size: var(--t-small); color: var(--ink); margin-top: 0.1rem; }

.fc__foot {
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
}
.fc__barcode { width: 11rem; height: 2.125rem; fill: var(--ink); }

/* printing one card: everything else leaves the page */
@media print {
  body.printing-card .detail__hero,
  body.printing-card .detail__grid > *:not(.dcard--field),
  body.printing-card .detail__close,
  body.printing-card .edgenav,
  body.printing-card .dcard--field h3 .btn { display: none !important; }
  body.printing-card .detail { position: static; overflow: visible; }
  body.printing-card .dcard--field { border: none; padding: 0; }
  .fieldcard { break-inside: avoid; }
  .fc__stub { background: #111 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
