/* ============================================================
   GLOBAL & TOKENS
============================================================ */
:root {
    --color-bg:          #FFF8F8;
    --color-hero-from:   #FFE4EC;
    --color-hero-to:     #F9C8D9;
    --color-primary:     #C9607A;
    --color-primary-dk:  #A8455F;
    --color-rose:        #E8A0B4;
    --color-gold:        #C9A96E;
    --color-text:        #3D2030;
    --color-text-muted:  #8B6475;
    --color-card-bg:     #FFFBFC;
    --color-card-border: #F2CDDA;
    --color-letter-bg:   #FFFDF5;
    --color-letter-line: #EDE0C8;

    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body:    'Lora', Georgia, serif;
    --font-script:  'Dancing Script', cursive;

    --radius-card:  1.25rem;
    --shadow-soft:  0 4px 24px rgba(180, 80, 100, 0.10);
    --shadow-hover: 0 8px 36px rgba(180, 80, 100, 0.20);
    --transition:   0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.75;
    overflow-x: hidden;
    margin-bottom: 0;
}

.container { max-width: 1100px; }

/* ============================================================
   SECTION COMMON
============================================================ */
.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    color: var(--color-primary);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 56px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-rose), var(--color-gold));
    border-radius: 999px;
    margin: 0.4rem auto 0;
}

.section-subtitle {
    font-style: italic;
    color: var(--color-text-muted);
    font-size: 1.05rem;
}

/* ============================================================
   ANIMATIONS
============================================================ */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-28px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}

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

@keyframes floatPetal {
    0%   { transform: translateY(-5vh) rotate(0deg);    opacity: 0; }
    10%  { opacity: 0.85; }
    90%  { opacity: 0.7; }
    100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

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

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes sealPop {
    0%   { transform: translateX(-50%) scale(0) rotate(-20deg); opacity: 0; }
    70%  { transform: translateX(-50%) scale(1.15) rotate(4deg); opacity: 1; }
    100% { transform: translateX(-50%) scale(1) rotate(0deg);    opacity: 1; }
}

.animate-fade-in-down { animation: fadeInDown 0.9s ease both; }
.animate-fade-in      { animation: fadeIn     1.1s ease 0.3s both; }
.animate-fade-in-up   { animation: fadeInUp   0.9s ease 0.55s both; }

/* ============================================================
   HERO SECTION
============================================================ */
.hero-section {
    position: relative;
    min-height: 100svh;
    background: linear-gradient(160deg, var(--color-hero-from) 0%, var(--color-hero-to) 60%, #F5D5E4 100%);
    overflow: hidden;
    padding: 2rem 1rem 5rem;
}

#petals-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.petal {
    position: absolute;
    top: -30px;
    font-size: 1.4rem;
    opacity: 0;
    animation: floatPetal linear infinite;
    user-select: none;
}

.hero-content {
    max-width: 720px;
    padding: 0 1rem;
}

.hero-pre-title {
    font-family: var(--font-script);
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: var(--color-primary);
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 9vw, 6rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-primary-dk);
    text-shadow: 0 2px 16px rgba(169, 80, 105, 0.15);
    margin-bottom: 1rem;
}

.hero-name {
    font-style: italic;
    color: var(--color-primary);
    background: linear-gradient(90deg, var(--color-primary-dk), var(--color-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--color-text-muted);
    max-width: 500px;
    margin: 0 auto 1.5rem;
}

.btn-hero {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dk));
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.75rem 2rem;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    box-shadow: 0 4px 18px rgba(180, 80, 110, 0.3);
    transition: transform var(--transition), box-shadow var(--transition);
}

.btn-hero:hover,
.btn-hero:focus-visible {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 8px 28px rgba(180, 80, 110, 0.40);
    color: #fff;
}

.scroll-down-arrow {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.8rem;
    color: var(--color-primary);
    opacity: 0.7;
    animation: scrollBounce 1.8s ease-in-out infinite;
    text-decoration: none;
    transition: opacity var(--transition);
}

.scroll-down-arrow:hover { opacity: 1; color: var(--color-primary-dk); }

/* ============================================================
   COUNTERS SECTION
============================================================ */
.counters-section {
    background: #fff;
}

.counter-card {
    background: var(--color-card-bg);
    border: 1.5px solid var(--color-card-border);
    border-radius: var(--radius-card);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: box-shadow var(--transition), transform var(--transition);
}

.counter-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.counter-card--rose {
    background: linear-gradient(145deg, #FFF5F8, #FFF0F4);
    border-color: #F0B8CC;
}

.counter-card-icon {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.counter-card-title {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--color-primary-dk);
    margin-bottom: 0.25rem;
}

.counter-card-date {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin-bottom: 1.5rem;
}

.counter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

.counter-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(210, 120, 150, 0.08);
    border-radius: 0.75rem;
    padding: 0.6rem 0.5rem;
    min-width: 0;
}

.counter-unit--highlight {
    background: linear-gradient(135deg, rgba(201, 96, 122, 0.15), rgba(201, 169, 110, 0.12));
    border: 1px solid var(--color-card-border);
}

.counter-value {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    min-width: 2ch;
    display: inline-block;
    text-align: center;
}

.counter-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-top: 0.2rem;
}

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

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #F9D5E0 0%, #ECC8D8 100%);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(168, 69, 95, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
    font-size: 2rem;
    color: #fff;
    border-radius: var(--radius-card);
}

.gallery-item:hover .gallery-overlay { opacity: 1; }

#lightboxModal .modal-content { background: transparent !important; }

/* ============================================================
   MUSIC PLAYER SECTION
============================================================ */
.music-section {
    background: linear-gradient(160deg, #FFF0F5 0%, #FBE8EF 100%);
}

.music-player-card {
    background: var(--color-card-bg);
    border: 1.5px solid var(--color-card-border);
    border-radius: var(--radius-card);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.music-art-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1.25rem;
}

.music-art {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-rose), var(--color-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    color: #fff;
    position: relative;
    z-index: 1;
    transition: transform 0.3s;
}

.music-art.is-playing {
    animation: spin 8s linear infinite;
}

.music-art-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px dashed var(--color-rose);
    opacity: 0;
    transition: opacity var(--transition);
}

.music-art-ring.is-visible {
    opacity: 0.7;
    animation: spin 12s linear infinite reverse;
}

.music-track-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: 0.1rem;
}

.music-track-name {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--color-primary-dk);
    margin-bottom: 1.25rem;
}

.music-controls { margin-bottom: 1.25rem; }

.btn-music-play {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dk));
    border: none;
    color: #fff;
    font-size: 1.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(180, 80, 110, 0.35);
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
}

.btn-music-play:hover,
.btn-music-play:focus-visible {
    transform: scale(1.1);
    box-shadow: 0 8px 28px rgba(180, 80, 110, 0.45);
    outline: none;
}

.music-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.music-time {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    min-width: 34px;
    text-align: center;
}

.music-progress,
.music-volume {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 5px;
    border-radius: 999px;
    background: var(--color-card-border);
    outline: none;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.music-volume-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    justify-content: center;
}

.music-volume { flex: 0 0 120px; }
.music-volume-icon { color: var(--color-text-muted); font-size: 1rem; }

/* ============================================================
   LOVE LETTER SECTION
============================================================ */
.letter-section { background: var(--color-bg); }

.letter-card {
    position: relative;
    background: var(--color-letter-bg);
    border: 1px solid #E8D5A0;
    border-radius: 0.5rem;
    padding: 4rem 3.5rem 3rem;
    box-shadow: 0 6px 40px rgba(150, 100, 50, 0.12), 0 0 0 6px rgba(212, 180, 120, 0.08);
    overflow: hidden;
}

/* Faint ruled lines */
.letter-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 39px,
        var(--color-letter-line) 39px,
        var(--color-letter-line) 40px
    );
    background-position: 0 80px;
    pointer-events: none;
    opacity: 0.55;
}

.letter-seal {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dk));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    box-shadow: 0 4px 14px rgba(168, 69, 95, 0.4);
    animation: sealPop 0.7s ease 0.3s both;
    z-index: 2;
}

.letter-body { position: relative; z-index: 1; }

.letter-salutation {
    font-family: var(--font-script);
    font-size: 1.8rem;
    color: var(--color-primary-dk);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.letter-content {
    font-family: 'Caveat', cursive;
    font-size: 1.45rem;
    font-weight: 500;
    color: var(--color-text);
    line-height: 2.1;
    min-height: 180px;
}

.letter-closing {
    font-family: var(--font-script);
    font-size: 1.35rem;
    color: var(--color-primary-dk);
    margin-top: 0.75rem;
    margin-bottom: 0.1rem;
}

.letter-signature {
    font-family: var(--font-script);
    font-size: 2rem;
    color: var(--color-primary);
}

.letter-corner {
    position: absolute;
    font-size: 1.1rem;
    color: var(--color-gold);
    opacity: 0.7;
    line-height: 1;
}

.letter-corner--tl { top:    0.75rem; left:   0.75rem; }
.letter-corner--tr { top:    0.75rem; right:  0.75rem; }
.letter-corner--bl { bottom: 0.75rem; left:   0.75rem; }
.letter-corner--br { bottom: 0.75rem; right:  0.75rem; }

/* ============================================================
   FOOTER
============================================================ */
.site-footer {
    background: linear-gradient(135deg, #F9D5E2, #F0C4D4);
    color: var(--color-text-muted);
    font-family: var(--font-script);
    font-size: 1.15rem;
}

/* ============================================================
   RESPONSIVE TWEAKS
============================================================ */
@media (max-width: 576px) {
    .letter-card       { padding: 3.5rem 1.75rem 2.5rem; }
    .music-player-card { padding: 2rem 1.25rem; }
}

/* ============================================================
   CONFETTI CANVAS
============================================================ */
#confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ============================================================
   SHOOTING STARS & WISH MESSAGE
============================================================ */
#star-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

#wish-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-script);
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 220, 100, 0.9), 0 2px 8px rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

#wish-message.is-visible {
    opacity: 1;
}

/* Sparkle particles spawned by JS on hero click */
.sparkle-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    animation: sparkleExplode 0.8s ease-out forwards;
}

@keyframes sparkleExplode {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* ============================================================
   POLAROID MEMORY WALL
============================================================ */
.gallery-section {
    background: #F7EBF0;
}

.polaroid-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2.5rem 2rem;
    justify-items: center;
    padding: 1rem 0 2rem;
}

.polaroid {
    background: #fff;
    padding: 10px 10px 40px;
    box-shadow: 3px 4px 18px rgba(100, 50, 60, 0.18), 0 1px 3px rgba(0,0,0,0.08);
    transform: rotate(var(--rot, 0deg)) translate(var(--tx, 0), var(--ty, 0));
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
    cursor: pointer;
    max-width: 240px;
    width: 100%;
}

.polaroid:hover {
    transform: rotate(0deg) translate(0, -8px) scale(1.04);
    box-shadow: 6px 12px 32px rgba(100, 50, 60, 0.28);
    z-index: 2;
}

.polaroid-frame {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: linear-gradient(135deg, #F2C8D5, #E0B0C0);
}

.polaroid-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.polaroid:hover .polaroid-frame img {
    transform: scale(1.06);
}

.polaroid-caption {
    font-family: var(--font-script);
    font-size: 0.95rem;
    color: var(--color-text-muted);
    text-align: center;
    margin: 8px 0 0;
    line-height: 1.3;
}

/* ============================================================
   OUR STORY TIMELINE
============================================================ */
.timeline-section {
    background: #fff;
}

.timeline {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
    padding: 1rem 0;
}

/* Vertical line */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--color-rose), var(--color-gold));
    transform: translateX(-50%);
    border-radius: 999px;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 3rem;
    position: relative;
}

/* Alternate: even items flip to the right */
.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-dot {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dk));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 14px rgba(168, 69, 95, 0.35);
    position: relative;
    z-index: 1;
    /* Align dot to the centre line */
    margin-left: calc(50% - 24px);
    margin-right: 0;
    flex-basis: 48px;
}

.timeline-item:nth-child(even) .timeline-dot {
    margin-left: 0;
    margin-right: calc(50% - 24px);
}

.timeline-card {
    background: var(--color-card-bg);
    border: 1.5px solid var(--color-card-border);
    border-radius: var(--radius-card);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-soft);
    flex: 1;
    max-width: calc(50% - 48px);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow var(--transition);
}

.timeline-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-card:hover {
    box-shadow: var(--shadow-hover);
}

.timeline-date {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-gold);
    font-family: var(--font-body);
    display: block;
    margin-bottom: 0.3rem;
}

.timeline-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--color-primary-dk);
    margin-bottom: 0.4rem;
}

.timeline-desc {
    font-size: 0.92rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin: 0;
}

/* Mobile: stack timeline vertically */
@media (max-width: 600px) {
    .timeline::before { left: 24px; }

    .timeline-item,
    .timeline-item:nth-child(even) {
        flex-direction: row;
        gap: 1rem;
    }

    .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        margin: 0;
    }

    .timeline-card {
        max-width: 100%;
    }
}

/* ============================================================
   TYPEWRITER LETTER
============================================================ */
.letter-content .tw-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--color-primary);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorBlink 0.9s step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}