:root {
  --navy: #0c2b3f;
  --navy-2: #164b64;
  --ocean: #087f98;
  --ocean-dark: #056276;
  --sky: #eaf7fa;
  --sand: #fffaf1;
  --coral: #e9795d;
  --ink: #18313f;
  --muted: #607582;
  --line: #d9e5e9;
  --white: #fff;
  --page-bg: #fff;
  --surface: #fff;
  --heading: var(--navy);
  --header-bg: rgba(255, 255, 255, .96);
  --overlay-bg: rgba(255, 255, 255, .92);
  --input-border: #b9cbd2;
  --sky-hover: #d8f0f4;
  --error-text: #842f22;
  --error-bg: #fff0ed;
  --error-border: #f1b1a4;
  --shadow: 0 18px 50px rgba(12, 43, 63, .12);
  --radius: 18px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --ocean: #52bfd1;
    --ocean-dark: #80d8e2;
    --sky: #153440;
    --sand: #1c2b32;
    --coral: #ff9a7c;
    --ink: #e2eef1;
    --muted: #abc0c8;
    --line: #34535e;
    --page-bg: #0d1b24;
    --surface: #142a35;
    --heading: #edf7f8;
    --header-bg: rgba(13, 27, 36, .96);
    --overlay-bg: rgba(20, 42, 53, .94);
    --input-border: #41616d;
    --sky-hover: #214653;
    --error-text: #ffc1b3;
    --error-bg: #412923;
    --error-border: #8c4d42;
    --shadow: 0 18px 50px rgba(0, 0, 0, .28);
    color-scheme: dark;
  }
}

html[data-theme="dark"] {
  --ocean: #52bfd1;
  --ocean-dark: #80d8e2;
  --sky: #153440;
  --sand: #1c2b32;
  --coral: #ff9a7c;
  --ink: #e2eef1;
  --muted: #abc0c8;
  --line: #34535e;
  --page-bg: #0d1b24;
  --surface: #142a35;
  --heading: #edf7f8;
  --header-bg: rgba(13, 27, 36, .96);
  --overlay-bg: rgba(20, 42, 53, .94);
  --input-border: #41616d;
  --sky-hover: #214653;
  --error-text: #ffc1b3;
  --error-bg: #412923;
  --error-border: #8c4d42;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--page-bg);
  font: 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

img { max-width: 100%; height: auto; }

a { color: var(--ocean-dark); }
a:hover { color: var(--coral); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 20;
  padding: .65rem 1rem;
  color: var(--white);
  background: var(--navy);
  border-radius: 0 0 8px 8px;
}
.skip-link:focus { top: 0; }

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 78px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
}
.brand img { width: 180px; height: auto; content: url("images/trajekt_logo.png"); }
.brand-text { display: none; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-left: auto;
}
.site-nav a {
  color: var(--heading);
  font-size: .94rem;
  font-weight: 700;
  text-decoration: none;
}
.site-nav a:hover { color: var(--ocean); }

.nav-toggle {
  display: none;
  margin-left: auto;
  padding: .55rem .75rem;
  color: var(--heading);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  min-height: 38px;
  padding: .45rem;
  color: var(--heading);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
}
.theme-toggle svg { display: block; width: 1.15rem; height: 1.15rem; }
.theme-toggle:hover { color: var(--ocean-dark); background: var(--surface); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 44px;
  padding: .65rem 1.05rem;
  color: var(--white);
  background: var(--ocean);
  border: 1px solid var(--ocean);
  border-radius: 10px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.button:hover { color: var(--white); background: var(--ocean-dark); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(8, 127, 152, .2); }
.button--dark { background: var(--navy); border-color: var(--navy); }
.button--dark:hover { background: #061c2a; }
.button--outline { color: var(--heading); background: transparent; border-color: var(--heading); }
.button--outline:hover { color: var(--white); background: var(--navy); }
.button--small { min-height: 38px; padding: .45rem .8rem; font-size: .9rem; }

.hero {
  padding: clamp(3rem, 8vw, 6.5rem) 0;
  background: linear-gradient(135deg, var(--sky) 0%, var(--page-bg) 62%);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
}
.eyebrow {
  display: inline-block;
  margin-bottom: .9rem;
  color: var(--ocean-dark);
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
h1, h2, h3 { margin: 0 0 1rem; color: var(--heading); line-height: 1.15; }
h1 { max-width: 760px; font-size: clamp(2.35rem, 5vw, 4.65rem); letter-spacing: -.045em; }
h2 { font-size: clamp(1.8rem, 3vw, 2.7rem); letter-spacing: -.025em; }
h3 { font-size: 1.25rem; }
.lead { max-width: 650px; margin: 0 0 1.5rem; color: var(--muted); font-size: 1.13rem; }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.section-action { margin-top: 1.5rem; }
.section-action--right { justify-content: flex-end; padding-right: .35rem; transform: translateY(.2rem); }
.hero-card {
  position: relative;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid rgba(8, 127, 152, .15);
  border-radius: 24px;
  box-shadow: var(--shadow);
  transform: rotate(1.5deg);
}
.hero-card img { display: block; width: 100%; border-radius: 16px; }
.hero-card--map { overflow: hidden; }
.hero-map { position: relative; overflow: hidden; border-radius: 16px; }
.hero-map__routes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-route-scene { opacity: 0; visibility: hidden; transition: opacity .55s ease; }
.hero-route-scene.is-active { opacity: 1; visibility: visible; }
.hero-route-line {
  fill: none;
  stroke: var(--coral);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 4 4;
  animation: route-flow 1.4s linear infinite;
}
.hero-route-point { fill: var(--navy); stroke: var(--white); stroke-width: 1.5; }
.hero-route-point--destination { fill: var(--coral); }
.hero-map__label {
  position: absolute;
  top: .7rem;
  left: .7rem;
  display: grid;
  gap: .05rem;
  padding: .35rem .55rem;
  color: var(--heading);
  background: var(--overlay-bg);
  border-radius: 8px;
  box-shadow: 0 5px 16px rgba(12, 43, 63, .14);
  font-size: .76rem;
  line-height: 1.25;
}
.hero-map__label strong { font-size: .82rem; }
.hero-map__label span { color: var(--muted); }
.hero-map.coordinate-inspector-active { cursor: crosshair; }
.hero-map__coordinates {
  position: absolute;
  z-index: 3;
  padding: .25rem .4rem;
  color: var(--white);
  background: rgba(12, 43, 63, .92);
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(12, 43, 63, .2);
  font: 600 .72rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  pointer-events: none;
  white-space: nowrap;
}
.hero-map__toggle {
  position: absolute;
  right: .55rem;
  bottom: .55rem;
  padding: .3rem .5rem;
  color: var(--heading);
  background: var(--overlay-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: .7rem;
  cursor: pointer;
}
.hero-map__toggle:hover { background: var(--surface); }
@keyframes route-flow { to { stroke-dashoffset: -16; } }
.hero-card-caption { padding: .85rem .6rem .2rem; color: var(--muted); font-size: .9rem; }

@media (prefers-reduced-motion: reduce) {
  .hero-route-scene { transition: none; }
  .hero-route-line { animation: none; }
}

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--muted { background: var(--sky); }
.section--sand { background: var(--sand); }
.section-heading { max-width: 720px; margin-bottom: 2rem; }
.section-heading p { margin: 0; color: var(--muted); }

.destination-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}
.destination-card {
  display: flex;
  align-items: center;
  min-height: 0;
  padding: .85rem 1rem;
  color: var(--heading);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 800;
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.destination-card:hover { color: var(--heading); border-color: var(--ocean); transform: translateY(-3px); box-shadow: 0 10px 25px rgba(12, 43, 63, .08); }
.destination-card--featured { background: var(--navy); color: var(--white); border-color: var(--navy); }
.destination-card--featured:hover { color: var(--white); }

.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.feature-card { padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.feature-number { display: grid; width: 38px; height: 38px; place-items: center; margin-bottom: 1rem; color: var(--white); background: var(--coral); border-radius: 50%; font-weight: 900; }
.feature-card p { margin: 0; color: var(--muted); }

.breadcrumb { padding: 1.25rem 0 0; color: var(--muted); font-size: .9rem; }
.breadcrumb a { color: var(--muted); }
.page-intro { padding: 2.4rem 0 1.5rem; }
.page-intro p { max-width: 720px; color: var(--muted); }

.destination-layout, .route-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); gap: 2rem; align-items: start; }
.map-card, .info-card, .content-card { padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(12, 43, 63, .05); }
.map-card { text-align: center; }
.map-card img { max-width: 100%; max-height: 520px; width: auto; border-radius: 12px; }
.map-card--routes { position: relative; }
.map-card--routes > img:first-child { display: block; margin: 0 auto; }
.map-card__route { position: absolute; top: 1.25rem; left: 50%; z-index: 1; display: block; transform: translateX(-50%); pointer-events: none; }
.route-list { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.route-list a { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; color: var(--heading); background: var(--sky); border-radius: 10px; font-weight: 800; text-decoration: none; }
.route-list a::after { content: "→"; color: var(--coral); }
.route-list a:hover { background: var(--sky-hover); }

.route-hero { padding: 2rem 0 2.8rem; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); }
.route-hero h1, .route-hero p, .route-hero .breadcrumb, .route-hero .breadcrumb a { color: var(--white); }
.route-hero .breadcrumb { padding-top: 0; opacity: .78; }
.route-hero p { max-width: 720px; margin: 0; opacity: .85; }
.badge-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.badge { padding: .35rem .65rem; color: var(--heading); background: var(--surface); border-radius: 999px; font-size: .82rem; font-weight: 800; }
.route-content { padding: 2.5rem 0 5rem; background: var(--sand); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 0; }
.fact { padding: 1rem; background: var(--sky); border-radius: 12px; }
.fact dt { color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.fact dd { margin: .25rem 0 0; color: var(--heading); font-weight: 850; }
.table-wrap { overflow-x: auto; margin-top: 1.2rem; }
.data-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; background: var(--surface); }
.data-table th, .data-table td { padding: .8rem .85rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; word-break: break-word; }
.data-table th { color: var(--heading); background: var(--sky); font-size: .88rem; }
.data-table td { font-size: .94rem; }
.operator-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; align-items: center; }
.operator-row img { width: 100%; max-height: 72px; object-fit: contain; padding: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.callout { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-top: 2rem; padding: 1.25rem 1.5rem; color: var(--white); background: var(--coral); border-radius: var(--radius); }
.callout h2 { margin: 0 0 .3rem; color: var(--white); font-size: 1.35rem; }
.callout p { margin: 0; opacity: .92; }
.callout .button { flex: 0 0 auto; color: var(--navy); background: var(--white); border-color: var(--white); }

.form-shell { max-width: 920px; margin: 2rem auto 5rem; padding: clamp(1.2rem, 4vw, 2.6rem); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.form-header { margin-bottom: 2rem; }
.form-header p { margin: 0; color: var(--muted); }
.form-section { margin: 0 0 2rem; padding: 0 0 1.6rem; border: 0; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-section legend { width: 100%; margin-bottom: 1rem; padding: 0; color: var(--heading); font-size: 1.3rem; font-weight: 900; }
.form-section legend small { display: block; margin-top: .2rem; color: var(--muted); font-size: .85rem; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field--full { grid-column: 1 / -1; }
.field label { color: var(--heading); font-size: .9rem; font-weight: 800; }
.field input, .field select, .field textarea { width: 100%; min-height: 45px; padding: .65rem .75rem; color: var(--ink); background: var(--surface); border: 1px solid var(--input-border); border-radius: 9px; font: inherit; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .nav-toggle:focus, .button:focus, a:focus { outline: 3px solid rgba(233, 121, 93, .35); outline-offset: 2px; }
.field small { color: var(--muted); font-size: .8rem; }
.checkbox-field { display: flex; gap: .6rem; align-items: flex-start; margin-top: 1rem; }
.checkbox-field input { width: 1.15rem; height: 1.15rem; margin-top: .25rem; accent-color: var(--ocean); }
.checkbox-field label { color: var(--ink); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.form-errors { margin: 0 0 1.5rem; padding: 1rem 1rem 1rem 2.5rem; color: var(--error-text); background: var(--error-bg); border: 1px solid var(--error-border); border-radius: 10px; }
.form-hint { margin: 0; color: var(--muted); font-size: .86rem; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.mt-1 { margin-top: 1rem; }
.justify-center { justify-content: center; }

.success-box { max-width: 720px; margin: 5rem auto; padding: clamp(1.5rem, 5vw, 3rem); text-align: center; background: var(--sky); border-radius: 24px; }
.success-box p { color: var(--muted); }

.legacy-document { overflow-x: auto; }
.legacy-document > div, .legacy-document > p { max-width: 100%; }
.legacy-document table { width: 100% !important; max-width: 100%; margin: 1rem 0; border-collapse: collapse; background: var(--surface); font: inherit; }
.legacy-document td, .legacy-document th { min-width: 3rem; padding: .55rem .65rem; color: var(--ink); border: 1px solid var(--line); font: inherit; vertical-align: top; }
.legacy-document th { color: var(--heading); background: var(--sky); font-weight: 800; }
.legacy-document img { max-width: 100%; height: auto; }
.legacy-document a { font-weight: 700; }
.legacy-document p { margin: 1rem 0; }
.legacy-document ul, .legacy-document ol { padding-left: 1.5rem; }

.site-footer { padding: 2.5rem 0; color: #dbeaf0; background: var(--navy); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; }
.site-footer h2 { color: var(--white); font-size: 1.2rem; }
.site-footer p { margin: .25rem 0; color: #c5d8df; }
.site-footer a { color: #d9f7fb; }
.footer-meta { margin-top: 2rem; padding-top: 1rem; color: #a4c0cb; border-top: 1px solid rgba(255,255,255,.15); font-size: .85rem; }

@media (max-width: 900px) {
  .site-nav { gap: .7rem; }
  .site-nav a { font-size: .86rem; }
  .destination-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .header-inner { min-height: 66px; gap: .6rem; }
  .brand img { width: 150px; }
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; top: 66px; left: 0; right: 0; align-items: stretch; flex-direction: column; gap: 0; padding: .5rem 1rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 12px 20px rgba(12,43,63,.08); }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: .7rem .25rem; }
  .header-inner > .button { display: none; }
  .theme-toggle { width: 40px; min-width: 40px; padding: .5rem; }
  .hero-grid, .destination-layout, .route-layout { grid-template-columns: 1fr; }
  .hero-card { max-width: 560px; margin: 0 auto; }
  .destination-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: 1fr; }
  .operator-row { grid-template-columns: 1fr; }
  .callout { align-items: flex-start; flex-direction: column; }
  .form-grid, .form-grid--three { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
}

@media (max-width: 420px) {
  .container { width: min(100% - 1.25rem, 1120px); }
  h1 { font-size: 2.3rem; }
  .destination-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .button-row, .form-actions { align-items: stretch; flex-direction: column; }
  .button { width: 100%; }
}
