/* ═══════════════════════════════════════════════════════════════════
   LOVE STORYBOOK — a 3D page-turning hardcover storybook invitation
   ═══════════════════════════════════════════════════════════════════ */
:root {
    --paper: #fbf6ec;
    --paper-2: #f3eada;
    --ink: #3d3a32;
    --ink-2: #6e675a;
    --ink-blue: #3c4a68;
    --rose: #c9918b;
    --rose-d: #94544f;
    --sage: #7d8f6c;
    --sage-d: #5c6c4e;
    --gold: #b08a48;
    --gold-l: #e6cb8a;
    --cover: #879878;
    --cover-d: #6d7d60;

    --f-script: 'Pinyon Script', cursive;
    --f-serif: 'Cormorant Garamond', 'Times New Roman', serif;
    --f-sc: 'Cormorant SC', 'Cormorant Garamond', serif;
    --f-hand: 'Caveat', cursive;

    --top: calc(60px + env(safe-area-inset-top, 0px));
    --bottom: calc(94px + env(safe-area-inset-bottom, 0px));

    --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .34 0 0 0 0 .22 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.has-qr { --bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body {
    font-family: var(--f-serif);
    color: var(--ink);
    background-color: #e6dccd;
    background-image:
        radial-gradient(ellipse 90% 60% at 18% -5%, rgba(255, 251, 242, .95), rgba(255, 251, 242, 0) 70%),
        radial-gradient(ellipse 80% 50% at 50% 115%, rgba(140, 108, 72, .28), rgba(140, 108, 72, 0) 70%),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 4px),
        repeating-linear-gradient(90deg, rgba(120, 95, 60, .035) 0 1px, transparent 1px 4px),
        var(--noise);
    -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }

/* dappled light through leaves on the table */
.table-light { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.leaf-shadow {
    position: absolute; top: -90px; right: -110px; width: 360px; height: 330px;
    background:
        radial-gradient(ellipse 26% 9% at 30% 40%, rgba(84, 78, 52, .16), transparent 70%),
        radial-gradient(ellipse 22% 8% at 52% 30%, rgba(84, 78, 52, .14), transparent 70%),
        radial-gradient(ellipse 24% 8% at 46% 58%, rgba(84, 78, 52, .13), transparent 70%),
        radial-gradient(ellipse 20% 7% at 70% 46%, rgba(84, 78, 52, .12), transparent 70%),
        radial-gradient(ellipse 18% 7% at 62% 72%, rgba(84, 78, 52, .1), transparent 70%);
    filter: blur(5px);
    transform-origin: 80% 10%;
    animation: sway 9s ease-in-out infinite alternate;
}
@keyframes sway { from { transform: rotate(-4deg); } to { transform: rotate(5deg) translateY(8px); } }

/* ── Stage & book ─────────────────────────────────────────────────── */
.stage { position: fixed; inset: 0; z-index: 1; }
.book-wrap {
    position: absolute; left: 0; right: 0; top: var(--top); bottom: var(--bottom);
    display: flex; align-items: center; justify-content: center;
    transition: bottom .4s ease;
}
.book {
    position: relative;
    width: min(calc(100vw - 36px), 440px);
    height: min(100%, 760px);
    transition: transform 1.5s cubic-bezier(.65, 0, .35, 1);
}
.board {
    position: absolute; inset: -7px -9px -7px -5px;
    border-radius: 3px 9px 9px 3px;
    background-color: var(--cover-d);
    background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(0,0,0,.06) 0 1px, transparent 1px 3px), var(--noise);
    box-shadow: 0 2px 3px rgba(60, 45, 25, .25), 0 30px 50px -20px rgba(60, 40, 20, .55), 0 12px 22px -10px rgba(60, 40, 20, .35);
}
.stack-r, .stack-b, .stack-l { position: absolute; pointer-events: none; }
.stack-r {
    top: 3px; bottom: 3px; right: -5px; width: 5px; border-radius: 0 2px 2px 0;
    background: repeating-linear-gradient(90deg, #f7f0e3 0 1px, #d6c9b0 1px 1.6px);
    transform-origin: left; transform: scaleX(calc(.2 + var(--remain, 1) * .8));
}
.stack-b {
    left: 3px; right: -4px; bottom: -4px; height: 4px;
    background: repeating-linear-gradient(0deg, #f7f0e3 0 1px, #d6c9b0 1px 1.6px);
}

/* satin ribbon bookmark (opens the table of contents) */
.ribbon {
    position: absolute; right: 96px; top: -42px; width: 18px; height: 58px; padding: 0; border: 0;
    background: none; cursor: pointer; transform-origin: 50% 100%; animation: ribbon 5s ease-in-out infinite alternate;
    filter: drop-shadow(1px 2px 1.5px rgba(80, 40, 30, .35));
}
.ribbon::before { content: ''; position: absolute; inset: 0 -14px -6px; }
.ribbon span {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, #a95f5c, #d8a09a 42%, #c27b76 60%, #a35a57);
    clip-path: polygon(0 0, 50% 20%, 100% 0, 100% 100%, 0 100%);
}
@keyframes ribbon { from { transform: rotate(-3deg); } to { transform: rotate(4deg); } }

.pages { position: absolute; inset: 0; perspective: 2400px; perspective-origin: 50% 50%; }

/* ── Leaves (pages) ───────────────────────────────────────────────── */
.leaf {
    position: absolute; inset: 0;
    transform-origin: left center;
    transform: rotateY(calc(var(--p, 0) * -180deg));
    transform-style: preserve-3d;
}
.leaf.gone, .leaf.prev { visibility: hidden; }
.leaf.turning { will-change: transform; }
.face {
    position: absolute; inset: 0; overflow: hidden;
    -webkit-backface-visibility: hidden; backface-visibility: hidden;
    background-color: var(--paper);
    border-radius: 2px 6px 6px 2px;
    box-shadow: inset -1px 0 0 rgba(160, 130, 90, .22), inset 0 -1px 0 rgba(160, 130, 90, .16);
}
.face.front {
    background-image:
        linear-gradient(to right, rgba(110, 85, 50, .2), rgba(110, 85, 50, .05) 16px, rgba(255, 255, 255, .25) 26px, transparent 46px),
        radial-gradient(ellipse 85% 75% at 55% 45%, transparent 62%, rgba(170, 135, 90, .13)),
        var(--noise);
}
.face.back {
    transform: rotateY(180deg);
    border-radius: 6px 2px 2px 6px;
    background-image:
        linear-gradient(to left, rgba(110, 85, 50, .2), rgba(110, 85, 50, .05) 16px, rgba(255, 255, 255, .25) 26px, transparent 46px),
        radial-gradient(ellipse 85% 75% at 45% 45%, transparent 62%, rgba(170, 135, 90, .13)),
        var(--noise);
}
/* shading of the turning page and the shadow it casts on the page below */
.face::after, .face.front::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.face.front::after {
    background: linear-gradient(to left, rgba(60, 40, 20, .32), rgba(60, 40, 20, .08) 30%, rgba(255, 250, 240, .22) 62%, rgba(60, 40, 20, .08));
    opacity: calc(var(--p, 0) * 1.8);
}
.face.back::after {
    background: linear-gradient(to right, rgba(60, 40, 20, .3), rgba(60, 40, 20, .06) 34%, rgba(255, 250, 240, .2) 64%, rgba(60, 40, 20, .06));
    opacity: calc((1 - var(--p, 0)) * 1.8);
}
.face.front::before {
    background: linear-gradient(to right, rgba(50, 32, 15, .42), rgba(50, 32, 15, .14) 42%, transparent 82%);
    opacity: calc(var(--u, 0) * (1 - var(--u, 0)) * 3.6);
}
.leaf.turning .face { box-shadow: 0 0 22px rgba(50, 32, 15, .14); }

.pg-head {
    position: absolute; top: 15px; left: 30px; right: 22px; text-align: center;
    font-family: var(--f-sc); font-size: 10.5px; letter-spacing: .26em; color: var(--ink-2); opacity: .75;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pg-inner {
    position: absolute; top: 36px; bottom: 34px; left: 0; right: 0;
    overflow-y: auto; overflow-x: hidden; padding: 14px 24px 26px 30px;
    touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12px, #000 calc(100% - 24px), transparent);
            mask-image: linear-gradient(to bottom, transparent, #000 12px, #000 calc(100% - 24px), transparent);
    z-index: 1;
}
.pg-inner::-webkit-scrollbar { display: none; }
.pg-inner.center { text-align: center; }
.pg-no {
    position: absolute; bottom: 11px; left: 0; right: 0; text-align: center;
    font-style: italic; font-size: 13px; color: var(--ink-2); letter-spacing: .08em;
}
.book.dragging { user-select: none; -webkit-user-select: none; }

/* dog-ear that invites the reader to turn the page */
.curl {
    position: absolute; right: 0; bottom: 0; width: 30px; height: 30px; z-index: 5; pointer-events: none;
    background: linear-gradient(315deg, #e2d4bb 0 49%, rgba(90, 65, 35, .25) 50%, #fffaf0 52%, #efe3cc 100%);
    border-top-left-radius: 4px;
    transform-origin: 100% 100%; transform: scale(0);
}
.leaf.current .curl { animation: curl 3.6s ease-in-out 1.2s infinite; }
@keyframes curl { 0%, 55%, 100% { transform: scale(.55); } 75% { transform: scale(1.05); } }

/* ── Typography inside pages ──────────────────────────────────────── */
.pg-inner p { font-size: 17.5px; line-height: 1.6; margin: 0 0 12px; }
.chap {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    font-family: var(--f-sc); font-size: 13px; letter-spacing: .42em; color: var(--gold);
    margin: 6px 0 0 !important; text-indent: .42em;
}
.chap::before, .chap::after { content: ''; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.chap::after { transform: scaleX(-1); }
.chap-title {
    font-family: var(--f-script); font-weight: 400; font-size: 44px; line-height: 1.15;
    text-align: center; color: var(--rose-d); margin: 0 0 14px;
}
.dropcap { text-align: left; }
.dropcap::first-letter {
    float: left; font-family: var(--f-serif); font-weight: 600; font-size: 64px; line-height: .78;
    padding: 6px 8px 0 0; color: var(--rose-d);
}
.body-c { text-align: center; }
.it { font-style: italic; color: var(--ink-2); }
.divider { display: block; width: 170px; height: 20px; margin: 14px auto; color: var(--gold); }
.divider.sm { width: 124px; height: 14px; margin: 10px auto 14px; }
.small-quote { font-style: italic; text-align: center; color: var(--ink-2); font-size: 16px !important; margin-top: 16px !important; }

.orn-sprig { display: block; width: 150px; height: 75px; margin: 2px auto 2px; }
.basmalah { font-family: 'Amiri', serif; font-size: 25px !important; text-align: center; color: var(--sage-d); margin: 4px 0 6px !important; }
.salam { font-family: var(--f-sc); font-size: 13.5px !important; letter-spacing: .1em; text-align: center; color: var(--rose-d); }
.dedic { font-style: italic; text-align: center; font-size: 18px !important; }
.dedic b { font-style: normal; font-weight: 600; color: var(--ink); }
.verse {
    position: relative; margin: 0 2px 16px; padding: 18px 16px 14px; text-align: center;
    border: 1px solid rgba(176, 138, 72, .5);
    box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px rgba(176, 138, 72, .25);
    background: rgba(255, 253, 247, .5);
}
.verse p { font-style: italic; font-size: 17px !important; margin: 0 !important; }
.verse cite { display: block; margin-top: 8px; font-family: var(--f-sc); font-style: normal; font-size: 12.5px; letter-spacing: .22em; color: var(--rose-d); }
.turn-hint { text-align: center; font-family: var(--f-sc); font-size: 12.5px !important; letter-spacing: .14em; color: var(--ink-2); margin-top: 6px !important; }
.turn-hint b { display: inline-block; color: var(--rose-d); animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }

/* portraits */
.portrait { position: relative; z-index: 0; width: 200px; height: 246px; margin: 2px auto 10px; }
.pt-oval {
    position: absolute; inset: 10px 24px 14px; border-radius: 50%; overflow: hidden;
    box-shadow: 0 0 0 1px var(--gold), 0 0 0 5px var(--paper), 0 0 0 6px rgba(176, 138, 72, .55), 0 10px 22px -8px rgba(80, 60, 30, .45);
    background: #efe5d3;
}
.pt-oval img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pt-ph {
    position: absolute; inset: 0; display: grid; place-items: center;
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .7), transparent 45%),
        radial-gradient(ellipse at 70% 80%, rgba(143, 162, 126, .45), transparent 60%),
        radial-gradient(ellipse at 25% 70%, rgba(236, 195, 188, .6), transparent 55%), #f3e9da;
}
.portrait.rose .pt-ph {
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .7), transparent 45%),
        radial-gradient(ellipse at 70% 75%, rgba(236, 195, 188, .7), transparent 60%),
        radial-gradient(ellipse at 25% 80%, rgba(143, 162, 126, .35), transparent 55%), #f6e8e2;
}
.pt-ph i { font-family: var(--f-script); font-style: normal; font-size: 92px; color: var(--rose-d); opacity: .85; transform: translateY(6px); }
.pt-laurel { position: absolute; z-index: -1; left: 0; bottom: 0; width: 200px; height: 100px; overflow: visible; pointer-events: none; }
.pt-bloom { position: absolute; width: 50px; height: 50px; left: 50%; bottom: -6px; transform: translateX(-50%); }
.person { font-family: var(--f-serif); font-weight: 600; font-size: 28px; line-height: 1.15; text-align: center; margin: 4px 0 4px; letter-spacing: .01em; }
.parents { text-align: center; color: var(--ink-2); font-size: 16.5px !important; }
.parents b { color: var(--ink); font-weight: 600; }

/* story */
.story-pic {
    position: relative; width: 78%; margin: 6px auto 20px; padding: 8px; background: #fffdf8;
    transform: rotate(-2deg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 10px 18px -10px rgba(80, 60, 30, .45);
}
.story-pic img, .sp-ph { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.sp-ph {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    background: radial-gradient(ellipse at 30% 30%, rgba(236, 195, 188, .55), transparent 60%), radial-gradient(ellipse at 75% 70%, rgba(143, 162, 126, .4), transparent 60%), #f5ecdf;
}
.sp-ph svg { width: 64px; height: 64px; }
.sp-ph svg + svg { width: 44px; height: 44px; margin-top: 30px; }
.tape {
    position: absolute; top: -11px; left: 50%; width: 86px; height: 22px; margin-left: -43px;
    background: repeating-linear-gradient(45deg, rgba(214, 160, 154, .55) 0 6px, rgba(236, 200, 194, .55) 6px 12px);
    transform: rotate(-4deg); box-shadow: 0 1px 1px rgba(0, 0, 0, .06);
}
.milestones { list-style: none; margin: 0; padding: 0; }
.milestones li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; margin-bottom: 6px; }
.milestones svg { width: 24px; height: 24px; margin-top: 2px; }
.milestones h4 { margin: 0 0 2px; font-family: var(--f-sc); font-weight: 600; font-size: 14.5px; letter-spacing: .16em; color: var(--rose-d); }
.milestones p { font-size: 16.5px !important; margin-bottom: 8px !important; }

/* countdown */
.cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0 6px; }
.cd-cell {
    aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: 1px solid rgba(176, 138, 72, .6); background: rgba(255, 253, 247, .6);
    box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px rgba(176, 138, 72, .28);
}
.cd-cell b { font-family: var(--f-serif); font-weight: 600; font-size: 27px; line-height: 1; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.cd-cell span { font-family: var(--f-sc); font-size: 10.5px; letter-spacing: .14em; color: var(--ink-2); margin-top: 2px; }
.cd-done { display: none; font-style: italic; color: var(--rose-d); }
.cd.done + .cd-done { display: block; }
.big-date { display: flex; flex-direction: column; align-items: center; margin: 0 0 6px !important; line-height: 1.2 !important; }
.big-date span { font-family: var(--f-sc); font-size: 14px; letter-spacing: .3em; color: var(--ink-2); text-indent: .3em; }
.big-date b { font-family: var(--f-serif); font-weight: 500; font-size: 86px; line-height: .95; color: var(--rose-d); font-variant-numeric: lining-nums; }

.btn {
    display: flex; width: fit-content; align-items: center; justify-content: center; margin: 12px auto 4px;
    padding: 10px 22px; border-radius: 999px; border: 1px solid rgba(176, 138, 72, .75);
    background: linear-gradient(#fffaf0, #f4e9d5); color: var(--rose-d); text-decoration: none; cursor: pointer;
    font-family: var(--f-sc); font-weight: 600; font-size: 13.5px; letter-spacing: .16em;
    box-shadow: 0 2px 0 rgba(176, 138, 72, .25), 0 6px 14px -8px rgba(80, 60, 30, .45);
    transition: transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; box-shadow: none; }

/* events */
.event {
    position: relative; margin: 2px 0 0; padding: 20px 14px 16px;
    border: 1px solid rgba(176, 138, 72, .5); background: rgba(255, 253, 247, .55);
    box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 6px rgba(176, 138, 72, .26);
}
.ev-ico { display: block; width: 76px; height: 54px; margin: 0 auto 2px; }
.ev-name { font-family: var(--f-script); font-weight: 400; font-size: 38px; line-height: 1.1; color: var(--rose-d); margin: 0 0 8px; }
.ev-date { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 2px 0 14px; }
.ev-date b { font-family: var(--f-serif); font-weight: 500; font-size: 60px; line-height: 1; font-variant-numeric: lining-nums; }
.ev-dow, .ev-my {
    font-family: var(--f-sc); font-size: 13px; letter-spacing: .14em; color: var(--ink-2); min-width: 86px;
    border-top: 1px solid rgba(176, 138, 72, .6); border-bottom: 1px solid rgba(176, 138, 72, .6); padding: 5px 2px;
}
.ev-rows { margin: 0; }
.ev-rows div { margin: 0 0 9px; }
.ev-rows dt { font-family: var(--f-sc); font-size: 11.5px; letter-spacing: .26em; color: var(--gold); }
.ev-rows dd { margin: 1px 0 0; font-size: 17.5px; line-height: 1.35; }
.ev-bouquet { position: relative; display: block; width: 150px; height: 66px; margin: -4px auto 0; }
.bq { position: absolute; }
.bq.s1 { width: 90px; height: 45px; left: 6px; top: 12px; transform: scaleX(-1) rotate(-12deg); }
.bq.s2 { width: 90px; height: 45px; right: 6px; top: 12px; transform: rotate(-12deg); }
.bq.b1 { width: 40px; height: 40px; left: 55px; top: 12px; }
.bq.b2 { width: 28px; height: 28px; left: 36px; top: 30px; }
.bq.b3 { width: 28px; height: 28px; left: 86px; top: 30px; }

/* map */
.map-frame {
    position: relative; margin: 4px 2px 16px; padding: 8px; background: #fffdf8; transform: rotate(-1deg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 10px 18px -8px rgba(80, 60, 30, .4);
}
.leaflet-map { height: 240px; width: 100%; z-index: 0; }
.map-illu { display: block; background: #f6eedf; }
.map-illu svg { display: block; width: 100%; height: auto; }
.map-illu .mt { font-family: var(--f-serif); font-style: italic; font-size: 12px; fill: #7d6a52; }
.map-illu .route { animation: dash 2.4s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -22; } }
.loc-name { font-family: var(--f-serif); font-weight: 600; font-size: 23px; margin: 0 0 4px; }
.loc-addr { color: var(--ink-2); font-size: 16px !important; }
.sb-marker svg { width: 30px; height: 40px; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .3)); }

/* album */
.album { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; margin: 6px 2px 8px; }
.snap {
    position: relative; display: block; padding: 7px 7px 30px; border: 0; background: #fffdf8; cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 10px 16px -10px rgba(80, 60, 30, .45);
}
.snap.s0 { transform: rotate(-2.6deg); }
.snap.s1 { transform: rotate(2.2deg) translateY(6px); }
.snap.s2 { transform: rotate(1.4deg); }
.snap.s3 { transform: rotate(-1.8deg) translateY(6px); }
.snap-img {
    display: block; aspect-ratio: 4 / 5; overflow: hidden;
    background: radial-gradient(ellipse at 30% 30%, rgba(236, 195, 188, .5), transparent 60%), radial-gradient(ellipse at 75% 75%, rgba(143, 162, 126, .4), transparent 60%), #f5ecdf;
}
.snap-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.snap.ph .snap-img { display: grid; place-items: center; }
.snap.ph .snap-img svg { width: 74%; height: 50%; }
.snap-cap { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-family: var(--f-hand); font-size: 17px; color: var(--ink-2); }
.snap .tape { width: 62px; height: 18px; margin-left: -31px; top: -9px; }
.snap .corners {
    position: absolute; inset: 3px 3px 26px 3px; pointer-events: none;
    background:
        linear-gradient(135deg, #6a5848 50%, transparent 50%) top left / 15px 15px no-repeat,
        linear-gradient(225deg, #6a5848 50%, transparent 50%) top right / 15px 15px no-repeat,
        linear-gradient(45deg, #6a5848 50%, transparent 50%) bottom left / 15px 15px no-repeat,
        linear-gradient(315deg, #6a5848 50%, transparent 50%) bottom right / 15px 15px no-repeat;
    opacity: .85;
}

/* gift partial, restyled for the page */
.gift-wrap { margin: 0 -10px 0 -14px; }
.gift-wrap #gift-section { background: transparent !important; padding: 4px 0 10px !important; font-family: var(--f-serif) !important; }
.gift-wrap .gs-heading h2 { font-family: var(--f-serif) !important; font-weight: 600 !important; color: var(--ink) !important; }
.gift-wrap .gs-heading h2::after { background: var(--gold) !important; }
.gift-wrap .gs-heading p, .gift-wrap .gs-sub-label { font-family: var(--f-serif) !important; }
.gift-wrap .gs-card, .gift-wrap .gs-bank-card { box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 8px 16px -10px rgba(80, 60, 30, .45) !important; border-radius: 4px !important; }
.gift-wrap .gs-btn, .gift-wrap .gs-bank-copy { font-family: var(--f-sc) !important; letter-spacing: .08em; }

/* RSVP — a lined letter */
.letter {
    position: relative; margin: 6px 0 4px; padding: 16px 16px 18px 32px;
    background-color: #fffdf6;
    background-image: repeating-linear-gradient(to bottom, transparent 0 33px, rgba(125, 143, 108, .26) 33px 34px);
    background-position: 0 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 12px 20px -12px rgba(80, 60, 30, .45);
    transform: rotate(.5deg);
}
.letter::before { content: ''; position: absolute; top: 0; bottom: 0; left: 22px; width: 1px; background: rgba(201, 145, 139, .55); }
.lt-l { display: block; font-family: var(--f-sc); font-size: 12px; letter-spacing: .22em; color: var(--gold); margin: 4px 0 0; }
.lt-in {
    display: block; width: 100%; border: 0; border-bottom: 1px dashed rgba(184, 128, 122, .55); border-radius: 0;
    background: transparent; outline: none; padding: 2px 0 2px; margin: 0 0 10px;
    font-family: var(--f-hand); font-weight: 600; font-size: 23px; color: var(--ink-blue);
}
.lt-in::placeholder { color: rgba(60, 74, 104, .35); }
.lt-area { resize: none; line-height: 1.45; min-height: 112px; }
.ticks { display: grid; gap: 4px; margin: 4px 0 10px; }
.tick { display: flex; align-items: center; gap: 10px; cursor: pointer; font-family: var(--f-hand); font-size: 21px; color: var(--ink); }
.tick input { position: absolute; opacity: 0; pointer-events: none; }
.tick i { position: relative; flex: none; width: 20px; height: 20px; border: 1.5px solid var(--ink-2); border-radius: 3px; transform: rotate(-3deg); }
.tick input:checked + i::after {
    content: ''; position: absolute; left: 5px; top: -6px; width: 8px; height: 18px;
    border-right: 3px solid var(--rose-d); border-bottom: 3px solid var(--rose-d); border-radius: 1px;
    transform: rotate(40deg);
}
.tick input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }
.seal-btn {
    display: flex; align-items: center; gap: 12px; margin: 14px auto 2px; padding: 7px 20px 7px 7px; cursor: pointer;
    border: 0; border-radius: 999px; background: linear-gradient(#f9f1e2, #efe2cb);
    box-shadow: inset 0 0 0 1px rgba(176, 138, 72, .55), 0 6px 14px -8px rgba(80, 60, 30, .45);
    font-family: var(--f-sc); font-weight: 600; font-size: 13.5px; letter-spacing: .12em; color: var(--rose-d);
}
.seal {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 47% 53% 50% 50% / 52% 48% 54% 46%;
    background: radial-gradient(circle at 35% 30%, #d68a84, #a14c47 58%, #7b3330);
    box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .3), inset 0 2px 2px rgba(255, 255, 255, .3), 0 2px 4px rgba(90, 30, 30, .35);
    color: rgba(255, 222, 212, .85);
}
.seal svg { width: 18px; height: 18px; }
.seal-btn:disabled { opacity: .8; cursor: default; }
.seal-btn.sent .seal { animation: stamp .5s ease; }
@keyframes stamp { 0% { transform: scale(1.4) rotate(-20deg); } 60% { transform: scale(.9); } 100% { transform: none; } }

/* guest book */
.wishes-list { margin: 0 2px; }
.wish-item { padding: 10px 2px 12px; border-bottom: 1px dashed rgba(176, 138, 72, .38); }
.wish-item.new { animation: inkIn 1s ease; }
@keyframes inkIn { from { opacity: 0; filter: blur(3px); } to { opacity: 1; filter: none; } }
.wish-message { font-family: var(--f-hand); font-weight: 500; font-size: 21px !important; line-height: 1.32 !important; color: var(--ink-blue); margin: 0 0 4px !important; word-break: break-word; }
.wish-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 4px 8px; }
.wish-name { font-style: italic; font-weight: 600; font-size: 16.5px; color: var(--rose-d); }
.wish-badge { font-family: var(--f-sc); font-size: 10.5px; letter-spacing: .12em; padding: 0 8px; border: 1px solid; border-radius: 999px; line-height: 1.6; }
.wish-badge.hadir { color: var(--sage-d); }
.wish-badge.tidak { color: var(--rose-d); }
.wish-badge.ragu { color: var(--gold); }
.wish-time { display: block; text-align: right; font-style: italic; font-size: 13px; color: var(--ink-2); }
.wish-empty { text-align: center; padding: 30px 0; color: var(--ink-2); font-style: italic; }
.wish-empty svg { width: 64px; height: 64px; }

/* the end */
.end-wreath { position: relative; width: 120px; height: 120px; margin: 0 auto; }
.end-wreath > svg:first-child { width: 100%; height: 100%; }
.ew-bloom { position: absolute; width: 46px; height: 46px; left: 50%; bottom: 4px; transform: translateX(-50%); }
.the-end { font-family: var(--f-script); font-weight: 400; font-size: 66px; line-height: 1; color: var(--rose-d); margin: 2px 0 10px; }
.end-k { font-family: var(--f-sc); font-size: 12px !important; letter-spacing: .3em; color: var(--gold); margin: 16px 0 0 !important; }
.end-names { font-family: var(--f-script); font-weight: 400; font-size: 42px; line-height: 1.2; margin: 0 0 4px; }
.end-names span { font-size: .7em; color: var(--rose-d); }
.end-fam { color: var(--ink-2); font-size: 15.5px !important; }
.credit { font-size: 12.5px !important; color: var(--ink-2); opacity: .75; margin-top: 14px !important; }

/* back of each page (seen while it turns, and as the left page on wide screens) */
.bk-orn { position: absolute; top: 44%; left: 50%; width: 170px; height: 84px; transform: translate(-50%, -50%); opacity: .55; }
.bk-note { position: absolute; top: 54%; left: 0; right: 0; padding: 0 34px; text-align: center; font-style: italic; font-size: 18px; color: var(--ink-2); }

/* ── Cover ────────────────────────────────────────────────────────── */
.cover {
    position: absolute; inset: -7px -9px -7px -5px; z-index: 400; cursor: pointer; outline: none;
    transform-origin: left center; transform: rotateY(calc(var(--p, 0) * -180deg)); transform-style: preserve-3d;
}
.cover.turning { will-change: transform; }
.cover.opened { z-index: 0; visibility: hidden; cursor: default; }
.cv-face { position: absolute; inset: 0; overflow: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: 3px 9px 9px 3px; }
.cv-front {
    background-color: var(--cover);
    background-image:
        radial-gradient(ellipse 80% 55% at 30% 18%, rgba(255, 255, 238, .24), transparent 70%),
        linear-gradient(to right, rgba(0, 0, 0, .3), rgba(0, 0, 0, .06) 18px, rgba(255, 255, 255, .1) 24px, transparent 36px),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 3px),
        var(--noise);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 0 40px rgba(40, 50, 30, .38);
}
.cv-front::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to left, rgba(30, 30, 15, .35), transparent 60%);
    opacity: calc(var(--p, 0) * 1.6);
}
.cv-spine {
    position: absolute; left: 0; top: 0; bottom: 0; width: 22px;
    background:
        linear-gradient(to bottom, transparent 36px, var(--gold-l) 36px 38px, transparent 38px 42px, var(--gold-l) 42px 43px, transparent 43px),
        linear-gradient(to top, transparent 36px, var(--gold-l) 36px 38px, transparent 38px 42px, var(--gold-l) 42px 43px, transparent 43px);
    opacity: .75;
    box-shadow: inset -2px 0 2px rgba(0, 0, 0, .22), 1px 0 0 rgba(255, 255, 255, .1);
}
.cv-frame {
    position: absolute; inset: 22px 20px 22px 40px;
    border: 1px solid rgba(230, 203, 138, .75); outline: 1px solid rgba(230, 203, 138, .4); outline-offset: 4px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 18px 14px;
    color: var(--gold-l);
}
.cv-corner { position: absolute; width: 44px; height: 44px; color: var(--gold-l); }
.cv-corner.tl { top: 6px; left: 6px; }
.cv-corner.tr { top: 6px; right: 6px; transform: scaleX(-1); }
.cv-corner.bl { bottom: 6px; left: 6px; transform: scaleY(-1); }
.cv-corner.br { bottom: 6px; right: 6px; transform: scale(-1); }
.foil {
    background: linear-gradient(105deg, #a37b38 0%, #f3dea2 28%, #bf9750 46%, #f7e5b0 64%, #a67e3a 100%);
    background-size: 240% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 1px 0 rgba(35, 45, 25, .5));
    animation: foil 7s ease-in-out infinite;
}
@keyframes foil { 0%, 100% { background-position: 0 0; } 50% { background-position: 100% 0; } }
.cv-top { width: 120px; height: 14px; color: var(--gold-l); margin: 0 0 10px; opacity: .9; }
.cv-kicker { margin: 0 0 12px; font-family: var(--f-sc); font-size: 11.5px; letter-spacing: .34em; color: #efdca8; text-indent: .34em; }
.cv-monogram { position: relative; width: 150px; height: 150px; margin-bottom: 2px; }
.cv-monogram svg { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 1px 0 rgba(35, 45, 25, .45)); }
.cv-monogram span {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: var(--f-serif); font-weight: 600; font-size: 40px; letter-spacing: .02em;
}
.cv-monogram i { font-family: var(--f-script); font-style: normal; font-weight: 400; font-size: 26px; margin: 4px 3px 0; }
.cv-script { margin: 8px 0 0; font-family: var(--f-script); font-size: 42px; line-height: 1.2; padding: 0 8px; }
.cv-title {
    margin: 0; font-family: var(--f-serif); font-weight: 500; font-size: clamp(30px, 9vw, 40px); line-height: 1.12; letter-spacing: .03em;
    padding: 0 4px;
}
.cv-title span { font-family: var(--f-script); font-weight: 400; font-size: .8em; }
.cv-flourish { width: 150px; height: 16px; margin: 10px 0 6px; color: var(--gold-l); }
.cv-date { margin: 0; font-family: var(--f-sc); font-size: 14px; letter-spacing: .3em; color: #f1e2b8; text-indent: .3em; }
.cv-plate {
    margin-top: 22px; padding: 10px 18px 12px; min-width: 74%; max-width: 100%; border-radius: 4px;
    background: linear-gradient(#f7eed8, #e8d6ae);
    box-shadow: inset 0 0 0 1px #b48d48, inset 0 0 0 4px #f7eed8, inset 0 0 0 5px rgba(180, 141, 72, .6), 0 3px 8px rgba(30, 40, 20, .4);
}
.pl-k { display: block; font-family: var(--f-sc); font-size: 10.5px; letter-spacing: .12em; color: #7d6a52; }
.pl-n { display: block; margin-top: 2px; font-family: var(--f-serif); font-weight: 600; font-size: 21px; line-height: 1.2; color: #4b3f2c; word-break: break-word; }
.cv-sprigs { display: flex; gap: 2px; margin-top: 16px; color: var(--gold-l); }
.cv-sprigs svg { width: 70px; height: 35px; }
.cv-sprigs svg:first-child { transform: scaleX(-1); }
.cv-hint { margin: 10px 0 0; font-family: var(--f-sc); font-size: 12px; letter-spacing: .26em; color: #f3e5bd; text-indent: .26em; }
.cv-hint span { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.cv-back {
    transform: rotateY(180deg); border-radius: 9px 3px 3px 9px;
    background-color: #ecd9d1;
    background-image:
        linear-gradient(to left, rgba(90, 50, 40, .22), transparent 30px),
        radial-gradient(circle at 25% 25%, rgba(184, 128, 122, .32) 2px, transparent 3px),
        radial-gradient(circle at 75% 75%, rgba(125, 143, 108, .3) 2px, transparent 3px),
        var(--noise);
    background-size: auto, 24px 24px, 24px 24px, auto;
    box-shadow: inset 0 0 0 9px var(--cover-d);
}
.cv-back::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to right, rgba(40, 25, 15, .3), transparent 60%);
    opacity: calc((1 - var(--p, 0)) * 1.6);
}
.exlibris {
    position: absolute; top: 50%; left: 50%; width: 62%; transform: translate(-50%, -50%);
    display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 14px 20px;
    background: var(--paper); border: 1px solid rgba(176, 138, 72, .7);
    box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px rgba(176, 138, 72, .35), 0 3px 8px rgba(80, 50, 40, .2);
}
.ex-bloom { width: 44px; height: 44px; }
.ex-k { font-family: var(--f-script); font-size: 30px; color: var(--rose-d); line-height: 1.2; }
.ex-l { font-style: italic; font-size: 14px; color: var(--ink-2); }
.ex-n { font-weight: 600; font-size: 18px; margin-top: 4px; }

/* ── Chrome: music, toc button, controls ──────────────────────────── */
.music-toggle-btn, .toc-btn, .ctl, .ctl-info {
    border: 1px solid rgba(176, 138, 72, .55); background: rgba(251, 246, 236, .88); color: var(--rose-d);
    box-shadow: 0 6px 14px -6px rgba(80, 60, 30, .4); cursor: pointer;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.music-toggle-btn {
    position: fixed; z-index: 1000; top: calc(12px + env(safe-area-inset-top, 0px)); right: 14px;
    width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; padding: 0;
}
.music-toggle-btn svg { width: 19px; height: 19px; }
.music-toggle-btn.playing svg { animation: spinSlow 6s linear infinite; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.toc-btn {
    position: fixed; z-index: 1000; top: calc(12px + env(safe-area-inset-top, 0px)); left: 14px;
    height: 42px; padding: 0 16px 0 12px; border-radius: 999px; display: flex; align-items: center; gap: 8px;
    font-family: var(--f-sc); font-weight: 600; font-size: 13px; letter-spacing: .14em;
    opacity: 0; pointer-events: none; transition: opacity .6s ease .3s;
}
.toc-btn svg { width: 18px; height: 18px; }
body.opened .toc-btn { opacity: 1; pointer-events: auto; }
.controls {
    position: fixed; z-index: 900; left: 50%; bottom: calc(var(--bottom) - 70px);
    display: flex; align-items: center; gap: 10px;
    transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity .6s ease .3s, transform .6s ease .3s, bottom .4s ease;
}
body.opened .controls { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.ctl { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; padding: 0; transition: opacity .3s; }
.ctl svg { width: 20px; height: 20px; }
body.at-first .ctl.prev, body.at-last .ctl.next { opacity: .35; pointer-events: none; }
.ctl-info {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 178px; height: 48px; padding: 0 12px; border-radius: 999px; color: var(--ink);
}
.ci-ch { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--f-sc); font-weight: 600; font-size: 12.5px; letter-spacing: .08em; }
.ci-no { font-style: italic; font-size: 13px; color: var(--ink-2); }

/* table of contents */
.toc {
    position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: rgba(60, 45, 30, .35); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    opacity: 0; pointer-events: none; transition: opacity .35s ease;
}
.toc.open { opacity: 1; pointer-events: auto; }
.toc-card {
    position: relative; width: min(100%, 400px); max-height: 84dvh; overflow-y: auto; padding: 26px 22px 16px;
    background-color: var(--paper); background-image: var(--noise); border-radius: 4px;
    box-shadow: inset 0 0 0 6px var(--paper), inset 0 0 0 7px rgba(176, 138, 72, .4), 0 30px 60px -20px rgba(40, 25, 10, .55);
    transform: translateY(18px) scale(.98); transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
.toc.open .toc-card { transform: none; }
.toc-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; background: none; color: var(--ink-2); font-size: 16px; cursor: pointer; }
.toc-k { margin: 0; text-align: center; font-family: var(--f-script); font-size: 40px; color: var(--rose-d); line-height: 1.2; }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list button {
    display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 8px 4px; border: 0; background: none; cursor: pointer; text-align: left;
    font-family: var(--f-serif); font-size: 18px; color: var(--ink);
}
.tc-ch { flex: none; min-width: 64px; font-family: var(--f-sc); font-size: 11.5px; letter-spacing: .14em; color: var(--gold); }
.toc-list i { flex: 1; min-width: 14px; border-bottom: 1px dotted rgba(61, 58, 50, .35); transform: translateY(-4px); }
.tc-n { font-style: italic; color: var(--ink-2); }
.toc-list li.on .tc-t { color: var(--rose-d); font-weight: 600; }

/* toast */
.toast {
    position: fixed; z-index: 3000; left: 50%; bottom: calc(var(--bottom) + 8px); max-width: calc(100vw - 40px);
    padding: 10px 18px; border-radius: 999px; background: rgba(61, 58, 50, .94); color: var(--paper);
    font-style: italic; font-size: 16px; text-align: center;
    transform: translate(-50%, 10px); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* lightbox */
.gallery-lightbox {
    position: fixed; inset: 0; z-index: 5000; display: none; align-items: center; justify-content: center;
    background: rgba(32, 26, 20, .93); opacity: 0; transition: opacity .3s;
}
.lb-img-wrap img { display: block; max-width: 90vw; max-height: 80dvh; border: 7px solid #fffdf8; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.lb-close, .lb-prev, .lb-next {
    position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(230, 203, 138, .5);
    background: rgba(251, 246, 236, .12); color: #f3e5bd; font-size: 22px; cursor: pointer; display: grid; place-items: center;
}
.lb-close { top: 16px; right: 16px; font-size: 16px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-counter { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: #f3e5bd; font-style: italic; }

/* ── Wide screens: an open two-page spread ────────────────────────── */
@media (min-width: 900px) {
    body.opening .book, body.opened .book { transform: translateX(50%); }
    .leaf.prev { visibility: visible; }
    .cover.opened { visibility: visible; }
    .cover.opened .cv-back::after { opacity: 0; }
    .stack-l {
        top: 3px; bottom: 3px; left: calc(-100% - 5px); width: 5px; border-radius: 2px 0 0 2px;
        background: repeating-linear-gradient(90deg, #d6c9b0 0 .6px, #f7f0e3 .6px 1.6px);
        transform-origin: right; transform: scaleX(calc(.2 + var(--done, 0) * .8)); opacity: 0; transition: opacity .4s;
    }
    body.opened .stack-l { opacity: 1; }
}

/* ── Short screens: tighten the cover ─────────────────────────────── */
@media (max-height: 740px) {
    .cv-top, .cv-sprigs { display: none; }
    .cv-monogram { width: 108px; height: 108px; }
    .cv-monogram span { font-size: 32px; }
    .cv-kicker { margin-bottom: 6px; }
    .cv-script { font-size: 34px; margin-top: 4px; }
    .cv-title { font-size: 30px; }
    .cv-flourish { margin: 6px 0 4px; }
    .cv-plate { margin-top: 14px; padding: 8px 14px 10px; }
    .cv-hint { margin-top: 12px; }
    .portrait { transform: scale(.86); margin: -14px auto -6px; }
}

/* ── Reduced motion: pages crossfade instead of turning ───────────── */
@media (prefers-reduced-motion: reduce) {
    .leaf.fade { animation: pageFade .45s ease; }
    @keyframes pageFade { from { opacity: 0; } to { opacity: 1; } }
    .curl, .ribbon, .leaf-shadow, .foil, .map-illu .route, .turn-hint b { animation: none !important; }
    .book { transition: none; }
}
