/* ============================================================
   Koena'S 50TH BIRTHDAY CELEBRATION
   SHARED PRODUCTION STYLESHEET — v2 (fixed)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,500&family=DM+Sans:wght@300;400;500;600;700&family=Italiana&display=swap');

:root {
    --ivory: #fffaf5;
    --cream: #f7eee7;
    --blush: #ead3d0;
    --rose: #b98786;
    --rose-dark: #8c5f60;
    --plum: #392333;
    --plum-deep: #241622;
    --gold: #c8a46a;
    --gold-light: #e5cf9e;
    --gold-foil: #d9b876;
    --white: #ffffff;
    --black: #161316;

    --serif: "Cormorant Garamond", Georgia, serif;
    --display: "Italiana", Georgia, serif;
    --sans: "DM Sans", Arial, sans-serif;

    --container: 1240px;
    --radius: 26px;
    --radius-small: 14px;

    --shadow-soft: 0 20px 70px rgba(57, 35, 51, 0.10);
    --shadow-card: 0 15px 50px rgba(57, 35, 51, 0.12);
    --shadow-gold: 0 15px 40px rgba(200, 164, 106, 0.28);

    --transition: 0.35s cubic-bezier(.22,1,.36,1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    overflow-x: hidden;
    width: 100%;
}

body {
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    background: var(--ivory);
    color: var(--plum);
    font-family: var(--sans);
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    overflow-wrap: break-word;
}

body.menu-open { overflow: hidden; }

img { max-width: 100%; display: block; }

button, input, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

::selection { background: var(--gold-light); color: var(--plum-deep); }

/* PRELOADER */

.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 40%, rgba(229,207,158,.18), transparent 35%),
        var(--plum-deep);
    transition: opacity .7s ease, visibility .7s ease;
}

.preloader.hidden { opacity: 0; visibility: hidden; }

.loader-content { text-align: center; color: var(--ivory); }

.loader-number {
    font-family: var(--display);
    font-size: clamp(5rem, 14vw, 10rem);
    line-height: .8;
    color: var(--gold-light);
    animation: candleFlicker 2.6s ease-in-out infinite;
}

.loader-text {
    margin-top: 28px;
    font-size: 10px;
    letter-spacing: .45em;
    text-transform: uppercase;
    opacity: .7;
}

.loader-line {
    width: 150px;
    height: 1px;
    background: rgba(255,255,255,.2);
    margin: 30px auto 0;
    overflow: hidden;
}

.loader-line span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--gold-light);
    animation: loaderProgress 3s ease forwards;
}

@keyframes loaderProgress { to { width: 100%; } }

/* SCROLL PROGRESS */

.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    z-index: 10000;
    background: linear-gradient(90deg, var(--gold), var(--rose));
}

/* HEADER */

.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 20px 0;
    transition: var(--transition);
}

.site-header.scrolled {
    padding: 11px 0;
    background: rgba(255,250,245,.90);
    backdrop-filter: blur(18px);
    box-shadow: 0 8px 35px rgba(57,35,51,.08);
}

.nav-container {
    width: min(calc(100% - 40px), var(--container));
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex-shrink: 1; overflow: hidden; }

.brand-mark {
    width: 45px; height: 45px;
    flex-shrink: 0;
    border: 1px solid var(--gold);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: var(--display);
    font-size: 21px;
    color: var(--gold);
}

.brand-copy {
    min-width: 0;
}

.brand-copy strong {
    display: block;
    font-family: var(--serif);
    font-size: 19px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-copy span {
    display: block;
    font-size: 8px;
    letter-spacing: .28em;
    text-transform: uppercase;
    opacity: .6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-links { display: flex; align-items: center; gap: 30px; }

.nav-links a {
    position: relative;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 10px 0;
}

.nav-links a::after {
    content: "";
    position: absolute;
    bottom: 3px; left: 0;
    width: 0; height: 1px;
    background: var(--gold);
    transition: width var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-cta {
    padding: 13px 20px !important;
    background: var(--plum);
    color: var(--white);
    border-radius: 999px;
    transition: var(--transition);
}

.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--plum-deep); box-shadow: var(--shadow-gold); transform: translateY(-2px); }

.menu-toggle {
    display: none;
    flex-shrink: 0;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--plum);
    color: white;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span { width: 18px; height: 1px; background: white; transition: var(--transition); }

/* MOBILE NAV */

.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: var(--plum-deep);
    color: var(--ivory);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: .5s ease;
}

.mobile-nav.open { opacity: 1; visibility: visible; }
.mobile-nav ul { text-align: center; }
.mobile-nav li { margin: 18px 0; overflow: hidden; }

.mobile-nav a {
    display: block;
    font-family: var(--serif);
    font-size: clamp(2.5rem, 9vw, 4.5rem);
    transform: translateY(100%);
    transition: transform .7s cubic-bezier(.22,1,.36,1);
}

.mobile-nav.open a { transform: translateY(0); }

.mobile-nav small {
    position: absolute;
    bottom: 35px;
    font-size: 9px;
    letter-spacing: .3em;
    text-transform: uppercase;
    opacity: .45;
}

/* GENERAL */

.container { width: min(calc(100% - 40px), var(--container)); margin: auto; }
.section { padding: 120px 0; position: relative; }

.section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--rose-dark);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3em;
    text-transform: uppercase;
}

.section-label::before { content: ""; width: 35px; height: 1px; background: var(--gold); }

.section-title {
    max-width: 780px;
    margin-top: 16px;
    font-family: var(--serif);
    font-size: clamp(3rem, 6vw, 6.5rem);
    line-height: .9;
    font-weight: 500;
    letter-spacing: -.025em;
}

.section-intro {
    max-width: 590px;
    margin-top: 24px;
    color: #725f69;
    font-size: 15px;
    line-height: 1.9;
}

/* HERO */

.hero {
    min-height: 100svh;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 75% 20%, rgba(200,164,106,.16), transparent 25%),
        linear-gradient(120deg, #fffaf5 0%, #f4e8e3 55%, #ead8d5 100%);
}

.hero::before {
    content: "";
    position: absolute;
    width: 700px; height: 700px;
    right: -250px; bottom: -300px;
    border-radius: 50%;
    border: 1px solid rgba(200,164,106,.3);
    transform: translateY(calc(var(--scrollY, 0) * 0.06px));
}

.hero::after {
    content: "";
    position: absolute;
    width: 480px; height: 480px;
    right: -140px; bottom: -190px;
    border-radius: 50%;
    border: 1px solid rgba(200,164,106,.18);
    transform: translateY(calc(var(--scrollY, 0) * 0.1px));
}

/* confetti burst — the ONE orchestrated load moment */
.confetti-field {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: -40px;
    opacity: 0;
    border-radius: 1px;
    animation-name: confettiFall;
    animation-timing-function: cubic-bezier(.35,.6,.4,1);
    animation-fill-mode: forwards;
}

@keyframes confettiFall {
    0%   { opacity: 0; transform: translate3d(0,-10px,0) rotate(0deg); }
    8%   { opacity: 1; }
    85%  { opacity: 1; }
    100% { opacity: 0; transform: translate3d(var(--drift,0px), 78vh, 0) rotate(340deg); }
}

.hero-content { position: relative; z-index: 5; padding-top: 90px; }

.hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 10px;
    letter-spacing: .38em;
    text-transform: uppercase;
    color: var(--rose-dark);
}

.hero-eyebrow span { width: 45px; height: 1px; background: var(--gold); }

.hero h1 {
    max-width: 850px;
    margin-top: 25px;
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(4.2rem, 10vw, 9.5rem);
    line-height: .82;
    letter-spacing: -.03em;
    color: var(--plum);
}

.hero h1 em {
    display: block;
    margin-left: 4%;
    font-family: var(--serif);
    font-style: italic;
    font-size: .32em;
    line-height: 1.4;
    letter-spacing: -.01em;
    color: var(--rose-dark);
}

.hero-date {
    margin-top: 35px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-date strong { font-family: var(--serif); font-size: 26px; font-weight: 600; }
.hero-date span { width: 1px; height: 30px; background: rgba(57,35,51,.2); }
.hero-date small { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: #7c6871; }

.hero-actions { display: flex; gap: 12px; margin-top: 35px; flex-wrap: wrap; }

.btn {
    min-height: 52px;
    padding: 0 25px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    transition: var(--transition);
}

.btn-primary { background: var(--plum); color: white; box-shadow: 0 15px 30px rgba(57,35,51,.18); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 20px 40px rgba(57,35,51,.25); }

.btn-outline { border: 1px solid rgba(57,35,51,.25); color: var(--plum); background: rgba(255,255,255,.3); }
.btn-outline:hover { border-color: var(--gold); background: white; transform: translateY(-3px); }

.hero-photo {
    position: absolute;
    right: 6%; top: 15%;
    width: min(40vw, 530px);
    height: 62vh;
    min-height: 440px;
    max-height: 560px;
    border-radius: 260px 260px 20px 20px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transform: rotate(2deg);
}

.hero-photo::before {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    padding: 3px;
    background: conic-gradient(from 0deg, var(--gold-light), var(--rose), var(--gold), var(--gold-light));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: .9;
    animation: ringRotate 12s linear infinite;
    z-index: 2;
}

@keyframes ringRotate { to { transform: rotate(360deg); } }

.hero-photo { background: linear-gradient(160deg, var(--blush), var(--cream)); }

.hero-photo img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.hero-photo-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(36,22,34,.3)); }

.hero-number {
    position: absolute;
    right: 30%; bottom: 5%;
    z-index: 4;
    font-family: var(--display);
    font-size: clamp(10rem, 23vw, 22rem);
    line-height: .7;
    color: rgba(200,164,106,.13);
    pointer-events: none;
    animation: candleFlicker 3.4s ease-in-out infinite;
}

@keyframes candleFlicker {
    0%, 100% { opacity: 1; filter: drop-shadow(0 0 0 transparent); }
    45% { opacity: .82; }
    50% { opacity: 1; filter: drop-shadow(0 0 18px rgba(200,164,106,.35)); }
    62% { opacity: .88; }
}

.hero-side-note {
    position: absolute;
    right: 2%; top: 50%;
    transform: rotate(90deg) translateX(50%);
    transform-origin: right center;
    font-size: 9px;
    letter-spacing: .4em;
    text-transform: uppercase;
    opacity: .45;
}

/* FLOATING DECORATION */

.floating-dot {
    position: absolute;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--gold);
    pointer-events: none;
    animation: float 5s ease-in-out infinite;
}

.dot-one   { top: 22%; left: 8%; }
.dot-two   { top: 70%; left: 45%; animation-delay: 1s; }
.dot-three { top: 35%; right: 48%; animation-delay: 2s; }
.dot-four  { top: 12%; right: 18%; width: 5px; height: 5px; background: var(--rose); animation-delay: .6s; animation-duration: 6s; }
.dot-five  { top: 55%; left: 20%; width: 9px; height: 9px; background: var(--gold-light); animation-delay: 1.6s; animation-duration: 4.5s; }
.dot-six   { top: 82%; right: 30%; width: 6px; height: 6px; background: var(--gold); animation-delay: 2.4s; animation-duration: 5.5s; }
.dot-seven { top: 45%; left: 65%; width: 5px; height: 5px; background: var(--rose); animation-delay: .3s; animation-duration: 6.5s; }
.dot-eight { top: 10%; left: 35%; width: 8px; height: 8px; background: var(--gold-light); animation-delay: 1.2s; animation-duration: 4.8s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* STORY */

.story-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 90px; align-items: center; }
.story-image { position: relative; }
.story-image-main { height: 650px; border-radius: 18px; overflow: hidden; }
.story-image-main img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.22,1,.36,1); }
.story-image:hover .story-image-main img { transform: scale(1.04); }

.story-image-frame {
    position: absolute;
    width: 180px; height: 230px;
    right: -40px; bottom: -50px;
    padding: 9px;
    background: white;
    box-shadow: var(--shadow-card);
    transform: rotate(5deg);
    transition: var(--transition);
}

.story-image:hover .story-image-frame { transform: rotate(0deg) translateY(-6px); }
.story-image-frame img { width: 100%; height: 100%; object-fit: cover; }

.story-copy { padding-right: 5%; }

.story-copy .quote {
    margin-top: 35px;
    padding-left: 25px;
    border-left: 2px solid var(--gold);
    font-family: var(--serif);
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    font-style: italic;
    line-height: 1.2;
}

/* STATS */

.stats-strip { background: var(--plum); color: white; padding: 55px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat { text-align: center; padding: 15px; border-right: 1px solid rgba(255,255,255,.12); }
.stat:last-child { border-right: 0; }

.stat-number {
    font-family: var(--display);
    font-size: clamp(3rem, 6vw, 5.5rem);
    color: var(--gold-light);
    line-height: .8;
}

.stat-label { margin-top: 14px; font-size: 9px; letter-spacing: .28em; text-transform: uppercase; opacity: .6; }

/* TIMELINE */

.timeline { position: relative; margin-top: 80px; }

.timeline::before {
    content: "";
    position: absolute;
    left: 50%; top: 0; bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--gold), var(--gold), transparent);
}

.timeline-item { width: 50%; padding: 0 60px 90px; position: relative; }
.timeline-item:nth-child(even) { margin-left: 50%; }

.timeline-item::after {
    content: "";
    position: absolute;
    top: 4px;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--gold);
    border: 3px solid var(--ivory);
    box-shadow: 0 0 0 1px var(--gold);
}

.timeline-item:nth-child(odd)::after { right: -6px; }
.timeline-item:nth-child(even)::after { left: -5px; }

.timeline-year { font-family: var(--display); font-size: 56px; color: var(--gold); }

.timeline-card {
    margin-top: 10px;
    padding: 28px;
    border: 1px solid rgba(57,35,51,.1);
    border-radius: var(--radius-small);
    background: rgba(255,255,255,.45);
    transition: var(--transition);
}

.timeline-card:hover { transform: translateY(-6px); background: white; box-shadow: var(--shadow-card); }
.timeline-card h3 { font-family: var(--serif); font-size: 27px; }
.timeline-card p { margin-top: 9px; color: #796a72; font-size: 13px; line-height: 1.8; }

/* BIO CARDS */

.bio-grid { margin-top: 55px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.bio-card {
    padding: 35px;
    border: 1px solid rgba(57,35,51,.1);
    border-radius: 20px;
    background: white;
    transition: var(--transition);
}

.bio-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-card); border-color: rgba(200,164,106,.4); }
.bio-card small { display: block; color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .25em; text-transform: uppercase; }
.bio-card h3 { margin-top: 15px; font-family: var(--serif); font-size: 27px; }
.bio-card p { margin-top: 9px; color: #786770; font-size: 12.5px; line-height: 1.8; }

@media (max-width: 800px) { .bio-grid { grid-template-columns: 1fr; } }

/* GALLERY (homepage teaser) */

.gallery-section { background: #f3e8e2; }
.gallery-grid {
    columns: 3 280px;
    column-gap: 1.5rem;
}

.gallery-item {
    position: relative;         /* FIX: required so the ::after caption anchors to this tile, not the page */
    overflow: hidden;           /* FIX: clips the hover zoom so it doesn't spill onto neighboring tiles */
    border-radius: 8px;
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

.gallery-item img {
    transition: transform .6s cubic-bezier(.22,1,.36,1); /* FIX: hover zoom now animates instead of snapping */
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}
.gallery-item::after {
    content: "VIEW MEMORY";
    position: absolute;
    inset: auto 15px 15px;
    padding: 12px;
    background: rgba(36,22,34,.75);
    backdrop-filter: blur(10px);
    color: white;
    text-align: center;
    font-size: 8px;
    letter-spacing: .25em;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
}

.gallery-item:hover img { transform: scale(1.08); }
.gallery-item:hover::after { opacity: 1; transform: translateY(0); }

.gallery-cta { margin-top: 45px; display: flex; justify-content: center; }

/* GALLERY PAGE (full, dedicated) */
.gallery-hero {
    position: relative;
    height: 100vh;
    overflow: hidden;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-video {
    height: 100%;
    width: auto;
    max-width: none;
}

/* Optional: blurred duplicate video filling the background */
.gallery-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('assets/gallery-hero-poster.jpg') center/cover;
    filter: blur(30px) brightness(0.6);
    z-index: 0;
}

.hero-video {
    position: relative;
    z-index: 1;
}

.gallery-filters {
    margin-top: 45px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 11px 22px;
    border-radius: 999px;
    border: 1px solid rgba(57,35,51,.18);
    background: rgba(255,255,255,.5);
    color: var(--plum);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    transition: var(--transition);
}

.filter-btn:hover { border-color: var(--gold); background: white; }

.filter-btn.active {
    background: var(--plum);
    border-color: var(--plum);
    color: white;
    box-shadow: var(--shadow-gold);
}

.masonry-gallery {
    padding: 70px 0 130px;
    column-count: 4;
    column-gap: 18px;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 18px;
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(24px) scale(.97);
    transition: opacity .6s ease, transform .6s cubic-bezier(.22,1,.36,1);
}

.masonry-item.visible { opacity: 1; transform: translateY(0) scale(1); }
.masonry-item.hidden-filter { display: none; }

.masonry-item img { width: 100%; display: block; transition: transform .8s cubic-bezier(.22,1,.36,1); }
.masonry-item:hover img { transform: scale(1.06); }

.masonry-caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 28px 18px 16px;
    background: linear-gradient(0deg, rgba(36,22,34,.82), transparent);
    color: white;
    opacity: 0;
    transform: translateY(8px);
    transition: var(--transition);
}

.masonry-item:hover .masonry-caption { opacity: 1; transform: translateY(0); }
.masonry-caption strong { display: block; font-family: var(--serif); font-size: 17px; }
.masonry-caption span { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; opacity: .7; }

@media (max-width: 1050px) { .masonry-gallery { column-count: 3; } }
@media (max-width: 700px) { .masonry-gallery { column-count: 2; column-gap: 12px; } .masonry-item { margin-bottom: 12px; } }
@media (max-width: 460px) { .masonry-gallery { column-count: 1; } }

/* LIGHTBOX */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(24,15,23,.94);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    opacity: 0;
    visibility: hidden;
    transition: .4s ease;
}

.lightbox.open { opacity: 1; visibility: visible; }

.lightbox-image {
    max-width: min(1100px, 90vw);
    max-height: 82vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 30px 100px rgba(0,0,0,.45);
    transform: scale(.95);
    transition: .5s cubic-bezier(.22,1,.36,1);
}

.lightbox.open .lightbox-image { transform: scale(1); }

.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute;
    width: 48px; height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.1);
    color: white;
    border: 1px solid rgba(255,255,255,.15);
    transition: var(--transition);
}

.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: var(--gold); color: var(--plum); }
.lightbox-close { top: 25px; right: 25px; font-size: 24px; }
.lightbox-prev { left: 25px; top: 50%; }
.lightbox-next { right: 25px; top: 50%; }
.lightbox-counter {
    position: absolute;
    bottom: 25px; left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.5);
    font-size: 10px;
    letter-spacing: .25em;
}

/* COUNTDOWN */

.countdown-section { background: var(--plum-deep); color: white; overflow: hidden; }
.countdown-section .section-label { color: var(--gold-light); }
.countdown-section .section-title { color: white; }

.countdown-wrap {
    margin-top: 60px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid rgba(255,255,255,.13);
    border-bottom: 1px solid rgba(255,255,255,.13);
}

.countdown-unit { padding: 45px 20px; text-align: center; border-right: 1px solid rgba(255,255,255,.13); }
.countdown-unit:last-child { border-right: 0; }

.countdown-value {
    font-family: var(--display);
    font-size: clamp(4rem, 8vw, 8rem);
    line-height: .75;
    color: var(--gold-light);
    font-variant-numeric: tabular-nums;
}

.countdown-label { margin-top: 25px; font-size: 9px; letter-spacing: .3em; text-transform: uppercase; opacity: .55; }

/* EVENT CARDS */

.event-grid { margin-top: 60px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.event-card {
    padding: 40px;
    border: 1px solid rgba(57,35,51,.1);
    border-radius: var(--radius);
    background: white;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.event-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-card); }

.event-day-tag {
    display: inline-flex;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--cream);
    color: var(--rose-dark);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.event-icon {
    width: 46px; height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid var(--gold);
    border-radius: 50%;
    color: var(--gold);
    margin-top: 22px;
}

.event-card h3 { margin-top: 22px; font-family: var(--serif); font-size: 30px; }
.event-card p { margin-top: 10px; color: #776870; line-height: 1.7; font-size: 13px; }
.event-facts { margin-top: 22px; display: flex; flex-direction: column; gap: 8px; }

.event-facts li { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12.5px; color: var(--plum); line-height: 1.6; }
.event-facts li strong { min-width: 68px; color: var(--rose-dark); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; padding-top: 3px; }

/* RSVP */

.rsvp-section { background: linear-gradient(135deg, #ead8d5, #f8eee9); }
.rsvp-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 70px; align-items: start; }
.rsvp-form { background: white; padding: 45px; border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 9px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #806c75; }

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    border: 1px solid #e5d9d3;
    background: #fffdfa;
    color: var(--plum);
    padding: 15px 16px;
    border-radius: 10px;
    outline: none;
    font-size: 16px;
    transition: var(--transition);
}

.form-group textarea { min-height: 120px; resize: vertical; }

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200,164,106,.12);
}

.form-message { margin-top: 15px; display: none; padding: 13px 15px; border-radius: 10px; font-size: 12px; }
.form-message.show { display: block; }
.form-message.success { background: #edf7ef; color: #32613a; }
.form-message.error { background: #fff0ef; color: #8d3832; }

.rsvp-contacts { margin-top: 25px; display: flex; gap: 12px; flex-wrap: wrap; }

.rsvp-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    border-radius: 999px;
    background: white;
    border: 1px solid rgba(57,35,51,.12);
    font-size: 12px;
    transition: var(--transition);
}

.rsvp-contact:hover { border-color: var(--gold); transform: translateY(-2px); }
.rsvp-contact strong { font-family: var(--serif); font-size: 15px; }

/* QUOTE / CLOSING */

.quote-section {
    position: relative;
    background-image: url('assets/17.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;

    padding: 8rem 0;
    color: #fff; /* adjust if your text needs to stay dark */
}

/* Dark overlay so the quote text stays readable over any photo */
.quote-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5); /* tweak opacity to taste */
}

.quote-section .container {
    position: relative;
    z-index: 1; /* lifts content above the overlay */
}
.big-quote {
    max-width: 900px;
    position: relative;
    z-index: 2;
    font-family: var(--serif);
    font-size: clamp(2.8rem, 6vw, 6.5rem);
    line-height: .95;
    font-weight: 400;
}

.big-quote em { color: var(--gold-light); }
.quote-credit { margin-top: 30px; font-size: 9px; letter-spacing: .3em; text-transform: uppercase; opacity: .5; }

/* MUSIC BUTTON */

.music-toggle {
    position: fixed;
    right: 25px; bottom: 25px;
    z-index: 900;
    height: 52px;
    padding: 0 22px 0 20px;
    border-radius: 999px;
    background: var(--plum);
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    box-shadow: 0 10px 30px rgba(57,35,51,.2);
    transition: var(--transition);
}

.music-toggle:hover { transform: translateY(-4px); background: var(--plum-deep); box-shadow: var(--shadow-gold); }

.music-toggle-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    white-space: nowrap;
}

.music-bars { display: flex; align-items: center; gap: 3px; height: 18px; flex-shrink: 0; }
.music-bars span { width: 2px; height: 6px; background: var(--gold-light); }
.music-toggle.playing .music-bars span { animation: soundbar .8s ease-in-out infinite alternate; }
.music-toggle.playing .music-bars span:nth-child(2) { animation-delay: .15s; }
.music-toggle.playing .music-bars span:nth-child(3) { animation-delay: .3s; }
@keyframes soundbar { to { height: 18px; } }

/* BACK TO TOP */

.back-top {
    position: fixed;
    left: 25px; bottom: 25px;
    z-index: 900;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: white;
    color: var(--plum);
    box-shadow: 0 10px 30px rgba(57,35,51,.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}

.back-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* FOOTER */

.site-footer { background: #1d121b; color: white; padding: 70px 0 35px; }

.footer-top {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 60px;
    padding-bottom: 60px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.footer-brand { font-family: var(--display); font-size: clamp(2.4rem, 6vw, 55px); color: var(--gold-light); }
.footer-description { max-width: 400px; margin-top: 18px; color: rgba(255,255,255,.5); font-size: 13px; line-height: 1.8; }
.footer-heading { margin-bottom: 18px; font-size: 9px; letter-spacing: .25em; text-transform: uppercase; color: var(--gold-light); }
.footer-links li { margin: 10px 0; }
.footer-links a { color: rgba(255,255,255,.6); font-size: 12px; transition: var(--transition); }
.footer-links a:hover { color: white; }

.footer-bottom {
    padding-top: 25px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: rgba(255,255,255,.35);
    font-size: 10px;
}

/* ============================================================
   3D SHOWPIECE ELEMENTS
   ============================================================ */

/* --- Hero medallion: a spinning 3D gold coin/wax-seal --- */

.hero-badge {
    position: absolute;
    left: 4%;
    bottom: 7%;
    z-index: 6;
    perspective: 900px;
    pointer-events: none;
}

.hero-badge-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 28%, #fbeecb, var(--gold) 55%, #a9824f 100%);
    box-shadow:
        0 25px 50px rgba(57,35,51,.35),
        inset 0 2px 4px rgba(255,255,255,.6),
        inset 0 -6px 10px rgba(90,60,20,.35);
    font-family: var(--display);
    font-size: 40px;
    line-height: .8;
    color: var(--plum-deep);
    transform-style: preserve-3d;
    animation: medallionSpin 9s cubic-bezier(.45,0,.55,1) infinite;
}

.hero-badge-inner::before {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 1px dashed rgba(57,35,51,.35);
}

.hero-badge-inner small {
    margin-top: 4px;
    font-family: var(--sans);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .2em;
}

@keyframes medallionSpin {
    0%, 8%   { transform: rotateY(0deg); }
    50%      { transform: rotateY(360deg); }
    58%,100% { transform: rotateY(360deg); }
}

@media (max-width: 800px) {
    .hero-badge-inner { width: 92px; height: 92px; font-size: 28px; }
}

/* --- Card tilt: mouse-reactive 3D depth, applied via JS to content cards --- */

.card-tilt {
    position: relative;
    will-change: transform;
    transform-style: preserve-3d;
}

.card-tilt::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.55), transparent 55%);
    opacity: 0;
    transition: opacity .4s ease;
    pointer-events: none;
}

.card-tilt.tilting::before { opacity: .5; }

/* --- Buttons: tactile press + ripple --- */

.btn { position: relative; overflow: hidden; }
.btn:active { transform: scale(.96); }

.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.55);
    transform: scale(0);
    animation: rippleOut .6s ease-out forwards;
    pointer-events: none;
}

@keyframes rippleOut {
    to { transform: scale(3.2); opacity: 0; }
}

.btn-celebrate {
    background: linear-gradient(120deg, var(--gold), var(--gold-light), var(--gold));
    background-size: 220% 100%;
    color: var(--plum-deep);
    box-shadow: 0 15px 35px rgba(200,164,106,.4);
    animation: celebrateShimmer 3.5s linear infinite;
}

.btn-celebrate:hover { transform: translateY(-3px) scale(1.03); }

@keyframes celebrateShimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 220% 50%; }
}

/* --- Cursor sparkles (hero only) --- */

.cursor-sparkle {
    position: fixed;
    z-index: 40;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold-light);
    box-shadow: 0 0 8px 2px rgba(229,207,158,.8);
    pointer-events: none;
    animation: sparkleFade .7s ease-out forwards;
}

@keyframes sparkleFade {
    0% { opacity: 1; transform: scale(1) translateY(0); }
    100% { opacity: 0; transform: scale(.2) translateY(-18px); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-badge-inner { animation: none; }
    .btn-celebrate { animation: none; }
    .cursor-sparkle { display: none; }
}

/* REVEAL ANIMATIONS */

.reveal { opacity: 0; transform: perspective(1000px) translateY(38px) rotateX(-10deg); transition: opacity .9s ease, transform .9s cubic-bezier(.22,1,.36,1); }
.reveal.visible { opacity: 1; transform: perspective(1000px) translateY(0) rotateX(0); }
.reveal-left { opacity: 0; transform: perspective(1000px) translateX(-48px) rotateY(20deg); transition: opacity .9s ease, transform .9s cubic-bezier(.22,1,.36,1); }
.reveal-left.visible { opacity: 1; transform: perspective(1000px) translateX(0) rotateY(0); }
.reveal-right { opacity: 0; transform: perspective(1000px) translateX(48px) rotateY(-20deg); transition: opacity .9s ease, transform .9s cubic-bezier(.22,1,.36,1); }
.reveal-right.visible { opacity: 1; transform: perspective(1000px) translateX(0) rotateY(0); }

/* RESPONSIVE */

/* TABLET (iPad portrait & landscape): switch to the compact nav here
   rather than at 800px, so it never has to cram the full nav-links row
   plus the "Leave a Wish" pill into a mid-size screen and overflow. */
@media (max-width: 1280px) {
    .nav-links { display: none; }
    .menu-toggle { display: flex; }

    /* Hero now behaves exactly like mobile from here down: stacked,
       full-width photo, no faded background-image treatment. */
    .hero { flex-direction: column; align-items: stretch; min-height: auto; padding-bottom: 55px; }
    .hero-content { position: static; z-index: auto; padding-top: 130px; }
    .hero-photo {
        position: relative; inset: auto; top: auto; right: auto;
        width: 100%; height: 60vh; min-height: 380px; max-height: 520px;
        margin-top: 40px; opacity: 1; transform: none;
    }
    .hero-number { display: none; }
    .hero-side-note { display: none; }

    /* FIX: hero becomes a stacked column here, so the medallion must go
       static in the same breakpoint — otherwise it stays absolutely
       positioned against the now much-taller .hero and floats over
       the photo instead of sitting near the title. */
    .hero-badge { position: static; display: flex; justify-content: center; margin: 24px 0 0; pointer-events: auto; }
}

@media (max-width: 1050px) {
    .story-grid { gap: 50px; }
    .footer-top { grid-template-columns: 1fr 1fr; }
    .footer-top > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 800px) {
    .section { padding: 90px 0; }
    .hero-content { padding-top: 110px; }
    .hero-photo { height: 55vh; min-height: 340px; max-height: 460px; }
    .hero h1 { font-size: clamp(4rem, 16vw, 7rem); }
    .hero h1 em { margin-left: 2%; }
    .story-grid, .rsvp-grid { grid-template-columns: 1fr; gap: 60px; }
    .story-image-main { height: 500px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat:nth-child(2) { border-right: 0; }
    .timeline::before { left: 5px; }
    .timeline-item, .timeline-item:nth-child(even) { width: 100%; margin-left: 0; padding-left: 35px; padding-right: 0; }
    .timeline-item::after, .timeline-item:nth-child(odd)::after, .timeline-item:nth-child(even)::after { left: 0; right: auto; }
    .timeline-year { font-size: 42px; }

    /* FIX: display:grid was missing, so grid-template-columns / grid-auto-rows /
       grid-column / grid-row below had no effect and mobile silently kept the
       desktop multi-column (columns: 3 280px) layout instead of this masonry grid. */
    .gallery-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 160px; }
    .gallery-item:nth-child(n) { grid-column: span 1; grid-row: span 2; }
    .gallery-item:nth-child(1) { grid-column: span 2; grid-row: span 3; }
    .event-grid { grid-template-columns: 1fr; }
    .countdown-wrap { grid-template-columns: 1fr 1fr; }
    .countdown-unit:nth-child(2) { border-right: 0; }
    .countdown-unit { border-bottom: 1px solid rgba(255,255,255,.13); }
    .form-grid { grid-template-columns: 1fr; }
    .form-group.full { grid-column: auto; }

    /* FIX: background-attachment: fixed is unreliable on iOS/mobile browsers
       (can render blank or jank on scroll), so disable it below tablet width. */
    .quote-section { background-attachment: scroll; }
}

@media (max-width: 520px) {
    .container, .nav-container { width: min(calc(100% - 28px), var(--container)); }
    .section { padding: 75px 0; }
    .hero-content { padding-top: 90px; }
    .hero-photo { height: 45vh; min-height: 280px; }
    .hero-date { gap: 12px; }
    .hero-date strong { font-size: 20px; }
    .hero-actions .btn { width: 100%; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.12); padding: 25px 10px; }
    .stat:nth-child(3), .stat:nth-child(4) { border-bottom: 0; }
    .story-image-frame { width: 125px; height: 165px; right: 10px; bottom: -25px; }
    .story-image-main { height: 430px; }
    .gallery-grid { gap: 8px; grid-auto-rows: 125px; }
    .rsvp-form { padding: 25px 18px; }
    .countdown-unit { padding: 30px 10px; }
    .countdown-label { margin-top: 18px; }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-close { top: 15px; right: 15px; }
    .footer-top { grid-template-columns: 1fr; gap: 35px; }
    .footer-top > div:first-child { grid-column: auto; }
    .footer-bottom { flex-direction: column; }
    .music-toggle { right: 15px; bottom: 15px; height: 46px; padding: 0 16px 0 15px; gap: 9px; }
    .music-toggle-label { font-size: 9px; }
    .back-top { left: 15px; bottom: 15px; }
    .gallery-filters { gap: 8px; }
    .filter-btn { padding: 9px 16px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .reveal, .reveal-left, .reveal-right { opacity: 1; transform: none; }
    .confetti-field { display: none; }
}

/* WHATSAPP SECTION */

.whatsapp-section { background: linear-gradient(135deg, #ead8d5, #f8eee9); padding: 30px 10px; }
.whatsapp-grid { margin-top: 50px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.whatsapp-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    border: 1px solid rgba(57,35,51,.1);
    border-radius: 20px;
    background: white;
    transition: var(--transition);
}

.whatsapp-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-card); border-color: #25d366; }

.whatsapp-icon {
    width: 58px; height: 58px;
    border-radius: 50%;
    background: #25d366;
    color: white;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.whatsapp-icon svg { width: 28px; height: 28px; fill: white; }
.whatsapp-info { flex: 1; }
.whatsapp-info strong { display: block; font-family: var(--serif); font-size: 22px; font-weight: 600; }
.whatsapp-info span { display: block; margin-top: 3px; color: #786770; font-size: 12px; }

.whatsapp-btn {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 999px;
    background: #25d366;
    color: white;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    transition: var(--transition);
}

.whatsapp-btn svg { width: 13px; height: 13px; fill: white; }
.whatsapp-btn:hover { background: #1da851; transform: translateY(-2px); }

@media (max-width: 700px) {
    .whatsapp-grid { grid-template-columns: 1fr; }
    .whatsapp-card { flex-direction: column; text-align: center; }
}

/* ============================================================
   GIFTS PAGE
   ============================================================ */

.gift-hero {
    padding: 200px 0 80px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(200,164,106,.14), transparent 45%),
        linear-gradient(120deg, #fffaf5 0%, #f4e8e3 55%, #ead8d5 100%);
}

.gift-hero .section-label { justify-content: center; }
.gift-hero .section-label::before { display: none; }
.gift-hero .section-title { margin-left: auto; margin-right: auto; }
.gift-hero .section-intro { margin-left: auto; margin-right: auto; text-align: center; }

.gift-card {
    max-width: 560px;
    margin: 55px auto 0;
    padding: 45px;
    background: white;
    border: 1px solid rgba(57,35,51,.1);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.gift-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
}

.gift-card-heading {
    display: flex;
    align-items: center;
    gap: 16px;
}

.gift-card-icon {
    width: 52px; height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 32% 28%, #fbeecb, var(--gold) 55%, #a9824f 100%);
    color: var(--plum-deep);
    font-family: var(--display);
    font-size: 22px;
}

.gift-card-heading h3 { font-family: var(--serif); font-size: 26px; font-weight: 600; }
.gift-card-heading span { display: block; margin-top: 2px; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--rose-dark); }

.gift-detail-list {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid rgba(57,35,51,.08);
}

.gift-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(57,35,51,.08);
}

.gift-detail-row dt {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #806c75;
}

.gift-detail-row dd {
    font-family: var(--serif);
    font-size: 19px;
    font-weight: 600;
    color: var(--plum);
    text-align: right;
}

.gift-copy-btn {
    margin-top: 28px;
    width: 100%;
    background: var(--plum);
    color: white;
    box-shadow: 0 15px 30px rgba(57,35,51,.18);
}

.gift-copy-btn:hover { background: var(--plum-deep); transform: translateY(-2px); }
.gift-copy-btn.copied { background: #32613a; }

.gift-note {
    margin: 30px auto 0;
    max-width: 560px;
    text-align: center;
    color: #806c75;
    font-size: 12.5px;
    line-height: 1.8;
}

@media (max-width: 520px) {
    .gift-hero { padding: 150px 0 60px; }
    .gift-card { padding: 30px 22px; }
    .gift-detail-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .gift-detail-row dd { text-align: left; }
}

/* NOTE: .wish-card / .wish-grid / .wish-item styling lives in wishes.html's
   own <style> block, since that page defines its own local rules (including
   the staggered middle-card offset). Keeping it there rather than duplicating
   it here avoids two versions of the same selectors drifting apart. */