/* shannatthew.com — v1 */

:root {
  --paper: #eef2ee;
  --surface: #f8faf7;
  --ink: #17313b;
  --muted: #586c70;
  --rule: #d3dcd6;
  --on-region: #ffffff;

  /* One colour per leg of the trip */
  --r-sea: #1d8466; /* Southeast Asia: jungle green */
  --r-jp: #c8402f;  /* Japan: torii vermilion */
  --r-eu: #2c66a8;  /* Europe: alpine blue */
  --r-ko: #8447a1;  /* Korea: plum */
  --r-cn: #96670b;  /* China and Hong Kong: ochre */
  --r-other: #586c70;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --gutter: clamp(16px, 4vw, 40px);
  --ribbon-h: 132px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #13252b;
    --surface: #1a3038;
    --ink: #e3ece8;
    --muted: #9db2b3;
    --rule: #2b444d;
    --on-region: #10232a;
    --r-sea: #46b892;
    --r-jp: #f0705f;
    --r-eu: #6ba1e0;
    --r-ko: #bb8ad6;
    --r-cn: #e0ae45;
    --r-other: #9db2b3;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-optical-sizing: auto;
  font-size: 16px;
  line-height: 1.5;
}

a { color: inherit; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

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

.masthead,
main,
.colophon {
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Masthead and hero ---------- */

.masthead { padding-block: 20px 0; }

.wordmark {
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.preview {
  margin: 16px 0 0;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9rem;
}

.hero { margin-top: clamp(28px, 7vw, 80px); }

.hero h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(2.6rem, 7.4vw, 5.6rem);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.status {
  margin: clamp(16px, 2.5vw, 28px) 0 0;
  max-width: 34ch;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  line-height: 1.3;
}
.status.is-error { color: var(--r-jp); font-family: var(--display); font-size: 1.05rem; max-width: 60ch; }

.facts {
  margin: 10px 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.money {
  margin: 6px 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.money a { color: var(--ink); text-underline-offset: 3px; }

/* ---------- The year ribbon ---------- */

.year { margin: clamp(32px, 5vw, 56px) 0 20px; }

.ribbon { position: relative; padding: 26px 0 30px; }

.ribbon-regions { position: absolute; inset: 0 0 auto 0; height: 22px; }

.ribbon-region {
  position: absolute;
  top: 0;
  padding-left: 6px;
  border-left: 2px solid var(--c);
  color: var(--c);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.2s;
}

.ribbon-band { position: relative; height: var(--ribbon-h); }

.seg {
  position: absolute;
  top: 0;
  bottom: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--c);
  box-shadow: inset -1px 0 0 var(--paper);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s;
}
.seg[data-tone="1"] { background: color-mix(in oklab, var(--c) 80%, var(--ink)); }
.seg:hover { transform: translateY(-5px); }
.seg.is-selected { transform: translateY(-8px); box-shadow: 0 0 0 2px var(--ink); z-index: 2; }
.seg.is-past { opacity: 0.5; }
.seg.is-dim, .ribbon-region.is-dim { opacity: 0.16; }
.seg:focus-visible { outline-offset: 0; z-index: 3; }

.seg-label {
  position: absolute;
  bottom: 8px;
  left: 50%;
  max-height: calc(100% - 16px);
  writing-mode: vertical-rl;
  transform: translateX(-50%) rotate(180deg);
  color: var(--on-region);
  font-size: 11px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.seg.no-label .seg-label { display: none; }

.today {
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
  pointer-events: none;
  z-index: 4;
}
.today span {
  position: absolute;
  top: 0;
  left: 6px;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.ribbon-months { position: relative; height: 20px; margin-top: 8px; }
.month {
  position: absolute;
  top: 0;
  height: 18px;
  padding-left: 4px;
  border-left: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 18px;
  white-space: nowrap;
}

.tip {
  position: absolute;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.85rem;
  line-height: 1.3;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}
.tip[hidden] { display: none; }
.tip strong { font-weight: 650; }

/* ---------- Filters ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 32px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 500 0.92rem/1.2 var(--display);
  cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }

/* ---------- Itinerary and map ---------- */

.explore {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(24px, 3.5vw, 48px);
  align-items: start;
}

.map-wrap {
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 8px;
}
#map { height: 100%; }
.map-error { padding: 24px; color: var(--muted); }

.region + .region { margin-top: 56px; }

.region-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding-top: 12px;
  border-top: 4px solid var(--c);
}
.region-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.region-head p { margin: 0; color: var(--muted); font-size: 0.92rem; font-variant-numeric: tabular-nums; }

.country { margin-top: 28px; }
.country h3 {
  margin: 0 0 8px;
  color: var(--c);
  font-size: 1.05rem;
  font-weight: 650;
}
.country h3 span { margin-left: 6px; color: var(--muted); font-weight: 400; font-size: 0.9rem; }

.stops { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }

.stop {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 16px;
  margin-inline: -12px;
  padding: 16px 12px 18px;
  border-bottom: 1px solid var(--rule);
  border-radius: 6px;
  cursor: pointer;
  scroll-margin: 24px;
}
.stop:hover .place { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.stop.is-selected { background: color-mix(in oklab, var(--c) 13%, var(--surface)); }
.stop.is-past > * { opacity: 0.6; }

.when { display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; }
.when .dates { font-weight: 600; font-size: 0.95rem; white-space: nowrap; }
.when .nights { color: var(--muted); font-size: 0.85rem; }
.when .here {
  align-self: flex-start;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--c);
  color: var(--on-region);
  font-size: 0.75rem;
  font-weight: 600;
}

.what h4 { margin: 0; }
.place {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 650 1.3rem/1.2 var(--display);
  letter-spacing: -0.012em;
  text-align: left;
  cursor: pointer;
}

.summary {
  margin: 4px 0 0;
  max-width: 58ch;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.45;
}
.highlights {
  margin: 6px 0 0;
  max-width: 58ch;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.5;
}
.getting {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}
.icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.tags li {
  padding: 1px 7px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

/* ---------- Costs ---------- */

/* Categories share one hue, light to dark, so they never compete with the region colours */
.cat-lodging { background: var(--ink); }
.cat-food { background: color-mix(in oklab, var(--ink) 78%, var(--paper)); }
.cat-activities { background: color-mix(in oklab, var(--ink) 60%, var(--paper)); }
.cat-diving { background: color-mix(in oklab, var(--ink) 44%, var(--paper)); }
.cat-flights { background: color-mix(in oklab, var(--ink) 33%, var(--paper)); }
.cat-fixed { background: color-mix(in oklab, var(--ink) 24%, var(--paper)); }

.cost { margin-top: 12px; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.cost summary {
  display: list-item;
  color: var(--muted);
  cursor: pointer;
  list-style-position: inside;
}
.cost summary:hover { color: var(--ink); }
.cost[open] summary { color: var(--ink); }
.cost .spent { color: var(--ink); font-weight: 600; }
.cost .is-over { color: var(--r-jp); }
.cost table { margin-top: 8px; border-collapse: collapse; }
.cost th, .cost td { padding: 3px 0; text-align: left; font-weight: 400; }
.cost tbody th { padding-right: 20px; color: var(--muted); }
.cost td { padding-left: 16px; text-align: right; }
.cost thead th { color: var(--muted); font-size: 0.78rem; text-align: right; }

.costs { margin-top: 72px; scroll-margin-top: 24px; }
.costs h2 {
  margin: 0;
  padding-top: 12px;
  border-top: 4px solid var(--ink);
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.costs-lead {
  margin: 10px 0 0;
  max-width: 62ch;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.45;
}

.cost-bar {
  display: flex;
  gap: 2px;
  height: 14px;
  margin-top: 24px;
  max-width: 820px;
}
.cost-bar span { flex-basis: 0; min-width: 2px; }
.cost-bar span:first-child { border-radius: 3px 0 0 3px; }
.cost-bar span:last-child { border-radius: 0 3px 3px 0; }

.cost-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.cost-legend li { display: flex; align-items: center; gap: 6px; }
.cost-legend strong { color: var(--ink); font-weight: 600; }
.swatch { width: 10px; height: 10px; border-radius: 2px; }

.table-wrap { margin-top: 24px; max-width: 820px; overflow-x: auto; }
.costs-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.costs-table th, .costs-table td { padding: 10px 12px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
.costs-table th:first-child { padding-left: 0; text-align: left; }
.costs-table td:last-child, .costs-table th:last-child { padding-right: 0; }
.costs-table thead th { color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.costs-table tbody th { font-weight: 600; }
.costs-table tbody th > span { display: inline-flex; align-items: center; gap: 8px; }
.costs-table .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.costs-table tfoot th, .costs-table tfoot td { border-bottom: 0; border-top: 2px solid var(--ink); font-weight: 700; }
.costs-table .is-over { color: var(--r-jp); }

/* ---------- Leaflet, restyled ---------- */

.leaflet-container { background: var(--paper); font-family: var(--display); }
.leaflet-popup-content-wrapper,
.leaflet-popup-tip { background: var(--surface); color: var(--ink); }
.leaflet-popup-content-wrapper { border-radius: 8px; box-shadow: 0 6px 24px rgb(0 0 0 / 0.18); }
.leaflet-popup-content { margin: 12px 16px 14px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-tooltip {
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font: 600 0.8rem/1.2 var(--display);
  box-shadow: none;
}
.leaflet-tooltip-top::before { border-top-color: var(--ink); }
.leaflet-bar a { background: var(--surface); color: var(--ink); border-bottom-color: var(--rule); }
.leaflet-bar a:hover { background: var(--paper); }
.leaflet-control-attribution { background: color-mix(in oklab, var(--surface) 85%, transparent) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--ink); }

.pop p { margin: 0; }
.pop-place { font-weight: 650; font-size: 1.05rem; line-height: 1.25; }
.pop-country { color: var(--muted); font-size: 0.85rem; }
.pop-dates { margin-top: 6px !important; font-weight: 600; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.pop-dates + .pop-dates { margin-top: 0 !important; }
.pop-summary { margin-top: 6px !important; font-family: var(--serif); font-size: 0.98rem; line-height: 1.4; }

.now-pin span {
  display: block;
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  from { transform: scale(0.45); opacity: 1; }
  to { transform: scale(1.7); opacity: 0; }
}

/* ---------- Footer ---------- */

.colophon { margin-block: 72px 40px; color: var(--muted); font-size: 0.9rem; }
.colophon p { margin: 0; padding-top: 16px; border-top: 1px solid var(--rule); }

/* ---------- Smaller screens ---------- */

@media (max-width: 900px) {
  .explore { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .map-wrap {
    order: -1;
    top: 0;
    z-index: 10;
    height: 42vh;
    height: 42dvh;
    margin: 0 calc(-1 * var(--gutter)) 24px;
    border-width: 0 0 1px;
    border-radius: 0;
  }
  .stop { scroll-margin-top: calc(42vh + 16px); }
}

@media (max-width: 640px) {
  :root { --ribbon-h: 96px; }
  .ribbon { padding-top: 0; }
  .ribbon-regions { display: none; }
  .month span { display: none; }
  .month::before { content: attr(data-short); }
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: calc(-1 * var(--gutter));
    padding: 2px var(--gutter) 6px;
    scrollbar-width: none;
  }
  .chip { flex: none; }
  .stop { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .when { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
  .when .here { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .seg, .ribbon-region { transition: none; }
  .now-pin span { animation: none; transform: scale(0.8); }
}
