/* ============================================
   PREMIUM BIRTHDAY WEBSITE — STYLE SHEET v3.0
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=Poppins:wght@300;400;600&display=swap');

/* ─── Reset & Root ─────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --rose:        hsl(344, 90%, 62%);
    --rose-dark:   hsl(344, 75%, 45%);
    --rose-light:  hsl(344, 100%, 95%);
    --rose-glow:   hsl(344, 90%, 62%, 0.35);
    --gold:        hsl(42,  90%, 57%);
    --gold-light:  hsl(42,  100%, 90%);
    --cream:       hsl(30,  40%, 97%);
    --ink:         hsl(330, 25%, 18%);
    --ink-soft:    hsl(330, 15%, 40%);
    --white:       #ffffff;

    --font-serif:  'Cormorant Garamond', Georgia, serif;
    --font-script: 'Great Vibes', cursive;
    --font-ui:     'Poppins', sans-serif;

    --shadow-soft: 0 8px 32px hsla(344, 60%, 40%, 0.12);
    --shadow-card: 0 24px 64px hsla(344, 60%, 30%, 0.18);
}

/* ─── Base ─────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-ui);
    background: 
        linear-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.7) 1px, transparent 1px),
        radial-gradient(ellipse at 20% 50%, hsl(330, 100%, 96%) 0%, hsl(280, 50%, 95%) 50%, hsl(344, 80%, 95%) 100%);
    background-size: 40px 40px, 40px 40px, 100% 100%;
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--ink);
}

/* ─── Canvas (Floating Hearts) ─────────────── */
#heartCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ─── Sparkles ─────────────────────────────── */
.sparkle-container {
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 9999;
}
.sparkle {
    position: absolute;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--gold);
    transform: translate(-50%, -50%);
    animation: sparkleAnim 0.7s forwards ease-out;
    box-shadow: 0 0 6px var(--gold);
}
@keyframes sparkleAnim {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0); }
}

/* ─── Wrapper ──────────────────────────────── */
#wrapper {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ─── Stars Background ─────────────────────── */
.stars-bg { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.star {
    position: absolute;
    background: var(--gold);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: twinkle 3s infinite ease-in-out;
    opacity: 0.6;
}
.s1  { width:22px; height:22px; top:8%;  left:6%;  animation-delay:0s; }
.s2  { width:14px; height:14px; top:18%; right:8%; animation-delay:0.5s; }
.s3  { width:18px; height:18px; bottom:22%; left:4%; animation-delay:1s; }
.s4  { width:12px; height:12px; top:55%; right:4%; animation-delay:1.5s; }
.s5  { width:20px; height:20px; bottom:10%; right:12%; animation-delay:2s; }
.s6  { width:10px; height:10px; top:40%; left:3%; animation-delay:2.5s; }
@keyframes twinkle {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50%       { transform: scale(1.4); opacity: 1; }
}

/* ─── Hero Section ─────────────────────────── */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5vw;
    padding: 4rem 2rem;
    max-width: 1300px;
    width: 100%;
    z-index: 3;
    animation: heroFadeIn 1.2s ease both;
}
@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Left Side ────────────────────────────── */
.hero__left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.6rem;
    flex: 1;
    min-width: 0;
}

.greeting-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--rose-light), var(--gold-light));
    border: 1px solid rgba(255, 107, 107, 0.2);
    padding: 0.45rem 1.2rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--rose-dark);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 2px 12px var(--rose-glow);
    animation: slideDown 0.8s 0.3s both ease;
}
.badge-icon { font-size: 0.7rem; animation: rotateStar 4s linear infinite; }
@keyframes rotateStar { to { transform: rotate(360deg); } }
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-15px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes textGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(255,117,140,0.5); }
    50% { text-shadow: 0 0 30px rgba(255,117,140,0.8), 0 0 10px rgba(255,255,255,0.8); }
}

/* ─── Main Title ───────────────────────────── */
.main-title {
    font-family: var(--font-script);
    font-size: clamp(4rem, 8vw, 8rem);
    line-height: 0.95;
    color: var(--rose);
    text-shadow: 0 2px 20px var(--rose-glow), 0 0 60px hsla(344, 90%, 62%, 0.1);
    display: flex;
    flex-direction: column;
    letter-spacing: 0.02em;
    animation: textGlow 3s ease-in-out infinite alternate;
}
.line-happy, .line-birthday {
    display: inline-flex;
    gap: 0.02em;
}
.line-happy span, .line-birthday span {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px) scale(0.8);
    animation: letterPop 0.5s forwards cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes letterPop {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Name Plate ───────────────────────────── */
.name-plate {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--white), var(--rose-light));
    padding: 0.7rem 2rem;
    border-radius: 100px;
    box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,0.9);
    border: 1px solid rgba(255, 107, 107, 0.15);
    animation: slideUp 0.8s 2.2s both ease;
}
.nameplate-text {
    font-family: var(--font-script);
    font-size: 2.4rem;
    color: var(--rose-dark);
    line-height: 1;
}
.pulse-heart {
    color: var(--rose);
    font-size: 1.1rem;
    animation: heartbeat 1.2s infinite ease-in-out;
    filter: drop-shadow(0 0 4px var(--rose));
}
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    30%       { transform: scale(1.35); }
    60%       { transform: scale(1.1); }
}

/* ─── Subtitle ─────────────────────────────── */
.subtitle {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.7;
    color: var(--ink-soft);
    font-style: italic;
    opacity: 0;
    animation: slideUp 0.8s 2.6s both ease;
}
.subtitle em { color: var(--rose); font-style: normal; font-weight: 600; }

/* ─── CTA Button ───────────────────────────── */
.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--rose), var(--rose-dark));
    color: var(--white);
    border: none;
    padding: 1rem 2.4rem;
    border-radius: 100px;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: var(--font-ui);
    cursor: pointer;
    box-shadow: 0 8px 24px var(--rose-glow), 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: slideUp 0.8s 3s both ease;
    letter-spacing: 0.03em;
}
.cta-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, hsla(0,0%,100%,0.2), transparent);
    border-radius: inherit;
}
.cta-btn:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 16px 40px var(--rose-glow), 0 4px 12px rgba(0,0,0,0.15);
}
.cta-btn:active { transform: scale(0.97); }
.cta-btn i { font-size: 1.2rem; animation: envelopeWiggle 2s 3.5s infinite ease-in-out; }
@keyframes envelopeWiggle {
    0%, 100% { transform: rotate(0); }
    25%       { transform: rotate(-12deg); }
    75%       { transform: rotate(12deg); }
}

/* ─── Date Chip ────────────────────────────── */
.date-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gold);
    background: var(--gold-light);
    padding: 0.4rem 1.2rem;
    border-radius: 100px;
    border: 1px solid hsla(42, 80%, 60%, 0.3);
    opacity: 0;
    animation: slideUp 0.8s 3.4s both ease;
    letter-spacing: 0.06em;
}
.date-chip i { font-size: 1rem; }

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

/* ─── Right Side: Photo ────────────────────── */
.hero__right {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
    perspective: 1000px;
    animation: photoReveal 1.2s 0.5s both ease;
}
@keyframes photoReveal {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

.photo-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    transition: transform 0.1s ease-out;
    transform-style: preserve-3d;
}

.glow-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: glowPulse 3s infinite ease-in-out;
}
.ring1 {
    background: conic-gradient(from 0deg, var(--rose), var(--gold), var(--rose));
    padding: 4px;
    animation-delay: 0s;
}
.ring2 {
    inset: -8px;
    border: 2px solid transparent;
    background: conic-gradient(from 180deg, var(--rose-light), transparent, var(--rose-light)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation-delay: 1.5s;
}
@keyframes glowPulse {
    0%, 100% { transform: rotate(0deg) scale(1); opacity: 0.7; }
    50%       { transform: rotate(180deg) scale(1.03); opacity: 1; }
}

.photo-frame {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--cream);
    border: 5px solid var(--white);
    box-shadow: var(--shadow-card);
    z-index: 2;
}
.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.photo-frame:hover .profile-photo { transform: scale(1.04); }

/* Balloons */
.balloon {
    position: absolute;
    width: clamp(60px, 8vw, 90px);
    z-index: 4;
}
.balloon img { width: 100%; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15)); }
.balloon-left  { top: -10%; left: -10%; animation: sway 4s infinite ease-in-out; }
.balloon-right { bottom: 0; right: -10%; animation: sway 5s infinite ease-in-out reverse; }
@keyframes sway {
    0%, 100% { transform: rotate(0deg); }
    25%       { transform: rotate(5deg); }
    75%       { transform: rotate(-5deg); }
}

/* Hat */
.hat-wrapper {
    position: absolute;
    top: -18%;
    right: 5%;
    width: clamp(50px, 8vw, 80px);
    z-index: 5;
    transform: rotate(20deg);
    animation: hatBounce 3s infinite ease-in-out;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}
.hat-wrapper img { width: 100%; }
@keyframes hatBounce {
    0%, 100% { transform: rotate(20deg) translateY(0); }
    50%       { transform: rotate(25deg) translateY(-8px); }
}

/* Flowers */
.photo-flowers { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.pf {
    position: absolute;
    width: 30px;
    animation: floatPetal 5s infinite ease-in-out;
    opacity: 0.85;
}
.pf1 { top: 10%; left: -5%;  animation-delay: 0s; }
.pf2 { bottom: 15%; left: -8%; animation-delay: 1.5s; }
.pf3 { top: 20%; right: -5%; animation-delay: 3s; }
@keyframes floatPetal {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%       { transform: translateY(-12px) rotate(20deg); }
}

/* ─── Modal Backdrop ───────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(20, 0, 10, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.modal-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

/* ─── Modal Card ───────────────────────────── */
.modal-card {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(145deg, var(--white) 0%, hsl(330, 60%, 98%) 100%);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.9);
    border: 1px solid rgba(255, 107, 107, 0.15);
    transform: scale(0.85) translateY(30px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    scroll-behavior: smooth;
}
.modal-card.active { transform: scale(1) translateY(0); }

/* Scrollbar styling */
.modal-card::-webkit-scrollbar { width: 4px; }
.modal-card::-webkit-scrollbar-track { background: transparent; }
.modal-card::-webkit-scrollbar-thumb { background: var(--rose-light); border-radius: 4px; }

/* ─── Close Button ─────────────────────────── */
.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    width: 42px; height: 42px;
    background: var(--rose-light);
    border: 1.5px solid rgba(255, 107, 107, 0.25);
    border-radius: 50%;
    color: var(--rose-dark);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}
.modal-close:hover {
    background: var(--rose);
    color: var(--white);
    transform: scale(1.1) rotate(90deg);
}

/* ─── Modal Inner Layout ───────────────────── */
.modal-inner {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

/* ─── Modal Left ───────────────────────────── */
.modal-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-width: 180px;
    text-align: center;
    border-right: 2px dashed hsla(344, 80%, 80%, 0.4);
    padding-right: 2rem;
}
.modal-avatar {
    width: 110px; height: 110px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--white);
    box-shadow: 0 0 0 4px var(--rose), 0 8px 24px var(--rose-glow);
}
.modal-avatar img { width: 100%; height: 100%; object-fit: cover; }
.modal-to {
    font-family: var(--font-script);
    font-size: 1.9rem;
    color: var(--rose-dark);
    line-height: 1;
}
.modal-gif img { width: 100px; border-radius: 12px; }
.modal-love-img img { width: 90px; }

/* ─── Modal Right ──────────────────────────── */
.modal-right {
    flex: 1;
    min-width: 0;
}
.modal-letter-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.letter-ornament {
    color: var(--gold);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    white-space: nowrap;
}
.letter-title {
    font-family: var(--font-script);
    font-size: 2.2rem;
    color: var(--rose-dark);
    white-space: nowrap;
}

.letter-body {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    background: linear-gradient(135deg, hsl(42, 100%, 98%), hsl(330, 60%, 98%));
    border-radius: 16px;
    padding: 1.75rem;
    border: 1px solid hsla(42, 80%, 80%, 0.3);
    position: relative;
}
.letter-body::before {
    content: '"';
    position: absolute;
    top: -0.5rem; left: 1rem;
    font-family: Georgia, serif;
    font-size: 5rem;
    color: var(--rose);
    opacity: 0.15;
    line-height: 1;
}
.letter-body p {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    line-height: 1.85;
    color: var(--ink-soft);
}
.letter-body p strong { color: var(--rose-dark); font-weight: 600; }
.letter-signature {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    font-family: var(--font-serif);
    color: var(--ink-soft);
    font-size: 1rem;
    font-style: italic;
    opacity: 0;
}
.sig-name {
    font-family: var(--font-script);
    font-size: 1.9rem;
    color: var(--rose);
    font-style: normal;
}

/* ─── Responsive ───────────────────────────── */
@media (max-width: 900px) {
    .hero {
        flex-direction: column-reverse;
        padding: 5rem 1.5rem 3rem;
        gap: 3rem;
        text-align: center;
    }
    .hero__left { align-items: center; }
    .greeting-badge { align-self: center; }
    .main-title { font-size: clamp(3.5rem, 12vw, 5rem); }
    .photo-wrapper {
        width: clamp(220px, 55vw, 300px);
        height: clamp(220px, 55vw, 300px);
    }
    .modal-inner { flex-direction: column; align-items: center; gap: 1.5rem; }
    .modal-left {
        border-right: none;
        border-bottom: 2px dashed hsla(344, 80%, 80%, 0.4);
        padding-right: 0;
        padding-bottom: 1.5rem;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    .modal-avatar { width: 80px; height: 80px; }
    .modal-to { font-size: 1.5rem; }
    .letter-title { font-size: 1.8rem; }
    .modal-letter-header { flex-direction: column; gap: 0.25rem; }
    .modal-card { padding: 1.5rem; border-radius: 20px; }
}

@media (max-width: 480px) {
    .hero { padding: 4rem 1rem 2.5rem; }
    .main-title { font-size: clamp(3rem, 15vw, 4.5rem); }
    .cta-btn { font-size: 0.95rem; padding: 0.9rem 2rem; }
    .modal-card { padding: 1.25rem; }
    .letter-body { padding: 1.25rem; }
    .letter-ornament { display: none; }
}