.page-dream {
  min-height: 100vh;
  color: #f4ebe7;
  background:
    radial-gradient(circle at 18% 18%, rgba(200, 111, 150, 0.12), transparent 28%),
    radial-gradient(circle at 82% 20%, rgba(74, 143, 131, 0.1), transparent 24%),
    radial-gradient(circle at 50% 62%, rgba(240, 141, 185, 0.08), transparent 32%),
    linear-gradient(180deg, #1b1620 0%, #141017 50%, #0d0a10 100%);
  overflow-x: hidden;
  position: relative;
}

.page-dream::before,
.page-dream::after {
  content: "";
  inset: 0;
  position: fixed;
  pointer-events: none;
}

.page-dream::before {
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 5px
    );
  opacity: 0.22;
}

.page-dream::after {
  z-index: 0;
  background: radial-gradient(circle at center, transparent 50%, rgba(0, 0, 0, 0.36) 100%);
}

.page-dream .site-header,
.page-dream .dream-main {
  position: relative;
  z-index: 1;
}

.page-dream .site-header {
  background: linear-gradient(180deg, rgba(10, 8, 12, 0.9), rgba(10, 8, 12, 0.18));
  backdrop-filter: blur(10px);
}

.page-dream .nav a,
.page-dream .theme-toggle {
  background: rgba(28, 22, 31, 0.82);
  border-color: rgba(244, 235, 231, 0.18);
}

.page-dream .nav a:hover,
.page-dream .nav a:focus-visible,
.page-dream .theme-toggle:hover,
.page-dream .theme-toggle:focus-visible {
  background: rgba(105, 49, 74, 0.72);
}

.page-dream .nav a.is-active,
.page-dream .nav a[aria-current="page"] {
  background: rgba(38, 72, 66, 0.84);
}

.dream-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.36) 0.7px, transparent 0.9px),
    radial-gradient(rgba(255, 255, 255, 0.16) 0.7px, transparent 0.9px);
  background-position: 0 0, 1.5px 1.5px;
  background-size: 4px 4px;
  mix-blend-mode: screen;
}

.dream-main {
  width: min(100%, 1180px);
  margin: 0 auto;
  min-height: calc(100vh - 76px);
  padding: 40px 24px 96px;
  display: grid;
  grid-template-columns: minmax(260px, 28rem) minmax(420px, 1fr);
  gap: clamp(36px, 4vw, 72px);
  align-items: start;
}

.dream-intro {
  width: min(36rem, 100%);
  margin: 18px 0 0;
}

.dream-kicker {
  margin: 0 0 8px;
  color: rgba(255, 157, 198, 0.88);
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dream-intro h1 {
  margin: 0;
  color: #ff9dc6;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  letter-spacing: 0.05em;
  line-height: 0.94;
}

.dream-lede {
  margin: 14px 0 0;
  max-width: 30rem;
  color: rgba(244, 235, 231, 0.78);
}

.dream-stage {
  position: relative;
  min-height: 900px;
}

.dream-haze {
  position: absolute;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.42;
  pointer-events: none;
}

.dream-haze-a {
  width: 26rem;
  height: 16rem;
  top: 8%;
  left: 0;
  background: radial-gradient(circle, rgba(240, 141, 185, 0.2), transparent 70%);
}

.dream-haze-b {
  width: 24rem;
  height: 16rem;
  top: 0;
  right: 4%;
  background: radial-gradient(circle, rgba(74, 143, 131, 0.18), transparent 72%);
}

.dream-haze-c {
  width: 30rem;
  height: 18rem;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 157, 198, 0.12), transparent 72%);
}

.dream-scene {
  position: relative;
  min-height: 900px;
}

.dream-project-field {
  position: absolute;
  inset: 12px 0 340px;
  display: grid;
  place-items: start center;
  align-content: start;
  z-index: 2;
  padding: 0 24px;
}

.dream-bubble-wrap {
  width: min(28rem, calc(100vw - 48px));
  display: grid;
  justify-items: center;
  gap: 14px;
  transform: none;
  transition: transform 220ms ease, opacity 220ms ease, filter 220ms ease;
  animation: dreamBubbleReveal 420ms ease forwards;
}

.dream-bubble {
  position: relative;
  display: block;
  width: min(18.5rem, 52vw);
  color: inherit;
}

.dream-bubble:focus-visible {
  outline: none;
}

.dream-bubble::before,
.dream-bubble::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(244, 235, 231, 0.2);
  border-radius: 999px;
  background: rgba(25, 20, 28, 0.84);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.dream-bubble::before {
  width: 30px;
  height: 30px;
  left: 64%;
  bottom: -16px;
}

.dream-bubble::after {
  width: 16px;
  height: 16px;
  left: 76%;
  bottom: -34px;
}

.dream-bubble-shell {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(244, 235, 231, 0.2);
  border-radius: 50%;
  overflow: hidden;
  background: rgba(25, 20, 28, 0.84);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  animation: dreamBubbleFloat 7s ease-in-out infinite;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.dream-bubble:hover .dream-bubble-shell,
.dream-bubble:focus-visible .dream-bubble-shell {
  transform: scale(1.04);
  border-color: rgba(244, 235, 231, 0.3);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.dream-bubble-image {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.dream-bubble-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.9) contrast(1.02);
}

.dream-bubble-copy {
  width: min(30rem, calc(100vw - 48px));
  display: grid;
  gap: 6px;
  text-align: center;
  padding-inline: 18px;
}

.dream-bubble-title {
  color: #f4ebe7;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.1vw, 1.95rem);
  letter-spacing: 0.05em;
  line-height: 1;
  margin: 0;
}

.dream-bubble-meta {
  color: rgba(255, 157, 198, 0.88);
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dream-bubble-description {
  color: rgba(244, 235, 231, 0.72);
  font-size: 0.9rem;
  line-height: 1.65;
  margin: 0;
}

.dream-bubble-hint {
  color: rgba(244, 235, 231, 0.5);
  font-family: var(--font-pixel);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dream-project-field.is-shuffling .dream-bubble-wrap {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(-20px);
}

.dream-bubble-wrap.is-opening {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(-28px) scale(1.02);
}

.dream-sleeper {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 1;
  width: min(20rem, 54vw);
  transform: translateX(-50%);
  animation: dreamSleeperFloat 6s ease-in-out infinite;
}

.sleep-aura {
  position: absolute;
  inset: 24% 12%;
  background: radial-gradient(circle, rgba(255, 157, 198, 0.12), transparent 70%);
  filter: blur(20px);
}

.sleep-sprite {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.sleep-body,
.sleep-blanket {
  transform-box: fill-box;
  transform-origin: center;
}

.sleep-body {
  animation: dreamBodyBreath 4s ease-in-out infinite;
}

.sleep-blanket {
  animation: dreamBlanketBreath 4s ease-in-out infinite;
}

.sleep-z {
  position: absolute;
  color: rgba(244, 235, 231, 0.62);
  font-family: var(--font-pixel);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  animation: dreamSleepLetter 4.8s linear infinite;
}

.sleep-z-a {
  top: 8%;
  right: 20%;
  animation-delay: 0s;
}

.sleep-z-b {
  top: 0;
  right: 15%;
  font-size: 0.88rem;
  animation-delay: 1.3s;
}

.sleep-z-c {
  top: -8%;
  right: 10%;
  font-size: 1rem;
  animation-delay: 2.6s;
}

.dream-controls {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.dream-button,
.dream-all-works {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid rgba(244, 235, 231, 0.18);
  background: rgba(25, 20, 28, 0.9);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  color: inherit;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.dream-button:hover,
.dream-button:focus-visible,
.dream-all-works:hover,
.dream-all-works:focus-visible {
  transform: translate(-1px, -1px);
  background: rgba(38, 72, 66, 0.86);
  border-color: rgba(244, 235, 231, 0.3);
}

.dream-button {
  cursor: pointer;
  color: #f4ebe7;
}

.dream-button[disabled] {
  cursor: wait;
  opacity: 0.72;
}

.dream-empty {
  width: min(28rem, calc(100vw - 48px));
  padding: 18px 20px;
  border: 1px solid rgba(244, 235, 231, 0.18);
  background: rgba(25, 20, 28, 0.9);
  color: rgba(244, 235, 231, 0.76);
  text-align: center;
}

.dream-empty a {
  color: #ff9dc6;
}

.noscript-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  padding: 12px 14px;
  border: 1px solid rgba(244, 235, 231, 0.2);
  background: rgba(20, 16, 23, 0.96);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes dreamBubbleReveal {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dreamBubbleFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes dreamSleeperFloat {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(-8px);
  }
}

@keyframes dreamBodyBreath {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-1px);
  }
}

@keyframes dreamBlanketBreath {
  0%,
  100% {
    transform: scaleY(1);
  }

  50% {
    transform: scaleY(1.04);
  }
}

@keyframes dreamSleepLetter {
  0% {
    opacity: 0;
    transform: translateY(0);
  }

  18%,
  58% {
    opacity: 0.72;
  }

  100% {
    opacity: 0;
    transform: translateY(-24px);
  }
}

@media (max-width: 960px) {
  .dream-main {
    display: block;
    padding: 32px 20px 108px;
  }

  .dream-intro {
    margin-top: 0;
  }

  .dream-stage,
  .dream-scene {
    min-height: 820px;
  }

  .dream-project-field {
    inset: 8px 0 300px;
  }
}

@media (max-width: 720px) {
  .dream-main {
    display: block;
    padding: 30px 16px 108px;
  }

  .dream-stage,
  .dream-scene {
    min-height: 760px;
  }

  .dream-bubble-wrap {
    width: min(24rem, calc(100vw - 32px));
    gap: 16px;
    transform: none;
  }

  .dream-bubble {
    width: min(17rem, 74vw);
  }

  .dream-project-field {
    inset: 8px 0 250px;
    padding-top: 8px;
  }

  .dream-sleeper {
    width: min(20rem, 78vw);
    bottom: 8px;
  }

  .dream-controls {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 520px) {
  .dream-intro h1 {
    font-size: clamp(2rem, 12vw, 3rem);
  }

  .dream-stage,
  .dream-scene {
    min-height: 780px;
  }

  .dream-bubble-wrap {
    width: calc(100vw - 32px);
    transform: none;
  }

  .dream-bubble {
    width: min(16rem, 78vw);
  }

  .dream-project-field {
    inset: 8px 0 230px;
  }

  .dream-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .dream-button,
  .dream-all-works {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dream-bubble-wrap,
  .dream-bubble-shell,
  .dream-sleeper,
  .sleep-body,
  .sleep-blanket,
  .sleep-z {
    animation: none !important;
  }

  .dream-project-field.is-shuffling .dream-bubble-wrap,
  .dream-bubble-wrap.is-opening {
    filter: none;
  }
}
