:root {
  --c-accent-1-300: color-mix(in hsl, var(--c-accent-1-500), white 20%);
  --c-accent-1-400: color-mix(in hsl, var(--c-accent-1-500), white 10%);
  --c-accent-1-500: hsl(153, 43%, 42%);
  --c-accent-1-600: color-mix(in hsl, var(--c-accent-1-500), black 10%);

  --c-accent-2-300: hsl(from var(--c-accent-2-500) h s 53%);
  --c-accent-2-400: hsl(from var(--c-accent-2-500) h s 48%);
  --c-accent-2-500: hsl(208, 100%, 43%);
  --c-accent-2-600: color-mix(in hsl, var(--c-accent-2-500), black 10%);
}

body {
  background: hsl(174 9% 98% / 1);
  color: hsl(211, 94%, 13%);
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 0;
}

a,
a:active,
a:link,
a:visited {
  color: var(--c-accent-2-500);
  text-decoration: solid underline 1px;
  text-underline-offset: 2px;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-variation-settings:
    "FILL" 0,
    "wght" 600,
    "GRAD" 0,
    "opsz" 20;
}

.material-symbols-filled {
  font-family: "Material Symbols Outlined";
  font-variation-settings:
    "FILL" 1,
    "wght" 600,
    "GRAD" 0,
    "opsz" 24;
}

.app {
  margin: 0 auto;
  max-width: 600px;
  padding: 0 16px 24px;
}

@media (min-width: 600px) {
  .app {
    padding: 24px 36px;
  }
}

.header {
  aspect-ratio: 2 / 1;
  background-image: url("/empire-state-building-observatory.webp");
  background-position: top center;
  background-size: cover;
  box-sizing: border-box;
  color: hsl(0 0% 100% / 0.95);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin: 0 -16px;
  padding: 24px 24px 20px;
  position: relative;
}

.header::before {
  background-image: linear-gradient(
    to top,
    hsl(0 0% 0% / 0.6) 10%,
    hsl(0 0% 0% / 0) 100%
  );
  bottom: 0;
  content: "";
  display: block;
  height: 40%;
  left: 0;
  mix-blend-mode: darken;
  position: absolute;
  right: 0;
  z-index: 0;
}

@scope (.header) {
  .title {
    color: hsl(0 0% 100% / 0.85);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 1;
  }

  .subtitle {
    font-size: 32px;
    font-weight: 300;
    letter-spacing: -0.5px;
    line-height: 1;
    margin: 0;
    padding: 0;
    position: relative;
    text-shadow: 0 0 1px hsl(0 0% 0% / 0.4);
    z-index: 1;
  }
}

.itinerary {
  padding: 0;
}

.itinerary__title {
  background-image: linear-gradient(
    to bottom,
    hsl(174 9% 98% / 1) 80%,
    hsl(174 9% 98% / 0) 100%
  );
  color: hsl(216 10% 36% / 1);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.333;
  margin: 0;
  padding: 24px 0 16px;
  position: sticky;
  top: 0;
  z-index: 1;
}

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

.event {
  background-image: linear-gradient(
    hsl(from var(--c-accent-2-300) h s l / 0.4),
    hsl(from var(--c-accent-2-300) h s l / 0.4)
  );
  background-size: 2px 100%;
  background-repeat: no-repeat;
  background-position: 8px 0;
  margin: 0;
  padding: 0 16px 16px 32px;
  position: relative;
  scroll-margin-top: 96px;
}

.event:target {
  padding-top: 3px;
}

.event::before {
  background-color: var(--c-accent-2-300);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 2px white,
    0 0 0 4px white;
  content: "";
  display: block;
  height: 10px;
  left: 4px;
  outline: 2px solid var(--c-accent-2-300);
  outline-offset: 0;
  position: absolute;
  top: 4px;
  width: 10px;
}

.event:last-child {
  background-size: 2px 18px;
  padding-bottom: 32px;
}

.event.is-green-line {
  background-image: linear-gradient(
    hsl(120deg 100% 27% / 0.7),
    hsl(120deg 100% 27% / 0.7)
  );
}

.event.is-orange-line {
  background-image: linear-gradient(
    hsl(19deg 100% 55% / 0.7),
    hsl(19deg 100% 55% / 0.7)
  );
}

.event.is-purple-line {
  background-image: linear-gradient(purple, purple);
}

.event.is-6-train::after {
  align-items: center;
  background: hsl(120, 100%, 27%);
  border-radius: 50%;
  color: white;
  content: "6";
  display: flex;
  font-size: 12px;
  height: 18px;
  justify-content: center;
  left: 0;
  position: absolute;
  top: 21px;
  width: 18px;
}

.event.is-7-train::after {
  align-items: center;
  background: purple;
  border-radius: 50%;
  color: white;
  content: "7";
  display: flex;
  font-size: 12px;
  height: 18px;
  justify-content: center;
  left: 0;
  position: absolute;
  top: 21px;
  width: 18px;
}

.event.is-B-train::after {
  align-items: center;
  background: hsl(19deg 100% 55%);
  border-radius: 50%;
  color: white;
  content: "B";
  display: flex;
  font-size: 12px;
  height: 18px;
  justify-content: center;
  left: 0;
  position: absolute;
  top: 21px;
  width: 18px;
}

.event-time {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
  font-size: 14px;
  font-weight: 700;
  line-height: 16px;
  transition:
    background 1s ease-in,
    color 750ms ease-out;
}

.event:target .event-time {
  background: var(--c-accent-2-500);
  border-radius: 4px;
  color: white;
  font-weight: 600;
  margin-left: -6px;
  margin-right: -6px;
  margin-top: -6px;
  padding: 3px 6px;
}

.event-anchor {
  align-items: center;
  background: hsl(204 43% 92% / 1);
  border-radius: 4px;
  box-sizing: border-box;
  color: hsl(209deg 30.12% 57.95% / 80%);
  cursor: pointer;
  display: flex;
  font-size: 14px;
  justify-content: center;
  margin: 0;
  padding: 2px;
  width: 24px;
}

.event:target .event-anchor {
  background: hsl(0deg 0% 100% / 25%);
  border-radius: 2px;
  color: white;
}

.event-desc {
  margin: 4px 0 0;
  padding: 0;
}

.event-details {
  display: block;
  margin: 16px 0 0;
  padding: 0 8px 8px;
}

.event-details[open] .event-details__summary::after {
  transform: rotate(180deg);
}

.event-details__summary {
  align-items: center;
  background: hsl(240 15% 94% / 1);
  border-radius: 4px;
  display: grid;
  color: hsl(231 20% 44% / 1);
  cursor: pointer;
  font-size: 14px;
  gap: 4px;
  grid-template-columns: auto 1fr;
  line-height: 16px;
  list-style-position: outside;
  margin: 0 0 12px -8px;
  max-width: fit-content;
  padding: 3px 8px;
}

.event-details__summary::after {
  border: 4px solid transparent;
  border-bottom-width: 0;
  border-top-color: hsl(231 20% 44% / 1);
  border-top-width: 5px;
  display: block;
  content: "";
  height: 0;
  transform: rotate(359deg);
  transform-origin: center 2px;
  transition: transform 200ms ease-out;
  width: 0;
}

.event-details__summary::marker,
.event-details__summary::-webkit-details-marker {
  display: none;
}

.event-details__summary + * {
  margin-top: 20px;
}

.event-details__location {
  display: grid;
  font-size: 14px;
  gap: 8px;
  grid-template-columns: auto auto;
  line-height: 18px;
  margin: 0 0 12px;
  max-width: fit-content;
  text-decoration: none;
}

.event-details__location-icon {
  color: hsl(153 57% 40% / 1);
  display: inline-block;
  font-size: 18px;
}

.event-details__subheading {
  color: hsl(231 20% 34% / 1);
  color: hsl(225 40% 22%);
  font-size: 14px;
  font-weight: 600;
  line-height: 16px;
  margin: 0 0 8px;
  padding: 0;
}

.event-details__list {
  margin: 0;
  padding: 0 0 0 14px;
}

.event-details__list-item {
  font-size: 14px;
  line-height: 17px;
  margin: 8px 0;
}
