:root {
  color-scheme: light;
  --background: #f5f5f7;
  --surface: #ffffff;
  --surface-subtle: #fafafa;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --line-soft: #e5e5ea;
  --blue: #0066cc;
  --blue-pressed: #004b99;
  --green: #176b3a;
  --green-fill: #e1f2e7;
  --yellow: #795500;
  --yellow-fill: #fff1c7;
  --red: #9c2822;
  --red-fill: #fbe4e2;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  letter-spacing: -0.012em;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

header,
main,
footer {
  width: min(1040px, calc(100% - 40px));
  margin-inline: auto;
}

header {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  border-radius: 9px;
}

nav {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 22px;
}

nav a,
footer a {
  color: #515154;
  font-size: 14px;
  text-decoration: none;
}

nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

nav [aria-current="page"] {
  color: var(--blue);
  font-weight: 650;
}

.intro {
  padding: 56px 0 30px;
}

.intro p,
.intro h1 {
  margin-top: 0;
}

.eyebrow {
  margin-bottom: 9px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 900px;
  margin-bottom: 12px;
  font-size: clamp(44px, 7vw, 68px);
  letter-spacing: -0.05em;
  line-height: 0.98;
}

#subcopy {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

#app {
  min-height: 320px;
}

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

.destination {
  grid-column: 1 / -1;
  margin: 34px 0 2px;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.destination:first-child {
  margin-top: 4px;
}

.park-card {
  position: relative;
  display: block;
  min-height: 190px;
  overflow: hidden;
  border-radius: 18px;
  background: #d8d8dc;
  box-shadow: var(--shadow);
  color: #ffffff;
  text-decoration: none;
  isolation: isolate;
}

.park-card img,
.park-card-placeholder {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.park-card-placeholder {
  background: #8e8e93;
}

.park-card-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.02) 35%,
    rgba(0, 0, 0, 0.76) 100%
  );
}

.park-card-name {
  position: absolute;
  right: 16px;
  bottom: 15px;
  left: 16px;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

@media (hover: hover) {
  .park-card:hover img {
    transform: scale(1.025);
  }
}

@media (min-width: 1000px) {
  .parks {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .park-card {
    min-height: 180px;
  }
}

.back-link {
  display: inline-flex;
  min-height: 44px;
  margin: 0 0 14px;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.back-link span {
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}

.viewer,
.detail {
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: var(--surface-subtle);
  box-shadow: var(--shadow);
}

.viewer {
  padding: 26px;
}

.detail {
  padding: 24px;
}

.park-meta {
  display: flex;
  min-height: 62px;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.park-meta p {
  margin: 0;
}

.meta-label {
  margin-bottom: 5px !important;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hours {
  font-size: 18px;
  font-weight: 650;
}

.freshness {
  max-width: 410px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-align: right;
}

.tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  margin: 20px 0 16px;
  align-items: end;
  gap: 10px;
}

.search-control,
.select-control {
  display: grid;
  gap: 6px;
}

.search-control > span,
.select-control > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

input[type="search"],
select,
.refresh-button,
.empty-state button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 12px;
}

input[type="search"] {
  width: 100%;
}

.refresh-button,
.empty-state button {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
  font-weight: 650;
}

.refresh-button:hover,
.empty-state button:hover {
  background: var(--blue-pressed);
}

.refresh-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.result-count {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 13px;
}

.rides {
  display: grid;
  gap: 9px;
}

.ride {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 12px;
  min-height: 76px;
  align-items: center;
  gap: 14px;
  padding: 14px 15px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 150ms ease,
    transform 150ms ease;
}

.ride:hover {
  border-color: #b8b8bd;
}

.ride-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.ride-copy strong {
  overflow: hidden;
  font-size: 16px;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ride-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #ececef;
  color: #58585d;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.badge.wait-low,
.current-wait-value.wait-low {
  background: var(--green-fill);
  color: var(--green);
}

.badge.wait-medium,
.current-wait-value.wait-medium {
  background: var(--yellow-fill);
  color: var(--yellow);
}

.badge.wait-high,
.badge.closed,
.badge.down,
.badge.refurbishment,
.current-wait-value.wait-high,
.current-wait-value.closed,
.current-wait-value.down,
.current-wait-value.refurbishment {
  background: var(--red-fill);
  color: var(--red);
}

.badge.open,
.badge.unavailable,
.current-wait-value.open,
.current-wait-value.unavailable {
  background: #ececef;
  color: #58585d;
}

.chevron {
  color: #8e8e93;
  font-size: 23px;
  line-height: 1;
}

.attribution,
.history-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.attribution a {
  color: var(--blue);
}

.current-wait {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(140px, 1fr) auto;
  min-height: 78px;
  align-items: center;
  gap: 16px;
  border-radius: 15px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--ink);
  padding: 14px 16px;
}

.current-wait-label {
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
}

.current-wait-value {
  justify-self: start;
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.current-wait > span:last-child {
  font-size: 12px;
  text-align: right;
}

.history-figure {
  margin: 8px 0 0;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--surface);
}

.history-freshness {
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.history-figure figcaption {
  display: grid;
  gap: 4px;
}

.history-figure figcaption strong {
  font-size: 19px;
  letter-spacing: -0.02em;
}

.history-figure figcaption span {
  color: var(--muted);
  font-size: 13px;
}

.chart-scroll {
  width: 100%;
  margin: 15px 0 8px;
  overflow-x: auto;
}

.history-chart {
  display: block;
  width: 100%;
  height: auto;
}

.chart-grid,
.chart-axis {
  vector-effect: non-scaling-stroke;
}

.chart-grid {
  stroke: #e8e8ed;
  stroke-width: 1;
}

.chart-axis {
  stroke: #a8a8ad;
  stroke-width: 1;
}

.history-line {
  fill: none;
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.history-point {
  fill: var(--blue);
  opacity: 0;
  stroke: var(--surface);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.history-point.is-selected,
.history-point.is-isolated {
  opacity: 1;
}

.history-point.is-selected {
  fill: var(--surface);
  stroke: var(--blue);
  stroke-width: 3;
}

.axis-label,
.axis-unit {
  fill: var(--muted);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 11px;
}

.axis-unit {
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.history-picker {
  display: grid;
  grid-template-columns: 160px minmax(180px, 1fr) minmax(130px, auto);
  align-items: center;
  gap: 12px;
  padding: 13px 0 3px;
}

.history-picker label {
  font-size: 13px;
  font-weight: 650;
}

input[type="range"] {
  width: 100%;
  min-height: 44px;
  accent-color: var(--blue);
}

.history-picker output {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.history-table {
  margin-top: 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.history-table summary {
  min-height: 44px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 650;
  line-height: 44px;
  cursor: pointer;
}

.table-scroll {
  overflow-x: auto;
}

.history-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.history-table th,
.history-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 10px;
  text-align: left;
}

.history-table tbody th {
  font-weight: 500;
}

.history-empty,
.history-loading {
  min-height: 260px;
  margin-top: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--surface);
  padding: 24px;
}

.history-empty {
  display: grid;
  place-content: center;
  text-align: center;
}

.history-empty h2,
.empty-state h2 {
  margin: 0 0 7px;
  font-size: 20px;
}

.history-empty p,
.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.history-loading > span {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-content: center;
  justify-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--surface);
  padding: 28px;
  text-align: center;
}

.empty-state button {
  margin-top: 16px;
}

.error-state {
  min-height: 240px;
}

.skeleton-line,
.skeleton-ride,
.skeleton-tools,
.skeleton-chart {
  background: linear-gradient(90deg, #e9e9ed 20%, #f4f4f6 40%, #e9e9ed 60%);
  background-size: 200% 100%;
  animation: loading 1.2s infinite linear;
}

.skeleton-line {
  height: 14px;
  border-radius: 7px;
}

.skeleton-title {
  width: min(280px, 62vw);
  height: 22px;
  margin-bottom: 10px;
}

.skeleton-copy {
  width: min(190px, 44vw);
}

.skeleton-tools {
  height: 44px;
  margin: 20px 0 16px;
  border-radius: 11px;
}

.skeleton-ride {
  height: 76px;
  margin-top: 9px;
  border-radius: 14px;
}

.skeleton-chart {
  height: 210px;
  margin-top: 18px;
  border-radius: 12px;
}

@keyframes loading {
  to {
    background-position: -200% 0;
  }
}

footer {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 42px 0 34px;
}

footer span {
  margin-right: auto;
  font-size: 14px;
  font-weight: 700;
}

.skip {
  position: fixed;
  z-index: 10;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  padding: 9px 12px;
}

.skip:focus {
  transform: none;
}

.noscript {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  margin: 0;
  background: var(--ink);
  color: #ffffff;
  padding: 12px;
  text-align: center;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  border-radius: 8px;
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

@media (max-width: 780px) {
  .parks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tools {
    grid-template-columns: 1fr 1fr;
  }

  .search-control {
    grid-column: 1 / -1;
  }

  .refresh-button {
    align-self: end;
  }

  .park-meta {
    display: grid;
  }

  .freshness {
    text-align: left;
  }

  .history-picker {
    grid-template-columns: 1fr;
  }

  .history-picker output {
    text-align: left;
  }
}

@media (max-width: 520px) {
  header,
  main,
  footer {
    width: min(100% - 28px, 1040px);
  }

  header {
    min-height: 68px;
  }

  nav {
    gap: 12px;
  }

  nav a {
    font-size: 13px;
  }

  nav a:first-child {
    display: none;
  }

  .intro {
    padding: 40px 0 24px;
  }

  h1 {
    font-size: 42px;
  }

  #subcopy {
    font-size: 16px;
  }

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

  .destination {
    margin-top: 28px;
  }

  .park-card {
    min-height: 160px;
  }

  .park-card-name {
    right: 12px;
    bottom: 12px;
    left: 12px;
    font-size: 15px;
  }

  .viewer,
  .detail {
    margin-inline: -14px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 20px 14px;
  }

  .tools {
    grid-template-columns: 1fr 1fr;
  }

  .search-control {
    grid-column: 1 / -1;
  }

  .refresh-button {
    grid-column: 1 / -1;
  }

  .ride {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .ride-copy strong {
    white-space: normal;
  }

  .chevron {
    display: none;
  }

  .badge {
    max-width: 112px;
  }

  .current-wait {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .current-wait > span:last-child {
    text-align: left;
  }

  .history-figure {
    padding: 16px 12px;
  }

  footer {
    flex-wrap: wrap;
  }

  footer span {
    width: 100%;
  }
}

@media (max-width: 339px) {
  .parks {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
