:root {
  --blue: #0d5bd7;
  --blue-dark: #074198;
  --red: #f33d55;
  --yellow: #ffd455;
  --cream: #fff6df;
  --ink: #10234a;
  --white: #fffdf8;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--sans);
  overflow-x: hidden;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 50; pointer-events: none; }

.login-page { min-height: 100svh; display: grid; place-items: center; padding: 1.5rem; color: var(--white); background-color: var(--blue); background-image: radial-gradient(circle at 15% 20%, rgba(255,255,255,.13) 0 2px, transparent 3px), radial-gradient(circle at 80% 40%, rgba(255,212,85,.24) 0 2px, transparent 3px); background-size: 44px 44px, 62px 62px; overflow: hidden; }
.login-modal { position: relative; width: min(100%, 32rem); padding: clamp(2rem, 6vw, 3.5rem); color: var(--ink); background: var(--cream); border: 4px solid var(--ink); box-shadow: 12px 12px 0 var(--red); text-align: center; transform: rotate(-.5deg); z-index: 2; }
.login-mark { width: 4.2rem; height: 4.2rem; margin: -5.6rem auto 1.7rem; display: grid; place-items: center; color: var(--white); background: var(--blue-dark); border: 3px solid var(--ink); border-radius: 50%; font-family: var(--serif); font-size: 1.8rem; font-weight: 700; box-shadow: 4px 4px 0 var(--yellow); }
.login-mark span { color: var(--yellow); font-family: var(--sans); font-size: .75rem; }
.login-eyebrow { margin: 0 0 1rem; color: var(--red); font-size: .72rem; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.login-modal h1 { margin: 0; font-size: clamp(2.5rem, 7vw, 4rem); line-height: .95; letter-spacing: -.055em; }
.login-copy { max-width: 24rem; margin: 1.4rem auto 1.8rem; font-family: var(--serif); font-size: 1.05rem; line-height: 1.5; }
.login-form { display: grid; gap: .8rem; }
.pin-label { font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.pin-fields { display: flex; justify-content: center; gap: clamp(.45rem, 2vw, .7rem); }
.pin-digit { width: clamp(3.1rem, 13vw, 4rem); height: 4.4rem; padding: .4rem; color: var(--ink); background: var(--white); border: 3px solid var(--ink); border-radius: 4px; font-family: var(--sans); font-size: 2rem; font-weight: 900; text-align: center; outline: none; }
.pin-digit:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(243,61,85,.18); transform: translateY(-2px); }
.login-form button { justify-self: center; margin-top: .35rem; padding: 1rem 1.25rem; color: var(--white); background: var(--red); border: 3px solid var(--ink); border-radius: 5px; box-shadow: 5px 5px 0 var(--yellow); font-weight: 900; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.login-form button:hover { transform: translate(2px,2px); box-shadow: 3px 3px 0 var(--yellow); }
.login-hint { margin: .3rem 0 0; font-family: var(--serif); font-size: .88rem; }
.login-error { margin: 0; color: #b32036; font-size: .8rem; font-weight: 800; }
.login-decor { position: fixed; color: var(--yellow); z-index: 1; }
.login-star { top: 8%; left: 10%; font-size: 6rem; transform: rotate(-12deg); }
.login-heart { right: 9%; bottom: 10%; color: var(--red); font-size: 5rem; transform: rotate(13deg); }

.hero {
  min-height: 100svh;
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 6rem);
  padding: 7rem clamp(1.4rem, 7vw, 8rem) 5rem;
  color: var(--white);
  background-color: var(--blue);
  background-image: radial-gradient(circle at 15% 20%, rgba(255,255,255,.12) 0 2px, transparent 3px), radial-gradient(circle at 80% 40%, rgba(255,212,85,.22) 0 2px, transparent 3px);
  background-size: 44px 44px, 62px 62px;
  overflow: hidden;
}

.nav { position: absolute; inset: 1.5rem clamp(1.4rem, 4vw, 4.5rem) auto; display: flex; justify-content: space-between; align-items: center; z-index: 5; }
.logo { text-decoration: none; width: 3.25rem; height: 3.25rem; display: grid; place-items: center; border: 2px solid currentColor; border-radius: 50%; font-family: var(--serif); font-size: 1.5rem; font-weight: 700; transform: rotate(-7deg); }
.logo span { color: var(--yellow); font-size: .8rem; }
.nav-pill { text-decoration: none; border: 1px solid rgba(255,255,255,.65); border-radius: 99px; padding: .8rem 1rem; font-size: .82rem; letter-spacing: .04em; transition: .2s ease; }
.nav-pill:hover { background: var(--white); color: var(--blue); }

.hero-copy { position: relative; z-index: 2; }
.eyebrow, .section-number { font-size: .78rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow::before { content: ""; display: inline-block; width: 2.8rem; border-top: 2px solid var(--yellow); margin: 0 .8rem .25rem 0; }
h1 { font-family: var(--serif); font-size: clamp(4.2rem, 9vw, 9rem); line-height: .79; letter-spacing: -.075em; margin: 1.6rem 0 2rem; font-weight: 400; }
h1 em { display: inline-block; color: var(--yellow); font-weight: 700; transform: rotate(-3deg) translateX(.2em); text-shadow: 4px 4px 0 var(--red); }
.intro { max-width: 35rem; font-family: var(--serif); font-size: clamp(1.15rem, 1.6vw, 1.45rem); line-height: 1.55; color: #dceaff; }
.primary-button { display: inline-flex; gap: 1rem; align-items: center; margin-top: 1.25rem; padding: 1rem 1.2rem; background: var(--red); color: #fff; text-decoration: none; border-radius: 6px; font-weight: 800; box-shadow: 6px 6px 0 var(--yellow); transition: transform .2s ease, box-shadow .2s ease; }
.primary-button:hover { transform: translate(3px,3px); box-shadow: 3px 3px 0 var(--yellow); }

.portrait-wrap { position: relative; width: min(39vw, 34rem); justify-self: center; z-index: 2; }
.portrait-frame { aspect-ratio: .86; overflow: hidden; border: 8px solid var(--white); border-radius: 48% 48% 8px 8px; box-shadow: 18px 18px 0 rgba(7,65,152,.65); transform: rotate(2.5deg); }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.age-sticker { position: absolute; right: -1.8rem; bottom: 3.5rem; width: 8.5rem; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink); background: var(--yellow); border: 4px solid var(--ink); border-radius: 50%; transform: rotate(9deg); box-shadow: 6px 6px 0 var(--red); }
.age-sticker strong { font-family: var(--serif); font-size: 3.6rem; line-height: .8; }
.age-sticker span { margin-top: .55rem; font-size: .7rem; font-weight: 900; text-transform: uppercase; }
.doodle { position: absolute; z-index: 3; color: var(--yellow); font-size: 4rem; }
.doodle-star { top: -2rem; left: -2rem; animation: spin 8s linear infinite; }
.doodle-heart { top: 20%; right: -2.5rem; color: var(--red); transform: rotate(12deg); }
.doodle-loop { bottom: -1rem; left: -3.4rem; width: 6rem; height: 3rem; border: 4px solid var(--yellow); border-right-color: transparent; border-radius: 50%; transform: rotate(-20deg); }
@keyframes spin { to { transform: rotate(360deg); } }

.ticker { position: absolute; left: 0; right: 0; bottom: 0; overflow: hidden; padding: .95rem 0; background: var(--yellow); color: var(--ink); border-block: 3px solid var(--ink); }
.ticker div { width: 100%; padding-inline: 1rem; text-align: center; white-space: nowrap; font-size: clamp(.58rem, 1vw, .83rem); font-weight: 900; line-height: 1.2; letter-spacing: clamp(.08em, .3vw, .18em); }

main section { padding: clamp(4.5rem, 10vw, 9rem) clamp(1.4rem, 7vw, 8rem); }
.wish-section { background: var(--cream); }
.section-number { color: var(--red); margin: 0 0 2rem; }
.wish-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(2.5rem, 8vw, 9rem); align-items: end; }
.wish-grid h2, .family-copy h2, .cake-intro h2, .stats-section h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.04em; }
.wish-grid h2 { font-size: clamp(2.9rem, 5.5vw, 6.2rem); line-height: .98; margin: 0; }
.wish-copy { border-left: 3px solid var(--red); padding-left: 1.5rem; font-family: var(--serif); font-size: 1.17rem; line-height: 1.65; }
.signature { font-family: var(--sans); font-size: .85rem; font-weight: 800; margin-top: 1.5rem; }
.signature span { color: var(--red); }

.family-section { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: clamp(2.5rem, 7vw, 7rem); background: var(--red); color: var(--white); }
.family-photo { position: relative; padding: 1rem; background: var(--white); transform: rotate(-2deg); box-shadow: 16px 16px 0 rgba(16,35,74,.4); }
.family-photo img { width: 100%; max-height: 42rem; object-fit: cover; object-position: center 75%; }
.photo-note { position: absolute; background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); padding: .55rem .75rem; font-size: .78rem; font-weight: 900; transform: rotate(-5deg); box-shadow: 3px 3px 0 var(--ink); }
.note-one { top: -1rem; left: 8%; }
.note-two { bottom: -1rem; right: 8%; transform: rotate(5deg); }
.family-copy p { text-transform: uppercase; font-size: .77rem; letter-spacing: .15em; }
.family-copy h2 { font-size: clamp(2.8rem, 5vw, 5.6rem); line-height: 1.02; margin: 1rem 0 0; }
.burst { display: block; color: var(--yellow); font-size: 5rem; animation: spin 12s linear infinite; transform-origin: 50% 55%; }

.cake-section { min-height: 90svh; display: grid; grid-template-columns: .75fr 1.25fr; gap: clamp(3rem, 8vw, 9rem); align-items: center; background: var(--blue-dark); color: var(--white); overflow: hidden; }
.cake-intro h2 { font-size: clamp(3.2rem, 5.5vw, 6.5rem); line-height: .9; margin: 1rem 0 1.8rem; color: var(--yellow); }
.cake-intro > p:last-child { max-width: 27rem; color: #c9dbff; line-height: 1.6; }
.cake-stage { position: relative; min-height: 35rem; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.candles { height: 8rem; display: flex; align-items: end; gap: clamp(1rem, 3vw, 2.2rem); z-index: 2; }
.candle { position: relative; width: 1.3rem; height: var(--h, 6rem); padding: 0; border: 2px solid var(--ink); border-radius: 2px 2px 0 0; background: repeating-linear-gradient(135deg, var(--yellow) 0 7px, var(--red) 7px 13px); cursor: pointer; }
.candle:nth-child(2) { --h: 7rem; }
.candle:nth-child(3) { --h: 6.3rem; }
.candle:nth-child(4) { --h: 7.4rem; }
.candle:nth-child(5) { --h: 5.7rem; }
.flame { position: absolute; left: 50%; top: -2.45rem; width: 1.35rem; height: 2.1rem; background: var(--yellow); border-radius: 80% 20% 55% 45%; transform: translateX(-50%) rotate(45deg); box-shadow: 0 0 16px 6px rgba(255,212,85,.35); animation: flicker .55s ease-in-out infinite alternate; transition: opacity .35s, transform .35s; }
@keyframes flicker { to { transform: translateX(-55%) rotate(40deg) scale(.85,1.05); } }
.candle.out .flame { opacity: 0; transform: translateX(-50%) translateY(-1rem) rotate(45deg) scale(.2); }
.cake { position: relative; width: min(32rem, 86vw); height: 14rem; background: var(--red); border: 4px solid var(--ink); border-radius: 22px 22px 12px 12px; display: grid; place-items: center; box-shadow: inset 0 -20px 0 rgba(16,35,74,.12); }
.icing { position: absolute; inset: 0 0 auto; height: 3rem; background: var(--cream); border-bottom: 4px solid var(--ink); border-radius: 17px 17px 45% 45%; }
.icing span { position: absolute; top: 1.3rem; width: 2.3rem; height: 3rem; background: var(--cream); border: solid var(--ink); border-width: 0 3px 3px; border-radius: 0 0 50% 50%; }
.icing span:nth-child(1) { left: 12%; } .icing span:nth-child(2) { left: 35%; height: 2.2rem; } .icing span:nth-child(3) { right: 35%; height: 2.6rem; } .icing span:nth-child(4) { right: 12%; }
.cake-text { display: flex; align-items: center; gap: 1rem; margin-top: 2rem; }
.cake-text strong { font-family: var(--serif); font-size: 6rem; line-height: 1; color: var(--yellow); }
.cake-text small { width: 7rem; font-size: .9rem; font-weight: 900; letter-spacing: .12em; line-height: 1.2; }
.cake-plate { width: min(38rem, 95vw); height: 1.3rem; background: var(--yellow); border: 4px solid var(--ink); border-radius: 50%; margin-top: -.25rem; }
.blow-button { margin-top: 2rem; display: flex; align-items: center; gap: .8rem; border: 0; border-radius: 99px; padding: .75rem 1.2rem .75rem .75rem; color: var(--ink); background: var(--yellow); cursor: pointer; box-shadow: 5px 5px 0 var(--red); transition: .2s; }
.blow-button:hover { transform: translateY(-3px); }
.blow-button:disabled { opacity: .65; cursor: wait; }
.blow-button span:last-child { text-align: left; display: flex; flex-direction: column; }
.blow-button small { font-size: .65rem; margin-top: .15rem; }
.mic-icon { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; }
.mic-status { min-height: 1.2rem; font-size: .75rem; color: #c9dbff; }
.celebration-message { position: absolute; top: 1rem; opacity: 0; transform: translateY(1rem) scale(.8); padding: .8rem 1rem; background: var(--white); color: var(--ink); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--yellow); font-weight: 900; transition: .4s; z-index: 10; }
.cake-stage.complete .celebration-message { opacity: 1; transform: none; }

.stats-section { background: var(--yellow); }
.stats-heading { display: grid; grid-template-columns: 1.2fr .8fr; column-gap: clamp(2rem, 8vw, 8rem); align-items: end; margin-bottom: clamp(3rem, 7vw, 6rem); }
.stats-heading .section-number { grid-column: 1 / -1; }
.stats-heading h2 { font-size: clamp(3.2rem, 6vw, 6.8rem); line-height: .92; margin: 0; }
.stats-heading > p:last-child { max-width: 32rem; margin: 0 0 .5rem; font-family: var(--serif); font-size: 1.15rem; line-height: 1.6; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.stat-card { min-height: 16rem; padding: clamp(1.4rem, 3vw, 2.2rem); display: flex; flex-direction: column; justify-content: flex-end; background: var(--white); border: 3px solid var(--ink); box-shadow: 7px 7px 0 var(--ink); transform: rotate(-.6deg); }
.stat-card:nth-child(even) { transform: rotate(.7deg); }
.stat-card strong { display: flex; align-items: baseline; gap: .25rem; font-family: var(--serif); font-size: clamp(3.2rem, 6vw, 6.5rem); font-weight: 400; line-height: .85; letter-spacing: -.06em; }
.stat-card strong i { font-family: var(--sans); font-size: .38em; font-style: normal; letter-spacing: 0; }
.stat-card > span { margin-top: 1.1rem; font-size: .82rem; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.stat-card small { margin-top: .55rem; line-height: 1.4; opacity: .72; }
.stat-main { grid-column: span 2; background: var(--ink); color: var(--white); }
.stat-main strong { color: var(--yellow); }
.stat-red { background: var(--red); color: var(--white); }
.stat-blue { background: var(--blue); color: var(--white); }
.stat-heart strong { color: var(--red); }

footer { padding: 2rem clamp(1.4rem, 7vw, 8rem); display: flex; justify-content: space-between; background: var(--ink); color: var(--white); font-size: .8rem; }
footer span { color: var(--red); }
footer a { text-decoration: none; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 8rem; text-align: center; }
  .hero-copy { order: 2; }
  .intro { margin-inline: auto; }
  .portrait-wrap { width: min(76vw, 27rem); order: 1; }
  .eyebrow::before { display: none; }
  h1 { font-size: clamp(4.4rem, 18vw, 7rem); }
  .wish-grid, .family-section, .cake-section { grid-template-columns: 1fr; }
  .family-copy { order: -1; }
  .cake-intro { text-align: center; }
  .cake-intro > p:last-child { margin-inline: auto; }
  .stats-heading { grid-template-columns: 1fr; gap: 1.5rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .nav-pill { font-size: 0; }
  .nav-pill span { font-size: 1rem; }
  .hero { padding-inline: 1.15rem; }
  .portrait-frame { border-width: 5px; }
  .age-sticker { width: 6.5rem; right: -1rem; bottom: 1rem; }
  .age-sticker strong { font-size: 2.8rem; }
  main section { padding-inline: 1.15rem; }
  .wish-copy { margin-left: .5rem; }
  .family-photo { padding: .5rem; box-shadow: 8px 8px 0 rgba(16,35,74,.4); }
  .cake-stage { min-height: 33rem; }
  .candles { gap: 1rem; }
  .cake-text strong { font-size: 4.5rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-main { grid-column: auto; }
  .stat-card { min-height: 13rem; }
  footer { flex-direction: column; gap: .8rem; }
}

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