:root {
    --ink: #15183b;
    --paper: #fff8e8;
    --yellow: #ffd83d;
    --orange: #ff6b35;
    --blue: #3ec5ff;
    --pink: #ff5ca8;
    --white: #fffdf7;
    --shadow: 0.55rem 0.65rem 0 var(--ink);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 14% 8%, rgba(255, 216, 61, .3) 0 9rem, transparent 9.1rem),
        radial-gradient(circle at 92% 19%, rgba(62, 197, 255, .22) 0 12rem, transparent 12.1rem),
        var(--paper);
    font-family: Inter, ui-rounded, "Arial Rounded MT Bold", system-ui, -apple-system, sans-serif;
    min-width: 18rem;
    overflow-x: hidden;
}

button, img { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.ticker {
    overflow: hidden;
    border-bottom: .2rem solid var(--ink);
    background: var(--ink);
    color: var(--yellow);
    font-weight: 950;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ticker__track {
    width: max-content;
    display: flex;
    gap: 2.4rem;
    padding: .65rem 1.2rem;
    animation: ticker 22s linear infinite;
}

.ticker__track span::after { content: " ✦"; color: var(--pink); }

main { width: min(74rem, calc(100% - 2rem)); margin: 0 auto; }

.hero {
    min-height: min(48rem, calc(100vh - 3rem));
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(18rem, .88fr);
    align-items: center;
    gap: clamp(2rem, 6vw, 6rem);
    padding: clamp(3rem, 8vw, 7rem) 0;
}

.eyebrow {
    margin: 0 0 .8rem;
    color: #5d6291;
    font-size: .85rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}

h1, h2, h3, p { text-wrap: balance; }

h1 {
    max-width: 12ch;
    margin: 0;
    font-size: clamp(3.4rem, 8vw, 7.6rem);
    line-height: .86;
    letter-spacing: -.075em;
    font-weight: 950;
}

h1 em {
    color: var(--orange);
    font-style: normal;
    text-decoration: underline wavy var(--blue) .08em;
    text-underline-offset: .08em;
}

.date-pill {
    display: inline-block;
    margin: 1.6rem 0 1.1rem;
    padding: .65rem .9rem;
    border: .18rem solid var(--ink);
    border-radius: 999px;
    background: var(--yellow);
    box-shadow: .22rem .25rem 0 var(--ink);
    font-weight: 900;
    transform: rotate(-1.3deg);
}

.countdown {
    display: flex;
    align-items: stretch;
    gap: .8rem;
    max-width: 39rem;
}

.countdown__main,
.countdown__small > div {
    border: .2rem solid var(--ink);
    background: var(--white);
    box-shadow: .3rem .35rem 0 var(--ink);
}

.countdown__main {
    min-width: 11.2rem;
    padding: .8rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.countdown__main strong {
    font-variant-numeric: tabular-nums;
    font-size: clamp(3.7rem, 8vw, 6.7rem);
    line-height: .82;
    letter-spacing: -.08em;
}

.countdown__main span,
.countdown__small span {
    color: #62668c;
    font-size: .8rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.countdown__small {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .7rem;
}

.countdown__small > div {
    min-width: 0;
    padding: .8rem .45rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.countdown__small strong {
    font-size: clamp(1.65rem, 4vw, 2.5rem);
    font-variant-numeric: tabular-nums;
}

.status { margin: 1.25rem 0; color: #4c5077; font-size: 1rem; font-weight: 700; }

.party-button {
    cursor: pointer;
    border: .2rem solid var(--ink);
    border-radius: .7rem;
    padding: .9rem 1.15rem;
    background: var(--pink);
    color: var(--ink);
    box-shadow: .32rem .38rem 0 var(--ink);
    font-weight: 950;
    transition: transform .14s ease, box-shadow .14s ease;
}

.party-button:hover { transform: translate(-.12rem, -.12rem) rotate(-1deg); box-shadow: .45rem .5rem 0 var(--ink); }
.party-button:active { transform: translate(.28rem, .3rem); box-shadow: 0 0 0 var(--ink); }
.party-button:focus-visible, .gallery-card__open:focus-visible, .lightbox__close:focus-visible { outline: .25rem solid var(--blue); outline-offset: .25rem; }

.photo-pile { position: relative; min-height: 31rem; }

.polaroid {
    position: absolute;
    width: clamp(13rem, 21vw, 18rem);
    margin: 0;
    padding: .72rem .72rem 1.45rem;
    border: .18rem solid var(--ink);
    background: var(--white);
    box-shadow: var(--shadow);
    animation: float 4.8s ease-in-out infinite;
}

.polaroid img,
.polaroid--placeholder > div {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border: .14rem solid var(--ink);
    object-fit: cover;
    background: #e9eef2;
}

.polaroid--placeholder > div { display: grid; place-items: center; font-size: 4.8rem; }
.polaroid figcaption { margin-top: .7rem; font-size: .9rem; font-weight: 900; text-align: center; }
.polaroid--1 { top: 1%; left: 4%; z-index: 3; transform: rotate(-8deg); }
.polaroid--2 { top: 22%; right: 0; z-index: 2; transform: rotate(9deg); animation-delay: -.9s; }
.polaroid--3 { bottom: 0; left: 9%; z-index: 1; transform: rotate(-2deg); animation-delay: -2s; }

.stamp {
    position: absolute;
    right: 6%;
    bottom: 5%;
    z-index: 5;
    width: 7.2rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: .32rem double var(--orange);
    border-radius: 50%;
    color: var(--orange);
    font-size: .78rem;
    font-weight: 950;
    letter-spacing: .08em;
    text-align: center;
    transform: rotate(-14deg);
}

.progress-section {
    margin: 0 0 clamp(5rem, 10vw, 8rem);
    padding: clamp(1.4rem, 4vw, 2.5rem);
    border: .2rem solid var(--ink);
    border-radius: 1.4rem;
    background: var(--yellow);
    box-shadow: var(--shadow);
    transform: rotate(.3deg);
}

.progress-section__heading,
.gallery-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
}

h2 { margin: 0; font-size: clamp(2rem, 5vw, 4rem); line-height: .95; letter-spacing: -.055em; }
.progress-section__heading > strong { white-space: nowrap; font-size: 1.15rem; }

.progress-track {
    position: relative;
    height: 2rem;
    margin-top: 1.8rem;
    overflow: visible;
    border: .18rem solid var(--ink);
    border-radius: 999px;
    background: var(--white);
}

.progress-fill {
    position: relative;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: repeating-linear-gradient(135deg, var(--orange) 0 1rem, var(--pink) 1rem 2rem);
    transition: width 1s cubic-bezier(.2, .9, .2, 1);
}

.progress-fill span { position: absolute; top: -1.15rem; right: -.8rem; font-size: 2.4rem; transform: scaleX(-1); }
.progress-dates { display: flex; justify-content: space-between; margin-top: .6rem; font-size: .8rem; font-weight: 850; }

.gallery-section { padding-bottom: 6rem; }
.photo-count { padding: .5rem .7rem; border: .15rem solid var(--ink); border-radius: 999px; background: var(--blue); font-weight: 900; white-space: nowrap; }

.gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1.2rem, 3vw, 2.2rem);
    margin-top: 2.6rem;
}

.gallery-card {
    margin: 0;
    padding: .75rem .75rem 1rem;
    border: .18rem solid var(--ink);
    background: var(--white);
    box-shadow: .35rem .4rem 0 var(--ink);
    transform: rotate(-1.2deg);
    transition: transform .22s ease, box-shadow .22s ease;
}

.gallery-card:nth-child(3n + 2) { transform: rotate(.9deg); }
.gallery-card:nth-child(3n + 3) { transform: rotate(-.3deg); }

.gallery-card:hover { z-index: 2; transform: translateY(-.4rem) rotate(0); box-shadow: .52rem .6rem 0 var(--ink); }
.gallery-card__open { width: 100%; padding: 0; cursor: zoom-in; border: 0; background: none; }
.gallery-card img { display: block; width: 100%; aspect-ratio: 4 / 3; border: .12rem solid var(--ink); object-fit: cover; }
.gallery-card figcaption { padding-top: .7rem; font-weight: 850; text-transform: capitalize; }

.empty-state {
    margin-top: 2.2rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: .18rem dashed var(--ink);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .55);
}

.empty-state > span { font-size: 3rem; }
.empty-state h3 { margin: 0 0 .3rem; font-size: 1.25rem; }
.empty-state p { margin: 0; }
.empty-state code { padding: .15rem .35rem; border-radius: .25rem; background: var(--ink); color: var(--white); }

footer { padding: 1.2rem; border-top: .18rem solid var(--ink); background: var(--ink); color: var(--white); text-align: center; font-weight: 800; }

.lightbox {
    width: min(57rem, calc(100% - 2rem));
    padding: 1rem;
    border: .2rem solid var(--ink);
    border-radius: 1rem;
    background: var(--white);
    box-shadow: .6rem .7rem 0 var(--ink);
}

.lightbox::backdrop { background: rgba(12, 14, 42, .82); backdrop-filter: blur(4px); }
.lightbox img { display: block; width: 100%; max-height: 72vh; object-fit: contain; background: #ececec; }
.lightbox p { margin: .8rem .5rem .2rem; font-weight: 900; text-transform: capitalize; }
.lightbox__close { position: absolute; top: .25rem; right: .25rem; width: 2.8rem; aspect-ratio: 1; cursor: pointer; border: .16rem solid var(--ink); border-radius: 50%; background: var(--yellow); font-size: 1.7rem; font-weight: 950; line-height: 1; }

.confetti-layer { position: fixed; inset: 0; z-index: 99; pointer-events: none; overflow: hidden; }
.confetti { position: absolute; top: -2rem; width: .75rem; height: 1.1rem; animation: confetti-fall var(--duration) linear forwards; }

.party-mode .hero__copy { animation: party-shake .55s ease both; }
.party-mode .ticker { filter: hue-rotate(90deg); }

@keyframes ticker { to { transform: translateX(-50%); } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -1rem; } }
@keyframes confetti-fall { to { transform: translate(var(--drift), 110vh) rotate(900deg); } }
@keyframes party-shake { 20% { transform: rotate(-1deg); } 40% { transform: rotate(1.5deg); } 60% { transform: rotate(-1deg); } 80% { transform: rotate(.5deg); } }

@media (max-width: 850px) {
    .hero { grid-template-columns: 1fr; min-height: auto; }
    .hero__copy { position: relative; z-index: 4; }
    .photo-pile { width: min(31rem, 100%); margin: 0 auto; }
    .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 550px) {
    main { width: min(100% - 1.2rem, 74rem); }
    .hero { padding-top: 2.5rem; }
    h1 { font-size: clamp(3.1rem, 18vw, 5.5rem); }
    .countdown { flex-direction: column; }
    .countdown__main { align-items: center; }
    .countdown__small > div { min-height: 5.4rem; }
    .photo-pile { min-height: 25rem; }
    .polaroid { width: 11.8rem; }
    .progress-section__heading, .gallery-heading { align-items: start; flex-direction: column; }
    .gallery { grid-template-columns: 1fr; }
    .empty-state { align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
