/* ============ Design Tokens ============ */
:root {
    --surface: #131313;
    --surface-container-lowest: #0e0e0e;
    --surface-container-low: #1c1b1b;
    --surface-container: #201f1f;
    --surface-container-high: #2a2a2a;
    --primary: #f2ca50;
    --primary-dim: #e9c349;
    --on-surface: #e5e2e1;
    --on-surface-variant: #d0c5af;
    --outline-variant: #4d4635;
    --petal-from: #5f1410;
    --petal-to: #410001;

    --max-width: 1200px;
    --margin: clamp(24px, 6vw, 80px);
    --stack-lg: clamp(72px, 14vw, 120px);
    --stack-md: clamp(48px, 9vw, 64px);
    --stack-sm: 32px;

    --font-head: "Playfair Display", serif;
    --font-body: "DM Sans", sans-serif;
    --font-script: "EB Garamond", serif;
}

/* ============ Reset ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--surface);
    color: var(--on-surface);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100dvh;
    line-height: 1.6;
}

img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

a {
    text-decoration: none;
    color: inherit;
}

.material-symbols-outlined {
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* ============ Shared ============ */
.eyebrow {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--primary);
    text-transform: uppercase;
}

.section-title {
    font-family: var(--font-head);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    line-height: 1.2;
    margin-top: 1rem;
}

.divider {
    width: 96px;
    height: 1px;
    background: rgba(242, 202, 80, 0.4);
    margin: 2rem auto;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ============ Scroll Reveal ============ */
.reveal {
    opacity: 0;
    transform: translateY(200px);
    transition: opacity 2s ease, transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: opacity, transform;
}

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

/* ============ Header ============ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--margin);
    background: rgba(19, 19, 19, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(77, 70, 53, 0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.logo-text {
    font-family: var(--font-head);
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--on-surface-variant);
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
}

/* ============ Mobile Menu ============ */
.mobile-menu {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    z-index: 49;
    background: rgba(19, 19, 19, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(77, 70, 53, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 0 var(--margin);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.mobile-menu.open {
    max-height: 300px;
    padding: 2rem var(--margin);
}

.mobile-menu a {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--on-surface-variant);
}

.mobile-menu a:hover {
    color: var(--primary);
}

/* ============ Hero ============ */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
    padding: 0 var(--margin);
    background: linear-gradient(to bottom, var(--surface), #2a0a0a, var(--surface));
}

.petal-container {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 20;
}

.hero-content .eyebrow {
    letter-spacing: 0.4em;
    display: block;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: var(--font-head);
    font-size: clamp(3.5rem, 15vw, 7rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.hero-date {
    font-family: var(--font-script);
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-style: italic;
    color: var(--on-surface-variant);
    opacity: 0.8;
}

.hero-subtitle {
    font-family: var(--font-head);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-style: italic;
    color: var(--primary);
    font-weight: 500;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(600px, 90vw);
    height: min(600px, 90vw);
    background: rgba(242, 202, 80, 0.05);
    border-radius: 50%;
    filter: blur(120px);
}

/* ============ Petals ============ */
.petal {
    position: absolute;
    background: linear-gradient(to bottom right, var(--petal-from), var(--petal-to));
    border-radius: 150% 0 150% 0;
    opacity: 0.6;
    pointer-events: none;
}

@keyframes fall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============ Gallery ============ */
.gallery {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--stack-lg) var(--margin);
}

.section-head {
    text-align: center;
    margin-bottom: var(--stack-md);
}

.polaroid-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.polaroid {
    background: #fff;
    padding: 1rem 1rem 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    aspect-ratio: 4 / 5;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.6s ease;
}

.polaroid-img {
    width: 100%;
    height: 100%;
    background: var(--surface-container);
    overflow: hidden;
}

.grayscale {
    filter: grayscale(1);
}

.tilt-left {
    transform: rotate(-3deg);
}

.tilt-right {
    transform: rotate(2deg);
}

.offset-down {
    margin-top: 2rem;
}

.offset-down-sm {
    margin-top: 1rem;
}

.polaroid:hover {
    transform: scale(1.05) rotate(0deg);
    box-shadow: 0 0 30px rgba(242, 202, 80, 0.3);
}

/* ============ Countdown ============ */
.countdown-section {
    background: var(--surface-container-lowest);
    border-top: 1px solid rgba(77, 70, 53, 0.2);
    border-bottom: 1px solid rgba(77, 70, 53, 0.2);
    padding: var(--stack-md) 0;
}

.countdown-inner {
    max-width: 56rem;
    margin: 0 auto;
    padding: 0 var(--margin);
    text-align: center;
}

.countdown-inner .eyebrow {
    display: block;
    color: var(--on-surface-variant);
    margin-bottom: var(--stack-sm);
}

.countdown-grid {
    display: flex;
    justify-content: center;
    gap: clamp(0.75rem, 3vw, 2rem);
    flex-wrap: wrap;
}

.count-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.count-box {
    width: clamp(64px, 18vw, 128px);
    height: clamp(64px, 18vw, 128px);
    border: 1px solid rgba(242, 202, 80, 0.4);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-container-high);
}

.count-box span {
    font-family: var(--font-head);
    font-size: clamp(1.5rem, 6vw, 3rem);
    color: var(--primary);
}

.count-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--on-surface-variant);
    margin-top: 0.75rem;
}

/* ============ Timeline ============ */
.timeline {
    max-width: 56rem;
    margin: 0 auto;
    padding: var(--stack-lg) var(--margin);
}

.timeline-track {
    position: relative;
}

.timeline-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--outline-variant), transparent);
    opacity: 0.3;
}

.timeline-event {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: var(--stack-md);
}

.timeline-event:last-child {
    margin-bottom: 0;
}

.event-side {
    flex: 1;
}

.event-side.left {
    text-align: right;
}

.event-side.right {
    text-align: left;
}

.event-side h4 {
    font-family: var(--font-head);
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

.event-date {
    font-style: italic;
    color: var(--on-surface-variant);
}

.event-text {
    color: var(--on-surface-variant);
}

.event-node {
    z-index: 20;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface-container);
    border: 1px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(242, 202, 80, 0.4);
}

.event-node .material-symbols-outlined {
    color: var(--primary);
}

/* ============ Letter ============ */
.letter {
    background: var(--surface);
    padding: var(--stack-lg) var(--margin);
}

.parchment {
    max-width: 48rem;
    margin: 0 auto;
    position: relative;
    padding: clamp(2rem, 6vw, 4rem);
    border-radius: 0.5rem;
    border: 1px solid rgba(77, 70, 53, 0.3);
    background-color: var(--surface-container);
    background-image: url("https://www.transparenttextures.com/patterns/dark-matter.png");
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.parchment-icon {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 3.5rem;
    color: rgba(242, 202, 80, 0.2);
    pointer-events: none;
}

.letter-head {
    text-align: center;
    margin-bottom: 3rem;
}

.letter-body p {
    font-family: var(--font-script);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-style: italic;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.signature {
    text-align: right;
    padding-top: 2rem;
}

.sign-off {
    font-family: var(--font-script);
    font-size: 1.5rem;
    font-style: italic;
    color: var(--primary);
}

.sign-name {
    font-family: var(--font-head);
    font-size: 1.5rem;
    margin-top: 0.5rem;
}

/* ============ Footer ============ */
.site-footer {
    background: var(--surface-container-lowest);
    border-top: 1px solid rgba(77, 70, 53, 0.2);
    padding: var(--stack-sm) var(--margin);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-logo {
    font-family: var(--font-script);
    font-size: 1.5rem;
    font-style: italic;
    color: var(--primary);
}

.footer-links {
    display: flex;
    gap: 2rem;
    color: var(--on-surface-variant);
}

.footer-links span {
    cursor: pointer;
    transition: color 0.3s;
}

.footer-links span:hover {
    color: var(--primary);
}

.footer-music {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-note {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--on-surface-variant);
    text-transform: uppercase;
}

.music-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(77, 70, 53, 0.3);
    background: none;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.1s;
}

.music-toggle:hover {
    background: var(--surface-variant);
}

.music-toggle:active {
    transform: scale(0.95);
}

.music-toggle.active {
    background: rgba(242, 202, 80, 0.1);
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .header-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    /* Stack timeline to one side on mobile */
    .timeline-line {
        left: 24px;
    }

    .timeline-event,
    .timeline-event.reverse {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding-left: 60px;
    }

    .event-side.left,
    .event-side.right {
        text-align: left;
        flex: none;
        width: 100%;
    }

    .event-node {
        position: absolute;
        left: 0;
        top: 0;
    }

    /* Reorder so heading shows before text on mobile */
    .timeline-event .event-side.left {
        order: 1;
    }

    .timeline-event .event-node {
        order: 0;
    }

    .timeline-event .event-side.right {
        order: 2;
    }

    .timeline-event.reverse .event-side.left {
        order: 2;
    }

    .timeline-event.reverse .event-side.right {
        order: 1;
    }

    .site-footer {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .footer-links {
        gap: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto;
    }
}