:root {
  --color-bg:    #000000;
  --color-fg:    #f4f2ec;
  --color-fg-dim: rgba(244, 242, 236, 0.55);
  --color-wave:  #3a3a3a;
  --color-wave-back: #2a2a2a;
  --color-moon:  rgba(244, 242, 236, 0.8);
  --color-ripple: rgba(244, 242, 236, 0.5);

  --font-quote: 'Cormorant Garamond', 'Georgia', serif;
  --font-ui:    'Inter', sans-serif;
  --font-mono:  'Courier New', ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--color-bg);
  color: var(--color-fg);
  overscroll-behavior: none;
}

.sky {
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 33.34vh);
  overflow: hidden;
  pointer-events: none;
}

.sky-scroll {
  position: absolute;
  inset: 0;
  will-change: transform, filter;
  filter: blur(0px);
  transition: filter 100ms linear;
}

.moon {
  position: absolute;
  top: 16px;
  right: 64px;
  margin: 0;
  color: var(--color-moon);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 14px;
  white-space: pre;
  user-select: none;
  filter: drop-shadow(0 0 0 rgba(244, 242, 236, 0));
  transition: filter 200ms ease-out;
}

.moon.moon-hover,
.moon.moon-scroll-glow {
  filter: drop-shadow(0 0 5px rgba(244, 242, 236, 0.6)) drop-shadow(0 0 12px rgba(244, 242, 236, 0.3));
}

.moon.moon-clicked {
  transition: filter 80ms ease-out;
  filter: drop-shadow(0 0 10px rgba(244, 242, 236, 1)) drop-shadow(0 0 24px rgba(244, 242, 236, 0.72));
}

.stars {
  position: absolute;
  inset: 0;
}

.star {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--color-fg);
  font-family: var(--font-mono);
  line-height: 1;
  opacity: 0.35;
  animation-name: star-twinkle;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

@keyframes star-twinkle {
  0%, 85%, 100% { opacity: 0.35; }
  92% { opacity: 1; }
}

.falling-star {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--color-fg);
  font-family: var(--font-mono);
  line-height: 1;
  opacity: 0;
  animation-name: falling-star;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}

@keyframes falling-star {
  0% { opacity: 0; transform: translate(0, 0); }
  12% { opacity: 1; }
  70% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)); }
}

.wave {
  position: fixed;
  z-index: 1;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 33.34vh;
  margin: 0;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 14px;
  white-space: pre;
  pointer-events: none;
  user-select: none;
}

.wave--back {
  z-index: 1;
  color: var(--color-wave-back);
}

.wave--front {
  z-index: 2;
  color: var(--color-wave);
}

.wave--ripples {
  z-index: 2;
  color: var(--color-ripple);
}

.stage {
  position: relative;
  z-index: 3;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
}

.frames {
  position: relative;
  width: min(88%, 700px);
  height: min(50vh, 320px);
}

.frame {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transition: opacity 70ms ease-out;
}

.frame.active {
  opacity: 1;
}

.frame .date {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-fg-dim);
  margin: 0 0 1.5rem;
}

.frame .thought {
  font-family: var(--font-quote);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  line-height: 1.45;
  color: var(--color-fg);
  margin: 0;
}

.frame .thought::before,
.frame .thought::after {
  content: '"';
  color: var(--color-fg-dim);
}

.frame .author {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-fg-dim);
  margin: 1.5rem 0 0;
}

.frame .author::before {
  content: '-\00A0';
}

.thought .earth-word {
  cursor: pointer;
  border-bottom: 1px dotted var(--color-fg-dim);
  transition: color 150ms ease-out;
}

.thought .earth-word:hover {
  color: var(--color-fg-dim);
}

.earth {
  position: absolute;
  /* Centered within the sky region above the wave (same height .sky uses),
     not the full viewport, so the globe reads as sitting in the sky rather
     than dipping into the water. */
  top: calc((100% - 33.34vh) / 2);
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  color: var(--color-fg);
  font-family: var(--font-mono);
  white-space: pre;
  text-align: center;
  user-select: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease-out;
}

.frames {
  transition: opacity 200ms ease-out;
}

.stage.earth-active .frames {
  opacity: 0;
}

.stage.earth-active .earth {
  opacity: 1;
}
