:root {
    --army-darkest: #162615;
    --army-dark: #233b21;
    --army-primary: #345430;
    --army-medium: #486e43;
    --army-light: #6a9163;
    --army-pale: #dce6d8;
    --gold-primary: #d4af37;
    --gold-light: #f3e5ab;
    --gold-bright: #ffd700;
    --cream-bg: #f7f6f0;
    --cream-card: #ffffff;
    --red-flag: #c8232c;
    --text-light: #f5f7f4;
    --text-dark: #1f2e1d;
    --shadow-soft: 0 12px 32px rgba(22, 38, 21, 0.25);
    --shadow-gold: 0 0 25px rgba(212, 175, 55, 0.35);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Be Vietnam Pro', 'Segoe UI', sans-serif;
    background-color: var(--army-darkest);
    color: var(--text-light);
    overflow-x: hidden;
    line-height: 1.65;
}

/* Canvas for falling petals & stars */
#effects-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

/* Background texture pattern */
.bg-pattern {
    position: fixed;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(72, 110, 67, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 80% 75%, rgba(212, 175, 55, 0.12) 0%, transparent 45%),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 2px, transparent 2px, transparent 10px);
    z-index: -1;
}

/* Welcome Envelope Modal */
.welcome-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #132212 0%, #264024 55%, #192b17 100%);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.welcome-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.military-envelope {
    max-width: 540px;
    width: 100%;
    background: linear-gradient(160deg, #2d492a 0%, #1e331c 100%);
    border: 2px solid var(--gold-primary);
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), inset 0 0 0 6px rgba(212, 175, 55, 0.15);
    animation: floatCard 4s ease-in-out infinite;
}

@keyframes floatCard {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.star-crest {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: radial-gradient(circle, var(--red-flag) 0%, #8f141b 100%);
    border: 3px solid var(--gold-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: var(--gold-bright);
    box-shadow: var(--shadow-gold);
}

.envelope-tag {
    display: inline-block;
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.15);
    padding: 6px 16px;
    border-radius: 99px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    margin-bottom: 16px;
}

.military-envelope h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.1rem;
    color: var(--gold-light);
    margin-bottom: 10px;
}

.military-envelope .recipient-name {
    font-family: 'Dancing Script', cursive;
    font-size: 2.7rem;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.4);
    margin-bottom: 18px;
}

.military-envelope p {
    color: var(--army-pale);
    font-size: 1rem;
    margin-bottom: 28px;
}

.btn-open {
    background: linear-gradient(135deg, var(--gold-primary) 0%, #b8860b 100%);
    color: #162615;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 14px 34px;
    border: none;
    border-radius: 99px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-open:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.6);
}

/* Top Navigation / Banner */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(22, 38, 21, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding: 12px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 0.5px;
}

.brand-star {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--red-flag);
    border: 2px solid var(--gold-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-bright);
    font-size: 15px;
}

.nav-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-btn {
    background: rgba(72, 110, 67, 0.4);
    color: var(--gold-light);
    border: 1px solid rgba(212, 175, 55, 0.45);
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-btn:hover {
    background: var(--gold-primary);
    color: var(--army-darkest);
    font-weight: 600;
}

/* Hero Section */
.hero {
    min-height: 90vh;
    padding: 60px 6% 80px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 48px;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(52, 84, 48, 0.7);
    border: 1px solid var(--gold-primary);
    color: var(--gold-light);
    padding: 8px 18px;
    border-radius: 99px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.2rem, 4.2vw, 3.6rem);
    line-height: 1.2;
    color: #ffffff;
    margin-bottom: 12px;
}

.hero-name {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2.8rem, 5vw, 4.4rem);
    color: var(--gold-primary);
    text-shadow: 0 4px 18px rgba(212, 175, 55, 0.3);
    margin-bottom: 22px;
    display: block;
}

.hero-quote {
    font-size: 1.12rem;
    color: var(--army-pale);
    background: rgba(35, 59, 33, 0.75);
    border-left: 4px solid var(--gold-primary);
    padding: 18px 24px;
    border-radius: 0 12px 12px 0;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
}

.hero-cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-primary), #b8860b);
    color: var(--army-darkest);
    font-weight: 700;
    padding: 14px 28px;
    border-radius: 99px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: var(--shadow-gold);
    transition: transform 0.25s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
}

.btn-secondary {
    background: rgba(52, 84, 48, 0.6);
    color: var(--text-light);
    border: 1.5px solid var(--gold-primary);
    font-weight: 600;
    padding: 14px 26px;
    border-radius: 99px;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.25s ease;
}

.btn-secondary:hover {
    background: var(--army-medium);
    transform: translateY(-3px);
}

/* Hero Frame */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
}

.military-portrait-frame {
    position: relative;
    width: 100%;
    max-width: 440px;
    border-radius: 24px;
    padding: 14px;
    background: linear-gradient(145deg, var(--gold-primary) 0%, #6e5716 50%, var(--gold-light) 100%);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55), var(--shadow-gold);
}

.military-portrait-inner {
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: var(--army-dark);
    aspect-ratio: 4 / 4.6;
}

.military-portrait-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.military-portrait-frame:hover .military-portrait-inner img {
    transform: scale(1.05);
}

.frame-ribbon {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #1e331c, #345430, #1e331c);
    border: 2px solid var(--gold-primary);
    padding: 8px 28px;
    border-radius: 99px;
    white-space: nowrap;
    color: var(--gold-light);
    font-weight: 700;
    font-size: 0.92rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.45);
}

/* Section Common */
.section {
    padding: 80px 6%;
    max-width: 1280px;
    margin: 0 auto;
}

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

.section-subtitle {
    color: var(--gold-primary);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.85rem;
    font-weight: 700;
    display: block;
    margin-bottom: 10px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    color: #ffffff;
    margin-bottom: 14px;
}

.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--gold-primary);
}

.section-divider::before,
.section-divider::after {
    content: "";
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

/* Commendation / Qualities Grid (Huy Hiệu Yêu Thương) */
.qualities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.quality-card {
    background: linear-gradient(160deg, rgba(52, 84, 48, 0.65) 0%, rgba(28, 48, 26, 0.85) 100%);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 18px;
    padding: 32px 24px;
    text-align: center;
    position: relative;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.quality-card:hover {
    transform: translateY(-8px);
    border-color: var(--gold-primary);
    box-shadow: var(--shadow-gold);
}

.medal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--army-medium), var(--army-dark));
    border: 2px solid var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.quality-card h3 {
    color: var(--gold-light);
    font-size: 1.25rem;
    margin-bottom: 10px;
    font-family: 'Playfair Display', serif;
}

.quality-card p {
    color: var(--army-pale);
    font-size: 0.96rem;
}

/* Gallery Section (3 Uploaded Photos) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.gallery-card {
    background: linear-gradient(180deg, #253f23 0%, #1a2d18 100%);
    border: 1.5px solid rgba(212, 175, 55, 0.45);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55), var(--shadow-gold);
}

.gallery-img-wrapper {
    position: relative;
    aspect-ratio: 4 / 4.5;
    overflow: hidden;
    cursor: pointer;
}

.gallery-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gallery-card:hover .gallery-img-wrapper img {
    transform: scale(1.07);
}

.gallery-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(22, 38, 21, 0.85);
    border: 1px solid var(--gold-primary);
    color: var(--gold-light);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 99px;
    backdrop-filter: blur(4px);
}

.gallery-caption {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gallery-caption h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    color: var(--gold-light);
    margin-bottom: 10px;
}

.gallery-caption p {
    color: var(--army-pale);
    font-size: 0.96rem;
}

/* Heartfelt Letter Section */
.letter-container {
    background: linear-gradient(135deg, #faf8f1 0%, #efe9d5 100%);
    color: var(--text-dark);
    border-radius: 24px;
    padding: 52px 48px;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    border: 4px solid var(--gold-primary);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
}

.letter-container::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1.5px dashed var(--army-medium);
    border-radius: 16px;
    pointer-events: none;
}

.letter-stamp {
    position: absolute;
    top: 28px;
    right: 34px;
    background: var(--army-primary);
    color: var(--gold-light);
    border: 2px solid var(--gold-primary);
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    transform: rotate(4deg);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.letter-greeting {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    color: var(--army-dark);
    margin-bottom: 20px;
}

.letter-body {
    font-size: 1.12rem;
    line-height: 1.85;
    color: #263824;
    margin-bottom: 28px;
}

.letter-body p {
    margin-bottom: 16px;
}

.letter-poem {
    background: rgba(52, 84, 48, 0.1);
    border-left: 4px solid var(--army-primary);
    padding: 18px 24px;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    font-weight: 500;
    color: var(--army-darkest);
    margin: 24px 0;
}

.letter-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 32px;
}

.letter-signature {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    color: var(--army-primary);
}

.wish-switcher {
    background: var(--army-primary);
    color: var(--gold-light);
    border: 1.5px solid var(--gold-primary);
    padding: 12px 22px;
    border-radius: 99px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.wish-switcher:hover {
    background: var(--army-dark);
    transform: translateY(-2px);
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(12, 22, 11, 0.92);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 820px;
    max-height: 88vh;
    position: relative;
    text-align: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 16px;
    border: 3px solid var(--gold-primary);
    box-shadow: var(--shadow-gold);
}

.lightbox-caption {
    margin-top: 14px;
    color: var(--gold-light);
    font-size: 1.15rem;
    font-family: 'Playfair Display', serif;
}

.lightbox-close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--red-flag);
    color: var(--gold-bright);
    border: 2px solid var(--gold-primary);
    font-size: 1.3rem;
    cursor: pointer;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    background: #101c0f;
    border-top: 1px solid rgba(212, 175, 55, 0.25);
    color: var(--army-pale);
    font-size: 0.95rem;
}

.footer strong {
    color: var(--gold-light);
}

@media (max-width: 960px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 36px;
    }
    .hero-cta-group {
        justify-content: center;
    }
    .gallery-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin: 0 auto;
    }
    .letter-container {
        padding: 36px 24px;
    }
    .letter-stamp {
        position: static;
        display: inline-block;
        margin-bottom: 16px;
        transform: none;
    }
}
