/* ==========================================================================
   SmartTrip Tanzania — design system
   Palette anchor: tanzanite (the gemstone found only in Tanzania, at the foot
   of Kilimanjaro). Six tokens. No hex value appears outside this block.
   ========================================================================== */

:root {
  --color-primary: #262E63;   /* tanzanite ink — narrative field */
  --color-surface: #E8E9E3;   /* Ngorongoro ash — working surface */
  --color-accent:  #A32C24;   /* shuka red — the route, the total, the act */
  --color-text:    #12162E;   /* ink */
  --color-muted:   #545A7A;   /* blue-grey, secondary */
  --color-border:  #787C71;   /* stone rule — 3.5:1 on ash, passes WCAG 1.4.11 */

  --font-display: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --font-body: "Chivo", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Chivo Mono", ui-monospace, "SFMono-Regular", monospace;

  --fs-display: clamp(2.9rem, 8.4vw, 6.6rem);
  --fs-h1: clamp(2.1rem, 4.6vw, 3.4rem);
  --fs-h2: clamp(1.55rem, 3vw, 2.35rem);
  --fs-h3: 1.2rem;
  --fs-body: 1.0625rem;
  --fs-caption: 0.9375rem;
  --fs-label: 0.7rem;

  --sp-1: 0.375rem;
  --sp-2: 0.75rem;
  --sp-3: 1.25rem;
  --sp-4: 2rem;
  --sp-5: 3.25rem;
  --sp-6: 5rem;
  --sp-7: 8rem;

  --rule: 1px solid var(--color-border);
  --wrap: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }

/* ---------- type ---------- */
h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.08; letter-spacing: -0.015em; }
.display { font-family: var(--font-display); font-size: var(--fs-display); line-height: 0.96; letter-spacing: -0.03em; }
h1 { font-family: var(--font-display); font-size: var(--fs-h1); }
h2 { font-family: var(--font-display); font-size: var(--fs-h2); }
h3 { font-family: var(--font-body); font-size: var(--fs-h3); font-weight: 600; letter-spacing: 0; line-height: 1.35; }
p { margin: 0 0 var(--sp-3); max-width: 62ch; }
.lede { font-size: clamp(1.1rem, 1.9vw, 1.4rem); line-height: 1.5; color: var(--color-text); }
.label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.19em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-muted);
  margin: 0 0 var(--sp-3);
  display: block;
}
.caption { font-size: var(--fs-caption); color: var(--color-muted); max-width: 56ch; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }

:where(a, button, select, input, summary):focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}
/* On the tanzanite field the shuka red would sit at 1.8:1 — the ring switches
   to the ash tone there, which holds 10.4:1. */
.ink :where(a, button, select, input, summary):focus-visible,
.site-head :where(a, button):focus-visible,
.hero :where(a, button):focus-visible,
.site-foot :where(a, button):focus-visible {
  outline-color: var(--color-surface);
}
.hero .builder :where(a, button, select, input, summary):focus-visible {
  outline-color: var(--color-accent);
}

/* ---------- layout ---------- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.band { padding: var(--sp-6) 0; }
.band--tall { padding: var(--sp-7) 0; }
.ink {
  background: var(--color-primary);
  color: var(--color-surface);
}
.ink .label, .ink .caption { color: var(--color-surface); opacity: 0.72; }
.ink a { color: var(--color-surface); }
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--color-accent); color: var(--color-surface);
  padding: var(--sp-2) var(--sp-3); text-decoration: none;
}
.skip:focus { left: 0; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: var(--color-primary);
  color: var(--color-surface);
  border-bottom: 1px solid color-mix(in srgb, var(--color-surface) 18%, transparent);
}
.site-head__in { display: flex; align-items: center; gap: var(--sp-4); min-height: 68px; }
.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; color: inherit; margin-right: auto; }
.brand svg { width: 30px; height: 30px; flex: none; }
.mark__route { stroke: var(--color-accent); fill: none; }
.mark__node { fill: var(--color-accent); }
.brand b { font-weight: 700; font-size: 1.06rem; letter-spacing: -0.02em; display: block; line-height: 1; }
.brand small {
  font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.28em;
  text-transform: uppercase; opacity: 0.7; display: block; margin-top: 3px;
}
.site-nav { display: flex; gap: var(--sp-3); align-items: center; }
.site-nav a {
  font-size: var(--fs-caption); text-decoration: none; padding: 0.4rem 0;
  border-bottom: 2px solid transparent; opacity: 0.86;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { opacity: 1; border-bottom-color: var(--color-surface); }
@media (max-width: 640px) {
  .site-head { position: static; }
  .site-head__in { flex-wrap: wrap; padding-bottom: var(--sp-2); min-height: 0; padding-top: var(--sp-2); }
  .site-nav { width: 100%; gap: var(--sp-4); overflow-x: auto; padding-bottom: 2px; }
  .site-nav a { white-space: nowrap; flex: none; }
  .sticky { position: static; }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--color-primary); color: var(--color-surface); }
.hero__terrain {
  position: absolute; inset: -6% -4%; width: 108%; height: 112%;
  opacity: 0.5; object-fit: cover; pointer-events: none;
  animation: drift 44s var(--ease) infinite alternate;
}
@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-2.2%, 1.6%, 0) scale(1.06); } }
.hero__in {
  position: relative;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--sp-5);
  align-items: center;
  padding: var(--sp-6) 0 var(--sp-6);
  min-height: min(88vh, 780px);
}
.hero__claim { max-width: 15ch; }
.hero p { color: var(--color-surface); opacity: 0.86; }
.hero__meta {
  display: flex; flex-wrap: wrap; gap: var(--sp-4);
  border-top: 1px solid color-mix(in srgb, var(--color-surface) 22%, transparent);
  padding-top: var(--sp-3); margin-top: var(--sp-4);
}
.hero__meta div { min-width: 8rem; }
.hero__meta b { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 600; display: block; }
.hero__meta small { font-size: var(--fs-label); letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.7; }
@media (max-width: 900px) {
  .hero__in { grid-template-columns: 1fr; min-height: 0; padding: var(--sp-5) 0; }
  .hero__claim { max-width: 100%; }
}

/* ---------- the builder ---------- */
.builder {
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-border);
  box-shadow: 0 26px 60px -30px color-mix(in srgb, var(--color-text) 70%, transparent);
}
.builder__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
  border-bottom: var(--rule);
}
.builder__head .label { margin: 0; }
.builder__head em { font-style: normal; font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-muted); }
.builder__body { padding: var(--sp-3); display: grid; gap: var(--sp-3); }
.field { display: grid; gap: var(--sp-1); }
.field > label { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.16em; text-transform: uppercase; color: var(--color-muted); font-weight: 600; }
select, .num {
  width: 100%; padding: 0.6rem 0.7rem; background: transparent;
  border: 1px solid var(--color-border); border-radius: 0;
  font-size: var(--fs-body);
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--color-text) 50%), linear-gradient(135deg, var(--color-text) 50%, transparent 50%); background-position: right 1rem center, right 0.7rem center; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 2.2rem; }
input[type="range"] { width: 100%; accent-color: var(--color-accent); }
.field--range .rowline { display: flex; justify-content: space-between; align-items: baseline; }
.field--range output { font-family: var(--font-mono); font-weight: 600; font-size: 1.05rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.chip span {
  display: block; padding: 0.34rem 0.7rem; border: 1px solid var(--color-border);
  font-size: var(--fs-caption); transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.chip input:checked + span { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-surface); }
.chip input:focus-visible + span { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* ---------- the signature: the live ledger ---------- */
.ledger { border-top: 2px solid var(--color-text); margin-top: var(--sp-2); }
.ledger__row {
  display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2);
  padding: 0.42rem 0; border-bottom: 1px dotted var(--color-border);
  font-family: var(--font-mono); font-size: var(--fs-caption);
  animation: settle 0.34s var(--ease);
}
@keyframes settle { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ledger__row i { font-style: normal; color: var(--color-muted); }
.ledger__row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ledger__total {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2);
  padding-top: var(--sp-2); margin-top: var(--sp-1);
  border-top: 2px solid var(--color-text);
}
.ledger__total span { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.16em; text-transform: uppercase; color: var(--color-muted); font-weight: 600; }
.ledger__total strong {
  font-family: var(--font-mono); font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  font-weight: 600; color: var(--color-accent); font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.ledger__foot { font-size: var(--fs-label); letter-spacing: 0.08em; color: var(--color-muted); font-family: var(--font-mono); text-transform: uppercase; margin-top: var(--sp-1); }

.btn {
  display: inline-flex; align-items: center; gap: 0.6rem; justify-content: center;
  background: var(--color-accent); color: var(--color-surface);
  border: 1px solid var(--color-accent); padding: 0.78rem 1.4rem; cursor: pointer;
  font-weight: 600; font-size: var(--fs-caption); letter-spacing: 0.04em;
  text-decoration: none; transition: background 0.18s var(--ease);
}
.btn:hover { background: var(--color-text); border-color: var(--color-text); }
.btn--ghost { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn--ghost:hover { background: var(--color-text); color: var(--color-surface); border-color: var(--color-text); }
.ink .btn--ghost { color: var(--color-surface); border-color: color-mix(in srgb, var(--color-surface) 45%, transparent); }
.ink .btn--ghost:hover { background: var(--color-surface); color: var(--color-primary); }

/* ---------- itinerary output ---------- */
.plan-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--sp-5); align-items: start; }
@media (max-width: 960px) { .plan-grid { grid-template-columns: 1fr; } }
.sticky { position: sticky; top: 92px; }

.days { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--color-text); }
.day {
  display: grid; grid-template-columns: 5.2rem 1fr auto; gap: var(--sp-3);
  padding: var(--sp-3) 0; border-bottom: var(--rule); align-items: start;
}
.day__n { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-muted); font-weight: 600; padding-top: 0.35rem; }
.day__where { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.15; margin-bottom: 0.2rem; }
.day__note { font-size: var(--fs-caption); color: var(--color-muted); margin: 0; max-width: 46ch; }
.day__cost { font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 0.35rem; }
.day__leg { font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-accent); letter-spacing: 0.1em; text-transform: uppercase; display: block; margin-top: 0.35rem; }
@media (max-width: 560px) {
  .day { grid-template-columns: 1fr auto; }
  .day__n { grid-column: 1 / -1; padding-top: 0; }
}

/* ---------- editorial index (platform modules) ---------- */
.index { border-top: 2px solid currentColor; }
.index__item { border-bottom: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.index__item > summary {
  display: grid; grid-template-columns: 1fr auto; gap: var(--sp-3); align-items: center;
  padding: var(--sp-3) 0; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-size: clamp(1.35rem, 2.6vw, 1.95rem); line-height: 1.15;
}
.index__item > summary::-webkit-details-marker { display: none; }
.index__item > summary::after { content: "+"; font-family: var(--font-mono); font-size: 1.5rem; opacity: 0.6; }
.index__item[open] > summary::after { content: "\2212"; }
.index__item > summary:hover { color: var(--color-accent); }
.ink .index__item > summary:hover { color: var(--color-surface); opacity: 0.7; }
.index__body { padding: 0 0 var(--sp-4); max-width: 66ch; }
.index__body p:last-child { margin-bottom: 0; }

/* ---------- figures ---------- */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-4); }
.figure { border-top: 2px solid currentColor; padding-top: var(--sp-2); }
.figure b { display: block; font-family: var(--font-mono); font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.figure span { display: block; font-size: var(--fs-caption); margin-top: var(--sp-2); opacity: 0.82; }

/* ---------- revenue bars ---------- */
.bars { margin: var(--sp-4) 0 0; padding: 0; list-style: none; }
.bars li { display: grid; grid-template-columns: 4.5rem 1fr 6.5rem; gap: var(--sp-3); align-items: center; padding: 0.55rem 0; border-bottom: 1px solid color-mix(in srgb, currentColor 26%, transparent); }
.bars .yr { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.72; }
.bars .track { height: 10px; background: color-mix(in srgb, currentColor 18%, transparent); position: relative; overflow: hidden; }
.bars .fill { position: absolute; inset: 0 auto 0 0; background: var(--color-accent); width: 0; transition: width 1.1s var(--ease); }
.bars .val { font-family: var(--font-mono); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- split ---------- */
.split { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: var(--sp-5); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: var(--sp-4); } }

.callout {
  border-left: 3px solid var(--color-accent); padding-left: var(--sp-3);
  font-family: var(--font-display); font-size: clamp(1.3rem, 2.4vw, 1.85rem); line-height: 1.25;
  max-width: 30ch;
}

/* ---------- reveal ---------- */
/* The reveal moves, it never hides: text is legible in the page's rest state,
   which is what a thumbnail, a shared link and a skim-reader all get. */
.rise { transform: translateY(16px); transition: transform 0.7s var(--ease); }
.rise.in { transform: none; }
@media (prefers-reduced-motion: reduce) { .rise { transform: none; } }

/* ---------- footer ---------- */
.site-foot { background: var(--color-text); color: var(--color-surface); padding: var(--sp-5) 0 var(--sp-4); }
.site-foot__in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--sp-4); }
@media (max-width: 760px) { .site-foot__in { grid-template-columns: 1fr 1fr; } }
.site-foot h3 { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.78; margin-bottom: var(--sp-2); font-weight: 600; }
.site-foot .caption { color: var(--color-surface); }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.site-foot a { text-decoration: underline; text-underline-offset: 3px; }
.foot-rule { border: 0; border-top: 1px solid color-mix(in srgb, var(--color-surface) 22%, transparent); margin: var(--sp-4) 0 var(--sp-3); }
.built { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.72; margin: 0; }

/* ==========================================================================
   Marketplace — guides and stays
   Rows, not cards: the listing repeats the ledger and day-by-day structure so
   the whole site reads as one system.
   ========================================================================== */
.filters {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--sp-3);
  display: grid; gap: var(--sp-3);
}
.filters__row { display: grid; gap: var(--sp-2); }
.filters__row > .label { margin: 0; }
.filters__top { display: grid; grid-template-columns: 1.6fr 1fr auto; gap: var(--sp-3); align-items: end; }
@media (max-width: 760px) { .filters__top { grid-template-columns: 1fr; } }
.filters__facets { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--sp-3); }

input[type="search"], input[type="text"] {
  width: 100%; padding: 0.6rem 0.7rem; background: transparent;
  border: 1px solid var(--color-border); border-radius: 0; font-size: var(--fs-body);
}
input[type="search"]::placeholder { color: var(--color-muted); }

.results-bar {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--sp-3); flex-wrap: wrap;
  margin: var(--sp-4) 0 var(--sp-2);
}
.results-bar b {
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.16em;
  text-transform: uppercase; font-weight: 600;
}

.listing { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--color-text); }
.listing__row {
  display: grid; grid-template-columns: 1fr 6.5rem 8.5rem 12rem;
  gap: var(--sp-3); align-items: start;
  padding: var(--sp-3) 0; border-bottom: var(--rule);
}
.listing__name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 400; line-height: 1.15; letter-spacing: -0.015em; }
.listing__meta {
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--color-muted); margin: 0.35rem 0 0.5rem;
}
.listing__note { font-size: var(--fs-caption); color: var(--color-muted); margin: 0 0 0.55rem; max-width: 52ch; }
.tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tag {
  font-size: 0.78rem; padding: 0.16rem 0.5rem;
  border: 1px solid var(--color-border); color: var(--color-muted);
}
.listing__num { text-align: right; }
.listing__num b {
  display: block; font-family: var(--font-mono); font-size: 1.15rem; font-weight: 600;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.listing__num small { display: block; font-size: var(--fs-label); color: var(--color-muted); letter-spacing: 0.06em; margin-top: 0.2rem; }
.listing__act { display: grid; gap: 0.45rem; justify-items: start; }
.avail {
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--color-muted); font-weight: 600;
}
.avail--now { color: var(--color-accent); }
.btn--sm { padding: 0.4rem 0.8rem; font-size: 0.82rem; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.req-note { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; color: var(--color-muted); max-width: 16rem; }
.empty { padding: var(--sp-4) 0; border-bottom: var(--rule); }
.empty p { margin: 0; }

@media (max-width: 1040px) {
  .listing__row { grid-template-columns: 1fr 7rem 9rem; }
  .listing__act { grid-column: 2 / -1; justify-items: end; text-align: right; }
}
@media (max-width: 620px) {
  .listing__row { grid-template-columns: 1fr auto; }
  .listing__main { grid-column: 1 / -1; }
  .listing__num { text-align: left; }
  .listing__num:nth-of-type(3) { text-align: right; }
  .listing__act { grid-column: 1 / -1; justify-items: start; text-align: left; }
}
