:root {
    --gold: #C5A059;
    --gold-light: #E8D090;
    --gold-dark: #8C6A2E;
    --purple: #4A2B4D;
    --purple-light: #7A4E7F;
    --cream: #FDF9F1;
    --text-color: #2C2621;
    
    --font-title: 'Playfair Display', serif;
    --font-script: 'Alex Brush', cursive;
    --font-body: 'Lora', serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #12100E;
    background-image: radial-gradient(circle at center, #2a2520 0%, #0d0c0a 100%);
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Alinhado ao topo */
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text-color);
    overflow: hidden;
}

#particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    background-color: var(--gold-light);
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 5px var(--gold); /* Reduzido para não travar o celular */
    animation: float 5s infinite linear;
    will-change: transform, opacity; /* Força o uso da Placa de Vídeo (GPU) */
}

@keyframes float {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    20% { opacity: 0.8; }
    80% { opacity: 0.8; }
    100% { transform: translateY(-100px) scale(0); opacity: 0; }
}

.book-viewport {
    position: relative;
    z-index: 10;
    perspective: 2000px;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Alinhado ao topo */
    padding: 0;
}

.container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

#book {
    width: 100vw;
    height: 100vh;
}

.page {
    background-color: var(--cream);
    background-image: url('assets/papel_pergaminho_1787183936615.jpg');
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.1), 
                -2px 0 5px rgba(0,0,0,0.2);
    overflow: hidden;
    position: relative;
}

.page-content {
    width: 100%;
    height: 100%;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.page-border {
    width: 100%;
    height: 100%;
    border: 2px solid var(--gold);
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
    box-shadow: inset 0 0 15px rgba(197, 160, 89, 0.2);
    background: rgba(253, 249, 241, 0.4);
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-title);
    text-align: center;
    color: var(--gold-dark);
}

.cover-title {
    font-size: 2.2rem;
    line-height: 1.1;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.cover-subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    font-style: italic;
    color: var(--text-color);
    margin-bottom: 30px;
}

.est {
    font-size: 0.9rem;
    font-style: italic;
    letter-spacing: 2px;
    margin-top: 20px;
}

.crest {
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border: 3px solid var(--gold);
    mix-blend-mode: multiply; /* Helps blend with parchment */
}

/* Announcement */
.announcement-text {
    text-align: center;
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 15px 0;
}

.top-text {
    margin-top: 20px;
}

.portrait-frame {
    width: 200px;
    height: 260px;
    margin: 20px 0;
    border-radius: 100px;
    overflow: hidden;
    border: 4px solid var(--gold);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4), inset 0 0 20px rgba(0,0,0,0.5);
    padding: 5px;
    background: var(--gold-dark);
}

.portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 95px;
}

.debutante-name {
    font-family: var(--font-script);
    font-size: 3.5rem;
    color: var(--purple);
    font-weight: 400;
    margin-top: 10px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* Sections */
.section-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    margin-top: 10px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    width: 50%;
    height: 1px;
    background: var(--gold);
}

.map-container {
    position: relative;
    width: 90%;
    height: 350px;
    margin-bottom: 30px;
    border: 2px solid var(--gold-dark);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-radius: 5px;
    overflow: hidden;
}

.map-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(0.3) contrast(1.1);
}

.wax-seal {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.wax-seal img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gold-btn {
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-family: var(--font-title);
    font-size: 1.1rem;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 30px;
}

.gold-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, var(--gold), #7A5920);
}

/* Registry */
.gift-box-wrapper {
    width: 220px;
    height: 220px;
    margin: 30px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.gift-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.registry-text {
    text-align: center;
    font-size: 1.05rem;
    margin-bottom: 30px;
    padding: 0 10px;
    font-style: italic;
}

/* Closing */
.closing-page {
    justify-content: space-between;
    text-align: center;
    background: rgba(0,0,0,0.02);
}

.closing-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.closing-text {
    font-family: var(--font-title);
    font-size: 1.4rem;
    line-height: 1.6;
    font-style: italic;
    color: var(--text-color);
    margin-bottom: 40px;
    padding: 0 20px;
}

.signature {
    font-family: var(--font-script);
    font-size: 3rem;
    color: var(--purple);
}

/* Page Corner Animation */
.page-corner {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 60px;
    cursor: pointer;
    z-index: 100;
    background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0.8) 100%);
    box-shadow: -2px -2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-top-left-radius: 10px;
}

.page-corner::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: radial-gradient(circle, rgba(197, 160, 89, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.page-corner:hover {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.6) 50%, #fff 100%);
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

/* Page Flip Adjustments */
.stf__item {
    pointer-events: auto !important;
}

.floral-decoration {
    width: 100px;
    height: 50px;
    background-image: radial-gradient(ellipse, var(--gold-light) 10%, transparent 10%),
                      radial-gradient(ellipse, var(--purple-light) 20%, transparent 20%);
    background-size: 10px 10px, 20px 20px;
    background-position: 0 0, 5px 5px;
    opacity: 0.3;
}

/* Reference Page 2 Styles */
.ref-style {
    justify-content: flex-start;
    padding: 30px 10px 10px 10px;
}

.cameo-container {
    width: 60px;
    height: 70px;
    margin: 0 auto 15px auto;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--gold-dark);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.cameo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: multiply;
}

.ref-small-text {
    font-family: var(--font-body);
    font-variant: small-caps;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    line-height: 1.4;
    font-weight: 600;
    text-align: center;
    margin: 10px 0;
    color: var(--text-color);
}

.ref-debutante-name {
    font-family: var(--font-script);
    font-size: 4rem;
    color: var(--purple);
    font-weight: 400;
    margin: 5px 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    line-height: 1;
}

.ref-gold-divider {
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 10px auto;
}

.ref-portrait-container {
    width: 250px;
    height: 330px;
    margin: 10px auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ref-portrait {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3));
}

.ref-date-time {
    text-align: center;
    margin-top: 10px;
}

.ref-small-caps-label {
    font-family: var(--font-body);
    font-variant: small-caps;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: var(--text-color);
    margin-bottom: 2px;
}

.ref-date-text {
    font-family: var(--font-title);
    font-size: 2.2rem;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--text-color);
    margin: 0 0 10px 0;
}

.ref-time-text {
    font-family: var(--font-title);
    font-size: 2.2rem;
    font-weight: 400;
    color: var(--text-color);
    margin: 0;
}

.ref-slash {
    color: var(--gold-dark);
    font-weight: 300;
}
