/* ============================================================
   DEAR BEBE — AN 18TH BIRTHDAY FLIPBOOK
   Navy / mist blue / porcelain white · cute but calm
   All artwork is drawn with CSS/SVG; no stock images needed.
   ============================================================ */
:root {
  color-scheme: dark;
  --night:#101b36;
  --navy:#17284a;
  --navy-soft:#30476d;
  --blue:#8fb1df;
  --powder:#c2d6f0;
  --sky:#e2ecfa;
  --paper:#f7f9ff;
  --paper-blue:#eaf1fc;
  --ink:#2b405f;
  --muted:#6f82a1;
  --pink:#ebc8dc;
  --border:rgba(105,135,177,.22);
  --shadow:0 35px 80px rgba(2,9,27,.36);
  --rounded:'Nunito','Quicksand',sans-serif;
  --sans:'DM Sans',Arial,sans-serif;
  --serif:Georgia,'Times New Roman',serif;
}
* {box-sizing:border-box}
[hidden] {display:none!important}
html {min-width:320px;scroll-behavior:smooth}
body {margin:0;min-height:100vh;min-height:100svh;overflow-x:hidden;background:var(--night);color:#edf4ff;font-family:var(--rounded);-webkit-font-smoothing:antialiased}
button,input {font:inherit}
button {cursor:pointer;-webkit-tap-highlight-color:transparent}
button:focus-visible,input:focus-visible,a:focus-visible {outline:3px solid #9bbdeb;outline-offset:4px}
a {color:inherit}
::selection {background:#a5bde5;color:#102447}
.night-sky {position:fixed;inset:0;z-index:-1;overflow:hidden;pointer-events:none;background:radial-gradient(ellipse 70% 52% at 6% 15%,#253c65 0%,transparent 75%),radial-gradient(ellipse 60% 48% at 96% 86%,#31446d 0%,transparent 75%),linear-gradient(155deg,#10192e,#182948 55%,#0d192f)}
.night-sky::after {content:"";position:absolute;inset:0;background-image:radial-gradient(#bfd4f8 1px,transparent 1px),radial-gradient(#ffffffa9 .75px,transparent 1px);background-position:10px 20px,90px 75px;background-size:153px 172px,218px 237px;opacity:.18}
.star {position:absolute;width:5px;height:5px;background:#c7d9f8;transform:rotate(45deg);border-radius:1px;box-shadow:0 0 17px #a3c6ff;animation:twinkle 4.5s ease-in-out infinite;z-index:1}
.star::before,.star::after {content:"";position:absolute;background:#e4eeff;border-radius:100px}
.star::before {width:1px;height:21px;left:2px;top:-8px}
.star::after {height:1px;width:21px;top:2px;left:-8px}
.star-a{left:12%;top:17%;animation-delay:-2s}.star-b{left:97%;top:32%;animation-delay:-1s}.star-c{left:91%;top:67%;animation-delay:-3s}.star-d{left:7%;top:84%;animation-delay:-.8s}.star-e{left:69%;top:77%;animation-delay:-4s}.star-f{left:41%;top:8%;animation-delay:-1.8s}
.cloud {position:absolute;width:320px;height:150px;border-radius:50%;background:#b5c9ef;filter:blur(75px);opacity:.08;animation:cloudMove 22s ease-in-out infinite alternate}
.cloud-a{left:-100px;bottom:11%}.cloud-b{right:-80px;top:14%;animation-delay:-8s}
@keyframes twinkle{50%{opacity:.25;transform:rotate(45deg) scale(.6)}}
@keyframes cloudMove{to{transform:translate(70px,-40px)}}

/* ── GATE ── */
.gate-area {display:grid;place-items:center;min-height:100svh;padding:40px 18px}
.gate-card {position:relative;isolation:isolate;width:min(100%,480px);padding:39px clamp(24px,5vw,56px) 33px;text-align:center;color:var(--ink);border:1px solid #dce6f5;border-radius:30px;background:linear-gradient(157deg,#f8fbff,#e8f0fc 75%,#e6ebf8);box-shadow:0 42px 100px #030b2160,inset 0 2px 1px #fff}
.gate-card::before {content:"";position:absolute;inset:12px;border:1.5px dashed #aac2e1a3;border-radius:23px;pointer-events:none;z-index:-1}
.gate-card::after {content:"✦";position:absolute;right:34px;top:53px;color:#8fa9d3;font-size:31px;transform:rotate(16deg)}
.gate-tape {position:absolute;top:-11px;left:50%;transform:translateX(-50%) rotate(-3deg);width:125px;height:29px;background:#c1d4f1b8;box-shadow:0 2px 5px #6e8cb522;border:1px solid #fff8}
.tiny-stars {color:#849ec9;font-size:17px;letter-spacing:3px}
.cat-wrap {height:148px;display:grid;place-items:center;margin-top:2px}
.sleepy-cat {width:166px;height:132px;filter:drop-shadow(0 9px 5px #8ca2c433);animation:catHover 4s ease-in-out infinite}
@keyframes catHover{50%{transform:translateY(-7px)}}
.gate-pill {display:inline-block;margin:2px auto 14px;padding:7px 14px;color:#5875a4;border:1px solid #bfd1e9;border-radius:100px;font-size:10px;font-weight:900;letter-spacing:.11em;text-transform:uppercase}
.gate-card h1 {margin:0;color:#263f69;font-size:clamp(33px,6vw,44px);font-weight:900;letter-spacing:-.065em;line-height:1.16}
.gate-card h1 em {font-family:var(--serif);font-weight:400;font-style:italic;color:#7898c8;letter-spacing:-.035em}
.gate-card>p {max-width:320px;margin:14px auto 27px;color:#7387a4;font-size:13px;line-height:1.8}
#pinForm {display:grid;gap:12px;text-align:center}
#pinForm label {text-transform:uppercase;letter-spacing:.14em;font-size:10px;font-weight:900;color:#6882a9}
#pinInput {width:100%;height:62px;padding:10px 15px;border-radius:16px;border:1.5px solid #c4d4ea;background:#fff9;text-align:center;letter-spacing:.36em;color:#263d67;font-size:30px;font-family:var(--sans);font-weight:700;box-shadow:inset 0 2px 9px #7899c115}
#pinInput::placeholder {letter-spacing:.26em;color:#a6b9d2}
#pinInput[aria-invalid="true"] {border-color:#bd7897;background:#fff0f6}
.form-message {height:20px;margin:0!important;color:#738bae;font-size:11px!important;line-height:1.5!important}
.primary-button {display:inline-flex;justify-content:center;align-items:center;gap:16px;min-height:48px;padding:13px 25px;border:0;border-radius:100px;background:linear-gradient(135deg,#546f9d,#263d67);color:#f6f9ff;font-size:13px;font-weight:900;box-shadow:0 12px 22px #4e639044;transition:transform .2s,box-shadow .2s,filter .2s}
.primary-button:hover {transform:translateY(-3px);box-shadow:0 16px 25px #4e639055;filter:brightness(1.08)}
.primary-button:active {transform:translateY(0)}
.gate-footer {display:block;margin-top:25px;color:#8293ac;font-size:10px;line-height:1.6}
.gate-card.shake {animation:shake .42s ease-in-out}
.gate-area .gate-card.unlocking {animation:fadeUnwrap .55s both}
@keyframes shake{0%,100%{transform:translateX(0)}20%,60%{transform:translateX(-7px)}40%,80%{transform:translateX(7px)}}
@keyframes fadeUnwrap{to{transform:translateY(-25px) scale(.96);opacity:0}}

/* ── SHELL ── */
.experience {width:100%;min-height:100svh;padding:18px 18px 30px;animation:experienceIn .65s both}
@keyframes experienceIn{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:translateY(0)}}
.site-header {display:flex;justify-content:space-between;align-items:center;gap:16px;width:min(100%,1220px);margin:0 auto 12px;padding:10px 8px}
.site-brand {display:flex;align-items:center;gap:11px;color:#e2ecff;font-size:17px;letter-spacing:-.05em;font-weight:800}
.site-brand b {font-weight:900;color:#bcd7fa}
.brand-icon {display:grid;place-items:center;width:41px;height:41px;border:1px solid #a7bce966;border-radius:14px;background:#d9e8ff1c;color:#cbdff9;font-size:22px}
.site-brand small {display:block;margin-top:2px;font-size:10px;font-weight:600;letter-spacing:.04em;color:#adbeda}
.header-right {display:flex;align-items:center;gap:13px}
.header-chip {padding:7px 14px;color:#dce8fc;border:1px solid #aabce744;border-radius:100px;font-size:11px;letter-spacing:.04em}
.music-toggle {display:flex;align-items:center;justify-content:center;gap:9px;min-width:100px;min-height:39px;padding:8px 13px;color:#f0f6ff;background:#e2ebfc1d;border:1px solid #c4d8fa66;border-radius:100px;font-size:12px;font-weight:800;transition:background .2s,transform .2s}
.music-toggle:hover {background:#e2ebfc32;transform:translateY(-2px)}
.music-toggle[aria-pressed="true"] {background:#7c9dc4;color:#112749}
.book-section {width:min(100%,1220px);margin:0 auto}
.book-topline {display:flex;justify-content:space-between;gap:20px;align-items:center;padding:3px 12px 13px;color:#aabfe1;font-size:10px;font-weight:800;letter-spacing:.16em;text-transform:uppercase}
.scrap-label::before {content:"✧ ";font-size:13px}
.chapter-tag {font-weight:700;color:#e0eafb}
.book {position:relative;isolation:isolate;display:grid;grid-template-columns:1fr 1fr;width:100%;height:min(72vh,730px);min-height:590px;max-height:780px;border:7px solid #dde6f2;border-radius:24px;overflow:hidden;box-shadow:0 24px 0 -12px #879abe,0 40px 85px #030a226e,0 10px 40px #00000055;background:#f6f8ff;perspective:1400px}
.book::before {content:"";position:absolute;z-index:3;inset:0;pointer-events:none;border-radius:16px;box-shadow:inset 0 0 35px #6a80a32a}
.book-spine {position:absolute;z-index:5;top:0;bottom:0;left:50%;width:25px;transform:translateX(-50%);pointer-events:none;background:linear-gradient(90deg,#a5b5d41a,#49658626 35%,#324b7340 50%,#aec1e225 75%,#fff0);box-shadow:0 0 25px #374f7730}
.book-page {position:relative;z-index:1;min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#aec2de transparent;color:var(--ink);background:radial-gradient(circle at 98% 3%,#dfebf998,transparent 37%),linear-gradient(150deg,#fcfdff,#eef4fc 68%,#e7eef9);overscroll-behavior:contain}
.book-page::-webkit-scrollbar {width:5px}.book-page::-webkit-scrollbar-thumb {background:#b6c9e2;border-radius:10px}
.page-left {border-right:1px solid #9db2d144;box-shadow:inset -22px 0 35px -22px #43577825}
.page-right {box-shadow:inset 22px 0 35px -22px #43577825}
.page-content {position:relative;display:flex;flex-direction:column;min-height:100%;padding:29px clamp(22px,3vw,44px) 34px;overflow:hidden}
.page-content::before {content:"";pointer-events:none;position:absolute;inset:12px;border:1px solid #aac3e044;border-radius:15px}
.page-topline {position:relative;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:10px;padding-bottom:14px;border-bottom:1px solid #bbd1e733;font-size:9px;color:#7890b2;letter-spacing:.13em;font-weight:900;text-transform:uppercase}
.page-number {color:#8098bb}
.page-bottom-star {position:absolute;bottom:11px;right:20px;color:#a5bde2;font-size:17px;pointer-events:none}
.eyebrow {font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.17em;color:#7a9ac9;margin:24px 0 14px}
.page-content h1,.page-content h2 {position:relative;margin:0;color:#233b65;font-size:clamp(31px,3.7vw,55px);line-height:1.18;letter-spacing:-.055em;font-weight:900}
.page-content h1 em,.page-content h2 em {font-family:var(--serif);font-weight:400;color:#7799c7;letter-spacing:-.05em}
.page-content h2 {font-size:clamp(28px,3.1vw,41px)}
.center-copy {margin:16px auto 20px;max-width:365px;color:#768aa8;font-size:13px;line-height:1.9}
.small-note {margin:9px 0 18px;color:#8497b2;font-size:12px;line-height:1.6}
.mini-stars {display:block;text-align:center;color:#a0b6d8;font-size:17px;letter-spacing:15px}
.handwritten-line {font-family:var(--serif);font-style:italic;color:#6988b7;font-size:19px;line-height:1.6;text-align:center}
.signature-text {font-family:var(--serif);font-style:italic;font-size:16px;color:#768fb6}

/* ── REAL PAGE TURN EFFECT ── */
.turn-sheet {position:absolute;z-index:11;left:50%;top:0;width:50%;height:100%;pointer-events:none;opacity:0;transform-style:preserve-3d;transform-origin:left center;backface-visibility:hidden}
.turn-sheet-front,.turn-sheet-back {position:absolute;inset:0;display:grid;place-items:center;backface-visibility:hidden;background:linear-gradient(145deg,#fefeff,#dce8fa);font-size:55px;color:#a2bcdf;box-shadow:0 0 34px #2944693b}
.turn-sheet-back {transform:rotateY(180deg);background:linear-gradient(125deg,#eaf2ff,#fff)}
.book.turning-next .turn-sheet {opacity:1;animation:turnNext .7s cubic-bezier(.65,.08,.23,.96) forwards}
.book.turning-prev .turn-sheet {left:0;transform-origin:right center;opacity:1;animation:turnPrev .7s cubic-bezier(.65,.08,.23,.96) forwards}
@keyframes turnNext{0%{transform:rotateY(0)}100%{transform:rotateY(-180deg)}}
@keyframes turnPrev{0%{transform:rotateY(0)}100%{transform:rotateY(180deg)}}
.book-controls {display:flex;justify-content:space-between;align-items:center;gap:20px;padding:22px 11px 8px}
.page-nav {display:flex;align-items:center;justify-content:center;gap:13px;min-width:174px;min-height:45px;padding:11px 19px;border:1px solid #b8cae56b;border-radius:100px;background:#dce9ff17;color:#e5eeff;font-size:12px;font-weight:900;transition:background .2s,transform .2s}
.page-nav:hover:not(:disabled) {transform:translateY(-2px);background:#e1ecff30}
.page-nav:disabled {opacity:.28;cursor:not-allowed}
.next-nav {background:#bdcff5;color:#1c3152;border-color:#dce8fe}
.next-nav:hover:not(:disabled) {background:#e3eeff}
.pagination {text-align:center;color:#d9e7ff;font-size:12px;font-weight:800;letter-spacing:.05em}
.page-dots {display:flex;gap:6px;justify-content:center;margin-top:9px}
.page-dots span {display:block;width:5px;height:5px;border-radius:100px;background:#6a81a7;transition:background .3s,width .3s}
.page-dots span.active {width:20px;border-radius:20px;background:#e6edff}
.book-hint {margin:17px 0 0;text-align:center;color:#95aacb;font-family:var(--serif);font-style:italic;font-size:12px}
.site-footer {width:min(100%,1220px);margin:28px auto 0;text-align:center;color:#8fa9d0;font-size:11px;letter-spacing:.02em}

/* ── PAGE 1: WELCOME ── */
.welcome-sheet {justify-content:center;align-items:center;text-align:center;background:radial-gradient(circle at 30% 53%,#d9e9fa,transparent 70%)}
.welcome-sheet .page-topline {align-self:stretch;position:absolute;top:29px;left:clamp(22px,3vw,44px);right:clamp(22px,3vw,44px)}
.welcome-top-art {position:relative;display:flex;align-items:center;justify-content:center;gap:23px;height:116px;margin-top:30px;color:#799ac4;font-size:28px;animation:floatIn 4s ease-in-out infinite}
.welcome-top-art .illustrated-moon {font-family:var(--serif);font-size:94px;line-height:1;color:#94b5df;filter:drop-shadow(0 5px 12px #98bbdf66)}
.little-bow {font-size:41px;color:#d1a9cb;transform:rotate(-12deg)}
@keyframes floatIn{50%{transform:translateY(-8px)}}
.welcome-sheet .eyebrow {margin:0 0 20px}
.welcome-sheet h1 {font-size:clamp(37px,4.2vw,59px)}
.welcome-sheet .center-copy {max-width:330px}
.age-stamp {display:inline-flex;align-items:center;gap:15px;margin:18px auto 23px;padding:10px 22px;background:#dee9f7;border:1px solid #b6cbe6;border-radius:14px;font-size:38px;line-height:1;font-weight:900;color:#577bac;transform:rotate(-3deg)}
.age-stamp span {max-width:95px;color:#7891b4;font-size:11px;line-height:1.5;text-align:left;letter-spacing:.06em;text-transform:uppercase}
.welcome-sheet .signature-text {margin:0 0 12px}

/* ── PAGE 2: CHILDHOOD ── */
.little-you-sheet {align-items:center;text-align:center}
.little-you-sheet h2 {align-self:stretch;margin-bottom:20px}
.little-you-sheet .eyebrow {margin-bottom:12px}
.childhood-frame {position:relative;width:min(100%,245px);padding:13px 13px 35px;margin:0 auto;transform:rotate(3deg);background:#fff;border:1px solid #d9e3ef;box-shadow:0 14px 28px #55759a33}
.childhood-photo {position:relative;display:grid;place-items:center;width:100%;aspect-ratio:1/1.14;overflow:hidden;background:linear-gradient(145deg,#9fb9df,#deeafb)}
.childhood-photo img {position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:2}
.childhood-photo img[hidden] {display:none!important}
.childhood-fallback {display:none;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:#f7fbff}
.childhood-photo.no-image .childhood-fallback {display:flex}
.childhood-fallback>span {font-size:55px}
.childhood-fallback small {font-family:var(--serif);font-style:italic;font-size:18px}
.frame-star {position:absolute;right:-19px;top:-19px;color:#95acd1;font-size:42px;transform:rotate(21deg)}
.little-you-sheet .handwritten-line {margin:25px 0 0;max-width:320px}
.little-you-sheet .small-note {margin-top:8px}

/* ── PAGES 3-4: MEMORY POLAROIDS ── */
.memories-sheet h2 {font-size:clamp(30px,3.2vw,45px)}
.memories-sheet .eyebrow {margin:20px 0 5px}
.memories-sheet .small-note {margin:7px 0 14px}
.polaroid-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px 12px;align-items:start}
.polaroid {display:block;min-width:0;padding:7px 7px 9px;border:1px solid #e0e7f1;background:#fff;color:#496483;box-shadow:0 7px 18px #5c79a126;text-align:center;transition:transform .23s,box-shadow .23s}
.polaroid:nth-child(3n+1){transform:rotate(-3deg)}.polaroid:nth-child(3n+2){transform:rotate(2deg)}.polaroid:nth-child(3n+3){transform:rotate(-1deg)}
.polaroid:hover {position:relative;z-index:2;transform:translateY(-5px) rotate(0)!important;box-shadow:0 15px 27px #55749b4d}
.photo-mat {position:relative;display:grid;place-items:center;width:100%;aspect-ratio:1/1.05;overflow:hidden;background:linear-gradient(140deg,#b3cbea,#7f9fc5)}
.polaroid:nth-child(4n+1) .photo-mat{background:linear-gradient(135deg,#a8c2ea,#748fb9)}
.polaroid:nth-child(4n+2) .photo-mat{background:linear-gradient(135deg,#d2def1,#90add5)}
.polaroid:nth-child(4n+3) .photo-mat{background:linear-gradient(135deg,#9db5d8,#cad8f1)}
.photo-mat img {position:absolute;inset:0;z-index:2;width:100%;height:100%;object-fit:cover}
.photo-mat img[hidden]{display:none!important}
.missing-photo {display:none;align-items:center;justify-content:center;flex-direction:column;gap:3px;color:#f9fbff}
.photo-mat.no-image .missing-photo{display:flex}
.missing-photo>span {font-size:31px;text-shadow:0 3px 12px #375b8840}
.missing-photo small {font-size:9px;letter-spacing:.04em}
.polaroid-caption {display:block;min-height:25px;padding-top:7px;font-family:var(--serif);font-size:10px;font-style:italic;line-height:1.35;color:#536f95}
.photo-footer {margin:19px 0 0;color:#9ab0cb;text-align:center;font-family:var(--serif);font-size:13px;font-style:italic}

/* ── PAGE 5: BOUQUET ── */
.bouquet-sheet {align-items:center;text-align:center}
.bouquet-sheet .eyebrow {margin-bottom:10px}
.bouquet-sheet .center-copy {margin:13px auto 0}
.bouquet-button {display:flex;align-items:center;flex-direction:column;justify-content:center;width:100%;max-width:330px;margin:0 auto 4px;padding:0;border:0;background:transparent;transition:transform .3s}
.bouquet-button:hover {transform:rotate(-4deg) scale(1.03)}
.bouquet-svg {display:block;width:min(100%,300px);height:auto;filter:drop-shadow(0 14px 7px #8aa5ce33);animation:bouquetFloat 6s ease-in-out infinite}
@keyframes bouquetFloat{50%{transform:translateY(-10px) rotate(2deg)}}
.bouquet-click-hint {display:inline-block;padding:8px 12px;margin-top:-11px;border:1px solid #b5cbe9;border-radius:100px;background:#e5edfa;color:#6e8ab3;font-size:10px;letter-spacing:.04em;font-weight:800}
.blue-ribbon-label {margin-top:10px;font-family:var(--serif);font-size:17px;font-style:italic;color:#7896ba}

/* ── PAGE 6: QUIZ ── */
.quiz-sheet .eyebrow,.reasons-sheet .eyebrow {margin:20px 0 7px}
.quiz-sheet h2 {margin-bottom:0}
.quiz-sheet .small-note {margin:8px 0 17px}
.quiz-list {display:grid;gap:15px}
.quiz-card {padding:15px;background:#fff9;border:1px solid #c2d3e844;border-radius:15px;box-shadow:0 4px 12px #8a9fb018}
.quiz-number {font-size:9px;text-transform:uppercase;letter-spacing:.1em;color:#879dc0;font-weight:900}
.quiz-card h3 {margin:4px 0 12px;font-size:14px;color:#3c5680;font-weight:900}
.quiz-answers {display:flex;flex-wrap:wrap;gap:7px}
.quiz-answer {padding:7px 10px;border-radius:100px;border:1px solid #becee6;background:#eff4fc;color:#5875a1;font-size:10px;font-weight:800;transition:background .2s,transform .2s}
.quiz-answer:hover {transform:translateY(-2px);background:#dfeafa}
.quiz-answer.correct {background:#b3cfda;color:#2d6072;border-color:#8fbac6}
.quiz-answer.incorrect {background:#f3d9e4;color:#a46480;border-color:#e2b3c7}
.quiz-feedback {margin:8px 0 0;min-height:15px;color:#91a2bd;font-size:10px;line-height:1.5}

/* ── PAGE 7: REASONS ── */
.reasons-sheet h2 {font-size:clamp(29px,3vw,40px)}
.reasons-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:6px 0 16px}
.reason-star {display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;min-height:94px;padding:12px;border:1px solid #a8c2e24d;border-radius:17px;text-align:left;background:linear-gradient(135deg,#dfeafd,#e8f1fc);box-shadow:0 5px 8px #a8b9d51b;transition:transform .25s,background .25s,border-color .25s}
.reason-star:nth-child(3n+2) {background:linear-gradient(140deg,#e8eefc,#e7e7f5)}
.reason-star:nth-child(4n+3) {background:linear-gradient(140deg,#e7eafb,#f2eafa)}
.reason-star:hover{transform:translateY(-2px);border-color:#8eacd8}
.reason-star.revealed{min-height:109px;background:#c9dcf2}
.reason-icon {color:#789bc9;font-size:19px;line-height:1}
.reason-title {color:#3d5b84;font-size:12px;font-weight:900}
.reason-note {color:#8298b7;font-size:10px;line-height:1.45}
.reason-star.revealed .reason-note {color:#4e6b91}
.reason-footer {margin:0;text-align:center;font-family:var(--serif);font-size:13px;font-style:italic;color:#8aa1c2}

/* ── PAGE 8: ENVELOPE ── */
.envelope-sheet {align-items:center;text-align:center}
.envelope-sheet .eyebrow {margin:23px 0 12px}
.envelope-sheet .center-copy {margin-bottom:34px}
.envelope-button {display:flex;align-items:center;flex-direction:column;gap:25px;width:100%;padding:0;border:0;background:transparent}
.envelope-body {position:relative;display:grid;place-items:center;width:min(100%,286px);height:180px;isolation:isolate;filter:drop-shadow(0 19px 16px #6a84a73a);border-radius:11px;background:#9bb5d8;transform:rotate(-4deg);transition:transform .35s}
.envelope-button:hover .envelope-body{transform:rotate(0deg) translateY(-4px)}
.envelope-body::before {position:absolute;inset:0;z-index:2;content:"";background:#b4cbed;clip-path:polygon(0 0,50% 59%,100% 0,100% 100%,0 100%);border-radius:9px}
.envelope-body::after {position:absolute;inset:0;z-index:3;content:"";background:#c0d6f2;clip-path:polygon(0 100%,50% 39%,100% 100%);border-radius:9px}
.envelope-flap {position:absolute;z-index:4;inset:0 0 auto;height:58%;background:#7f9ac5;clip-path:polygon(0 0,100% 0,50% 100%);transform-origin:50% 0;transition:transform .85s ease}
.envelope-seal {position:absolute;z-index:5;display:grid;place-items:center;width:55px;height:55px;border-radius:100px;background:#e9bcd5;color:#fdfaff;font-size:30px;box-shadow:0 5px 12px #5367894d;transition:transform .8s,opacity .5s}
.envelope-note {position:absolute;z-index:1;display:grid;place-items:center;inset:22px 22px 7px;padding:10px;background:#f7faff;color:#6082af;font-family:var(--serif);font-size:18px;font-style:italic;line-height:1.7;box-shadow:0 -5px 15px #44597624;transition:transform .8s}
.envelope-button.is-open .envelope-flap{transform:rotateX(90deg);opacity:0;pointer-events:none}
.envelope-button.is-open .envelope-seal{opacity:0;transform:translateY(17px) scale(.65)}
.envelope-button.is-open .envelope-note{z-index:3;transform:translateY(-47px);font-size:16px;line-height:1.25}
.envelope-hint {font-size:12px;color:#6e8cae;font-weight:800}
.seal-footer{margin-top:30px;font-family:var(--serif);font-size:17px;font-style:italic;color:#90a6c7}

/* ── PAGE 9: THE FULL LETTER ── */
.letter-sheet {padding-bottom:56px}
.letter-sheet h2 {margin-bottom:19px}
.full-letter {position:relative;padding:18px 19px 25px;border-radius:9px;background:repeating-linear-gradient(0deg,transparent 0,transparent 29px,#9cb5d128 30px),#fff9;border:1px solid #cbd9eb;font-size:12.5px;color:#485e7c;line-height:1.95}
.full-letter p {margin:0 0 19px}
.letter-ending {margin-top:35px;font-family:var(--serif);font-size:19px;font-style:italic;color:#6c85ac;line-height:1.6}
.letter-ending strong {font-size:26px;font-weight:400;color:#4c6d9f}
.letter-bottom {margin:25px 0 0;text-align:center;font-family:var(--serif);font-style:italic;color:#8aa1c2;font-size:14px}

/* ── PAGE 10: CAKE + BIRTHDAY FINALE ── */
.final-sheet {align-items:center;justify-content:center;text-align:center;background:radial-gradient(circle at 50% 54%,#d7e6fa,#f7faff 80%)}
.final-sheet .page-topline{position:absolute;top:29px;left:clamp(22px,3vw,44px);right:clamp(22px,3vw,44px)}
.final-stars {margin-top:34px;color:#8daed8;font-size:25px;letter-spacing:12px}
.final-sheet .eyebrow {margin:18px 0 12px}
.final-sheet h1 {font-size:clamp(32px,3.5vw,52px)}
.cake-wrap {position:relative;width:280px;height:207px;flex-shrink:0;margin:13px 0 0;display:flex;flex-direction:column;align-items:center;justify-content:end;filter:drop-shadow(0 13px 13px #6684b53c)}
.candles {position:absolute;z-index:5;bottom:151px;display:flex;gap:12px;color:#fff;font-size:19px;font-weight:900}
.candles span {position:relative;display:grid;place-items:center;width:22px;height:45px;background:linear-gradient(90deg,#6d91c9,#b4cdef,#7d9ed1);border:1px solid #6081b6;border-radius:5px 5px 3px 3px}
.candles span::before {content:"";position:absolute;bottom:calc(100% + 5px);left:8px;width:8px;height:17px;border-radius:70% 0 65% 65%;background:#f3dca4;box-shadow:0 0 9px #eebd75;transform:rotate(-15deg);animation:flame 1s ease-in-out infinite alternate}
@keyframes flame{to{transform:rotate(13deg) scale(.85);opacity:.8}}
.cake-top {z-index:3;width:190px;height:42px;border-radius:50% 50% 24% 24%/55% 55% 26% 26%;background:linear-gradient(90deg,#f9fbff,#d9e6fb,#f7faff);box-shadow:inset 0 -8px 0 #c1d6f1;border-bottom:3px dotted #8aa9d8}
.cake-middle {z-index:2;width:206px;height:72px;margin-top:-4px;border-radius:10px 10px 16px 16px;background:linear-gradient(90deg,#9dbce5,#cbdef6,#8aabd7);border-top:5px solid #edf4ff;display:grid;place-items:center}
.cake-heart {font-family:var(--serif);font-size:49px;color:#f2f7ff}
.cake-bottom {width:231px;height:57px;margin-top:-4px;border-radius:8px 8px 17px 17px;background:linear-gradient(90deg,#adc5ea,#e8efff,#9ab8e3);border-top:8px solid #eef5ff}
.cake-plate {width:275px;height:13px;border-radius:50%;margin-top:-2px;background:#607fae}
.cake-spark {position:absolute;top:25px;color:#93aed7;font-size:28px;animation:twinkle 3s ease-in-out infinite}
.cake-spark-one {left:5px}.cake-spark-two {right:9px;top:65px}
.final-message {margin:10px 0 14px;max-width:325px;color:#6e86a7;font-size:12px;line-height:1.8}
.confetti-button {font-size:12px;min-height:42px;padding:10px 21px}
.final-sheet .signature-text {margin:12px 0 0;font-size:15px}

/* ── DIALOGS ── */
.pretty-dialog {position:fixed;inset:0;width:min(90vw,460px);max-height:86svh;margin:auto;padding:0;overflow-y:auto;border:1px solid #c4d5ed;border-radius:26px;background:linear-gradient(160deg,#f8faff,#e6eefb);color:var(--ink);box-shadow:0 24px 90px #0008}
.pretty-dialog::backdrop{background:#0b142dd9;backdrop-filter:blur(8px)}
.pretty-dialog[open]{animation:modalEnter .3s both}
@keyframes modalEnter{from{opacity:0;transform:translateY(20px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
.dialog-inner {position:relative;padding:38px 34px 35px;text-align:center}
.dialog-close {position:absolute;top:12px;right:14px;display:grid;place-items:center;width:33px;height:33px;color:#6f87a8;background:#d6e4f5;border:0;border-radius:50%;font-size:24px}
.dialog-symbol {font-size:50px;color:#83a9d7}
.dialog-inner .eyebrow{margin:15px 0}
.dialog-inner h2 {margin:0 0 17px;color:#29436e;font-size:28px;font-weight:900;letter-spacing:-.045em}
.dialog-inner p {margin:0 0 23px;color:#617b9c;font-size:13px;line-height:1.85}
.mini-button {min-height:43px;font-size:12px}
.photo-dialog .dialog-inner {padding-top:54px}
.photo-dialog img {display:block;width:100%;max-height:65svh;object-fit:contain;border:8px solid white;box-shadow:0 7px 25px #587aa32a}
.photo-dialog p {margin:16px 0 0;font-family:var(--serif);font-size:19px;font-style:italic}
.music-dialog iframe {display:block;margin:20px auto;border:0;border-radius:12px;background:#b2c5e3}
.spotify-link {display:inline-block;color:#426998;font-size:12px;text-decoration:underline;text-underline-offset:4px}
.secondary-button {display:block;width:100%;margin:18px 0 0;padding:11px 15px;border:1px solid #acbed8;background:transparent;color:#526c92;border-radius:100px;font-size:11px;font-weight:800}
.confetti-layer {position:fixed;inset:0;z-index:100;pointer-events:none;overflow:hidden}
.confetti {position:absolute;top:-30px;left:var(--x);width:8px;height:13px;border-radius:2px;animation:confettiFall var(--duration) linear var(--delay) forwards;opacity:.97}
@keyframes confettiFall {0%{transform:translateY(-30px) rotate(0deg)}100%{transform:translateY(112vh) rotate(var(--rotation));opacity:.15}}
.toast {position:fixed;z-index:150;left:50%;bottom:25px;transform:translate(-50%,15px);max-width:calc(100% - 35px);padding:12px 20px;border-radius:100px;border:1px solid #b7c9e8;background:#e6f0ff;color:#2f4b73;font-size:12px;text-align:center;opacity:0;pointer-events:none;transition:transform .3s,opacity .3s;box-shadow:0 10px 25px #0c183c44}
.toast.show {opacity:1;transform:translate(-50%,0)}

/* ── COMPACT DESKTOP / TABLET ── */
@media(max-width:1050px){
  .book{min-height:590px;height:73vh}
  .page-content{padding:25px 22px 31px}
  .polaroid-grid{gap:12px 9px}
  .polaroid{padding:6px 6px 7px}
  .polaroid-caption{font-size:9px}
  .reason-star{padding:10px}
  .reason-icon{font-size:15px}
  .reason-title{font-size:11px}
  .reason-note{font-size:9px}
  .quiz-card{padding:12px}
}
/* ── MOBILE: ONE PAGE OF THE BOOK AT A TIME ── */
@media(max-width:760px){
  .experience{padding:10px 12px 25px}
  .site-header{padding:10px 3px;margin-bottom:5px}
  .site-brand{font-size:14px}
  .site-brand small{font-size:8px}
  .brand-icon{width:35px;height:35px;font-size:19px}
  .header-chip{display:none}
  .music-toggle{min-width:83px;min-height:36px;font-size:11px}
  .book-topline{font-size:9px;padding:7px 5px 12px}
  .book{display:block;max-width:560px;margin:0 auto;height:72svh;min-height:530px;max-height:770px;border-width:6px;border-radius:20px}
  .book-spine,.page-left{display:none!important}
  .page-right{height:100%;width:100%;box-shadow:none}
  .turn-sheet{left:0!important;width:100%;transform-origin:left center}
  .book.turning-next .turn-sheet{animation:mobileNext .7s cubic-bezier(.65,.08,.23,.96) forwards}
  .book.turning-prev .turn-sheet{animation:mobilePrev .7s cubic-bezier(.65,.08,.23,.96) forwards}
  @keyframes mobileNext{0%{transform:rotateY(0)}100%{transform:rotateY(-90deg)}}
  @keyframes mobilePrev{0%{transform:rotateY(-90deg)}100%{transform:rotateY(0)}}
  .page-content{padding:23px 26px 29px}
  .page-content::before{inset:10px}
  .page-topline{font-size:9px}
  .page-content h1{font-size:clamp(37px,8vw,57px)}
  .page-content h2{font-size:clamp(30px,6.8vw,45px)}
  .book-controls{padding:19px 0 5px;gap:8px}
  .page-nav{min-width:auto;min-height:44px;padding:10px 13px;font-size:11px;gap:7px}
  .book-hint{font-size:11px;line-height:1.6}
  .welcome-sheet .page-topline,.final-sheet .page-topline{left:26px;right:26px;top:23px}
  .welcome-top-art{height:111px}
  .welcome-sheet .center-copy{font-size:13px}
  .polaroid-grid{gap:12px 10px}
  .polaroid-caption{font-size:10px}
  .reason-star{min-height:93px}
  .full-letter{font-size:13px}
}
@media(max-width:440px){
  .gate-area{padding:22px 14px}
  .gate-card{padding:30px 25px 27px}
  .cat-wrap{height:129px}.sleepy-cat{width:150px;height:120px}
  .gate-card h1{font-size:34px}
  .experience{padding:7px 9px 24px}
  .book{height:72svh;min-height:520px;border-width:5px}
  .page-content{padding:19px 19px 28px}
  .page-content h2{font-size:35px}
  .page-topline{font-size:8px}
  .book-topline{font-size:8px}
  .page-nav{padding:10px 10px;min-height:40px;font-size:10px}
  .page-nav span:not(:last-child){white-space:nowrap}
  .pagination{font-size:10px;white-space:nowrap}
  .welcome-sheet .page-topline,.final-sheet .page-topline{left:19px;right:19px;top:19px}
  .welcome-top-art{height:88px;gap:10px}.welcome-top-art .illustrated-moon{font-size:78px}.little-bow{font-size:35px}
  .welcome-sheet .eyebrow{font-size:9px}
  .welcome-sheet h1{font-size:40px}
  .welcome-sheet .center-copy{font-size:12px;line-height:1.75}
  .age-stamp{margin:12px 0 14px;font-size:31px}
  .memories-sheet .eyebrow{margin:15px 0 4px}
  .memories-sheet h2{font-size:36px}
  .memories-sheet .small-note{font-size:11px;margin-bottom:11px}
  .polaroid-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:13px 11px}
  .polaroid-caption{font-size:9px;min-height:24px}
  .photo-footer{font-size:11px;margin-top:14px}
  .childhood-frame{width:215px}
  .little-you-sheet .handwritten-line{font-size:17px;margin-top:17px}
  .bouquet-svg{width:240px}.bouquet-sheet .center-copy{font-size:12px}.bouquet-sheet .eyebrow{font-size:9px}
  .quiz-list{gap:10px}.quiz-card{padding:10px}.quiz-card h3{font-size:12px;margin-bottom:8px}.quiz-answer{font-size:9px;padding:6px 9px}
  .reasons-grid{gap:7px}.reason-star{padding:8px;min-height:86px;border-radius:12px}.reason-star.revealed{min-height:107px}.reason-note{font-size:9px}
  .envelope-body{height:156px;width:245px}.envelope-sheet .center-copy{margin-bottom:40px}
  .full-letter{padding:14px;font-size:12.5px}
  .cake-wrap{transform:scale(.87);margin:-1px 0 -14px}.final-sheet h1{font-size:35px}.final-message{font-size:11px}
  .final-stars{margin-top:30px;font-size:20px}
  .dialog-inner{padding:35px 21px 29px}
}
@media(max-width:350px){
  .book{min-height:515px}
  .page-content{padding:17px 16px 26px}
  .page-topline{font-size:7px}
  .page-content h2{font-size:30px}
  .book-topline{letter-spacing:.08em}
  .page-nav{font-size:9px;padding:8px}
  .page-nav span:nth-child(2){display:none}
  .next-nav span:first-child{display:none}
  .polaroid-grid{gap:9px}
  .reason-star{min-height:85px}
  .quiz-answer{font-size:8px}
}
@media(prefers-reduced-motion:reduce){
 *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}
}
