/* ===================================================
   DESIGN SYSTEM — Memorial Tribute Page
   =================================================== */

:root {
    /* Colors */
    --color-bg-dark: #0d0b08;
    --color-bg-section: #faf8f5;
    --color-bg-alt: #f3efe9;
    --color-gold: #c9a96e;
    --color-gold-light: #dfc799;
    --color-gold-dark: #8e7441;
    --color-text-primary: #2c2a25;
    --color-text-secondary: #6b665c;
    --color-text-light: #f5f0e8;
    --color-card-bg: rgba(255, 255, 255, 0.92);
    --color-border: rgba(201, 169, 110, 0.25);

    /* Typography */
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Lora', serif;
    --font-script: 'Great Vibes', cursive;

    /* Spacing */
    --section-padding: 120px 0;
    --container-width: 1400px;

    /* Transitions */
    --transition-smooth: 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-primary);
    background-color: var(--color-bg-section);
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul { list-style: none; }

/* ===== FLOATING PETALS CANVAS ===== */
#petals-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ===== NAVIGATION ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 18px 0;
    transition: background var(--transition-smooth), padding var(--transition-smooth), box-shadow var(--transition-smooth);
}

.nav.scrolled {
    background: rgba(13, 11, 8, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 10px 0;
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.nav-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 6px rgba(201, 169, 110, 0.5));
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-text-light);
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-gold);
    transition: width 0.4s ease;
}

.nav-links a:hover {
    color: var(--color-gold-light);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.nav-toggle span {
    width: 26px;
    height: 2px;
    background: var(--color-text-light);
    border-radius: 2px;
    transition: all 0.3s;
}

/* ===== HERO SECTION ===== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.05);
    animation: heroZoom 25s ease-in-out infinite alternate;
}

@keyframes heroZoom {
    0% { transform: scale(1.05); }
    100% { transform: scale(1.15); }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(13, 11, 8, 0.4) 0%,
        rgba(13, 11, 8, 0.6) 50%,
        rgba(13, 11, 8, 0.85) 100%
    );
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--color-text-light);
    padding: 0 20px;
}

.hero-pretext {
    font-family: var(--font-script);
    font-size: 2rem;
    color: var(--color-gold-light);
    margin-bottom: 10px;
    opacity: 0;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    font-weight: 300;
    letter-spacing: 4px;
    line-height: 1.2;
    margin-bottom: 15px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.4);
    opacity: 0;
}

.hero-name {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 400;
    letter-spacing: 3px;
    color: var(--color-gold-light);
    margin-bottom: 30px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 1s ease, transform 1s ease, letter-spacing 3s ease, text-shadow 3s ease;
}

.hero-name.visible {
    animation: gentlePulse 5s ease-in-out infinite alternate;
}

@keyframes gentlePulse {
    0% {
        text-shadow: 0 2px 10px rgba(201, 169, 110, 0.3), 0 0 4px rgba(255, 255, 255, 0.1);
        letter-spacing: 3px;
    }
    100% {
        text-shadow: 0 2px 25px rgba(201, 169, 110, 0.8), 0 0 15px rgba(255, 255, 255, 0.4);
        letter-spacing: 4.5px;
    }
}


.hero-dates {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    letter-spacing: 3px;
    color: var(--color-gold);
    margin-bottom: 40px;
    opacity: 0;
}

.date-separator {
    font-size: 1.2rem;
    opacity: 0.6;
}

.hero-quote {
    max-width: 550px;
    margin: 0 auto 50px;
    font-size: 1.05rem;
    line-height: 1.9;
    color: rgba(245, 240, 232, 0.8);
    opacity: 0;
}

.hero-scroll-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 1px solid rgba(201, 169, 110, 0.5);
    border-radius: 50%;
    color: var(--color-gold);
    transition: all 0.4s;
    animation: bounceDown 2.5s ease-in-out infinite;
    opacity: 0;
}

.hero-scroll-btn:hover {
    background: rgba(201, 169, 110, 0.15);
    border-color: var(--color-gold);
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* ===== REVEAL ANIMATIONS ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.9s var(--transition-smooth), transform 0.9s var(--transition-smooth);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== SECTION BASE ===== */
.section {
    padding: var(--section-padding);
}

.section-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 30px;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-icon {
    display: block;
    font-size: 1.2rem;
    color: var(--color-gold);
    margin-bottom: 16px;
    letter-spacing: 8px;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 300;
    color: var(--color-text-primary);
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.ornament {
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
    margin: 0 auto;
}

/* ===== TRIBUTE SECTION ===== */
.section-tribute {
    background: var(--color-bg-section);
}

.tribute-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 60px;
    align-items: start;
}

.tribute-image {
    position: sticky;
    top: 100px;
    overflow: hidden;
    /* Organic water drop shape */
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    /* Soft faded water edges */
    -webkit-mask-image: radial-gradient(ellipse at center, black 65%, transparent 98%);
    mask-image: radial-gradient(ellipse at center, black 65%, transparent 98%);
    animation: waterBlob 10s ease-in-out infinite alternate;
}

@keyframes waterBlob {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: translateY(0);
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: translateY(-12px);
    }
    100% {
        border-radius: 40% 60% 50% 50% / 40% 50% 60% 50%;
        transform: translateY(0);
    }
}

.tribute-image::after {
    display: none;
}

.tribute-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.tribute-image:hover img {
    transform: scale(1.05);
}

.tribute-text p {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: 22px;
    text-align: justify;
}

.tribute-text p:first-child::first-letter {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    float: left;
    line-height: 1;
    margin-right: 10px;
    color: var(--color-gold);
    font-weight: 600;
}

/* ===== RECUERDOS / SLIDESHOW SECTION ===== */
.section-recuerdos {
    background: var(--color-bg-alt);
}

.slideshow-wrapper {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.slideshow {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.18),
                0 0 0 1px rgba(201, 169, 110, 0.2);
}

.slideshow::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid rgba(201, 169, 110, 0.25);
    border-radius: 20px;
    z-index: 3;
    pointer-events: none;
}

.slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    filter: blur(0px);
    transform: scale(1);
    transition: opacity 2.5s ease-in-out,
                filter 2.5s ease-in-out,
                transform 2.5s ease-in-out;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    filter: blur(0px);
    transform: scale(1);
    z-index: 2;
}

.slide.dissolving {
    opacity: 0;
    filter: blur(18px);
    transform: scale(1.08);
    z-index: 3;
}

.slideshow-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(201, 169, 110, 0.3);
    cursor: pointer;
    transition: all 0.4s ease;
}

.dot.active {
    background: var(--color-gold);
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(201, 169, 110, 0.5);
}

/* ===== CANDLE SECTION ===== */
.section-candle {
    background: var(--color-bg-dark);
    text-align: center;
    overflow: hidden;
}

.section-candle .section-header h2 {
    color: var(--color-text-light);
}

.candle-subtitle {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--color-gold-light);
    font-style: italic;
    margin-bottom: 50px;
}

.candle-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.candle-image-wrapper {
    position: relative;
    width: 220px;
    height: 280px;
    border-radius: 16px;
    overflow: hidden;
}

.candle-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    opacity: 0.3;
    transition: opacity 1s ease;
}

.candle-image-wrapper.lit .candle-img {
    opacity: 1;
}

.candle-glow {
    position: absolute;
    top: 0;
    left: 50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 200, 100, 0.5) 0%, transparent 70%);
    border-radius: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 1.5s ease;
    pointer-events: none;
}

.candle-image-wrapper.lit .candle-glow {
    opacity: 1;
    animation: flickerGlow 3s ease-in-out infinite alternate;
}

@keyframes flickerGlow {
    0% { opacity: 0.7; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
    100% { opacity: 0.8; transform: translateX(-50%) scale(1.02); }
}

.btn-candle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--color-gold-dark), var(--color-gold));
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    letter-spacing: 1.5px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s;
    box-shadow: 0 8px 25px rgba(201, 169, 110, 0.3);
}

.btn-candle:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(201, 169, 110, 0.5);
}

.btn-candle.lit {
    background: linear-gradient(135deg, #5a7a3a, #7ca053);
    pointer-events: none;
}

.btn-candle.lit .btn-text::after {
    content: ' ✓';
}

.candle-counter {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--color-gold-light);
    opacity: 0.8;
}

#candle-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gold);
}

/* ===== CONDOLENCES SECTION ===== */
.section-condolences {
    background: var(--color-bg-section);
}

.condolence-subtitle {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    font-style: italic;
    margin-bottom: 50px;
}

.condolence-form {
    max-width: 600px;
    margin: 0 auto 60px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text-primary);
    background: rgba(255,255,255,0.8);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.15);
}

.btn-submit {
    display: block;
    width: 100%;
    padding: 16px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, var(--color-gold-dark), var(--color-gold));
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.4s;
    box-shadow: 0 6px 20px rgba(201, 169, 110, 0.25);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(201, 169, 110, 0.4);
}

.messages-list {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message-entry {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 24px 28px;
    animation: fadeInUp 0.6s ease;
}

.message-entry .message-author {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-gold-dark);
    margin-bottom: 6px;
}

.message-entry .message-text {
    font-size: 0.98rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.message-entry .message-time {
    display: block;
    margin-top: 10px;
    font-size: 0.82rem;
    color: #aaa;
    font-style: italic;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== THANKS SECTION ===== */
.section-thanks {
    background: var(--color-bg-alt);
}

.thanks-card {
    max-width: 750px;
    margin: 0 auto;
    background: var(--color-card-bg);
    border-radius: 20px;
    padding: 60px 50px;
    border: 1px solid var(--color-border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.08);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.thanks-card::before {
    content: '"';
    position: absolute;
    top: 20px;
    left: 30px;
    font-family: var(--font-heading);
    font-size: 8rem;
    color: rgba(201, 169, 110, 0.08);
    line-height: 1;
    pointer-events: none;
}

.thanks-card p {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
    line-height: 1.9;
}

.thanks-closing {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--color-gold-dark);
    margin-top: 30px;
}

.thanks-signature {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--color-text-primary);
    margin-top: 30px;
    line-height: 1.6;
}

.family-name {
    font-family: var(--font-script);
    font-size: 2.5rem;
    color: var(--color-gold);
    display: block;
    margin-top: 8px;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--color-bg-dark);
    padding: 50px 20px;
    text-align: center;
}

.footer-quote {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--color-gold-light);
    margin-bottom: 16px;
}

.footer-copy {
    font-size: 0.9rem;
    color: rgba(245, 240, 232, 0.4);
    letter-spacing: 1px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .tribute-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-name {
        font-size: 2.2rem;
        margin-bottom: 20px;
    }

    .hero-pretext {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .tribute-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .tribute-image {
        position: relative;
        top: 0;
        max-width: 400px;
        margin: 0 auto;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        background: rgba(13, 11, 8, 0.96);
        backdrop-filter: blur(20px);
        padding: 20px;
        gap: 0;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li {
        padding: 12px 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .nav-toggle {
        display: flex;
    }

    .hero-title {
        font-size: 2.4rem;
        letter-spacing: 2px;
    }

    .hero-name {
        font-size: 1.8rem;
        letter-spacing: 1.5px;
        margin-bottom: 18px;
    }

    .hero-pretext {
        font-size: 1.3rem;
    }

    .hero-dates {
        font-size: 1.1rem;
    }

    .section-header h2 {
        font-size: 2.2rem;
    }

    .thanks-card {
        padding: 40px 25px;
    }

    .section {
        padding: 80px 0;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-name {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }

    .hero-pretext {
        font-size: 1.1rem;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .family-name {
        font-size: 2rem;
    }
}

/* ===== DEDICATION PULSE ===== */
.pulse-dedication {
    display: block;
    margin-top: 15px;
    font-family: var(--font-body);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-gold-dark);
    font-style: normal;
    animation: gentlePulseDedication 4s ease-in-out infinite alternate;
    text-align: center;
}

@keyframes gentlePulseDedication {
    0% {
        text-shadow: 0 1px 4px rgba(201, 169, 110, 0.15), 0 0 1px rgba(255, 255, 255, 0.05);
        letter-spacing: 2px;
        opacity: 0.8;
    }
    100% {
        text-shadow: 0 1px 18px rgba(201, 169, 110, 0.85), 0 0 8px rgba(255, 255, 255, 0.3);
        letter-spacing: 3px;
        opacity: 1;
    }
}

/* ===== PDF TEMPLATE STYLES ===== */
.pdf-container {
    padding: 60px;
    background: #faf8f5;
    color: #2c2a25;
    font-family: 'Lora', serif;
    position: relative;
    border: 10px solid #c9a96e;
    box-sizing: border-box;
}

.pdf-header {
    text-align: center;
    margin-bottom: 30px;
}

.pdf-photo {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #c9a96e;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.pdf-content {
    text-align: center;
}

.pdf-content h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    font-style: italic;
    color: #c9a96e;
    margin-bottom: 5px;
}

.pdf-content h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 42px;
    margin-bottom: 20px;
}

.pdf-stamp {
    border: 2px solid #8e7441;
    display: inline-block;
    padding: 15px 30px;
    margin: 20px 0 40px 0;
    position: relative;
}

.pdf-stamp::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px dashed #c9a96e;
}

.stamp-title {
    font-family: 'Great Vibes', cursive;
    font-size: 28px;
    color: #8e7441;
    margin: 0 0 5px 0;
}

.stamp-dates {
    font-family: 'Lora', serif;
    font-size: 14px;
    letter-spacing: 3px;
    margin: 0;
}

.pdf-text {
    text-align: justify;
    line-height: 1.8;
    font-size: 16px;
    color: #4a4a4a;
    padding: 0 40px;
}

.pdf-text p {
    margin-bottom: 15px;
}

.pdf-signature {
    text-align: right;
    margin-top: 40px !important;
    font-size: 18px;
}

