:root {
  --ink: #0b1016;
  --cream: #f3e6c8;
  --cream-dim: #c9b48a;
  --gold: #e0b56a;
  --lamp: #5a3a18;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--cream);
  background: var(--ink);
  font-family: "Fraunces", "Times New Roman", serif;
  cursor: crosshair;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(180deg, #080d14 0%, #121821 48%, #1c1710 100%);
}

.wash,
.glow-moon,
.glow-floor,
.vignette {
  position: absolute;
  inset: 0;
}

.wash {
  background: radial-gradient(
    ellipse 80% 60% at 50% 40%,
    rgba(28, 40, 58, 0.28),
    transparent 72%
  );
}

.glow-moon {
  background: radial-gradient(
    ellipse 52% 42% at 76% 8%,
    rgba(240, 216, 160, 0.38),
    rgba(240, 216, 160, 0.1) 36%,
    transparent 70%
  );
}

.glow-floor {
  background: radial-gradient(
    ellipse 90% 50% at 50% 112%,
    rgba(120, 74, 32, 0.5),
    rgba(56, 34, 16, 0.22) 46%,
    transparent 72%
  );
}

.vignette {
  box-shadow: inset 0 0 120px 36px rgba(5, 8, 12, 0.45);
}

.mobile {
  position: fixed;
  inset: 0 0 auto;
  height: 42vh;
  pointer-events: none;
  z-index: 1;
}

.charm {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: top center;
  animation: sway 7.5s ease-in-out infinite;
}

.charm-moon {
  left: 11%;
  animation-duration: 8.2s;
}

.charm-orb {
  left: 78%;
  animation-duration: 6.4s;
  animation-delay: -2s;
}

.charm-star {
  left: 88%;
  animation-duration: 9s;
  animation-delay: -1.2s;
}

.string {
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--cream-dim));
  opacity: 0.55;
}

.charm-moon .string {
  height: 11vh;
}

.charm-orb .string {
  height: 7vh;
}

.charm-star .string {
  height: 16vh;
}

.charm-icon {
  width: 28px;
  height: 28px;
  fill: var(--cream);
  filter: drop-shadow(0 0 10px rgba(224, 181, 106, 0.35));
}

.charm-star .charm-icon {
  width: 18px;
  height: 18px;
}

.orb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px rgba(224, 181, 106, 0.55);
}

.wishes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.speck {
  position: absolute;
  border-radius: 50%;
  background: #f4ead4;
  box-shadow: 0 0 6px rgba(244, 234, 212, 0.7);
  animation: twinkle 4.6s ease-in-out infinite;
}

.wish {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  color: var(--cream);
  animation: twinkle 3.4s ease-in-out infinite;
}

.wish::before,
.wish::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: currentColor;
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(243, 230, 200, 0.9);
  transform: translate(-50%, -50%);
}

.wish::before {
  width: 2px;
  height: 100%;
}

.wish::after {
  width: 100%;
  height: 2px;
}

.wish.pop {
  animation: pop 0.45s ease-out, twinkle 3.4s ease-in-out 0.45s infinite;
}

main {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 12vh 1.5rem 10vh;
  pointer-events: none;
  animation: rise 1.1s ease both;
}

.eyebrow {
  margin: 0 0 1.6rem;
  color: var(--cream-dim);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: lowercase;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(3.4rem, 13vw, 5.8rem);
  font-weight: 340;
  font-style: italic;
  font-optical-sizing: auto;
  letter-spacing: 0.03em;
  line-height: 0.9;
  text-align: center;
  color: var(--cream);
}

.watch {
  position: relative;
  width: min(48vw, 260px);
  aspect-ratio: 1;
}

.dial {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ring,
.ring-inner,
.ticks path {
  fill: none;
  stroke: var(--cream);
}

.ring {
  stroke-width: 0.7;
  opacity: 0.92;
}

.ring-inner {
  stroke-width: 0.35;
  opacity: 0.28;
}

.ticks path {
  stroke-width: 1.1;
  stroke-linecap: square;
  opacity: 0.7;
}

.hands line {
  stroke: var(--cream);
  stroke-linecap: round;
  transform-origin: 100px 100px;
}

.hour {
  stroke-width: 3.2;
  transform: rotate(307deg);
}

.minute {
  stroke-width: 1.7;
  transform: rotate(84deg);
}

.hub {
  fill: var(--cream);
}

.mark {
  fill: var(--cream-dim);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 8px;
  letter-spacing: 1.4px;
}

.when,
.age,
.hint {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.when {
  margin: 2.1rem 0 0;
  color: var(--cream-dim);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-align: center;
}

.age {
  margin: 0.7rem 0 0;
  color: var(--cream);
  font-size: clamp(0.78rem, 2.4vw, 0.92rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.hint {
  position: fixed;
  right: 0;
  bottom: 1.3rem;
  left: 0;
  z-index: 3;
  margin: 0;
  color: var(--cream-dim);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: lowercase;
  opacity: 0.55;
  pointer-events: none;
}

@keyframes sway {
  0%,
  100% {
    transform: rotate(-4.5deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.88);
  }
  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}

@keyframes pop {
  0% {
    opacity: 0;
    transform: scale(0.2);
  }
  70% {
    opacity: 1;
    transform: scale(1.35);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 900px) {
  .watch {
    width: min(28vw, 280px);
  }

  .charm-moon {
    left: 18%;
  }

  .charm-orb {
    left: 73%;
  }

  .charm-star {
    left: 81%;
  }
}

@media (max-width: 640px) {
  .charm-moon {
    left: 6%;
  }

  .charm-orb {
    left: 72%;
  }

  .charm-star {
    left: 86%;
  }

  .charm-icon {
    width: 22px;
    height: 22px;
  }

  .charm-star .charm-icon {
    width: 15px;
    height: 15px;
  }

  main {
    padding-top: 16vh;
  }

  .watch {
    width: min(56vw, 220px);
  }

  h1 {
    margin-bottom: 1.15rem;
  }

  .when {
    padding: 0 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .charm,
  .wish,
  .speck,
  main {
    animation: none;
  }
}
