/* ============================================================
   LUXURY WEDDING BOOK — PREMIUM DESIGN
   Leather texture • Gold foil • Ornamental borders
   ============================================================ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    background: #0f0d0a;
    font-family: 'Cormorant Garamond', serif;
    -webkit-font-smoothing: antialiased;
    color: #3E3025;
}

/* ─── PRELOADER ─── */
.loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0f0d0a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s;
    pointer-events: none;
}

.loader.hidden {
    opacity: 0;
}

.loader-icon {
    font-size: 48px;
    color: #C9A96E;
    animation: pulse 1.5s ease-in-out infinite;
}

.loader-text {
    color: #8a7d70;
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 15px;
}

/* ─── SCENE ─── */
.book-scene {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background:
        radial-gradient(ellipse at 50% 40%, #1e1a15 0%, #0f0d0a 70%);
}

.vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 10;
}

/* ─── BOOK CONTAINER ─── */
.book-container {
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.5),
        0 5px 15px rgba(0, 0, 0, 0.3);
}

/* ═══════════════════════════════════════════════
   PAGE BASE
   ═══════════════════════════════════════════════ */
.my-page {
    background-color: #F5EFDF;
    overflow: hidden;
}

.page-content {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════
   FRONT COVER — LEATHER TEXTURE
   ═══════════════════════════════════════════════ */
.cover-front {
    /* Deep leather-like gradient */
    background:
        /* Subtle grain noise */
        url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E"),
        /* Diamond stitch pattern */
        repeating-linear-gradient(45deg,
            transparent, transparent 20px,
            rgba(201, 169, 110, 0.03) 20px, rgba(201, 169, 110, 0.03) 21px),
        repeating-linear-gradient(-45deg,
            transparent, transparent 20px,
            rgba(201, 169, 110, 0.03) 20px, rgba(201, 169, 110, 0.03) 21px),
        /* Deep leather color */
        linear-gradient(165deg, #2c2318 0%, #1a150f 40%, #15110c 100%);
    color: #D4B87A;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

/* Gold border frame on cover */
.cover-border-frame {
    position: absolute;
    inset: 12px;
    border: 2px solid rgba(201, 169, 110, 0.4);
    pointer-events: none;
    z-index: 2;
}

.cover-border-frame::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(201, 169, 110, 0.2);
}

/* Cover corner ornaments */
.cover-corner {
    position: absolute;
    font-size: 22px;
    color: rgba(201, 169, 110, 0.5);
    z-index: 3;
    line-height: 1;
}

.cover-corner-tl {
    top: 20px;
    left: 20px;
    transform: rotate(0deg);
}

.cover-corner-tr {
    top: 20px;
    right: 20px;
    transform: rotate(90deg);
}

.cover-corner-bl {
    bottom: 20px;
    left: 20px;
    transform: rotate(-90deg);
}

.cover-corner-br {
    bottom: 20px;
    right: 20px;
    transform: rotate(180deg);
}

.cover-content {
    position: relative;
    z-index: 5;
    padding: 30px;
}

/* Cover Monogram */
.cover-monogram {
    font-family: 'Great Vibes', cursive;
    font-size: 28px;
    color: rgba(201, 169, 110, 0.6);
    margin-bottom: 10px;
    letter-spacing: 3px;
}

/* Cover Flourish */
.cover-flourish {
    color: rgba(201, 169, 110, 0.5);
    font-size: 16px;
    letter-spacing: 4px;
    margin: 12px 0;
}

.cover-flourish.gold {
    color: rgba(201, 169, 110, 0.7);
}

.cover-subtitle {
    font-size: 12px;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: rgba(212, 184, 122, 0.7);
    margin-bottom: 15px;
}

.cover-names {
    font-family: 'Playfair Display', serif;
    font-size: 34px;
    line-height: 1.15;
    color: #E8D5A3;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.cover-names .amp {
    display: block;
    font-family: 'Great Vibes', cursive;
    font-size: 36px;
    color: rgba(201, 169, 110, 0.6);
    margin: 6px 0;
}

.cover-date {
    font-size: 17px;
    letter-spacing: 4px;
    color: rgba(212, 184, 122, 0.8);
    margin-top: 5px;
}

.btn-open {
    margin-top: 22px;
    padding: 10px 28px;
    border: 1px solid rgba(201, 169, 110, 0.5);
    color: #D4B87A;
    background: rgba(201, 169, 110, 0.08);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 11px;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-open:hover,
.btn-open:active {
    background: rgba(201, 169, 110, 0.2);
    border-color: rgba(201, 169, 110, 0.8);
}

/* ═══════════════════════════════════════════════
   BACK COVER
   ═══════════════════════════════════════════════ */
.cover-back {
    background:
        repeating-linear-gradient(45deg, transparent, transparent 20px, rgba(201, 169, 110, 0.03) 20px, rgba(201, 169, 110, 0.03) 21px),
        repeating-linear-gradient(-45deg, transparent, transparent 20px, rgba(201, 169, 110, 0.03) 20px, rgba(201, 169, 110, 0.03) 21px),
        linear-gradient(165deg, #2c2318 0%, #1a150f 40%, #15110c 100%);
    color: #D4B87A;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.back-thanks {
    font-size: 18px;
    margin-bottom: 8px;
}

.back-names {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    color: #E8D5A3;
    margin-bottom: 8px;
}

.back-year {
    font-size: 16px;
    letter-spacing: 5px;
    color: rgba(212, 184, 122, 0.6);
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════
   ENDPAPER — Decorative pattern (inside cover)
   ═══════════════════════════════════════════════ */
.endpaper {
    background: #2a2218;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.endpaper-pattern {
    position: absolute;
    inset: 0;
    /* Classic damask-like pattern via CSS */
    background:
        radial-gradient(circle at 25% 25%, rgba(201, 169, 110, 0.06) 2px, transparent 2px),
        radial-gradient(circle at 75% 25%, rgba(201, 169, 110, 0.06) 2px, transparent 2px),
        radial-gradient(circle at 25% 75%, rgba(201, 169, 110, 0.06) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(201, 169, 110, 0.06) 2px, transparent 2px),
        radial-gradient(circle at 50% 50%, rgba(201, 169, 110, 0.04) 3px, transparent 3px);
    background-size: 30px 30px;
    opacity: 1;
}

.endpaper-center {
    position: relative;
    z-index: 2;
}

.endpaper-monogram {
    font-family: 'Great Vibes', cursive;
    font-size: 40px;
    color: rgba(201, 169, 110, 0.4);
    text-shadow: 0 0 30px rgba(201, 169, 110, 0.15);
}

/* ═══════════════════════════════════════════════
   INNER BOOK PAGES — Premium paper
   ═══════════════════════════════════════════════ */
.book-page {
    /* Warm aged paper */
    background:
        /* Paper grain */
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E"),
        linear-gradient(180deg, #FAF6EC 0%, #F3ECD8 30%, #EDE5CE 100%);
    position: relative;
}

.book-page.aged {
    background:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"),
        linear-gradient(180deg, #F3ECD8 0%, #EDE5CE 30%, #E8DDC5 100%);
}

/* Book spine shadow on left pages */
.book-page::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.06), transparent);
    pointer-events: none;
    z-index: 5;
}

/* ─── PAGE BORDER FRAME ─── */
.page-border-frame {
    position: absolute;
    inset: 15px;
    border: 1px solid rgba(180, 155, 110, 0.35);
    pointer-events: none;
    z-index: 3;
}

.page-border-frame::before {
    content: "";
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(180, 155, 110, 0.15);
}

/* ─── CORNER FILIGREES ─── */
.corner-decor {
    position: absolute;
    width: 35px;
    height: 35px;
    z-index: 4;
    pointer-events: none;
}

/* Use borders to create L-shaped ornaments */
.corner-decor::before {
    content: "✦";
    position: absolute;
    font-size: 10px;
    color: rgba(180, 155, 110, 0.5);
}

.corner-decor.tl {
    top: 20px;
    left: 20px;
}

.corner-decor.tl::before {
    top: 0;
    left: 0;
}

.corner-decor.tr {
    top: 20px;
    right: 20px;
}

.corner-decor.tr::before {
    top: 0;
    right: 0;
}

.corner-decor.bl {
    bottom: 20px;
    left: 20px;
}

.corner-decor.bl::before {
    bottom: 0;
    left: 0;
}

.corner-decor.br {
    bottom: 20px;
    right: 20px;
}

.corner-decor.br::before {
    bottom: 0;
    right: 0;
}

/* ─── PAGE INNER CONTENT ─── */
.page-inner {
    padding: 45px 30px 35px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 2;
}

/* ─── DECORATIVE ELEMENTS ─── */
.decor-header {
    color: rgba(180, 155, 110, 0.6);
    font-size: 18px;
    margin-bottom: 15px;
    letter-spacing: 5px;
}

.decor-footer {
    color: rgba(180, 155, 110, 0.4);
    font-size: 14px;
    margin-top: auto;
    padding-top: 15px;
    letter-spacing: 5px;
}

/* Ornamental Dividers */
.ornamental-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(180, 155, 110, 0.5);
    font-size: 14px;
    margin: 12px 0 18px;
    letter-spacing: 3px;
}

.ornamental-divider.small {
    font-size: 12px;
    margin: 8px 0 12px;
}

.divider-gem {
    color: #BFA57D;
    font-size: 10px;
}

/* ─── TYPOGRAPHY ─── */
.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    color: #3A2E22;
    font-weight: 500;
    letter-spacing: 1px;
}

.page-title.small-title {
    font-size: 20px;
}

.page-text {
    font-size: 16px;
    line-height: 1.7;
    color: #4A3F35;
    font-weight: 500;
}

.page-text.cursive {
    font-family: 'Great Vibes', cursive;
    font-size: 22px;
    color: #8B7355;
    margin-top: 12px;
    line-height: 1.4;
}

.cursive-large {
    font-family: 'Great Vibes', cursive;
    font-size: 26px;
    color: #D4B87A;
}

.page-text.small-text {
    font-size: 14px;
    color: #6B5E50;
}

/* Page numbers */
.page-number {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: rgba(150, 135, 115, 0.5);
    letter-spacing: 2px;
    z-index: 5;
}

/* ─── QUOTE BLOCK ─── */
.quote-block {
    position: relative;
    padding: 15px 10px;
    max-width: 260px;
}

.quote-mark {
    font-family: 'Playfair Display', serif;
    font-size: 50px;
    color: rgba(180, 155, 110, 0.3);
    line-height: 0.6;
    position: absolute;
}

.quote-mark.open {
    top: -5px;
    left: -5px;
}

.quote-mark.close {
    bottom: 0;
    right: -5px;
}

.quote-text {
    font-size: 17px;
    line-height: 1.7;
    color: #4A3F35;
    font-style: italic;
    font-weight: 500;
    position: relative;
    z-index: 2;
}

/* ─── TIMELINE ─── */
.timeline-elegant {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 240px;
    position: relative;
}

/* Vertical line */
.timeline-elegant::before {
    content: "";
    position: absolute;
    left: 60px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(180, 155, 110, 0.4), transparent);
}

.tl-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.tl-year {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    color: #8B7355;
    font-weight: 600;
    min-width: 45px;
    text-align: right;
}

.tl-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(180, 155, 110, 0.5);
    border: 1px solid #BFA57D;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.tl-item.highlight .tl-dot {
    background: #C9A96E;
    box-shadow: 0 0 8px rgba(201, 169, 110, 0.4);
    width: 10px;
    height: 10px;
}

.tl-event {
    font-size: 15px;
    color: #4A3F35;
    font-weight: 500;
}

.tl-item.highlight .tl-event {
    color: #3A2E22;
    font-weight: 600;
}

/* ─── SCHEDULE ─── */
.schedule-elegant {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 250px;
}

.sched-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
}

.sched-time {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    color: #8B7355;
    font-weight: 600;
    min-width: 50px;
}

.sched-line {
    flex: 1;
    height: 1px;
    background: repeating-linear-gradient(to right,
            rgba(180, 155, 110, 0.3) 0px, rgba(180, 155, 110, 0.3) 3px,
            transparent 3px, transparent 6px);
    margin: 0 10px;
}

.sched-event {
    font-size: 15px;
    color: #4A3F35;
    font-weight: 500;
}

/* ─── NOTE CARD ─── */
.note-card {
    padding: 20px;
    border: 1px solid rgba(180, 155, 110, 0.2);
    background: rgba(255, 255, 255, 0.3);
    max-width: 250px;
    margin: 10px 0;
}

.note-emoji {
    font-size: 30px;
    margin-bottom: 10px;
}

/* ─── LOCATION ─── */
.location-name {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    color: #3A2E22;
    font-weight: 600;
    margin-bottom: 5px;
}

.btn-map {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 20px;
    border: 1px solid rgba(180, 155, 110, 0.4);
    color: #8B7355;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.btn-map:active {
    background: rgba(180, 155, 110, 0.1);
}

/* Watermark page */
.page-watermark {
    font-family: 'Great Vibes', cursive;
    font-size: 50px;
    color: rgba(180, 155, 110, 0.15);
    user-select: none;
}

/* ─── RSVP FORM ─── */
.rsvp-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 220px;
    margin-top: 10px;
}

.rsvp-form input {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(180, 155, 110, 0.3);
    font-family: 'Cormorant Garamond', serif;
    font-size: 15px;
    color: #3A2E22;
    text-align: center;
    outline: none;
    transition: border 0.3s;
}

.rsvp-form input:focus {
    border-color: rgba(180, 155, 110, 0.6);
}

.rsvp-form input::placeholder {
    color: rgba(100, 88, 72, 0.5);
}

.btn-submit {
    padding: 10px;
    background: #BFA57D;
    border: none;
    color: #FFF;
    text-transform: uppercase;
    font-size: 12px;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit:hover,
.btn-submit:active {
    background: #A8905E;
}

.rsvp-note {
    font-size: 14px;
    color: #8B7355;
    height: 20px;
    margin-top: 5px;
}

/* ═══════════════════════════════════════════════
   UI CONTROLS — Bottom Navigation
   ═══════════════════════════════════════════════ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    pointer-events: none;
    z-index: 50;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(15, 13, 10, 0.95) 0%, transparent 100%);
}

.nav-btn {
    background: rgba(201, 169, 110, 0.08);
    border: 1px solid rgba(201, 169, 110, 0.3);
    color: #C9A96E;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.nav-btn:active {
    background: rgba(201, 169, 110, 0.25);
    transform: scale(0.92);
}

.nav-counter {
    color: #C9A96E;
    font-size: 14px;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
    opacity: 0.7;
    pointer-events: auto;
}

/* ─── ANIMATIONS ─── */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.96);
    }
}