:root {
  color-scheme: light;
  --ink: #172126;
  --muted: #66777f;
  --line: #d9e2e4;
  --paper: #fbfbf8;
  --panel: #ffffff;
  --sea: #dcecee;
  --land: #cfd9d2;
  --accent: #c45f45;
  --accent-dark: #8f3f30;
  --done: #2f7c72;
  --future: #9ba8ad;
  --shadow: 0 26px 70px rgba(30, 45, 50, 0.12);
  font-family: "Outfit", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% 0%, rgba(196, 95, 69, 0.12), transparent 28rem),
    linear-gradient(145deg, #f8f8f3 0%, #eef5f4 100%);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.overview {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 28px;
  align-items: end;
  min-height: 28dvh;
}

.eyebrow,
.section-kicker,
.label {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 8vw, 6.7rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 2.4vw, 2.5rem);
  line-height: 1;
  letter-spacing: 0;
}

.intro {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.4vw, 1.22rem);
  line-height: 1.55;
}

.status-board,
.next-panel,
.timeline-panel,
.map-section {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.status-board {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 8px;
}

.status-board div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.status-board div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.status-board strong {
  display: block;
  margin-top: 7px;
  font-size: 1.25rem;
  line-height: 1.1;
}

.status-subline {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.25;
}

.map-section {
  margin-top: 28px;
  padding: 22px;
  border-radius: 8px;
}

.map-toolbar,
.timeline-heading {
  display: flex;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.map-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-button,
.text-button {
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease;
}

.text-button {
  padding: 0 16px;
}

.icon-button:hover,
.text-button:hover,
.text-button.active {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.icon-button:active,
.text-button:active {
  transform: translateY(1px) scale(0.98);
}

.map-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sea);
}

.map-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at center, transparent 46%, rgba(23, 33, 38, 0.06) 72%, rgba(23, 33, 38, 0.16) 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.24), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.18));
  pointer-events: none;
}

#routeMap {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: clamp(300px, 42vw, 430px);
  min-height: 300px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 24% 35%, rgba(255, 255, 255, 0.58), transparent 15rem),
    linear-gradient(135deg, #d8eef2, #b7dbe5 54%, #dcece8);
}

.map-canvas {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: 0 0;
  transition: transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

.map-ocean-current {
  opacity: 0.34;
  animation: oceanDrift 12s linear infinite;
}

.map-land {
  fill: #d2dbcf;
  stroke: rgba(93, 116, 116, 0.22);
  stroke-width: 1.2;
}

.map-grid {
  stroke: rgba(74, 93, 101, 0.14);
  stroke-width: 1;
}

.scale-line {
  stroke: rgba(23, 33, 38, 0.74);
  stroke-width: 3;
  stroke-linecap: round;
}

.scale-label {
  fill: rgba(23, 33, 38, 0.82);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 700;
}

.route-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-line.future {
  stroke: var(--future);
  stroke-width: 2.2;
  stroke-dasharray: 7 10;
  animation: routeMarch 10s linear infinite;
}

.route-line.done {
  stroke: var(--done);
  stroke-width: 4.2;
}

.port-dot {
  cursor: pointer;
  transition: transform 180ms ease;
}

.port-dot:hover {
  transform: scale(1.35);
}

.port-label {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.86);
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
}

.graticule line {
  stroke: rgba(74, 93, 101, 0.16);
  stroke-width: 1;
}

.landmarks path {
  fill: var(--land);
  opacity: 0.76;
  filter: url(#softShadow);
}

.ship-marker {
  filter: drop-shadow(0 12px 14px rgba(23, 33, 38, 0.24));
  pointer-events: none;
}

.ship-wake {
  fill: none;
  stroke: rgba(47, 124, 114, 0.48);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 6 6;
  animation: wakeDrift 1.9s linear infinite;
}

.ship-body {
  fill: var(--accent);
  stroke: #fff;
  stroke-width: 2;
}

.ship-cabin {
  fill: #fff7ef;
  stroke: #fff;
  stroke-width: 1.6;
}

.ship-funnel {
  fill: var(--ink);
}

.ship-window {
  fill: #ffe2c6;
}

.ship-label {
  fill: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 6px;
  stroke-linejoin: round;
}

@keyframes wakeDrift {
  to {
    stroke-dashoffset: -24;
  }
}

@keyframes routeMarch {
  to {
    stroke-dashoffset: -120;
  }
}

@keyframes oceanDrift {
  to {
    transform: translateX(-90px);
  }
}

.details-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: 28px;
  margin-top: 28px;
  align-items: start;
}

.side-stack {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 20px;
}

.next-panel,
.timeline-panel,
.bridge-cam-card {
  border-radius: 8px;
  padding: 26px;
}

.bridge-cam-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.bridge-cam-card h2 {
  margin-bottom: 14px;
}

.cam-viewer {
  overflow: hidden;
  height: 190px;
  margin: 14px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dcecee;
}

.cam-viewer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cam-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 8px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent-dark);
  background: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease;
}

.cam-fallback:hover {
  background: #fff7ef;
}

.cam-fallback:active {
  transform: translateY(1px) scale(0.98);
}

.time-pair {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}

.time-pair div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 250, 249, 0.84);
}

.time-pair span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.time-pair strong {
  display: block;
  margin-top: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
}

.panel-copy {
  color: var(--muted);
  line-height: 1.55;
}

.search-box {
  display: grid;
  gap: 7px;
  min-width: min(100%, 330px);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent);
}

.timeline {
  display: grid;
  gap: 10px;
  max-height: 690px;
  overflow: auto;
  padding-right: 6px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 118px;
  gap: 14px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.timeline-item:hover,
.timeline-item.active {
  border-color: rgba(196, 95, 69, 0.72);
  background: #fff;
  transform: translateY(-1px);
}

.timeline-item.done {
  border-left: 5px solid var(--done);
}

.timeline-item.current {
  border-left: 5px solid var(--accent);
}

.timeline-date {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}

.timeline-main strong {
  display: block;
  font-size: 1.02rem;
}

.timeline-main span {
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline-main p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.38;
}

.timeline-time {
  color: var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  text-align: right;
}

.tooltip {
  position: fixed;
  max-width: 280px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(30, 45, 50, 0.16);
  color: var(--ink);
  font-size: 0.88rem;
  pointer-events: none;
}

.tooltip strong {
  display: block;
  margin-bottom: 4px;
}

@media (max-width: 900px) {
  .overview,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .side-stack {
    position: static;
  }

  .map-toolbar,
  .timeline-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  .timeline-time {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1480px);
    padding-top: 18px;
  }

  .status-board,
  .map-section,
  .next-panel,
  .timeline-panel {
    padding: 16px;
  }

  #routeMap {
    height: 320px;
    min-height: 320px;
  }
}
