:root {
  --bg: #050505;
  --text: #f3f3ee;
  --muted: #8c8c87;
  --faint: #4d4d49;
  --line: #262624;
  --line-strong: #464641;

  --pad-x: clamp(28px, 3vw, 52px);
  --pad-y: clamp(24px, 3vh, 44px);
}


* {
  box-sizing: border-box;
}


html,
body {
  margin: 0;

  width: 100%;
  height: 100%;

  background: var(--bg);
  color: var(--text);
}


body {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "Helvetica Neue",
    Helvetica,
    Arial,
    sans-serif;

  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;

  overflow: hidden;
}


.display {
  width: 100%;
  height: 100%;

  display: grid;

  grid-template-rows:
    minmax(0, 1fr)
    52px;

  background: var(--bg);
}


/* ==================================================
   FOUR-PANEL MATRIX
================================================== */

.matrix {
  min-height: 0;

  display: grid;

  grid-template-columns:
    1fr 1fr;

  grid-template-rows:
    1fr 1fr;
}


.pane {
  position: relative;

  min-width: 0;
  min-height: 0;

  overflow: hidden;

  padding:
    var(--pad-y)
    var(--pad-x);
}


.time-pane,
.matrix > .platform-pane:nth-of-type(3) {
  border-right:
    1px solid var(--line);
}


.time-pane,
.weather-pane {
  border-bottom:
    1px solid var(--line);
}


/* ==================================================
   COMMON TYPOGRAPHY
================================================== */

.pane-label,
.status,
.platform-meta,
.live-status,
.ticker-label,
.system-status {
  font-size:
    clamp(8px, 0.62vw, 11px);

  font-weight: 650;

  letter-spacing: 0.14em;

  text-transform: uppercase;
}


.pane-label,
.status,
.platform-meta,
.system-status {
  color: var(--muted);
}


.pane-top {
  display: flex;

  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;
}


/* ==================================================
   TIME
================================================== */

.time-pane {
  display: flex;
  flex-direction: column;
}


.time-block {
  flex: 1;

  min-height: 0;

  display: flex;
  flex-direction: column;

  justify-content: center;
}


.clock {
  margin-left: -0.06em;

  font-size:
    clamp(100px, 12.2vw, 220px);

  font-weight: 620;

  line-height: 0.74;

  letter-spacing: -0.085em;

  white-space: nowrap;

  font-variant-numeric:
    tabular-nums;
}


.date {
  margin-top:
    clamp(30px, 3.5vh, 48px);

  color: var(--muted);

  font-size:
    clamp(11px, 0.85vw, 15px);

  font-weight: 600;

  letter-spacing: 0.13em;

  text-transform: uppercase;
}


/* ==================================================
   WEATHER
================================================== */

.weather-pane {
  display: flex;
  flex-direction: column;
}


.weather-block {
  flex: 1;

  min-height: 0;

  display: flex;
  flex-direction: column;

  justify-content: center;
}


.temperature {
  margin-left: -0.04em;

  font-size:
    clamp(105px, 11.6vw, 210px);

  font-weight: 620;

  line-height: 0.72;

  letter-spacing: -0.085em;

  white-space: nowrap;
}


.condition {
  margin-top:
    clamp(27px, 3vh, 40px);

  font-size:
    clamp(18px, 1.65vw, 30px);

  font-weight: 560;

  letter-spacing: -0.025em;

  line-height: 1;
}


.weather-meta {
  display: flex;

  gap:
    clamp(22px, 3vw, 46px);

  margin-top: 19px;
}


.weather-meta div {
  display: flex;

  align-items: baseline;

  gap: 7px;

  color: var(--muted);

  font-size:
    clamp(9px, 0.68vw, 12px);

  font-weight: 600;

  letter-spacing: 0.08em;
}


.weather-meta strong {
  color: var(--text);

  font-weight: 650;
}


/* ==================================================
   PLATFORM
================================================== */

.platform-pane {
  display: flex;
  flex-direction: column;
}


.platform-header {
  display: flex;

  align-items: flex-start;
  justify-content: space-between;

  gap: 28px;
}


.platform-header h1 {
  margin:
    clamp(12px, 1.4vh, 18px)
    0
    0;

  font-size:
    clamp(30px, 3vw, 54px);

  font-weight: 610;

  line-height: 0.9;

  letter-spacing: -0.055em;
}


.platform-meta {
  display: flex;

  flex-direction: column;
  align-items: flex-end;

  gap: 12px;

  white-space: nowrap;
}


.live-status {
  color: var(--faint);
}


.live-status.live {
  color: var(--text);
}


.arrivals {
  flex: 1;

  min-height: 0;

  display: grid;

  grid-template-rows:
    repeat(4, minmax(0, 1fr));

  margin-top:
    clamp(22px, 2.5vh, 34px);

  border-top:
    1px solid var(--line-strong);
}


.arrival {
  min-height: 0;

  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    auto;

  align-items: center;

  gap: 30px;

  border-bottom:
    1px solid var(--line);
}


.arrival-destination {
  min-width: 0;

  overflow: hidden;

  font-size:
    clamp(17px, 1.75vw, 32px);

  font-weight: 540;

  letter-spacing: -0.03em;

  text-overflow: ellipsis;

  white-space: nowrap;
}


.arrival-eta {
  font-size:
    clamp(30px, 3vw, 56px);

  font-weight: 620;

  line-height: 1;

  letter-spacing: -0.06em;

  white-space: nowrap;

  font-variant-numeric:
    tabular-nums;
}


.arrival-unit {
  margin-left: 7px;

  color: var(--muted);

  font-size:
    clamp(8px, 0.62vw, 11px);

  font-weight: 650;

  letter-spacing: 0.11em;
}


.arrival.empty {
  color: var(--faint);
}


/* ==================================================
   TICKER
================================================== */

.ticker {
  min-width: 0;

  display: grid;

  grid-template-columns:
    auto
    minmax(0, 1fr)
    auto;

  align-items: center;

  gap: 24px;

  overflow: hidden;

  border-top:
    1px solid var(--line-strong);

  background: var(--bg);
}


.ticker-label {
  padding-left:
    var(--pad-x);

  color: var(--text);
}


.ticker-window {
  min-width: 0;

  overflow: hidden;

  white-space: nowrap;
}


.ticker-track {
  width: max-content;

  display: flex;

  align-items: center;

  gap: 58px;

  animation:
    ticker-scroll
    75s
    linear
    infinite;
}


.ticker-item {
  font-size:
    clamp(10px, 0.8vw, 13px);

  font-weight: 540;

  letter-spacing: 0.015em;
}


.ticker-source {
  margin-right: 10px;

  color: var(--muted);

  font-size: 0.8em;

  font-weight: 700;

  letter-spacing: 0.1em;

  text-transform: uppercase;
}


.system-status {
  padding-right:
    var(--pad-x);

  white-space: nowrap;
}


@keyframes ticker-scroll {

  from {
    transform:
      translateX(0);
  }

  to {
    transform:
      translateX(-50%);
  }

}


/* ==================================================
   SHORT LANDSCAPE DISPLAY
================================================== */

@media
  (orientation: landscape)
  and (min-width: 800px)
  and (max-height: 760px) {

  :root {
    --pad-x:
      clamp(22px, 2.5vw, 38px);

    --pad-y:
      clamp(18px, 2vh, 28px);
  }


  .display {
    grid-template-rows:
      minmax(0, 1fr)
      44px;
  }


  .clock {
    font-size:
      clamp(86px, 10.4vw, 160px);
  }


  .temperature {
    font-size:
      clamp(88px, 10vw, 150px);
  }


  .date {
    margin-top: 22px;
  }


  .condition {
    margin-top: 20px;
  }


  .platform-header h1 {
    margin-top: 9px;

    font-size:
      clamp(26px, 2.7vw, 42px);
  }


  .arrivals {
    margin-top: 16px;
  }


  .arrival-destination {
    font-size:
      clamp(15px, 1.55vw, 24px);
  }


  .arrival-eta {
    font-size:
      clamp(25px, 2.5vw, 40px);
  }

}


/* ==================================================
   MOBILE / PORTRAIT
================================================== */

@media
  (orientation: portrait),
  (max-width: 799px) {

  html,
  body {
    height: auto;

    overflow-y: auto;
  }


  .display {
    height: auto;

    display: block;
  }


  .matrix {
    display: block;
  }


  .pane {
    min-height: 420px;

    border-right: 0 !important;

    border-bottom:
      1px solid var(--line);
  }


  .platform-pane {
    min-height: 560px;
  }


  .ticker {
    height: 50px;

    grid-template-columns:
      auto
      minmax(0, 1fr);
  }


  .system-status {
    display: none;
  }

}


/* ==================================================
   REDUCED MOTION
================================================== */

@media
  (prefers-reduced-motion: reduce) {

  .ticker-track {
    animation: none;
  }

}
