/* ─────────────────────────────────────────────
   BIRTHDAY — HANDCRAFTED EDITORIAL DESIGN
   ───────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;1,400;1,500&family=Tenor+Sans&family=Pinyon+Script&display=swap');

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

html {
    scroll-behavior: smooth;
}

/* ── TOKENS ── */
:root {
    --ink: #1a1410;
    --paper: #f5efe6;
    --warm: #e8ddd0;
    --rose: #c17b7b;
    --rose2: #9e5a5a;
    --gold: #b89a6a;
    --muted: #7a6a5a;
    --ff-serif: 'EB Garamond', Georgia, serif;
    --ff-sans: 'Tenor Sans', sans-serif;
    --ff-script: 'Pinyon Script', cursive;
}

/* ── BASE ── */
body {
    font-family: var(--ff-serif);
    background: var(--paper);
    color: var(--ink);
    overflow-x: hidden;
    font-size: 18px;
    line-height: 1.75;
}

/* ── NOISE OVERLAY ── */
.noise {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    opacity: 0.6;
    mix-blend-mode: multiply;
}

/* ── INK CANVAS ── */
#ink {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

/* ── SCROLL HINT ── */
.scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.scroll-hint span {
    display: block;
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--rose));
    animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
    0% {
        transform: scaleY(0);
        transform-origin: top;
    }

    50% {
        transform: scaleY(1);
        transform-origin: top;
    }

    51% {
        transform: scaleY(1);
        transform-origin: bottom;
    }

    100% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

/* ── SECTION LABEL ── */
.s-label {
    font-family: var(--ff-sans);
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2rem;
}

/* ── LETTER NUMBER ── */
.letter-number {
    font-family: var(--ff-sans);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--rose);
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

/* ─────────────────── INTRO ─────────────────── */
.s-intro {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.intro-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 30% 40%, rgba(193, 123, 123, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 60% 80% at 70% 70%, rgba(184, 154, 106, 0.08) 0%, transparent 70%),
        var(--paper);
}

.intro-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 24px;
    max-width: 900px;
}

.intro-eyebrow {
    font-family: var(--ff-sans);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--rose);
    margin-bottom: 2.5rem;
    line-height: 2;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    animation: fadeUp 1s ease 0.3s forwards;
}

.intro-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-bottom: 2.5rem;
}

.intro-title .line {
    display: block;
    opacity: 0;
    transform: translateY(30px);
}

.l1 {
    font-family: var(--ff-script);
    font-size: clamp(4rem, 12vw, 9rem);
    color: var(--rose2);
    line-height: 1;
    animation: fadeUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

.l2 {
    font-family: var(--ff-serif);
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 400;
    font-style: italic;
    color: var(--ink);
    line-height: 1.1;
    animation: fadeUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

.l3 {
    font-family: var(--ff-serif);
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 400;
    color: var(--ink);
    line-height: 1.1;
    animation: fadeUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
}

.intro-ornament {
    color: var(--gold);
    width: 200px;
    margin: 0 auto 2rem;
    opacity: 0;
    animation: fadeUp 1s ease 1.1s forwards;
}

.intro-sub {
    font-family: var(--ff-serif);
    font-style: italic;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--muted);
    opacity: 0;
    animation: fadeUp 1s ease 1.3s forwards;
}

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

/* ─────────────────── LETTER ─────────────────── */
.s-letter {
    position: relative;
    z-index: 1;
    padding: 120px 24px;
    background: var(--ink);
    color: var(--paper);
}

.letter-wrap {
    max-width: 720px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 0 40px;
    align-items: start;
}

.s-letter .letter-number {
    color: var(--rose);
}

.s-letter .s-label {
    color: rgba(245, 239, 230, 0.4);
}

.letter-body {
    padding-top: 0;
}

.letter-text {
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 2;
    color: rgba(245, 239, 230, 0.85);
}

.letter-text p {
    margin-bottom: 1.4em;
}

.letter-text p:first-child {
    font-family: var(--ff-script);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: var(--rose);
    margin-bottom: 1em;
    line-height: 1;
}

.letter-sign {
    font-family: var(--ff-script);
    font-size: clamp(1.5rem, 3vw, 2.2rem) !important;
    color: var(--gold) !important;
    margin-top: 2rem;
    line-height: 1 !important;
}

/* ─────────────────── GALLERY ─────────────────── */
.s-gallery {
    position: relative;
    z-index: 1;
    padding: 100px 24px 80px;
    background: var(--paper);
}

.gallery-header {
    max-width: 1200px;
    margin: 0 auto 60px;
}

.gallery-sub {
    font-style: italic;
    color: var(--muted);
    font-size: 1rem;
    margin-top: -1rem;
}

/* Masonry-style grid */
.gallery-masonry {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 240px;
    gap: 16px;
}

.g-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.g-item.g-tall {
    grid-row: span 2;
}

.g-item.g-wide {
    grid-column: span 2;
}

.g-img-wrap {
    position: absolute;
    inset: 0;
    background: var(--warm);
    overflow: hidden;
}

.g-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s;
    display: block;
}

.g-img-wrap.no-photo img {
    display: none;
}

.g-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--warm), #e0d4c8);
    opacity: 0;
    transition: opacity 0.3s;
}

.g-img-wrap.no-photo .g-placeholder {
    opacity: 1;
}

.g-item:hover .g-img-wrap img {
    transform: scale(1.06);
}

.g-cap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 16px 14px;
    background: linear-gradient(to top, rgba(26, 20, 16, 0.85) 0%, transparent 100%);
    color: rgba(245, 239, 230, 0.9);
    font-size: 0.85rem;
    font-style: italic;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.g-item:hover .g-cap {
    transform: translateY(0);
}

/* ─────────────────── LIGHTBOX ─────────────────── */
.lb {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(26, 20, 16, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
    backdrop-filter: blur(8px);
}

.lb.open {
    opacity: 1;
    visibility: visible;
}

.lb-fig {
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
    animation: lbIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lbIn {
    from {
        transform: scale(0.92);
        opacity: 0;
    }
}

.lb-fig img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.lb-fig figcaption {
    margin-top: 16px;
    font-style: italic;
    color: rgba(245, 239, 230, 0.6);
    font-size: 0.95rem;
}

.lb-close,
.lb-prev,
.lb-next {
    position: absolute;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(245, 239, 230, 0.5);
    font-family: var(--ff-sans);
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    transition: color 0.2s;
}

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
    color: var(--rose);
}

.lb-close {
    top: 24px;
    right: 32px;
    font-size: 1rem;
}

.lb-prev {
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
}

.lb-next {
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
}

/* ─────────────────── VIDEOS ─────────────────── */
.s-videos {
    position: relative;
    z-index: 1;
    padding: 100px 24px;
    background: var(--warm);
}

.videos-header {
    max-width: 1200px;
    margin: 0 auto 60px;
}

.videos-trio {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.6fr 1fr;
    gap: 20px;
    align-items: center;
}

.v-side {
    display: flex;
    flex-direction: column;
}

.v-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.side-video {
    width: 100%;
    border-radius: 4px;
    background: var(--ink);
    display: block;
}

.main-video {
    width: 100%;
    border-radius: 4px;
    background: var(--ink);
    display: block;
}

.v-cap {
    font-style: italic;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 700px) {
    .videos-trio {
        grid-template-columns: 1fr;
    }
}

/* ─────────────────── WISHES ─────────────────── */
.s-wishes {
    position: relative;
    z-index: 1;
    padding: 100px 24px;
    background: var(--paper);
}

.wishes-header {
    max-width: 800px;
    margin: 0 auto 60px;
}

.wishes-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.w-item {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 0 40px;
    padding: 40px 0;
    border-top: 1px solid rgba(26, 20, 16, 0.1);
    align-items: start;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.w-item.vis {
    opacity: 1;
    transform: none;
}

.w-item:last-child {
    border-bottom: 1px solid rgba(26, 20, 16, 0.1);
}

.w-num {
    font-family: var(--ff-sans);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--rose);
    padding-top: 6px;
    opacity: 0.7;
}

.w-body h3 {
    font-family: var(--ff-script);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--rose2);
    line-height: 1;
    margin-bottom: 12px;
}

.w-body p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.8;
}

/* ─────────────────── QUOTE ─────────────────── */
.s-quote {
    position: relative;
    z-index: 1;
    padding: 120px 24px;
    background: var(--ink);
    color: var(--paper);
    text-align: center;
    overflow: hidden;
}

.quote-inner {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.q-mark {
    width: 60px;
    color: var(--rose);
    margin: 0 auto 24px;
    display: block;
}

.q-text {
    font-family: var(--ff-serif);
    font-style: italic;
    font-size: clamp(1.3rem, 3vw, 2rem);
    line-height: 1.7;
    color: rgba(245, 239, 230, 0.9);
    transition: opacity 0.5s ease;
}

.q-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 48px;
}

.q-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(245, 239, 230, 0.2);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    border: none;
}

.q-dot.on {
    background: var(--rose);
    transform: scale(1.4);
}

/* ─────────────────── FINALE ─────────────────── */
.s-finale {
    position: relative;
    z-index: 1;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--paper);
    overflow: hidden;
    text-align: center;
}

#finale-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.finale-inner {
    position: relative;
    z-index: 2;
    padding: 40px 24px;
}

.finale-eyebrow {
    font-family: var(--ff-sans);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.finale-eyebrow.vis {
    opacity: 1;
    transform: none;
}

.finale-big {
    font-family: var(--ff-serif);
    font-size: clamp(3.5rem, 10vw, 8rem);
    font-weight: 400;
    line-height: 1.05;
    color: var(--ink);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease 0.2s, transform 1s ease 0.2s;
}

.finale-big.vis {
    opacity: 1;
    transform: none;
}

.finale-heart {
    font-family: var(--ff-script);
    font-size: clamp(3rem, 8vw, 5rem);
    color: var(--rose);
    margin: 16px 0 0;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.8s ease 0.5s;
    animation: none;
}

.finale-heart.vis {
    opacity: 1;
    animation: heartPulse 2s ease-in-out infinite 1s;
}

@keyframes heartPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.12);
    }
}

.finale-name {
    font-family: var(--ff-script);
    font-size: clamp(3rem, 9vw, 6rem);
    color: var(--rose2);
    line-height: 1.1;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.7s, transform 0.8s ease 0.7s;
}

.finale-name.vis {
    opacity: 1;
    transform: none;
}

.finale-btn {
    margin-top: 48px;
    padding: 14px 40px;
    background: none;
    border: 1px solid var(--rose);
    color: var(--rose2);
    font-family: var(--ff-sans);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
    opacity: 0;
    transition: opacity 0.8s ease 1s, background 0.3s, color 0.3s;
}

.finale-btn.vis {
    opacity: 1;
}

.finale-btn:hover {
    background: var(--rose);
    color: var(--paper);
}

/* ─────────────────── SCROLL REVEAL ─────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.vis {
    opacity: 1;
    transform: none;
}

/* ─────────────────── RESPONSIVE ─────────────────── */
@media (max-width: 900px) {
    .gallery-masonry {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
    }

    .g-item.g-wide {
        grid-column: span 2;
    }

    .videos-row {
        grid-template-columns: 1fr;
    }

    .v-card--big {
        order: -1;
    }
}

@media (max-width: 600px) {
    .letter-wrap {
        grid-template-columns: 1fr;
    }

    .letter-number {
        display: none;
    }

    .gallery-masonry {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 160px;
    }

    .g-item.g-tall {
        grid-row: span 1;
    }

    .g-item.g-wide {
        grid-column: span 2;
    }

    .g-cap {
        transform: none;
    }

    .w-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .w-num {
        display: none;
    }
}