@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap');

:root {
  color-scheme: dark;
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --ease-gentle: cubic-bezier(0.2, 0.75, 0.25, 1);
}

* {
  box-sizing: border-box;
}

body {
  --sky-top: #101a31;
  --sky-bottom: #263d5a;
  --panel: rgba(15, 26, 48, 0.72);
  --panel-border: rgba(221, 232, 255, 0.13);
  --heading: #f5f1e8;
  --body-text: #d4dbea;
  --muted: #9eacc5;
  --accent: #f1cc83;
  --accent-ink: #263047;
  --secondary-border: rgba(218, 229, 248, 0.32);
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--body-text);
  background:
    radial-gradient(ellipse at 50% 110%, rgba(79, 110, 143, 0.36), transparent 52%),
    linear-gradient(160deg, var(--sky-top), var(--sky-bottom));
  transition: background 900ms var(--ease-gentle), color 700ms var(--ease-gentle);
}

body[data-scene='day'] {
  color-scheme: light;
  --sky-top: #f3dfbd;
  --sky-bottom: #d99f84;
  --panel: rgba(255, 250, 239, 0.78);
  --panel-border: rgba(111, 76, 59, 0.14);
  --heading: #49352f;
  --body-text: #67504a;
  --muted: #8d7066;
  --accent: #d49a52;
  --accent-ink: #fffaf1;
  --secondary-border: rgba(105, 75, 62, 0.3);
  background:
    radial-gradient(ellipse at 50% 105%, rgba(255, 236, 190, 0.85), transparent 48%),
    linear-gradient(160deg, var(--sky-top), var(--sky-bottom));
}

button {
  font: inherit;
}

.page-shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 20px 26px;
}

.message-panel {
  width: min(100%, 670px);
  padding: clamp(30px, 6vw, 58px);
  border: 1px solid var(--panel-border);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: 0 24px 90px rgba(5, 12, 25, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-align: center;
  transition: background 700ms var(--ease-gentle), border-color 700ms var(--ease-gentle);
}

.celestial-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  height: 58px;
  margin-bottom: 23px;
  font-size: 2rem;
}

.mark-moon {
  color: #dce6f6;
  text-shadow: 0 0 24px rgba(214, 230, 255, 0.58);
  transition: opacity 600ms ease, transform 800ms var(--ease-gentle);
}

.mark-sun {
  color: #f1cb80;
  text-shadow: 0 0 26px rgba(255, 210, 125, 0.55);
  transition: opacity 600ms ease, transform 800ms var(--ease-gentle);
}

body[data-scene='day'] .mark-moon {
  opacity: 0.35;
  transform: translateX(8px) scale(0.8);
}

body[data-scene='day'] .mark-sun {
  transform: scale(1.17);
}

.eyebrow {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}

h1 {
  max-width: 540px;
  margin: 0 auto;
  color: var(--heading);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.1rem, 6vw, 3.45rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.13;
}

.prompt {
  margin: 22px 0 0;
  color: var(--body-text);
  font-size: 1.05rem;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 13px;
  margin-top: 34px;
}

.choice {
  display: inline-flex;
  min-width: 142px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 25px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.96rem;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.choice:hover {
  transform: translateY(-3px);
}

.choice:active {
  transform: translateY(0);
}

.choice:focus-visible,
.back-button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.choice-yes {
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 8px 24px rgba(9, 15, 27, 0.14);
}

.choice-yes:hover {
  box-shadow: 0 12px 28px rgba(9, 15, 27, 0.2);
}

.choice-no {
  color: var(--heading);
  border-color: var(--secondary-border);
  background: transparent;
}

.choice-no:hover {
  background: rgba(255, 255, 255, 0.07);
}

.small-note {
  margin: 29px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.farewell-copy {
  max-width: 520px;
  margin: 26px auto 0;
  text-align: left;
}

.farewell-copy p {
  margin: 0 0 17px;
  color: var(--body-text);
  font-size: 0.99rem;
  line-height: 1.85;
}

.farewell-copy p:last-child {
  margin-bottom: 0;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 31px;
  padding: 10px 15px;
  border: 1px solid var(--secondary-border);
  border-radius: 999px;
  color: var(--body-text);
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 180ms ease, transform 180ms ease;
}

.back-button:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.no-copy {
  margin: 20px 0 0;
  color: var(--body-text);
  font-size: 1.1rem;
}

.quiet-moon {
  margin-top: 22px;
  color: #dce6f6;
  font-size: 3.7rem;
  text-shadow: 0 0 32px rgba(214, 230, 255, 0.45);
  animation: moon-glow 4s ease-in-out infinite;
}

.page-footer {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-align: center;
}

.sky-decoration {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.star {
  position: absolute;
  color: rgba(236, 242, 255, 0.72);
  font-size: 1.1rem;
  animation: twinkle 4s ease-in-out infinite;
  transition: opacity 700ms ease;
}

.star-one { top: 15%; left: 13%; }
.star-two { top: 25%; right: 17%; font-size: 2rem; animation-delay: 1s; }
.star-three { top: 70%; left: 9%; animation-delay: 2s; }
.star-four { top: 78%; right: 13%; font-size: 2.2rem; animation-delay: 0.5s; }
.star-five { top: 11%; right: 32%; font-size: 0.8rem; animation-delay: 1.5s; }

.orbiting-sun,
.orbiting-moon {
  position: absolute;
  opacity: 0.13;
  transition: opacity 700ms ease, transform 900ms var(--ease-gentle);
}

.orbiting-sun {
  top: -125px;
  right: -95px;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(248, 211, 145, 0.5);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(248, 211, 145, 0.035), 0 0 0 58px rgba(248, 211, 145, 0.025);
}

.orbiting-moon {
  bottom: -160px;
  left: -60px;
  color: #dce6f6;
  font-size: 360px;
  line-height: 1;
}

body[data-scene='day'] .star {
  opacity: 0.15;
}

body[data-scene='day'] .orbiting-sun {
  opacity: 0.23;
  transform: translate(-18px, 18px) scale(1.08);
}

body[data-scene='day'] .orbiting-moon {
  opacity: 0.035;
}

.screen[hidden] {
  display: none;
}

.screen.is-active {
  animation: screen-appear 650ms var(--ease-gentle) both;
}

@keyframes screen-appear {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes moon-glow {
  0%, 100% { opacity: 0.78; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

@media (max-width: 520px) {
  .page-shell {
    padding: 24px 14px 20px;
  }

  .message-panel {
    padding: 34px 23px;
    border-radius: 24px;
  }

  .celestial-mark {
    margin-bottom: 17px;
  }

  .choices {
    flex-direction: column;
    align-items: stretch;
    margin-inline: 12px;
  }

  .choice {
    width: 100%;
  }

  .farewell-copy p {
    font-size: 0.94rem;
    line-height: 1.78;
  }

  .orbiting-sun {
    top: -190px;
    right: -165px;
  }

  .orbiting-moon {
    bottom: -190px;
    left: -115px;
    font-size: 290px;
  }
}

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