:root {
  --night: #fce8ed;
  --night-soft: #f7cfda;
  --gold: #8f5265;
  --gold-strong: #c76d8c;
  --muted: #9b7180;
  --line: rgba(151, 74, 101, .22);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--night); }
body {
  margin: 0;
  min-height: 100vh;
  color: #744356;
  font-family: "Noto Serif SC", Georgia, serif;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 255, 255, .92), transparent 26rem),
    radial-gradient(circle at 85% 45%, rgba(242, 185, 205, .6), transparent 30rem),
    linear-gradient(155deg, #fff7f8 0%, #fbdde5 42%, #f5c9d7 72%, #f8e5e9 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 25%, rgba(173, 92, 119, .13) 100%);
  z-index: 0;
}

#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.soft-orbs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.soft-orbs::before, .soft-orbs::after { content: ""; position: absolute; width: 24rem; height: 24rem; border-radius: 50%; filter: blur(2px); opacity: .3; }
.soft-orbs::before { left: -9rem; top: 25%; background: radial-gradient(circle at 35% 35%, #fff, #f0a8bd 65%, transparent 66%); }
.soft-orbs::after { right: -11rem; bottom: 5%; background: radial-gradient(circle at 35% 35%, #fff7d8, #efb6c9 65%, transparent 66%); }
main { position: relative; z-index: 1; width: min(100%, 920px); margin: auto; }

.countdown-view, .birthday-view {
  min-height: 100svh;
  padding: clamp(3.5rem, 8vw, 6.5rem) 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(.78rem, 2.5vw, 1rem);
  font-weight: 600;
  letter-spacing: .24em;
}
.sub-eyebrow { margin: .65rem 0 0; color: #9d6a7b; font-size: .82rem; letter-spacing: .18em; }

.ornament { height: clamp(8rem, 20vh, 13rem); display: grid; place-items: center; }
.ornament span, .ornament span::before, .ornament span::after {
  display: block; width: 1px; height: 34px; background: var(--gold-strong); content: ""; position: absolute;
}
.ornament span { position: relative; transform: rotate(0deg); }
.ornament span::before { transform: rotate(60deg); }
.ornament span::after { transform: rotate(-60deg); }

.hero-copy h1 {
  margin: 2.25rem 0 1.6rem;
  color: var(--gold);
  font-size: clamp(2.15rem, 7.3vw, 4.25rem);
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: .05em;
  text-wrap: balance;
  text-shadow: 0 10px 34px rgba(173, 82, 112, .15);
}
.hero-copy h1 span { color: #b94f74; }
.lead { color: #8f6674; font-size: clamp(.92rem, 2.8vw, 1.12rem); line-height: 2.05; letter-spacing: .08em; }

.countdown-wrap { margin-top: clamp(3.4rem, 10vw, 5.5rem); width: min(100%, 680px); }
.countdown-label { color: #966778; letter-spacing: .16em; font-size: .92rem; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(.5rem, 2.2vw, 1.25rem); margin-top: 1.35rem; }
.time-unit span {
  display: grid;
  place-items: center;
  aspect-ratio: .88;
  border: 1px solid var(--line);
  border-radius: 1.3rem;
  color: #a34d6b;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.1rem, 9vw, 4.5rem);
  font-variant-numeric: tabular-nums;
  background: linear-gradient(145deg, rgba(255,255,255,.72), rgba(255,241,245,.38));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 18px 50px rgba(155, 72, 101, .13);
}
.time-unit small { display: block; margin-top: 1rem; color: #986f7c; font-size: .82rem; font-weight: 400; letter-spacing: .25em; }
.date-line { margin: 3rem 0 .65rem; color: #87596a; font-size: 1.1rem; letter-spacing: .24em; }
.timezone { color: #aa7c8b; font-size: .8rem; letter-spacing: .12em; }
.love-note { margin: clamp(4.5rem, 12vw, 7rem) 0 1rem; font: italic 500 clamp(2rem, 8vw, 3.25rem)/1 "Cormorant Garamond", serif; color: #9e6679; }

.settings-button, .motion-toggle, .replay-button {
  border: 1px solid rgba(230, 214, 168, .35);
  color: #875468;
  background: rgba(255, 247, 249, .65);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font: inherit;
}
.settings-button { position: fixed; z-index: 5; top: 1rem; right: 1rem; padding: .65rem .9rem; border-radius: 999px; font-size: .78rem; letter-spacing: .08em; }
.settings-button span { color: var(--gold-strong); }
.motion-toggle { position: fixed; z-index: 5; right: 1rem; bottom: 1rem; padding: .75rem 1rem; border-radius: 999px; font-size: .75rem; }
.settings-button:hover, .motion-toggle:hover, .replay-button:hover { border-color: var(--gold-strong); color: #a23f64; }

.birthday-view { justify-content: center; gap: 1.1rem; position: relative; overflow: hidden; }
.birthday-view[hidden], .countdown-view[hidden] { display: none; }
.gift-glow { position: absolute; width: 32rem; height: 32rem; background: radial-gradient(circle, rgba(238, 133, 169, .26), transparent 65%); pointer-events: none; }
.birthday-view h2 { margin: .5rem 0; color: var(--gold); font-size: clamp(3rem, 11vw, 6rem); line-height: 1.35; letter-spacing: .06em; }
.birthday-view h2 span { color: #b84970; }
.wish { max-width: 36rem; margin: .5rem auto; color: #835d6a; font-size: clamp(1rem, 3.4vw, 1.25rem); line-height: 2.1; letter-spacing: .1em; white-space: pre-line; }
.wish-divider { color: var(--gold-strong); margin: .7rem 0; }
.signature { color: #a67787; letter-spacing: .15em; }
.replay-button { margin-top: 1.5rem; padding: .9rem 1.4rem; border-radius: 999px; font-size: .83rem; letter-spacing: .1em; }

.cake { width: 130px; height: 142px; position: relative; margin: 1.8rem auto .5rem; filter: drop-shadow(0 16px 25px rgba(0,0,0,.35)); }
.cake span { position: absolute; left: 50%; transform: translateX(-50%); }
.cake-plate { width: 130px; height: 9px; border-radius: 50%; background: #b8a672; bottom: 0; }
.cake-body { width: 105px; height: 56px; border-radius: 7px 7px 16px 16px; bottom: 8px; background: linear-gradient(90deg, #d5b66c, #f0daa1 48%, #b9934f); }
.cake-top { width: 105px; height: 22px; border-radius: 50%; bottom: 52px; background: #f7e8bf; box-shadow: inset 0 -5px 0 #cfaa63; }
.candle { width: 7px; height: 34px; bottom: 72px; border-radius: 3px; background: repeating-linear-gradient(45deg, #efe2b4 0 5px, #9e7d51 5px 9px); }
.flame { width: 14px; height: 24px; bottom: 108px; border-radius: 60% 40% 60% 40%; background: #ffe184; box-shadow: 0 0 18px #ffd76a; animation: flicker 1.1s ease-in-out infinite alternate; }

dialog { width: min(calc(100% - 2rem), 520px); border: 1px solid rgba(177, 83, 115, .25); border-radius: 1.5rem; padding: 0; color: #704151; background: #fff5f7; box-shadow: 0 32px 100px rgba(111, 45, 69, .28); }
dialog::backdrop { background: rgba(105, 49, 70, .36); backdrop-filter: blur(7px); }
#settingsForm { padding: 1.6rem; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.dialog-heading h2 { margin: .4rem 0 0; color: var(--gold); font-size: 1.7rem; }
.close-button { border: 0; background: transparent; color: #936476; font-size: 2rem; cursor: pointer; }
label { display: block; margin-top: 1rem; color: #85576a; font-size: .84rem; letter-spacing: .08em; }
input, textarea { display: block; width: 100%; margin-top: .5rem; border: 1px solid rgba(177,83,115,.22); border-radius: .75rem; padding: .8rem .9rem; color: #743f53; background: rgba(255,255,255,.72); font: inherit; outline: none; }
input:focus, textarea:focus { border-color: #d2b969; box-shadow: 0 0 0 3px rgba(210,185,105,.1); }
textarea { resize: vertical; }
.form-hint { margin: 1rem 0; color: #7f7b7c; font-size: .72rem; line-height: 1.6; }
.save-button { width: 100%; border: 0; border-radius: .85rem; padding: .9rem; color: #181628; background: linear-gradient(90deg, #cdb15d, #f1df9d); font: 600 .95rem "Noto Serif SC", serif; cursor: pointer; }

@keyframes flicker { to { transform: translateX(-50%) rotate(4deg) scale(.92); opacity: .84; } }
@media (max-width: 420px) {
  .countdown-view { padding-inline: .85rem; }
  .countdown { gap: .42rem; }
  .time-unit span { border-radius: .9rem; }
  .settings-button { top: .7rem; right: .7rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
