:root {
  color-scheme: light;
  --ink: #1e2528;
  --muted: #647077;
  --line: #d8e0df;
  --paper: #fbfcfa;
  --panel: #ffffff;
  --mist: #edf4f1;
  --forest: #1f5f4b;
  --fjord: #2d6f8a;
  --moss: #8c9b49;
  --clay: #b9684a;
  --shadow: 0 10px 30px rgba(30, 37, 40, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(31, 95, 75, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(45, 111, 138, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
}

a {
  color: var(--fjord);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

button,
select,
input {
  font: inherit;
}

button,
select {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
}

button {
  min-height: 42px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
}

button:hover,
select:hover,
.tab:hover {
  border-color: var(--forest);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
}

.skip-link:focus {
  top: 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 250, 0.94);
  backdrop-filter: blur(14px);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--forest);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.quick-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr);
  gap: 18px;
  align-items: stretch;
  min-height: calc(100vh - 112px);
  padding: 24px 0;
}

.intro-panel,
.route-mini,
.stop-detail,
.route-board {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.intro-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 460px;
  padding: clamp(24px, 5vw, 56px);
  background:
    linear-gradient(rgba(9, 22, 25, 0.18), rgba(9, 22, 25, 0.5)),
    url("assets/images/hero-geirangerfjord.jpg");
  background-position: center;
  background-size: cover;
  color: white;
}

.intro-panel .eyebrow {
  color: #d8efe5;
}

.intro-panel h2 {
  max-width: 800px;
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.intro-panel p:not(.eyebrow) {
  max-width: 680px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.summary-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
}

.summary-item strong {
  display: block;
  font-size: 1.35rem;
}

.summary-item span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.85rem;
}

.route-mini {
  display: flex;
  flex-direction: column;
  min-height: 460px;
  overflow: hidden;
}

.route-map {
  flex: 1;
  min-height: 260px;
  background: var(--mist);
}

.route-map svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 260px;
}

.route-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.route-stats div {
  padding: 14px;
  background: var(--panel);
}

.route-stats strong {
  display: block;
  font-size: 1.25rem;
}

.route-stats span {
  color: var(--muted);
  font-size: 0.86rem;
}

.section {
  padding: 34px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  letter-spacing: 0;
}

.section-heading p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.timeline-date {
  color: var(--forest);
  font-weight: 850;
}

.timeline-item h3 {
  margin: 0 0 2px;
  font-size: 1.05rem;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--mist);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 750;
  white-space: nowrap;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.tab[aria-selected="true"] {
  border-color: var(--forest);
  background: var(--forest);
  color: white;
}

.stop-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 1.05fr);
  overflow: hidden;
}

.stop-image {
  min-height: 420px;
  background-position: center;
  background-size: cover;
}

.stop-copy {
  padding: clamp(20px, 4vw, 34px);
}

.stop-copy h3 {
  margin: 0 0 4px;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
}

.stop-copy p {
  color: var(--muted);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.meta-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.meta-grid strong {
  display: block;
  margin-top: 3px;
}

.highlight-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

.highlight-list li {
  padding: 10px 12px;
  border-left: 3px solid var(--moss);
  background: var(--mist);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto auto auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.filters label:not(.toggle) {
  display: grid;
  gap: 5px;
}

.filters label span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.filters select {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
  white-space: nowrap;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--forest);
}

.result-meta {
  min-height: 28px;
  margin: 12px 0;
  color: var(--muted);
  font-weight: 750;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.activity-card,
.source-card,
.route-leg {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.activity-card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
  overflow: hidden;
}

.activity-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--mist);
}

.activity-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px;
}

.activity-card h3 {
  margin: 0 0 7px;
  font-size: 1.05rem;
}

.activity-card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.activity-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 14px;
}

.activity-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
  color: var(--forest);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.activity-links a:hover {
  border-color: rgba(31, 95, 75, 0.45);
  background: #eef7f1;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
}

.route-board {
  padding: 16px;
}

.route-legs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.route-leg {
  padding: 13px;
}

.route-leg .step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-weight: 850;
}

.route-leg h3 {
  margin: 0 0 5px;
  font-size: 1rem;
}

.route-leg p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.source-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.source-card {
  padding: 13px;
}

.source-card strong {
  display: block;
  margin-bottom: 2px;
}

.source-card span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

footer {
  margin-top: 34px;
  padding: 26px 16px 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .dashboard,
  .stop-detail {
    grid-template-columns: 1fr;
  }

  .dashboard {
    min-height: 0;
  }

  .route-mini,
  .intro-panel {
    min-height: 380px;
  }

  .activity-grid,
  .route-legs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  main {
    width: min(100% - 24px, 1180px);
  }

  .summary-strip,
  .meta-grid,
  .highlight-list,
  .activity-grid,
  .source-list,
  .route-legs,
  .filters {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .timeline-item .badge {
    justify-self: start;
  }

  .stop-image {
    min-height: 260px;
  }
}
