/* ============================================================
   OZTROOPY — navigation chart
   Design tokens. Change these and the whole site follows.
   ============================================================ */

:root {
  /* Ground & surfaces */
  --basalt:      #14181a;   /* page */
  --slate:       #1b2123;   /* panels */
  --slate-hi:    #242c2e;   /* raised panels, inputs */
  --hairline:    #2f3a3b;   /* rules */

  /* Ink */
  --bone:        #e9e6dd;   /* primary text */
  --dust:        #97a09c;   /* secondary text */
  --spinifex:    #c9b27c;   /* labels, eyebrows, map grid */

  /* Interactive */
  --tide:        #45b3a8;   /* links, focus, active */
  --tide-dim:    #2c6f69;

  /* Route hues — one per trip */
  --r-rust:      #d8563a;
  --r-tide:      #45b3a8;
  --r-straw:     #d9a93a;
  --r-sky:       #7fa8db;
  --r-lichen:    #93b45c;
  --r-clay:      #c2755f;
  --r-orchid:    #b184c6;
  --r-rose:      #d4788f;
  --r-jade:      #4fbf86;

  /* Type */
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body:    "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Measure */
  --page:  1240px;
  --gutter: clamp(18px, 4vw, 48px);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--basalt);
  color: var(--bone);
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--tide); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--bone); }
:focus-visible {
  outline: 2px solid var(--tide);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- type scale ---------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 115%;
  line-height: 1.02;
  letter-spacing: -0.005em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 7.2vw, 5.4rem); text-transform: uppercase; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.7rem); text-transform: uppercase; }
h3 { font-size: clamp(1.15rem, 1.9vw, 1.45rem); font-stretch: 105%; }
p  { margin: 0 0 1.1em; max-width: 68ch; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--spinifex);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}
.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--bone); max-width: 60ch; }
.muted { color: var(--dust); }
.mono { font-family: var(--mono); }

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.band { padding-block: clamp(3.2rem, 7vw, 5.6rem); }
.band + .band { border-top: 1px solid var(--hairline); }
.band-tight { padding-block: clamp(2.2rem, 4vw, 3.2rem); }

/* ---------- masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(20, 24, 26, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.masthead-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 62px;
}
.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 1.05rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--bone);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark span { color: var(--spinifex); }
.nav { display: flex; align-items: center; gap: clamp(0.9rem, 2.4vw, 1.9rem); }
.nav a {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--dust);
  text-decoration: none;
  padding-block: 0.35rem;
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--bone); }
.nav a[aria-current="page"] { color: var(--bone); border-bottom-color: var(--spinifex); }

/* ---------- hero ---------- */
.hero { padding-top: clamp(2.4rem, 5vw, 4rem); }
.hero h1 { margin-bottom: 1.1rem; }
.hero-copy { max-width: 46ch; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.6rem, 3vw, 2.6rem);
  align-items: start;
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr); }
}

/* ---------- map ---------- */
.chart {
  position: relative;
  background:
    radial-gradient(120% 90% at 40% 20%, #1d2426 0%, #14181a 72%);
  border: 1px solid var(--hairline);
  padding: clamp(0.6rem, 1.6vw, 1.2rem);
}
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }

.grat { stroke: var(--spinifex); stroke-opacity: 0.1; stroke-width: 1; fill: none; }
.coast {
  fill: #1d2527;
  stroke: var(--spinifex);
  stroke-opacity: 0.55;
  stroke-width: 1.1;
  stroke-linejoin: round;
}
.border-line {
  stroke: var(--spinifex);
  stroke-opacity: 0.26;
  stroke-width: 1;
  stroke-dasharray: 5 5;
  fill: none;
}
.state-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  fill: var(--spinifex);
  fill-opacity: 0.42;
  text-anchor: middle;
}
.town-dot { fill: var(--dust); fill-opacity: 0.55; }
.town-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  fill: var(--dust);
  fill-opacity: 0.72;
}
.home-ring { fill: none; stroke: var(--bone); stroke-width: 1.2; }
.home-dot { fill: var(--bone); }
.home-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  fill: var(--bone);
}

.route-line {
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-width 0.18s ease, opacity 0.18s ease;
}
.route-line.is-planned { stroke-dasharray: 9 7; }
.legend .swatch.is-planned {
  background: repeating-linear-gradient(90deg, var(--sw) 0 6px, transparent 6px 11px);
}
.dist.is-planned, .go.is-planned { color: var(--dust); }
.route-hit { fill: none; stroke: transparent; stroke-width: 20; pointer-events: stroke; cursor: pointer; }
.route-cap { stroke-width: 0; }
.route-group { transition: opacity 0.18s ease; }
.chart.is-hovering .route-group { opacity: 0.22; }
.chart.is-hovering .route-group.is-active { opacity: 1; }
.route-group.is-active .route-line { stroke-width: 4.2; }
.route-group a:focus-visible { outline: none; }
.route-group a:focus-visible .route-line { stroke-width: 4.6; }

.chart-tip {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  background: var(--slate-hi);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--spinifex);
  padding: 0.5rem 0.7rem;
  min-width: 150px;
  opacity: 0;
  transform: translate(-50%, -120%);
  transition: opacity 0.12s ease;
}
.chart-tip.is-on { opacity: 1; }
.chart-tip strong {
  display: block;
  font-family: var(--display);
  font-stretch: 108%;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}
.chart-tip span {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dust);
}

.chart-note {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dust);
  margin-top: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* draw-in animation */
@media (prefers-reduced-motion: no-preference) {
  .route-line.is-drawing {
    stroke-dasharray: var(--len);
    stroke-dashoffset: var(--len);
    animation: draw 1.5s cubic-bezier(0.22, 0.7, 0.24, 1) forwards;
    animation-delay: var(--delay, 0s);
  }
  .route-cap.is-drawing { opacity: 0; animation: fadein 0.5s ease forwards; animation-delay: calc(var(--delay, 0s) + 1.1s); }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }

/* ---------- legend / trip index ---------- */
.legend { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.legend li { border-bottom: 1px solid var(--hairline); }
.legend a {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.85rem;
  padding: 0.85rem 0.2rem;
  text-decoration: none;
  color: var(--bone);
}
.legend a:hover, .legend a:focus-visible { background: var(--slate); color: var(--bone); }
.legend .swatch {
  height: 3px;
  border-radius: 2px;
  align-self: center;
  background: var(--sw, var(--spinifex));
}
.legend .name { font-family: var(--display); font-stretch: 108%; font-weight: 600; font-size: 1.02rem; }
.legend .name small {
  display: block;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dust);
  margin-top: 0.15rem;
}
.legend .dist { font-family: var(--mono); font-size: 0.75rem; color: var(--spinifex); white-space: nowrap; }

/* ---------- instrument strip ---------- */
.cluster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--hairline);
}
@media (min-width: 720px) { .cluster { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cluster div {
  padding: 1.1rem 1.2rem;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
@media (min-width: 720px) { .cluster div { border-bottom: 0; } }
.cluster div:last-child { border-right: 0; }
.cluster dt {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--dust);
  margin-bottom: 0.4rem;
}
.cluster dd {
  margin: 0;
  font-family: var(--display);
  font-stretch: 118%;
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  letter-spacing: -0.01em;
}
.cluster dd sup {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--spinifex);
  vertical-align: super;
  margin-left: 0.25rem;
}

/* ---------- cards ---------- */
.cards {
  display: grid;
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card {
  background: var(--slate);
  padding: 1.5rem 1.4rem 1.6rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  border-top: 3px solid var(--sw, var(--spinifex));
  transition: background 0.16s ease;
}
.card:hover, .card:focus-visible { background: var(--slate-hi); color: inherit; }
.card .meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--dust);
}
.card h3 { color: var(--bone); }
.card p { font-size: 0.94rem; color: var(--dust); }
.card .go {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--spinifex);
}

/* ---------- two column prose ---------- */
.split {
  display: grid;
  gap: clamp(1.6rem, 4vw, 3.4rem);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 880px) {
  .split { grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr); }
}
.split-wide { }
@media (min-width: 880px) {
  .split-wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ---------- spec table ---------- */
.spec { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.spec th, .spec td { text-align: left; padding: 0.72rem 0.2rem; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.spec th {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dust);
  width: 42%;
  white-space: nowrap;
}
.spec td { color: var(--bone); }

/* ---------- mod list ---------- */
.mods { display: grid; gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); grid-template-columns: minmax(0,1fr); }
@media (min-width: 760px) { .mods { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mod { background: var(--slate); padding: 1.4rem; }
.mod h3 { margin-bottom: 0.8rem; }
.mod ul { list-style: none; margin: 0; padding: 0; }
.mod li {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 0.6rem;
  padding: 0.45rem 0;
  font-size: 0.93rem;
  border-bottom: 1px dashed rgba(201, 178, 124, 0.14);
}
.mod li:last-child { border-bottom: 0; }
.mod li::before { content: "▸"; color: var(--spinifex); font-size: 0.7rem; line-height: 1.9; }
.mod li b { font-weight: 600; }
/* the description is a third grid item, so it must be pinned to the text
   column — otherwise it auto-places into the 14px bullet column */
.mod li em {
  grid-column: 2;
  min-width: 0;
  font-style: normal;
  color: var(--dust);
  display: block;
  font-size: 0.86rem;
  margin-top: 0.15rem;
}

/* ---------- waypoint log ---------- */
.log { list-style: none; margin: 0; padding: 0; }
.log li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 1rem;
  padding-bottom: 1.5rem;
  position: relative;
}
.log li::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 14px;
  bottom: -2px;
  width: 1px;
  background: var(--hairline);
}
.log li:last-child { padding-bottom: 0; }
.log li:last-child::before { display: none; }
.log .pin {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--basalt);
  border: 2px solid var(--sw, var(--spinifex));
  margin-top: 8px;
  position: relative;
  z-index: 1;
  justify-self: center;
}
.log .wp-name { font-family: var(--display); font-stretch: 108%; font-weight: 600; font-size: 1.05rem; }
.log .wp-coord {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--spinifex);
  margin-bottom: 0.3rem;
}
.log .wp-note { font-size: 0.94rem; color: var(--dust); max-width: 60ch; }

/* ---------- photo placeholders ---------- */
.frames { display: grid; gap: 1rem; align-items: start; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.frame {
  aspect-ratio: 4 / 3;
  background:
    repeating-linear-gradient(135deg, rgba(201,178,124,0.05) 0 10px, transparent 10px 20px),
    var(--slate);
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}
.frame span {
  padding: 1rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dust);
}
/* default: whole photo, letterboxed inside a uniform 4:3 box */
.frame img { width: 100%; height: 100%; object-fit: contain; }

/* a photo fills the box edge to edge, so drop the placeholder hatching */
.frame:has(img) { background: var(--slate); }

/* is-crop: fill the box and trim the overflow (the old default) */
.frame.is-crop img { object-fit: cover; }

/* is-full: frame takes the photo's own shape, nothing trimmed */
.frame.is-full { aspect-ratio: auto; }
.frame.is-full img { height: auto; object-fit: contain; }
.frame.is-full .frame-link { height: auto; }

/* click through to the full-size file */
.frame-link {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
}
.frame-link::after {
  content: "\2197";
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1;
  color: var(--bone);
  background: rgba(20, 24, 26, 0.75);
  border: 1px solid var(--hairline);
  padding: 4px 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.frame-link:hover::after, .frame-link:focus-visible::after { opacity: 1; }
.frame-link:focus-visible { outline: 2px solid var(--tide); outline-offset: -2px; }

/* ---------- pull quote / field note ---------- */
.note {
  border-left: 3px solid var(--spinifex);
  background: var(--slate);
  padding: 1.2rem 1.3rem;
  margin: 1.8rem 0;
}
.note p { font-size: 1.02rem; }
.note .by {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--spinifex);
  margin-top: 0.6rem;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.73rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--basalt);
  background: var(--spinifex);
  padding: 0.72rem 1.15rem;
  text-decoration: none;
  border: 1px solid var(--spinifex);
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover, .btn:focus-visible { background: transparent; color: var(--spinifex); }
.btn-ghost { background: transparent; color: var(--bone); border-color: var(--hairline); }
.btn-ghost:hover, .btn-ghost:focus-visible { background: transparent; color: var(--spinifex); border-color: var(--spinifex); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.6rem; }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.4rem; }
.chip {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--dust);
  background: transparent;
  border: 1px solid var(--hairline);
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}
.chip:hover { color: var(--bone); border-color: var(--spinifex); }
.chip[aria-pressed="true"] { color: var(--basalt); background: var(--spinifex); border-color: var(--spinifex); }
.chip-toggle { margin-left: auto; }

/* map key */
.chart-key {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin: 0.9rem 0 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dust);
}
.chart-key span { display: inline-flex; align-items: center; gap: 0.5rem; }
.chart-key .k-line {
  display: inline-block;
  width: 26px;
  height: 0;
  border-top: 2px solid var(--spinifex);
}
.chart-key .k-dash { border-top-style: dashed; }
.chart-key + .chart-note { margin-top: 0.45rem; }

/* ---------- trip header ---------- */
.trip-head { border-bottom: 1px solid var(--hairline); }
.trip-head .rule { height: 4px; background: var(--sw, var(--spinifex)); width: 84px; margin-bottom: 1.4rem; }
.crumb {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dust);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 1.6rem;
}
.crumb:hover { color: var(--spinifex); }

.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.pager a { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.13em; text-transform: uppercase; text-decoration: none; color: var(--dust); }
.pager a:hover { color: var(--spinifex); }
.pager b { display: block; font-family: var(--display); font-stretch: 108%; font-size: 1.05rem; color: var(--bone); text-transform: none; letter-spacing: 0; margin-top: 0.25rem; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--hairline); padding-block: 2.6rem 3.4rem; }
.foot-in { display: flex; justify-content: space-between; gap: 1.4rem; flex-wrap: wrap; align-items: flex-end; }
.foot .mark { font-family: var(--display); font-stretch: 125%; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; font-size: 1rem; }
.foot p { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--dust); text-transform: uppercase; }
.foot a { color: var(--spinifex); text-decoration: none; }
.foot a:hover { color: var(--bone); text-decoration: underline; }

/* ---------- helpers ---------- */
.stack > * + * { margin-top: 1.5rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
