:root {
  --ink: #17212b;
  --muted: #607080;
  --paper: #ffffff;
  --field: #f3f6f8;
  --line: #d8e0e5;
  --navy: #18324a;
  --harbor: #176f7d;
  --teal: #2a918a;
  --sun: #d9a441;
  --coral: #c96052;
  --violet: #725d91;
  --shadow: 0 18px 46px rgba(23, 33, 43, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--field);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 12px clamp(18px, 4vw, 54px);
  background: rgba(243, 246, 248, 0.93);
  border-bottom: 1px solid rgba(23, 33, 43, 0.12);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: white;
  background: var(--harbor);
  border-radius: 8px;
  font-size: 14px;
  letter-spacing: 0;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.nav a {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 730;
  text-decoration: none;
}

.nav a:hover {
  color: var(--navy);
}

.language-menu {
  display: inline-flex;
  align-items: center;
  position: relative;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.language-menu label {
  white-space: nowrap;
}

.language-menu select {
  min-height: 36px;
  max-width: 178px;
  margin: 0;
  padding: 0 30px 0 10px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
}

#google_translate_element {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.language-menu .goog-te-gadget {
  height: 0;
  overflow: hidden;
  font-size: 0;
}

body > .skiptranslate,
.goog-te-banner-frame,
.goog-te-balloon-frame {
  display: none !important;
}

body {
  top: 0 !important;
}

.hero {
  position: relative;
  min-height: calc(100vh - 64px);
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(8, 19, 31, 0.9), rgba(8, 19, 31, 0.57) 48%, rgba(8, 19, 31, 0.22)),
    linear-gradient(0deg, rgba(8, 19, 31, 0.62), rgba(8, 19, 31, 0.04) 48%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(1040px, calc(100% - 36px));
  margin: 0 auto;
  padding: 9vh 0 12vh;
  color: white;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--sun);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 1000px;
  font-size: clamp(48px, 8vw, 112px);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-copy {
  width: min(820px, 100%);
  margin: 24px 0 28px;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.45;
}

.hero-search {
  width: min(820px, 100%);
}

.hero-search label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 850;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.hero-search-status {
  min-height: 22px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  font-weight: 750;
}

input,
button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
}

input {
  width: 100%;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
  outline: none;
}

input:focus {
  border-color: var(--sun);
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.28);
}

button {
  padding: 0 18px;
  color: white;
  background: var(--harbor);
  font-weight: 850;
  cursor: pointer;
}

button:hover {
  background: var(--navy);
}

.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats-band div {
  display: grid;
  gap: 4px;
  padding: 22px clamp(18px, 4vw, 54px);
  background: var(--paper);
}

.stats-band strong {
  color: var(--navy);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

.stats-band span {
  color: var(--muted);
  font-weight: 760;
}

.tool-shell,
.visuals,
.map-section,
.region-section,
.river-section,
.line-section,
.routes,
.planning {
  padding: 76px clamp(18px, 4vw, 54px);
}

.visuals {
  background: var(--paper);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(220px, 420px) minmax(260px, 720px);
  justify-content: space-between;
  gap: 28px;
  margin: 0 0 28px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 0.98;
  letter-spacing: 0;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.controls {
  display: grid;
  gap: 16px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.filter-group {
  display: grid;
  grid-template-columns: 95px 1fr;
  align-items: start;
  gap: 12px;
}

.filter-group > span {
  padding-top: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 38px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
}

.chip:hover,
.chip[aria-pressed="true"] {
  color: white;
  background: var(--navy);
  border-color: var(--navy);
}

.compact .chip {
  font-size: 12px;
}

.results-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-weight: 780;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.image-card {
  position: relative;
  min-height: 240px;
  overflow: hidden;
  background: var(--navy);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(23, 33, 43, 0.12);
}

.image-card:first-child {
  grid-column: span 2;
  min-height: 360px;
}

.image-card img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  display: block;
}

.image-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 3px;
  padding: 42px 14px 14px;
  color: white;
  background: linear-gradient(0deg, rgba(8, 19, 31, 0.78), rgba(8, 19, 31, 0));
}

.image-caption strong {
  font-size: 15px;
}

.image-caption span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 760;
}

.port-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}

.port-card,
.line-card,
.region-card,
.river-card,
.route-card,
.planning-grid article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(23, 33, 43, 0.07);
}

.port-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rank {
  color: var(--harbor);
  font-size: 13px;
  font-weight: 900;
}

.size-pill,
.rating-pill,
.role-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  color: white;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
}

.size-small {
  background: var(--teal);
}

.size-medium {
  background: var(--violet);
}

.size-large {
  background: var(--coral);
}

.rating-pill {
  color: var(--ink);
  background: #f6e4ae;
}

.role-pill {
  color: white;
  background: var(--navy);
}

.port-card h3,
.line-card h3,
.region-card h3,
.river-card h3,
.route-card h3,
.planning-grid h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0;
}

.meta-grid {
  display: grid;
  gap: 8px;
}

.meta-grid div {
  display: grid;
  gap: 2px;
}

.label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.meta-grid span:last-child,
.port-card p,
.line-card p,
.region-card p,
.river-card p,
.route-card p,
.planning-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.line-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.line-list span {
  padding: 5px 8px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 820;
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.card-actions a,
.line-card a,
.region-card button,
.river-card button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: white;
  background: var(--harbor);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
}

.card-actions a:nth-child(2n),
.line-card a,
.region-card button,
.river-card button {
  background: var(--navy);
}

.card-actions a:hover,
.line-card a:hover,
.region-card button:hover,
.river-card button:hover {
  filter: brightness(0.92);
}

.map-section,
.river-section,
.routes {
  background: #e8eef2;
}

.world-map {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background:
    linear-gradient(145deg, #cfe3ea, #eef5f7 52%, #d8e6ec),
    #dceaf0;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.continent {
  position: absolute;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(23, 33, 43, 0.08);
  border-radius: 48% 52% 47% 53%;
}

.land-na { left: 7%; top: 18%; width: 26%; height: 25%; }
.land-sa { left: 25%; top: 52%; width: 14%; height: 28%; transform: rotate(16deg); }
.land-eu { left: 47%; top: 20%; width: 18%; height: 16%; }
.land-af { left: 50%; top: 39%; width: 17%; height: 28%; }
.land-asia { left: 62%; top: 21%; width: 27%; height: 24%; }
.land-au { left: 75%; top: 62%; width: 15%; height: 12%; }

.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  gap: 4px;
  min-width: 110px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(23, 33, 43, 0.12);
  border-left: 5px solid var(--harbor);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(23, 33, 43, 0.13);
}

.map-pin strong {
  font-size: 12px;
}

.map-pin span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.line-grid,
.region-grid,
.river-grid,
.route-grid,
.planning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.line-card,
.region-card,
.river-card,
.route-card,
.planning-grid article {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.region-card,
.river-card {
  align-content: start;
}

.region-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.region-meta span {
  padding: 5px 8px;
  color: var(--navy);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 850;
}

.river-card {
  border-left: 5px solid var(--harbor);
}

.route-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 7px;
}

.source-note {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 28px clamp(18px, 4vw, 54px);
  color: white;
  background: var(--navy);
}

.footer a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .stats-band,
  .section-head {
    grid-template-columns: 1fr;
  }

  .filter-group {
    grid-template-columns: 1fr;
  }

  .filter-group > span {
    padding-top: 0;
  }

  .world-map {
    min-height: 680px;
  }

  .map-pin {
    min-width: 96px;
    max-width: 130px;
  }
}

@media (max-width: 560px) {
  .search-row,
  .card-actions {
    grid-template-columns: 1fr;
  }

  .hero-content {
    padding-bottom: 9vh;
  }

  .hero h1 {
    font-size: clamp(42px, 15vw, 70px);
  }

  .image-card:first-child {
    grid-column: auto;
    min-height: 260px;
  }
}
