:root {
  color-scheme: dark;
  --page: #050505;
  --ink: #ffffff;
  --control: rgba(255, 255, 255, 0.14);
  --control-strong: rgba(255, 255, 255, 0.22);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  overflow: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 4;
  content: "";
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: soft-light;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.28) 0 0.5px, transparent 0.7px),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.18) 0 0.45px, transparent 0.65px);
  background-size: 3px 3px, 5px 5px;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background: rgba(0, 0, 0, 0.76);
}

.backdrop-image {
  position: fixed;
  inset: -120px;
  z-index: -2;
  width: calc(100% + 240px);
  height: calc(100% + 240px);
  object-fit: cover;
  opacity: 0;
  filter: blur(96px) saturate(1.24) brightness(0.62);
  transform: scale(1.1);
  transition: opacity 1100ms ease;
}

.backdrop-image.is-loaded {
  opacity: 0;
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 72px);
}

.viewer {
  position: relative;
  width: min(100%, 1180px);
  aspect-ratio: 16 / 9;
  isolation: isolate;
}

body.has-empty-series .viewer {
  background: rgba(255, 255, 255, 0.035);
  border-radius: 32px;
}

.ambient-image {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  border-radius: 32px;
  object-fit: cover;
  opacity: 0;
  filter: blur(86px) saturate(1.76) brightness(1.48);
  transform: scale(1.035);
  transition:
    opacity 900ms ease,
    transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ambient-image.is-loaded {
  opacity: 0.38;
  transform: scale(1.065);
}

.viewer.is-loading .ambient-image {
  opacity: 0.11;
  transform: scale(1.035);
}

.daily-image {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  display: none;
  border: 0;
  border-radius: 32px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 36px 120px rgba(0, 0, 0, 0.34);
  opacity: 0;
  transform: scale(0.992);
  transform-origin: center;
  transition:
    opacity 900ms ease,
    transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.daily-image.has-src {
  display: block;
}

.daily-image.is-loaded {
  opacity: 1;
  transform: scale(1);
}

.viewer.is-loading .daily-image {
  opacity: 0.18;
  transform: scale(0.982);
}

.control-row {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.control {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: var(--control);
  color: var(--ink);
  font: inherit;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(18px);
  transition:
    background 180ms ease;
}

.info {
  font-size: 1rem;
  font-style: italic;
  font-weight: 800;
}

.date-pill {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0 16px;
  background: var(--control);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: auto;
  backdrop-filter: blur(18px);
  transition:
    background 180ms ease;
}

.button-group {
  display: flex;
  gap: 8px;
}

.viewer:hover .control-row,
.viewer:focus-within .control-row {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.control:hover,
.control:focus-visible {
  background: var(--control-strong);
  outline: none;
}

.control[hidden] {
  display: none;
}

.field-note {
  position: absolute;
  top: calc(100% + 18px);
  right: 24px;
  left: 24px;
  margin: 0 auto;
  max-width: 760px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.55;
  text-align: center;
  text-wrap: balance;
  opacity: 0;
  transform: translateY(-2px);
  transition:
    opacity 500ms ease,
    transform 500ms ease;
}

.daily-image.is-loaded ~ .field-note:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
}

.field-note[hidden] {
  display: none;
}

.news-panel {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 12;
  width: min(430px, 88vw);
  height: 100vh;
  overflow: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0 22px 28px;
  background: rgba(8, 8, 8, 0.76);
  box-shadow: 28px 0 90px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(24px);
  transform: translateX(-100%);
  transition:
    transform 320ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 320ms ease;
}

.news-panel.is-open {
  transform: translateX(0);
}

.news-panel header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 0 18px;
  margin-bottom: 12px;
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(24px);
}

.news-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.84rem;
  font-weight: 800;
}

.news-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.news-close:hover,
.news-close:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: var(--ink);
  outline: none;
}

.news-list {
  margin: 0;
  padding: 0;
  list-style-position: inside;
}

.news-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 9px 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.82rem;
  line-height: 1.35;
}

.news-list li + li {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.news-list span,
.news-list small {
  display: block;
}

.news-list small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.74rem;
}

.story-link {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.74);
  text-decoration: none;
}

.story-link:hover,
.story-link:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: var(--ink);
  outline: none;
}

.image-loader {
  position: fixed;
  top: 22px;
  right: 78px;
  z-index: 10;
  width: 28px;
  height: 28px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.image-loader::before {
  position: absolute;
  inset: 0;
  content: "";
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  animation: loader-spin 900ms linear infinite;
}

.image-loader span {
  display: none;
}

body.is-loading .image-loader {
  opacity: 1;
  transform: scale(1);
}

.series-menu {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 11;
}

.series-trigger {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font: inherit;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition:
    color 180ms ease;
}

.series-trigger:hover,
.series-trigger:focus-visible,
.series-trigger[aria-expanded="true"] {
  color: var(--ink);
  outline: none;
}

.series-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 158px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 6px;
  background: rgba(8, 8, 8, 0.68);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(22px);
}

.series-options[hidden] {
  display: none;
}

.series-option {
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.series-option:hover,
.series-option:focus-visible,
.series-option[aria-checked="true"] {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  outline: none;
}

@keyframes loader-spin {
  to {
    transform: rotate(1turn);
  }
}

@media (max-width: 640px) {
  .page {
    padding: 18px;
  }

  .ambient-image {
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    filter: blur(58px) saturate(1.66) brightness(1.36);
  }

  .daily-image {
    border-radius: 24px;
  }

  .control-row {
    right: 10px;
    bottom: 10px;
    left: 10px;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .control {
    width: 40px;
    height: 40px;
  }

  .date-pill {
    min-height: 40px;
  }

  .field-note {
    top: calc(100% + 14px);
    right: 8px;
    left: 8px;
    font-size: 0.76rem;
  }

  .news-panel {
    width: min(360px, 92vw);
    padding-right: 18px;
    padding-left: 18px;
  }

  .image-loader {
    top: 16px;
    right: 68px;
  }

  .series-menu {
    top: 10px;
    right: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-image,
  .daily-image {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .backdrop-image {
    opacity: 0;
  }

  .ambient-image {
    opacity: 0.38;
  }

  .image-loader::before {
    animation: none;
  }
}
