/* ROOT VARIABLES */
:root {
    --primary: #0B1E33;
    --accent: #C5A059;
    --bg: #FDFCFB;
    --text: #334155;
}

/* ================= GLOBAL ================= */

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-family: 'Playfair Display', serif;
    color: var(--primary);
}

/* ================= 3D ENVELOPE INTRO ================= */

#intro-container {
    height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, #ffffff 0%, #e2e8f0 100%);
    position: fixed;
    z-index: 1000;
    transition: transform 1s cubic-bezier(0.87, 0, 0.13, 1);
}

.envelope-wrapper {
    perspective: 1500px;
    cursor: pointer;
}

.envelope {
    position: relative;
    width: 450px;
    height: 300px;
    background: white;
    transform-style: preserve-3d;
    transition: transform 0.8s ease;
    box-shadow: 0 50px 100px rgba(0,0,0,0.2);
}

/* Front side */

.envelope-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: url("https://img.evbuc.com/https%3A%2F%2Fcdn.evbuc.com%2Fimages%2F1178423087%2F2992042626433%2F1%2Foriginal.20260225-164856?fit=crop&w=800&q=75") center/cover;
    border: 8px solid white;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 20px;
}

.envelope-front::after {
    content: "CLICK TO OPEN";
    color: white;
    font-size: 12px;
    letter-spacing: 4px;
    background: rgba(0,0,0,0.4);
    padding: 8px 15px;
    backdrop-filter: blur(5px);
}

/* Back side */

.envelope-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #f1f5f9;
    transform: rotateY(180deg);
    backface-visibility: hidden;
}

.flap {
    position: absolute;
    top: 0;
    width: 100%;
    height: 50%;
    background: #e2e8f0;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform-origin: top;
    transition: 0.6s 0.8s;
    z-index: 3;
}

.letter {
    position: absolute;
    bottom: 10px;
    left: 5%;
    width: 90%;
    height: 90%;
    background: white;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
    transition: 0.8s 1.4s;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid #eee;
}

/* Open animations */

.envelope-wrapper.open .envelope {
    transform: rotateY(180deg);
}

.envelope-wrapper.open .flap {
    transform: rotateX(180deg);
    z-index: 1;
}

.envelope-wrapper.open .letter {
    transform: translateY(-180px);
    z-index: 2;
}

/* ================= MAIN CONTENT ================= */

#main-content {
    opacity: 0;
    visibility: hidden;
    transition: 1s;
}

.logo-section {
    text-align: center;
    padding: 60px 20px;
    background: white;
}

.logo-section img {
    width: 300px;
    max-width: 100%;
    height: auto;
}

/* ================= HERO ================= */

.parallax-hero {
    height: 60vh;
    min-height: 400px;
    background:
        linear-gradient(rgba(11,30,51,0.6), rgba(11,30,51,0.6)),
        url("https://images.unsplash.com/photo-1605999353377-37c775c79889?auto=format&fit=crop&w=1600&q=80");
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 20px;
}

.parallax-hero h1 {
    color: white;
    font-size: 3.5rem;
    margin-bottom: 10px;
    max-width: 90%;
}

/* ================= LAYOUT ================= */

.container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 80px 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 80px;
}

/* ================= CARD ================= */

.luxury-card {
    background: white;
    padding: 50px;
    border-left: 5px solid var(--accent);
    box-shadow: 0 20px 50px rgba(0,0,0,0.05);
}

.luxury-card h2 {
    margin-top: 0;
    font-size: 2rem;
}

/* ================= BUTTON ================= */

.btn-gold {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 18px 40px;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 2px;
    border: 1px solid var(--accent);
    transition: 0.3s;
    margin-top: 20px;
    text-align: center;
}

.btn-gold:hover {
    background: var(--accent);
    color: var(--primary);
    transform: translateY(-3px);
}

/* ================= SPONSORS ================= */

.sponsor-box {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    padding: 40px;
    background: white;
    border: 1px solid #e2e8f0;
}

.sponsor-box img {
    height: 250px;
    margin: 0px;
    object-fit: contain;
    filter: grayscale(100%);
    transition: .4s;
    max-width: 100%;
}

.sponsor-box img:hover {
    filter: grayscale(0%);
    transform: scale(1.1);
}

/* ================= FOOTER ================= */

.site-footer {
    background: var(--primary);
    color: white;
    padding: 80px 20px 60px;
    text-align: center;
    border-top: 3px solid var(--accent);
}

.event-password {
    color: red;
}

.footer-container {
    max-width: 900px;
    width: 100%;
    margin: auto;
}

.footer-logo {
    height: 70px;
    margin-bottom: 25px;
    filter: brightness(0) invert(1);
    max-width: 100%;
}

.footer-tagline {
    font-size: 14px;
    line-height: 1.6;
    opacity: .8;
    margin-bottom: 30px;
}

.footer-copy {
    margin-top: 30px;
    font-size: 12px;
    opacity: .6;
}

/* ================= HERO PASSWORD NOTE ================= */

.form-password {
    margin-top: 15px;
    font-size: 14px;
    letter-spacing: 2px;
    color: white;
    opacity: .85;
    animation: pulseText 2.5s infinite ease-in-out;
}

@keyframes pulseText {
    0% { opacity: .5 }
    50% { opacity: 1 }
    100% { opacity: .5 }
}

/* ================= RSVP REMINDER ================= */

.rsvp-reminder {
    text-align: center;
    max-width: 700px;
    width: 100%;
    margin: 60px auto;
    padding: 40px;
    background: white;
    border-top: 4px solid var(--accent);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* ================= HSSC LOGO CENTER ================= */

.hssc-logo {
    display: block;
    height: 80px;
    width: auto;
    object-fit: contain;
    margin: 0 auto;
    max-width: 100%;
}

/* ================= SOCIAL ================= */

.social-icons {
    margin-bottom: 30px;
}

.social-icons img {
    width: 28px;
    height: 28px;
    margin: 0 12px;
    transition: .3s;
    filter: brightness(0) invert(1);
}

.social-icons img:hover {
    transform: rotate(15deg) scale(1.2);
}

/* ================= IMAGE STYLING ================= */

.envelope-front img {
    position: absolute;
    top: 79px;
    right: 166px;
    height: 115px;
    transform: rotate(17deg);
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.25));
    animation: pulseGrow 2s ease-in-out infinite;
}

@keyframes pulseGrow {
    0% {
        transform: rotate(17deg) scale(1);
    }
    50% {
        transform: rotate(17deg) scale(1.15);
    }
    100% {
        transform: rotate(17deg) scale(1);
    }
}

.letter img {
    height: 50px;
    margin: 0 auto 10px;
    max-width: 100%;
}

.luxury-card img {
    height: 250px;
    display: block;
    margin: 0px 240px 0px 240px;
    max-width: calc(100% - 480px);
}

/* ================= ANIMATIONS ================= */

.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease-out;
}

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

/* ================= EVENT LIST ================= */

.event-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.event-list li {
    margin-bottom: 10px;
}

/* ================= SECTION TITLE ================= */

.section-title {
    text-align: center;
    margin-top: 60px;
}

/* ================= COMMUNITY CARD ================= */

.community-card {
    text-align: center;
}

.community-card p {
    margin: 20px 0;
}

/* ================= RESPONSIVE BREAKPOINTS ================= */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .parallax-hero h1 {
        font-size: 3rem;
    }

    .luxury-card {
        padding: 40px;
    }

    .luxury-card h2 {
        font-size: 1.8rem;
    }

    .luxury-card img {
        margin: 0px 150px 0px 150px;
        max-width: calc(100% - 300px);
    }

    .envelope-front img {
        right: 140px;
        height: 100px;
        top: 70px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .envelope {
        width: 320px;
        height: 220px;
    }

    .envelope-front img {
        right: 100px;
        height: 80px;
        top: 50px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        margin-bottom: 60px;
    }

    .parallax-hero {
        height: auto;
        min-height: 50vh;
        padding: 60px 20px;
    }

    .parallax-hero h1 {
        font-size: 2.2rem;
    }

    .logo-section {
        padding: 40px 20px;
    }

    .logo-section img {
        width: 250px;
    }

    .luxury-card {
        padding: 35px;
    }

    .luxury-card h2 {
        font-size: 1.6rem;
    }

    .luxury-card img {
        height: 200px;
        margin: 0px auto;
        max-width: 100%;
    }

    .container {
        padding: 60px 20px;
    }

    .sponsor-box {
        flex-direction: column;
        padding: 30px 20px;
    }

    .sponsor-box img {
        margin: 15px 0;
        height: 200px;
    }

    .rsvp-reminder {
        padding: 30px 20px;
        margin: 40px auto;
    }

    .footer-logo {
        height: 60px;
    }

    .site-footer {
        padding: 60px 20px 40px;
    }

    .btn-gold {
        padding: 16px 32px;
        font-size: 0.9rem;
    }

    .hssc-logo {
        height: 70px;
    }

    .letter {
        padding: 15px;
    }

    .invite-title {
        font-size: 1.2rem;
    }

    .invite-subtitle {
        font-size: 0.9rem;
    }
}

/* Large phones */
@media (max-width: 576px) {
    html {
        font-size: 14px;
    }

    .parallax-hero h1 {
        font-size: 1.8rem;
    }

    .hero-date {
        font-size: 0.9rem;
    }

    .form-password {
        font-size: 12px;
        letter-spacing: 1px;
    }

    .luxury-card {
        padding: 25px;
        border-left-width: 4px;
    }

    .luxury-card h2 {
        font-size: 1.5rem;
    }

    .event-list li {
        font-size: 0.95rem;
    }

    .btn-gold {
        padding: 14px 28px;
        letter-spacing: 1px;
        width: 100%;
        max-width: 300px;
    }

    .sponsor-box img {
        height: 150px;
    }

    .hssc-logo {
        height: 60px;
    }

    .social-icons img {
        width: 24px;
        height: 24px;
        margin: 0 8px;
    }

    .footer-tagline {
        font-size: 13px;
    }

    .rsvp-reminder h3 {
        font-size: 1.3rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .letter img {
        height: 40px;
    }
}

/* Small phones */
@media (max-width: 375px) {
    .envelope {
        width: 280px;
        height: 190px;
    }

    .envelope-front img {
        right: 85px;
        height: 65px;
        top: 45px;
    }

    .parallax-hero h1 {
        font-size: 1.5rem;
    }

    .logo-section img {
        width: 200px;
    }

    .luxury-card {
        padding: 20px;
    }

    .luxury-card h2 {
        font-size: 1.3rem;
    }

    .btn-gold {
        padding: 12px 24px;
        font-size: 0.85rem;
    }

    .sponsor-box img {
        height: 120px;
    }

    .hssc-logo {
        height: 50px;
    }

    .container {
        padding: 40px 15px;
    }

    .info-grid {
        gap: 20px;
        margin-bottom: 40px;
    }

    .rsvp-reminder {
        padding: 25px 15px;
    }
}

/* Very small phones */
@media (max-width: 320px) {
    .envelope {
        width: 260px;
        height: 175px;
    }

    .envelope-front img {
        right: 80px;
        height: 55px;
        top: 40px;
    }

    .parallax-hero h1 {
        font-size: 1.3rem;
    }

    .hero-date {
        font-size: 0.8rem;
    }

    .luxury-card {
        padding: 18px;
    }

    .btn-gold {
        padding: 10px 20px;
        font-size: 0.8rem;
    }
}

/* Handle mobile devices that don't support fixed background */
@supports not (background-attachment: fixed) {
    .parallax-hero {
        background-attachment: scroll;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .envelope {
        transition: none;
    }

    .flap {
        transition: none;
    }

    .letter {
        transition: none;
    }

    .form-password {
        animation: none;
        opacity: 0.85;
    }

    .envelope-front img {
        animation: none;
    }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    #intro-container {
        height: auto;
        min-height: 100vh;
        padding: 20px;
    }

    .envelope {
        width: 350px;
        height: 240px;
    }

    .parallax-hero {
        height: auto;
        min-height: 100vh;
        padding: 40px 20px;
    }

    .parallax-hero h1 {
        font-size: 2rem;
    }
}