:root {
  --paper: #f4edda;
  --paper-deep: #e8ddc3;
  --ink: #171713;
  --muted: #625f56;
  --wine: #6f2338;
  --wine-deep: #491322;
  --sea: #153e4b;
  --sea-deep: #0c2933;
  --route: #f0b94d;
  --route-pale: #ffe0a1;
  --green: #2d6c5b;
  --red: #b4473d;
  --line: rgba(23, 23, 19, .22);
  --shadow: 0 16px 50px rgba(31, 23, 13, .13);
  --radius: 22px;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(255,255,255,.72), transparent 28rem),
    repeating-linear-gradient(0deg, rgba(65,49,31,.018) 0, rgba(65,49,31,.018) 1px, transparent 1px, transparent 4px),
    var(--paper);
  font-family: var(--sans);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--route); color: var(--ink); }
a { color: inherit; }
button, select, input { font: inherit; }
button { color: inherit; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: .7rem 1rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 3vw, 3rem);
  color: var(--paper);
}
.brand {
  font-size: .76rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  font-weight: 750;
}
.header-actions { display: flex; align-items: center; gap: .65rem; }
.lang-link,
.header-link {
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 999px;
  padding: .38rem .72rem;
  text-decoration: none;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  backdrop-filter: blur(10px);
  background: rgba(10, 30, 35, .25);
}
.lang-link:hover, .header-link:hover { background: rgba(255,255,255,.16); }

.hero {
  position: relative;
  min-height: min(900px, 100svh);
  overflow: hidden;
  color: var(--paper);
  background:
    linear-gradient(115deg, rgba(11,38,46,.98) 0 45%, rgba(15,49,60,.93) 65%, rgba(31,77,82,.9)),
    var(--sea);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, .92fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 7rem);
  padding: clamp(7rem, 12vh, 9rem) clamp(1.25rem, 5vw, 6rem) clamp(4rem, 8vh, 6rem);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .17;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 40%, transparent 0 28%, rgba(255,255,255,.11) 28.2% 28.5%, transparent 28.7%),
    repeating-linear-gradient(13deg, transparent 0 35px, rgba(255,255,255,.07) 36px, transparent 37px 79px);
}
.hero-copy, .hero-passport { position: relative; z-index: 2; }
.eyebrow {
  margin: 0 0 1rem;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--route-pale);
}
h1 {
  max-width: 10ch;
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3.35rem, 7.2vw, 7.9rem);
  line-height: .92;
  letter-spacing: -.045em;
}
.hero-deck {
  max-width: 40rem;
  margin: 1.7rem 0 0;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  color: rgba(244,237,218,.84);
}
.hero-deck strong { color: var(--paper); }
.hero-cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 46px;
  padding: .72rem 1.05rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  background: var(--route);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(0,0,0,.22);
}
.cta.secondary {
  background: transparent;
  color: var(--paper);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: none;
}
.cta:hover { transform: translateY(-1px); }

.hero-passport {
  width: min(100%, 520px);
  justify-self: center;
  padding: clamp(1.4rem, 3vw, 2.4rem);
  color: var(--ink);
  background: var(--paper);
  border-radius: 9px 24px 24px 9px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  transform: rotate(1.2deg);
}
.hero-passport::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 12px;
  border-left: 1px dashed rgba(23,23,19,.25);
}
.passport-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}
.passport-label {
  font-size: .68rem;
  text-transform: uppercase;
  font-weight: 850;
  letter-spacing: .15em;
  color: var(--muted);
}
.hero-number {
  font-family: var(--serif);
  font-size: clamp(6.5rem, 14vw, 11rem);
  line-height: .7;
  color: var(--wine);
  letter-spacing: -.08em;
}
.number-caption {
  max-width: 11rem;
  margin-top: .5rem;
  font-size: .82rem;
  line-height: 1.35;
  font-weight: 750;
  text-align: right;
}
.stamp-route { padding: 1.5rem 0 .3rem; }
.stamp-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  gap: .3rem;
}
.stamp-row::before {
  content: "";
  position: absolute;
  left: 9%; right: 9%; top: 28px;
  border-top: 3px dotted var(--wine);
  opacity: .5;
}
.stamp {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-inline: auto;
  border: 2px solid var(--wine);
  border-radius: 50%;
  background: var(--paper);
  color: var(--wine);
  font-weight: 900;
  font-size: .78rem;
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px rgba(111,35,56,.35);
}
.stamp:nth-child(2n) { transform: rotate(-6deg); }
.stamp-name {
  margin-top: .55rem;
  text-align: center;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.15;
}
.passport-foot {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
}

main { overflow: clip; }
.section {
  padding: clamp(4rem, 9vw, 8rem) clamp(1.1rem, 5vw, 5rem);
}
.section-inner { width: min(1180px, 100%); margin: 0 auto; }
.section-kicker {
  margin: 0 0 .7rem;
  color: var(--wine);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
h2 {
  margin: 0;
  max-width: 18ch;
  font-family: var(--serif);
  font-size: clamp(2.35rem, 4.6vw, 5.2rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.035em;
}
.section-lead {
  max-width: 49rem;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
}

.explorer-section { background: #e8dec7; }
.explorer-shell {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: minmax(300px, .37fr) minmax(0, .63fr);
  border: 1px solid rgba(23,23,19,.18);
  border-radius: 28px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.controls-panel { padding: clamp(1.1rem, 2.7vw, 2rem); }
.control-grid { display: grid; gap: 1rem; }
.control-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .55rem;
  align-items: end;
}
.field { display: grid; gap: .4rem; min-width: 0; }
.field label {
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
select {
  width: 100%;
  min-height: 46px;
  padding: .65rem 2.1rem .65rem .75rem;
  border: 1px solid rgba(23,23,19,.28);
  border-radius: 10px;
  background-color: rgba(255,255,255,.45);
  color: var(--ink);
  font-weight: 720;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 16px) 19px, calc(100% - 11px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
select:focus, button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--route);
  outline-offset: 2px;
}
.swap-button, .icon-button {
  min-width: 46px;
  min-height: 46px;
  border: 1px solid rgba(23,23,19,.25);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}
.swap-button:hover, .icon-button:hover { background: var(--paper-deep); }
.block-row { display: grid; grid-template-columns: 1fr auto; gap: .55rem; }
.add-button,
.share-button,
.reset-button {
  min-height: 46px;
  padding: .6rem .9rem;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
  cursor: pointer;
}
.reset-button { background: transparent; color: var(--ink); border: 1px solid rgba(23,23,19,.25); }
.add-button:hover, .share-button:hover { background: var(--wine); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; min-height: .1rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .38rem .48rem .38rem .65rem;
  border-radius: 999px;
  background: rgba(180,71,61,.12);
  color: #7d241f;
  border: 1px solid rgba(180,71,61,.25);
  font-size: .78rem;
  font-weight: 800;
}
.chip button {
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(180,71,61,.12);
  color: inherit;
  cursor: pointer;
}
.check-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .65rem;
  align-items: start;
  padding: .85rem;
  border: 1px dashed rgba(23,23,19,.24);
  border-radius: 12px;
}
.check-row input { width: 18px; height: 18px; margin-top: .2rem; accent-color: var(--wine); }
.check-row strong { display: block; font-size: .84rem; }
.check-row small { display: block; margin-top: .15rem; color: var(--muted); line-height: 1.35; }
.action-row { display: flex; flex-wrap: wrap; gap: .55rem; }

.result-card {
  position: relative;
  margin-top: 1.25rem;
  padding: 1.2rem;
  border-radius: 16px;
  background: var(--wine);
  color: var(--paper);
  overflow: hidden;
}
.result-card::after {
  content: "";
  position: absolute;
  width: 150px; height: 150px;
  border: 12px double rgba(255,255,255,.09);
  border-radius: 50%;
  right: -35px; bottom: -65px;
  transform: rotate(-12deg);
}
.result-top { display: flex; align-items: flex-end; gap: .8rem; }
.result-number {
  font-family: var(--serif);
  font-size: clamp(4.5rem, 8vw, 7.3rem);
  line-height: .72;
  color: var(--route-pale);
  letter-spacing: -.06em;
}
.result-unit { padding-bottom: .35rem; font-weight: 850; }
.result-summary { position: relative; z-index: 1; margin: 1rem 0 0; font-size: .92rem; }
.result-meta { position: relative; z-index: 1; margin: .55rem 0 0; color: rgba(244,237,218,.72); font-size: .75rem; }
.route-chain { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: 1rem; }
.route-node {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .58rem;
  border-radius: 8px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.15);
  font-size: .73rem;
  font-weight: 800;
}
.route-arrow { color: var(--route-pale); font-weight: 900; }
.special-note {
  margin-top: .8rem;
  padding: .75rem .85rem;
  border-left: 3px solid var(--route);
  background: rgba(255,255,255,.07);
  font-size: .78rem;
}

.map-panel {
  position: relative;
  min-height: 610px;
  background:
    radial-gradient(circle at 42% 46%, rgba(49,111,119,.38), transparent 38%),
    var(--sea-deep);
  overflow: hidden;
}
.map-head {
  position: absolute;
  z-index: 5;
  top: 1rem; left: 1rem; right: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  color: var(--paper);
  pointer-events: none;
}
.map-hint { max-width: 29rem; font-size: .72rem; color: rgba(244,237,218,.68); }
.map-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .65rem; font-size: .67rem; }
.legend-item { display: inline-flex; gap: .35rem; align-items: center; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(244,237,218,.45); }
.legend-dot.route { background: var(--route); }
.legend-dot.blocked { background: var(--red); }
.world-map { width: 100%; height: 100%; min-height: 610px; display: block; touch-action: manipulation; }
.country-shape {
  fill: rgba(244,237,218,.13);
  stroke: rgba(244,237,218,.23);
  stroke-width: .55;
  vector-effect: non-scaling-stroke;
  transition: fill .18s ease, opacity .18s ease;
  cursor: pointer;
}
.country-shape:hover { fill: rgba(244,237,218,.25); }
.country-shape.route-country { fill: rgba(240,185,77,.53); stroke: var(--route-pale); }
.country-shape.route-end { fill: var(--route); }
.country-shape.blocked-country { fill: rgba(180,71,61,.55); stroke: #ffb0a9; }
.country-shape.dimmed { opacity: .42; }
.route-line {
  fill: none;
  stroke: var(--route);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 1 10;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 5px rgba(240,185,77,.5));
  animation: route-dash 16s linear infinite;
}
.route-line.special { stroke: #f58f6b; stroke-dasharray: 9 7; }
.route-marker { fill: var(--paper); stroke: var(--wine); stroke-width: 3; vector-effect: non-scaling-stroke; }
.route-marker.end { fill: var(--route); }
.route-code {
  fill: var(--paper);
  font-size: 13px;
  font-family: var(--sans);
  font-weight: 900;
  paint-order: stroke;
  stroke: var(--sea-deep);
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
}
.map-tooltip {
  position: absolute;
  z-index: 10;
  display: none;
  max-width: 230px;
  padding: .45rem .58rem;
  border-radius: 7px;
  background: rgba(15,20,18,.92);
  color: var(--paper);
  font-size: .7rem;
  pointer-events: none;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
.map-tooltip.visible { display: block; }

.scenarios { margin-top: 1.5rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.scenario-button {
  min-height: 118px;
  padding: 1rem;
  border: 1px solid rgba(23,23,19,.2);
  border-radius: 15px;
  text-align: left;
  background: rgba(255,255,255,.25);
  cursor: pointer;
}
.scenario-button:hover { background: var(--paper); transform: translateY(-2px); }
.scenario-button strong { display: block; font-family: var(--serif); font-size: 1.15rem; line-height: 1.15; }
.scenario-button span { display: block; margin-top: .45rem; color: var(--muted); font-size: .78rem; line-height: 1.35; }

.insight-section { background: var(--wine); color: var(--paper); }
.insight-section .section-kicker { color: var(--route-pale); }
.insight-section .section-lead { color: rgba(244,237,218,.72); }
.insight-grid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(1.2rem, 4vw, 4rem);
  align-items: center;
}
.big-route-card {
  background: var(--paper);
  color: var(--ink);
  padding: clamp(1.3rem, 3vw, 2.2rem);
  border-radius: 20px;
  transform: rotate(-.7deg);
  box-shadow: 0 20px 60px rgba(0,0,0,.24);
}
.big-route-number {
  font-family: var(--serif);
  font-size: clamp(5rem, 10vw, 9rem);
  line-height: .75;
  color: var(--wine);
}
.big-route-card h3 { margin: 1rem 0 .55rem; font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.7rem); line-height: 1; }
.big-route-card p { margin: 0; color: var(--muted); }
.mini-route { margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px solid var(--line); font-size: .78rem; font-weight: 800; }
.insight-copy p { font-size: clamp(1rem, 1.55vw, 1.3rem); color: rgba(244,237,218,.83); }
.insight-copy p:first-child { margin-top: 0; }
.inline-action {
  margin-top: 1rem;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  padding: .65rem .9rem;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  font-weight: 800;
}
.inline-action:hover { background: rgba(255,255,255,.1); }

.metrics-grid { margin-top: 2.5rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
.metric {
  min-height: 180px;
  padding: 1.25rem;
  border-top: 5px solid var(--wine);
  background: rgba(255,255,255,.34);
  box-shadow: 0 5px 20px rgba(23,23,19,.06);
}
.metric-number { font-family: var(--serif); font-size: clamp(3.1rem, 6vw, 5.8rem); line-height: .9; color: var(--wine); }
.metric-label { margin-top: .75rem; font-size: .84rem; font-weight: 800; }
.metric small { display: block; margin-top: .35rem; color: var(--muted); line-height: 1.35; }

.method-section { background: #ded2b8; }
.method-grid { margin-top: 2.5rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem 4rem; }
.method-grid h3 { margin: 0 0 .6rem; font-family: var(--serif); font-size: 1.45rem; }
.method-grid p { margin: 0; color: var(--muted); }
.source-list { margin: 1rem 0 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.source-list a { text-underline-offset: 3px; }
.date-line { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }

.site-footer {
  padding: 2rem clamp(1.1rem, 5vw, 5rem);
  background: var(--ink);
  color: rgba(244,237,218,.74);
  font-size: .77rem;
}
.footer-inner { width: min(1180px, 100%); margin: 0 auto; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-inner a { color: var(--paper); text-underline-offset: 3px; }

.back-to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 44px;
  block-size: 44px;
  border: 1px solid rgba(244,237,218,.3);
  color: var(--paper);
  text-decoration: none;
  font-size: 1.1rem;
}
.js .back-to-top {
  position: fixed;
  inset-block-end: calc(1.1rem + env(safe-area-inset-bottom));
  inset-inline-end: calc(1.1rem + env(safe-area-inset-right));
  z-index: 40;
  background: var(--wine);
  border-color: var(--route);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease;
}
.js .back-to-top.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }
body:focus { outline: 3px solid var(--route); outline-offset: -3px; }
@media (prefers-reduced-motion: reduce) { .js .back-to-top { transition: none; } }
@media print { .back-to-top { display: none; } }

.toast {
  position: fixed;
  z-index: 100;
  left: 50%; bottom: 1.2rem;
  transform: translate(-50%, 150%);
  opacity: 0;
  padding: .7rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 10px 35px rgba(0,0,0,.25);
  font-size: .8rem;
  font-weight: 750;
  transition: transform .25s ease, opacity .25s ease;
}
.toast.visible { transform: translate(-50%, 0); opacity: 1; }

@keyframes route-dash { to { stroke-dashoffset: -180; } }

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 7rem; }
  .hero-passport { width: min(580px, 100%); }
  .explorer-shell { grid-template-columns: 1fr; }
  .map-panel { min-height: 480px; order: -1; }
  .world-map { min-height: 480px; }
  .scenarios { grid-template-columns: 1fr 1fr; }
  .insight-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .site-header { padding-inline: 1rem; }
  .header-link { display: none; }
  .hero { padding: 6.2rem 1rem 3rem; gap: 2.4rem; }
  h1 { font-size: clamp(3.25rem, 16vw, 5rem); }
  .hero-deck { font-size: 1rem; }
  .hero-passport { padding: 1.2rem .9rem 1.2rem 1.2rem; }
  .hero-number { font-size: 7.2rem; }
  .stamp { width: 48px; height: 48px; font-size: .68rem; }
  .stamp-row::before { top: 23px; }
  .stamp-name { font-size: .58rem; }
  .section { padding: 4rem 1rem; }
  h2 { font-size: clamp(2.25rem, 12vw, 3.5rem); }
  .explorer-shell { margin-inline: -.25rem; border-radius: 18px; }
  .map-panel, .world-map { min-height: 330px; }
  .map-head { top: .65rem; left: .7rem; right: .7rem; }
  .map-hint { max-width: 15rem; font-size: .61rem; }
  .map-legend { display: none; }
  .control-pair { grid-template-columns: 1fr 44px; }
  .control-pair .field:last-child { grid-column: 1 / -1; }
  .swap-button { grid-column: 2; grid-row: 1; }
  .block-row { grid-template-columns: 1fr; }
  .add-button { width: 100%; }
  .result-number { font-size: 5.4rem; }
  .route-node { font-size: .67rem; }
  .scenarios { grid-template-columns: 1fr; }
  .scenario-button { min-height: auto; }
  .metrics-grid, .method-grid { grid-template-columns: 1fr; }
  .metric { min-height: 145px; }
  .footer-inner { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .hero-passport, .big-route-card { transform: none; }
}

.license-note {
  margin-top: 0.9rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
