:root {
  --deep: #073f43;
  --ink: #12383a;
  --mist: #f4e9be;
  --sun: #f4c95e;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background:
    var(--deep)
    url("/assets/analog-horizon-poster.webp")
    center / cover
    fixed;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

.background-film {
  position: fixed;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: saturate(1.06) contrast(0.92) blur(0.4px);
  transform: scale(1.035);
  transition: opacity 1.4s ease;
  pointer-events: none;
}

.background-film.is-playing {
  opacity: 0.94;
}

body::after {
  position: fixed;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(244, 233, 190, 0.34), transparent 30rem),
    linear-gradient(rgba(246, 226, 167, 0.18), rgba(5, 54, 57, 0.16));
  content: "";
  pointer-events: none;
}

.crt {
  position: fixed;
  z-index: 24;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      rgba(0, 25, 27, 0.14) 2px,
      rgba(0, 25, 27, 0.14) 4px
    );
  mix-blend-mode: multiply;
}

.entry {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  place-items: center;
  overflow: hidden;
  padding:
    max(1rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 48%, rgba(244, 233, 190, 0.22), transparent 30rem),
    linear-gradient(rgba(4, 61, 64, 0.06), rgba(3, 37, 40, 0.18));
  transition: opacity 1.2s ease, filter 1.2s ease, visibility 1.2s;
}

.entry-glow {
  display: grid;
  width: min(80rem, 100%);
  justify-items: center;
  padding: clamp(2rem, 5vw, 5rem);
  border-radius: 50%;
  color: var(--mist);
  background: radial-gradient(circle, rgba(13, 76, 77, 0.74), transparent 70%);
  filter: drop-shadow(0 0 2.4rem rgba(244, 201, 94, 0.24));
}

.entry h1 {
  width: max-content;
  max-width: none;
  justify-self: center;
  margin: 0;
  font-family: "Avenir Next", Avenir, "Trebuchet MS", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(4.2rem, 13vw, 9rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.75;
  text-align: center;
  white-space: nowrap;
  text-shadow:
    0 0 2rem rgba(244, 201, 94, 0.35),
    3px 4px 0 rgba(202, 76, 43, 0.32);
}

.entry-credit {
  margin: 1rem 0 2.2rem;
  font-family: "Courier New", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  opacity: 0.72;
}

.entry-credit a,
.byline,
.project-credit a,
#track-artist {
  color: inherit;
  text-decoration: none;
}

.entry-credit a:hover,
.entry-credit a:focus-visible,
.byline:hover,
.byline:focus-visible,
.project-credit a:hover,
.project-credit a:focus-visible,
#track-artist:hover,
#track-artist:focus-visible {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.entry button {
  min-width: 10rem;
  padding: 0.9rem 1.6rem;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(244, 233, 190, 0.9);
  box-shadow:
    0 0 2rem rgba(244, 201, 94, 0.3),
    inset 0 0 1.2rem rgba(244, 201, 94, 0.45);
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  transition: transform 250ms ease, background 250ms ease;
}

.entry-description {
  width: min(40rem, 84vw);
  margin: 1.7rem 0 0;
  font-family: "Courier New", monospace;
  font-size: clamp(0.78rem, 1.15vw, 0.98rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.055em;
  opacity: 0.9;
  text-align: center;
  text-shadow: 0 0 1.2rem rgba(244, 233, 190, 0.28);
}

.entry .entry-description span {
  display: block;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  opacity: 1;
}

.entry .entry-description span + span {
  margin-top: 0.5rem;
  font-size: 0.88em;
  font-weight: 400;
  letter-spacing: 0.09em;
  opacity: 0.8;
}

.entry button:not(:disabled):hover {
  background: var(--mist);
  transform: scale(1.04);
}

.entry button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.entry span {
  margin-top: 1rem;
  font-family: "Courier New", monospace;
  font-size: 0.57rem;
  letter-spacing: 0.12em;
  opacity: 0.72;
}

.entry span:empty {
  display: none;
}

.before-entry {
  overflow: hidden;
}

.entered .entry {
  visibility: hidden;
  opacity: 0;
  filter: blur(1.5rem);
}

.site {
  min-height: 100vh;
  opacity: 0;
  transition: opacity 1.5s ease 0.15s;
}

.entered .site {
  opacity: 1;
}

.topbar {
  position: fixed;
  z-index: 8;
  top: 0;
  left: 0;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.5rem;
  color: rgba(244, 233, 190, 0.86);
  font-family: "Courier New", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.brand-lockup {
  display: grid;
  justify-items: start;
  color: inherit;
  text-decoration: none;
}

.wordmark {
  font-family: "Avenir Next", Avenir, "Trebuchet MS", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.045em;
  text-decoration: none;
  text-shadow: 0 0 1.4rem rgba(244, 233, 190, 0.35);
}

.byline {
  margin-top: 0.16rem;
  font-size: 0.43rem;
  letter-spacing: 0.14em;
  opacity: 0.52;
  text-decoration: none;
}

.quiet-button {
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0.75;
}

.quiet-button:hover,
.quiet-button:focus-visible {
  opacity: 1;
  text-decoration: underline;
}

.topnav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.topnav a {
  color: inherit;
  text-decoration: none;
  opacity: 0.75;
}

.topnav a:hover,
.topnav a:focus-visible {
  opacity: 1;
  text-decoration: underline;
}

.story-field {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  overflow: hidden;
  padding: 7rem clamp(1.5rem, 7vw, 8rem) 9rem;
  touch-action: none;
}

.story-field::before {
  position: absolute;
  width: min(84vw, 68rem);
  height: min(84vw, 68rem);
  border-radius: 50%;
  background: rgba(238, 218, 158, 0.14);
  box-shadow:
    0 0 9rem rgba(238, 218, 158, 0.26),
    inset 0 0 8rem rgba(238, 218, 158, 0.14);
  content: "";
  filter: blur(26px);
}

.story {
  position: relative;
  z-index: 2;
  width: min(72rem, 100%);
  text-align: center;
  transition:
    opacity 900ms ease,
    transform 1450ms cubic-bezier(0.18, 0.75, 0.14, 1),
    filter 1200ms ease;
}

.story.leaving-up {
  opacity: 0;
  filter: blur(34px);
  transform: translateY(-7rem) scale(1.04);
}

.story.leaving-down {
  opacity: 0;
  filter: blur(34px);
  transform: translateY(7rem) scale(1.04);
}

.story.arriving-up {
  opacity: 0;
  filter: blur(34px);
  transform: translateY(7rem) scale(0.98);
}

.story.arriving-down {
  opacity: 0;
  filter: blur(34px);
  transform: translateY(-7rem) scale(0.98);
}

.story-kind,
.story-source {
  font-family: "Courier New", monospace;
  text-transform: lowercase;
}

.story-date {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.48rem 0.78rem;
  border: 1px solid rgba(5, 54, 57, 0.16);
  border-radius: 999px;
  color: rgba(5, 54, 57, 0.78);
  background: rgba(244, 233, 190, 0.3);
  box-shadow: 0 0 1.8rem rgba(244, 233, 190, 0.22);
  font-family: "Courier New", monospace;
  font-size: 0.63rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.story-date[hidden] {
  display: none;
}

.story-kind {
  margin: 0 0 1.3rem;
  color: rgba(5, 54, 57, 0.68);
  font-size: 0.67rem;
  letter-spacing: 0.18em;
}

.story h2 {
  max-width: 18ch;
  margin: 0 auto;
  color: var(--ink);
  font-family: Verdana, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(2.6rem, 6.2vw, 6.25rem);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 0.94;
  text-wrap: balance;
  text-shadow:
    0 1px 0 rgba(244, 233, 190, 0.7),
    0 0 2.4rem rgba(244, 233, 190, 0.62);
}

.story-heart {
  max-width: 48rem;
  margin: 2rem auto 1.7rem;
  color: rgba(8, 48, 50, 0.96);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 2vw, 1.65rem);
  font-weight: 700;
  line-height: 1.45;
  text-wrap: balance;
  text-shadow: 0 1px 0 rgba(244, 233, 190, 0.62);
}

.story-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.82rem 1.3rem;
  border: 0;
  border-radius: 999px;
  color: var(--mist);
  background: rgba(5, 65, 67, 0.76);
  box-shadow:
    0 0 2.8rem rgba(244, 233, 190, 0.28),
    inset 0 0 1rem rgba(244, 233, 190, 0.12);
  font-family: "Courier New", monospace;
  font-size: 0.7rem;
  font-weight: bold;
  transition: transform 250ms ease, background 250ms ease;
}

.story-link:hover,
.story-link:focus-visible {
  background: rgba(5, 65, 67, 0.92);
  transform: scale(1.035);
}

.story-source {
  margin: 0.9rem 0 0;
  color: rgba(5, 54, 57, 0.58);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
}

.gesture-coach {
  position: absolute;
  z-index: 12;
  right: 1.4rem;
  bottom: 7.4rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem 0.8rem 1rem;
  border: 1px solid rgba(244, 233, 190, 0.2);
  border-radius: 1.4rem;
  color: rgba(244, 233, 190, 0.92);
  background: rgba(5, 62, 65, 0.68);
  box-shadow: 0 0 2.4rem rgba(244, 233, 190, 0.17);
  backdrop-filter: blur(14px);
  font-family: "Courier New", monospace;
  opacity: 0;
  pointer-events: none;
  transform: translateY(1rem) scale(0.94);
  transition:
    opacity 900ms ease,
    filter 900ms ease,
    transform 1100ms cubic-bezier(0.18, 0.8, 0.18, 1);
}

.gesture-coach.visible {
  opacity: 1;
  transform: none;
}

.gesture-coach.dismissed {
  opacity: 0;
  filter: blur(0.6rem);
  pointer-events: none;
  transform: translateY(-1.2rem) scale(0.96);
}

.gesture-copy {
  display: grid;
  gap: 0.18rem;
  white-space: nowrap;
}

.gesture-copy strong {
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}

.gesture-copy small {
  font-size: 0.48rem;
  letter-spacing: 0.06em;
  opacity: 0.65;
}

.gesture-hand {
  width: 2.15rem;
  height: 3.25rem;
  overflow: visible;
  fill: rgba(244, 233, 190, 0.16);
  stroke: var(--mist);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  animation: demonstrate-swipe 2.8s ease-in-out infinite;
}

@keyframes demonstrate-swipe {
  0%,
  100% {
    opacity: 0.55;
    transform: translateY(0.55rem);
  }
  45% {
    opacity: 1;
    transform: translateY(-0.55rem);
  }
  60% {
    opacity: 0.45;
  }
}

.sound {
  position: fixed;
  z-index: 10;
  right: 1.3rem;
  bottom: 1.2rem;
  display: grid;
  grid-template-columns: auto minmax(12rem, 1fr) auto;
  gap: 1rem;
  align-items: center;
  min-width: 27rem;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  color: var(--mist);
  background: rgba(5, 62, 65, 0.56);
  box-shadow: 0 0 2rem rgba(3, 43, 46, 0.22);
  backdrop-filter: blur(16px);
  font-family: "Courier New", monospace;
  transform-origin: right bottom;
  transition:
    transform 480ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background 480ms ease,
    box-shadow 480ms ease;
}

.sound:hover,
.sound:focus-within {
  background: rgba(5, 62, 65, 0.82);
  box-shadow: 0 0 3.5rem rgba(244, 233, 190, 0.24);
  transform: scale(1.18);
}

.sound-controls {
  display: flex;
  gap: 0.38rem;
  align-items: center;
}

.sound-controls button {
  display: grid;
  min-width: 3.25rem;
  min-height: 2.7rem;
  place-content: center;
  gap: 0.08rem;
  padding: 0.38rem 0.5rem;
  border: 0;
  border-radius: 1rem;
  color: var(--deep);
  background: rgba(244, 233, 190, 0.82);
  font-size: 0.72rem;
  opacity: 0.88;
  transition: opacity 360ms ease, transform 360ms ease, background 240ms ease;
}

.sound-controls button:nth-child(2) {
  min-width: 3.8rem;
  background: rgba(244, 233, 190, 0.96);
  opacity: 1;
}

.sound-controls button span {
  font-size: 0.8rem;
  line-height: 1;
}

.sound-controls button small {
  font-family: "Courier New", monospace;
  font-size: 0.43rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.sound-controls button:hover {
  background: var(--mist);
  opacity: 1;
  transform: translateY(-1px);
}

.sound-identity {
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.sound-identity button {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.sound-details {
  min-width: 0;
  padding-inline: 0.15rem;
}

.sound span,
.sound strong {
  display: block;
}

#track-album {
  overflow: hidden;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.1;
  opacity: 0.7;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-mainline {
  display: flex;
  gap: 0.48rem;
  align-items: center;
  overflow: hidden;
  margin-top: 0.28rem;
  white-space: nowrap;
}

#track-artist {
  display: inline;
  flex: 0 0 auto;
  overflow: hidden;
  font-family: "Avenir Next", Avenir, "Trebuchet MS", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  opacity: 1;
  text-overflow: ellipsis;
}

.track-separator {
  display: inline;
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.42;
}

#track-title {
  margin: 0;
  overflow: hidden;
  font-family: "Avenir Next", Avenir, "Trebuchet MS", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1;
  opacity: 0.96;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sound-identity:hover strong {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.platform-links {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.38rem;
}

.platform-links a {
  padding: 0.2rem 0.38rem;
  border: 1px solid rgba(244, 233, 190, 0.22);
  border-radius: 999px;
  color: inherit;
  font-size: 0.42rem;
  letter-spacing: 0.03em;
  opacity: 0.7;
  text-decoration: none;
}

.platform-links a:hover,
.platform-links a:focus-visible {
  background: rgba(244, 233, 190, 0.14);
  opacity: 1;
}

.sound-wave {
  display: flex;
  height: 1rem;
  gap: 2px;
  align-items: center;
}

.sound-wave i {
  width: 2px;
  height: 35%;
  border-radius: 99px;
  background: var(--mist);
  animation: pulse 900ms ease-in-out infinite alternate;
}

.sound-wave i:nth-child(2) {
  height: 85%;
  animation-delay: -300ms;
}

.sound-wave i:nth-child(3) {
  height: 60%;
  animation-delay: -600ms;
}

.sound-wave i:nth-child(4) {
  animation-delay: -150ms;
}

.sound.paused .sound-wave i {
  height: 2px;
  animation-play-state: paused;
}

@keyframes pulse {
  to {
    height: 100%;
  }
}

dialog {
  width: min(31rem, calc(100% - 2rem));
  padding: 2.5rem;
  border: 0;
  border-radius: 2rem;
  color: var(--mist);
  background: rgba(5, 67, 69, 0.94);
  box-shadow: 0 0 6rem rgba(2, 31, 33, 0.6);
}

dialog::backdrop {
  background: rgba(2, 35, 37, 0.58);
  backdrop-filter: blur(12px);
}

dialog h2 {
  margin: 1.5rem 0;
  font-family: Verdana, "Helvetica Neue", Arial, sans-serif;
  font-size: 3rem;
  letter-spacing: -0.08em;
}

.dialog-close {
  float: right;
}

.music-room-label {
  margin: 0 0 0.8rem;
  font-family: "Courier New", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.music-room a {
  color: var(--sun);
}

.music-room-links {
  display: grid;
  gap: 0.65rem;
  justify-items: center;
}

.music-room {
  text-align: center;
}

.music-room h2 {
  margin-bottom: 1rem;
}

.music-room p:not(.music-room-label) {
  max-width: 27rem;
  margin: 0 auto 1.3rem;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.5;
}

.project-credit {
  font-family: "Courier New", monospace !important;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  opacity: 0.54;
}

.archive-page {
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

@media (max-width: 680px) {
  .entry {
    height: 100svh;
  }

  .entry-glow {
    width: 100%;
    padding: 2rem 0.5rem;
  }

  .entry h1 {
    width: auto;
    max-width: 100%;
    font-size: clamp(3rem, 15.5vw, 4.35rem);
    letter-spacing: -0.055em;
    line-height: 0.86;
  }

  .entry-credit {
    margin: 0.9rem 0 1.8rem;
    font-size: 0.62rem;
  }

  .entry-description {
    width: min(19rem, 78vw);
    font-size: 0.7rem;
  }

  .entry span {
    max-width: 80vw;
    text-align: center;
  }

  .topbar {
    padding: 1rem;
  }

  .story-field {
    min-height: 100svh;
    padding: 5.5rem 1.1rem 9.5rem;
  }

  .story h2 {
    font-size: clamp(2.3rem, 11.5vw, 4rem);
  }

  .story-heart {
    font-size: 1.08rem;
  }

  .gesture-coach {
    right: 0.85rem;
    bottom: 7.4rem;
  }

  .sound {
    right: 50%;
    bottom: 0.9rem;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    width: calc(100% - 1.8rem);
    min-width: 0;
    padding: 0.68rem 0.78rem;
    transform: translateX(50%);
  }

  .sound-controls {
    gap: 0.25rem;
  }

  .sound-controls button {
    min-width: 2.8rem;
    min-height: 2.55rem;
    padding-inline: 0.35rem;
  }

  .sound-controls button:nth-child(2) {
    min-width: 3.25rem;
  }

  #track-album {
    font-size: 0.55rem;
  }

  .track-mainline {
    gap: 0.3rem;
    margin-top: 0.18rem;
  }

  #track-artist {
    font-size: 0.8rem;
  }

  .track-separator {
    font-size: 0.75rem;
  }

  #track-title {
    font-size: 0.86rem;
  }

  .sound-wave {
    display: none;
  }

  .sound:hover,
  .sound:focus-within {
    transform: translateX(50%) scale(1.03);
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .topbar {
    padding: 0.65rem 1rem;
  }

  .story-field {
    padding: 3.3rem 1rem 5.4rem;
  }

  .story-kind {
    margin-bottom: 0.55rem;
  }

  .story h2 {
    max-width: 22ch;
    font-size: clamp(1.9rem, 9.8vh, 3.4rem);
    line-height: 0.98;
  }

  .story-heart {
    max-width: 42rem;
    margin: 0.8rem auto 0.85rem;
    font-size: clamp(0.95rem, 3.7vh, 1.2rem);
  }

  .story-link {
    padding: 0.62rem 1rem;
  }

  .story-source,
  .gesture-coach {
    display: none;
  }

  .sound {
    right: 0.75rem;
    bottom: 0.6rem;
    min-width: 18rem;
    padding: 0.48rem 0.65rem;
    transform: none;
  }

  .sound:hover,
  .sound:focus-within {
    transform: scale(1.04);
  }
}

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