:root {
  --platform: #E7ECF1;
  --ink: #18202E;
  --ink-soft: #4A5568;
  --board: #1A2E57;
  --board-alt: #213765;
  --board-line: #2C4478;
  --on-board: #F3F6FA;
  --muted: #93A6C8;
  --signal: #B42A1E;
  --focus: #7FB2FF;

  --sans: "Barlow", system-ui, sans-serif;
  --cond: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-4: clamp(2.75rem, 7vw, 4.75rem);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--platform);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.55;
}

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.page {
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5.5rem) clamp(1.25rem, 4vw, 2.5rem) 3rem;
}

/* Title */
.masthead {
  max-width: 40rem;
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
}

.masthead h1 {
  margin: 0;
  font-family: var(--cond);
  font-weight: 700;
  font-size: var(--step-4);
  line-height: 0.95;
  letter-spacing: -0.015em;
}

.masthead p {
  margin: 1rem 0 0;
  font-size: var(--step-1);
  line-height: 1.4;
  color: var(--ink-soft);
  max-width: 34rem;
}

/* The board */
.board {
  background: var(--board);
  color: var(--on-board);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 18px 40px -24px rgba(26, 46, 87, 0.55);
}

.board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem 0.9rem;
  border-bottom: 2px solid var(--board-line);
}

.board-head h2 {
  margin: 0;
  font-family: var(--cond);
  font-weight: 600;
  font-size: var(--step-2);
  line-height: 1.1;
}

.clock {
  font-family: var(--cond);
  font-weight: 600;
  font-size: var(--step-2);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.clock .colon { animation: blink 2s steps(1) infinite; }

@keyframes blink { 50% { opacity: 0.25; } }

.cols,
.row > summary {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr) 8.5rem 6.5rem;
  column-gap: 1.25rem;
  padding: 0 1.5rem;
}

.cols {
  padding-top: 0.6rem;
  padding-bottom: 0.45rem;
  font-family: var(--cond);
  font-size: var(--step--1);
  color: var(--muted);
}

.rows { list-style: none; margin: 0; padding: 0; }

.rows > li:nth-child(even) { background: var(--board-alt); }

.row > summary {
  list-style: none;
  cursor: pointer;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  font-family: var(--cond);
  align-items: baseline;
}

.row > summary::-webkit-details-marker { display: none; }

.row > summary:hover { background: rgba(255, 255, 255, 0.05); }

.row > summary:focus-visible { outline-offset: -3px; }

.year {
  font-weight: 600;
  font-size: var(--step-1);
  font-variant-numeric: tabular-nums;
}

.dest { min-width: 0; }

.dest .name {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 600;
  font-size: var(--step-1);
  line-height: 1.25;
}

.dest .name::after {
  content: "";
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-0.2rem) rotate(45deg);
  transition: transform 0.2s ease;
}

.row[open] .dest .name::after { transform: translateY(0) rotate(-135deg); }

.dest .via {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--sans);
  font-size: var(--step--1);
  line-height: 1.4;
  color: var(--muted);
}

.track,
.kind {
  font-size: var(--step-0);
  font-weight: 500;
}

.kind { color: var(--muted); }

.detail {
  padding: 0.1rem 1.5rem 1.4rem calc(1.5rem + 4.25rem + 1.25rem);
}

.detail p {
  margin: 0 0 1rem;
  max-width: 38rem;
  font-size: var(--step-0);
  line-height: 1.55;
  color: #D7DFEC;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.links a {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border: 1.5px solid var(--board-line);
  border-radius: 999px;
  font-family: var(--cond);
  font-weight: 600;
  font-size: var(--step--1);
  text-decoration: none;
  color: var(--on-board);
}

.links a:hover { border-color: var(--muted); }

.links a.primary {
  background: var(--on-board);
  border-color: var(--on-board);
  color: var(--board);
}

.links a.primary:hover { background: #fff; }

@supports (interpolate-size: allow-keywords) {
  .row { interpolate-size: allow-keywords; }
  .row::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size 0.25s ease, content-visibility 0.25s allow-discrete;
  }
  .row[open]::details-content { block-size: auto; }
}

/* Departed */
.departed {
  margin-top: clamp(3rem, 7vw, 4.5rem);
  max-width: 44rem;
}

.departed h2 {
  margin: 0 0 0.35rem;
  font-family: var(--cond);
  font-weight: 600;
  font-size: var(--step-2);
  line-height: 1.15;
}

.departed > p {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
}

.history { list-style: none; margin: 0; padding: 0; }

.history li {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  column-gap: 1.25rem;
  padding: 0.9rem 0;
  border-top: 1px solid #C9D2DD;
}

.history li:last-child { border-bottom: 1px solid #C9D2DD; }

.history .when {
  font-family: var(--cond);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.history h3 {
  margin: 0;
  font-family: var(--cond);
  font-weight: 600;
  font-size: var(--step-1);
  line-height: 1.25;
}

.history .status {
  margin-left: 0.5rem;
  font-family: var(--cond);
  font-weight: 600;
  font-size: var(--step--1);
  color: var(--signal);
  white-space: nowrap;
}

.history .status.kept { color: var(--ink-soft); }

.history p { margin: 0.2rem 0 0; color: var(--ink-soft); }

.history a { text-underline-offset: 0.18em; }

footer {
  margin-top: 3.5rem;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

footer a { text-underline-offset: 0.18em; }

@media (max-width: 720px) {
  .page { padding-top: 3.5rem; }
  .cols { display: none; }
  .row > summary {
    grid-template-columns: 3.25rem minmax(0, 1fr);
    grid-template-areas:
      "year dest"
      ".    meta";
    row-gap: 0.35rem;
    column-gap: 0.9rem;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }
  .year { grid-area: year; font-size: var(--step-0); }
  .dest { grid-area: dest; }
  .track, .kind { grid-row: 2; font-size: var(--step--1); }
  .track { grid-column: 2; }
  .kind { grid-column: 2; justify-self: end; }
  .board-head { padding: 1rem 1.1rem 0.8rem; }
  .detail { padding: 0.1rem 1.1rem 1.25rem calc(1.1rem + 3.25rem + 0.9rem); }
  .history li { grid-template-columns: 1fr; row-gap: 0.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  .clock .colon { animation: none; }
  .dest .name::after { transition: none; }
  .row::details-content { transition: none !important; }
}

.page { position: relative; }

.lang {
  position: absolute;
  top: clamp(1rem, 3vw, 1.75rem);
  right: clamp(1.25rem, 4vw, 2.5rem);
  font-family: var(--cond);
  font-weight: 600;
  font-size: var(--step--1);
}

.lang a { color: var(--ink-soft); text-underline-offset: 0.18em; }

.lang a:hover { color: var(--ink); }
