/* ═══════════════════════════════════════════════════════════════
   KITTY'S BIRTHDAY — style.css
   Aesthetic: Warm velvet candlelight • Burgundy & Gold • Elegant
   ═══════════════════════════════════════════════════════════════ */

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

/* ─── Design Tokens ───────────────────────────────────────────── */
:root {
    /* Background layers */
    --bg-base: #08030a;
    --bg-deep: #100818;
    --bg-warm: #1a0c14;
    --bg-glow: #280e1a;

    /* Gold palette */
    --gold-bright: #f5d98e;
    --gold-mid: #e8c56a;
    --gold-dim: #9a7a3a;
    --gold-faint: #4a3a1a;

    /* Rose palette */
    --rose-light: #ecb0c0;
    --rose-mid: #d47090;
    --rose-dim: #8a3050;

    /* Text */
    --text-cream: #f5ead6;
    --text-soft: #c8a882;
    --text-muted: #7a5c48;
    --text-faint: #3a2818;

    /* Card glass */
    --card-bg: rgba(22, 8, 16, 0.80);
    --card-border: rgba(232, 197, 106, 0.18);
    --card-shine: rgba(232, 197, 106, 0.06);

    /* Fonts */
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-script: 'Dancing Script', cursive;
    --font-body: 'Lato', 'Helvetica Neue', Arial, sans-serif;

    /* Spacing */
    --section-pad: clamp(80px, 12vh, 140px);
}

/* ─── Base ────────────────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-base);
    color: var(--text-cream);
    font-family: var(--font-body);
    font-weight: 300;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Three.js Canvas ─────────────────────────────────────────── */
#bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ─── Vignette Overlay ────────────────────────────────────────── */
.vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 50% 0%, transparent 40%, rgba(8, 3, 10, 0.55) 100%),
        radial-gradient(ellipse at 0% 50%, rgba(8, 3, 10, 0.30) 0%, transparent 55%),
        radial-gradient(ellipse at 100% 50%, rgba(8, 3, 10, 0.30) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 100%, transparent 40%, rgba(8, 3, 10, 0.55) 100%);
}

/* ─── Layout ──────────────────────────────────────────────────── */
main {
    position: relative;
    z-index: 2;
}

.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--section-pad) clamp(20px, 6vw, 80px);
    position: relative;
}

/* Subtle warm radial washes per section */
.hero-section {
    background: radial-gradient(ellipse 80% 60% at 50% 45%,
            rgba(100, 30, 55, 0.28) 0%, transparent 70%);
}

.story-section:nth-child(2n) {
    background: radial-gradient(ellipse 70% 55% at 25% 50%,
            rgba(70, 18, 38, 0.22) 0%, transparent 65%);
}

.story-section:nth-child(2n+1) {
    background: radial-gradient(ellipse 70% 55% at 75% 50%,
            rgba(60, 14, 42, 0.22) 0%, transparent 65%);
}

.finale-section {
    background: radial-gradient(ellipse 90% 70% at 50% 55%,
            rgba(130, 38, 68, 0.30) 0%, transparent 65%);
    min-height: 100vh;
}

/* ─── Scroll-Reveal System ────────────────────────────────────── */
.scroll-reveal {
    opacity: 0;
    transform: translateY(38px);
    transition:
        opacity 0.95s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.95s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Delay helpers */
.delay-1 {
    transition-delay: 0.10s;
}

.delay-2 {
    transition-delay: 0.30s;
}

.delay-3 {
    transition-delay: 0.55s;
}

.delay-4 {
    transition-delay: 0.80s;
}

/* ═══════════════════════════════════════════════════════════════
     HERO SECTION
     ═══════════════════════════════════════════════════════════════ */
.hero-content {
    text-align: center;
    max-width: 780px;
    width: 100%;
}

.pre-title {
    font-family: var(--font-script);
    font-size: clamp(1.05rem, 2.8vw, 1.45rem);
    color: var(--gold-dim);
    letter-spacing: 0.06em;
    margin-bottom: 22px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3.2rem, 11vw, 7.5rem);
    font-weight: 700;
    line-height: 1.08;
    color: var(--text-cream);
    margin-bottom: 30px;
    letter-spacing: -0.015em;
}

.name-accent {
    display: inline-block;
    font-style: italic;
    background: linear-gradient(140deg,
            var(--gold-bright) 0%,
            var(--rose-light) 45%,
            var(--gold-mid) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: nameShimmer 5s ease-in-out infinite;
}

@keyframes nameShimmer {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 2.2vw, 1.15rem);
    font-weight: 300;
    color: var(--text-soft);
    letter-spacing: 0.06em;
    line-height: 1.8;
    margin-bottom: 64px;
}

/* ─── Scroll Hint ─────────────────────────────────────────────── */
.scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.hint-text {
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.hint-line {
    width: 1px;
    height: 52px;
    background: linear-gradient(to bottom, var(--gold-dim), transparent);
    animation: hintPulse 2.2s ease-in-out infinite;
}

@keyframes hintPulse {

    0%,
    100% {
        opacity: 0.25;
        transform: scaleY(0.85);
    }

    50% {
        opacity: 0.90;
        transform: scaleY(1.10);
    }
}

/* ═══════════════════════════════════════════════════════════════
     STORY CARDS
     ═══════════════════════════════════════════════════════════════ */
.story-section {
    padding: var(--section-pad) clamp(20px, 6vw, 80px);
}

.story-section.align-left {
    justify-content: flex-start;
}

.story-section.align-right {
    justify-content: flex-end;
}

.story-card {
    max-width: 560px;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 3px;
    padding: clamp(36px, 6vw, 58px) clamp(28px, 5vw, 52px);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(232, 197, 106, 0.04),
        0 28px 90px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 var(--card-shine);
    transition: box-shadow 0.5s ease, transform 0.5s ease;
}

/* Gradient border shimmer */
.story-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 3px;
    padding: 1px;
    background: linear-gradient(145deg,
            rgba(232, 197, 106, 0.35) 0%,
            transparent 40%,
            rgba(212, 112, 138, 0.20) 100%);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Soft inner glow top-left */
.story-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 60%;
    height: 40%;
    background: radial-gradient(ellipse at 0% 0%,
            rgba(232, 197, 106, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

.story-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 0 0 1px rgba(232, 197, 106, 0.10),
        0 40px 100px rgba(0, 0, 0, 0.65),
        0 0 40px rgba(232, 197, 106, 0.08),
        inset 0 1px 0 var(--card-shine);
}

.ornament {
    display: block;
    font-size: 1.3rem;
    color: var(--gold-mid);
    margin-bottom: 22px;
    opacity: 0.75;
    animation: ornamentBreath 3.5s ease-in-out infinite;
}

@keyframes ornamentBreath {

    0%,
    100% {
        opacity: 0.55;
    }

    50% {
        opacity: 0.95;
    }
}

.story-card h2 {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 3.5vw, 1.9rem);
    font-weight: 400;
    font-style: italic;
    color: var(--text-cream);
    line-height: 1.32;
    margin-bottom: 18px;
    letter-spacing: 0.01em;
}

.story-card p {
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 1.8vw, 1.02rem);
    font-weight: 300;
    color: var(--text-soft);
    line-height: 1.9;
}

/* ═══════════════════════════════════════════════════════════════
     FINALE SECTION
     ═══════════════════════════════════════════════════════════════ */
.finale-wrapper {
    text-align: center;
    max-width: 720px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* ─── Decorative Rule ─────────────────────────────────────────── */
.finale-deco {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto 36px;
    width: min(320px, 80%);
}

.finale-deco.flip {
    margin: 36px auto 44px;
    transform: scaleY(-1);
}

.deco-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold-dim), transparent);
}

.deco-star {
    font-size: 0.9rem;
    color: var(--gold-mid);
    opacity: 0.7;
}

.deco-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gold-dim);
    opacity: 0.6;
}

/* ─── Finale Text ─────────────────────────────────────────────── */
.finale-pre {
    font-family: var(--font-script);
    font-size: clamp(1rem, 2.8vw, 1.4rem);
    color: var(--gold-dim);
    letter-spacing: 0.06em;
    margin-bottom: 20px;
}

.finale-title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 9.5vw, 6.5rem);
    font-weight: 700;
    line-height: 1.08;
    margin-bottom: 28px;
    background: linear-gradient(140deg,
            var(--gold-bright) 0%,
            var(--rose-light) 50%,
            var(--gold-mid) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: nameShimmer 6s ease-in-out infinite;
    letter-spacing: -0.01em;
}

.finale-title em {
    display: block;
    font-style: italic;
    font-weight: 400;
}

.finale-message {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    font-weight: 300;
    color: var(--text-soft);
    line-height: 1.9;
    letter-spacing: 0.03em;
    max-width: 440px;
    margin: 0 auto;
}

/* ─── Gift Button ─────────────────────────────────────────────── */
.gift-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 20px 56px;
    background: transparent;
    border: 1px solid var(--gold-mid);
    border-radius: 2px;
    color: var(--gold-bright);
    font-family: var(--font-body);
    font-size: clamp(0.78rem, 2vw, 0.88rem);
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    cursor: pointer;
    overflow: hidden;
    outline: none;
    transition:
        color 0.4s ease,
        border-color 0.4s ease,
        box-shadow 0.4s ease,
        transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Shimmer sweep */
.btn-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
            transparent 30%,
            rgba(232, 197, 106, 0.12) 50%,
            transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.gift-button:hover .btn-shimmer,
.gift-button:focus .btn-shimmer {
    transform: translateX(100%);
}

/* Fill on hover */
.gift-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(232, 197, 106, 0.08),
            rgba(212, 112, 138, 0.08));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gift-button:hover::before,
.gift-button:focus::before {
    opacity: 1;
}

/* Outer glow on hover */
.gift-button:hover,
.gift-button:focus {
    border-color: var(--gold-bright);
    color: #fff;
    box-shadow:
        0 0 20px rgba(232, 197, 106, 0.20),
        0 0 50px rgba(232, 197, 106, 0.10),
        0 0 80px rgba(212, 112, 138, 0.08);
    transform: translateY(-2px);
}

.gift-button:active {
    transform: scale(0.97) translateY(0);
}

.btn-icon {
    font-size: 1.25rem;
    position: relative;
    z-index: 1;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gift-button:hover .btn-icon {
    transform: scale(1.25) rotate(-12deg);
}

.btn-label {
    position: relative;
    z-index: 1;
}

/* Disabled state */
.gift-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* ─── Finale Footer Note ──────────────────────────────────────── */
.finale-footer {
    font-family: var(--font-script);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-top: 0;
    opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════
     RESPONSIVE
     ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {

    .story-section.align-left,
    .story-section.align-right {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    :root {
        --section-pad: 70px;
    }

    .story-card {
        padding: 32px 24px;
    }

    .gift-button {
        padding: 18px 40px;
        gap: 10px;
    }

    .finale-title {
        font-size: clamp(2.4rem, 14vw, 4rem);
    }

    .finale-deco,
    .finale-deco.flip {
        width: 70%;
    }
}

@media (max-width: 380px) {
    .hero-title {
        font-size: 2.8rem;
    }

    .story-card {
        padding: 26px 18px;
    }

    .gift-button {
        padding: 16px 28px;
        letter-spacing: 0.15em;
        font-size: 0.78rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
     SCROLLBAR
     ═══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-faint);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dim);
}

/* ═══════════════════════════════════════════════════════════════
     SELECTION
     ═══════════════════════════════════════════════════════════════ */
::selection {
    background: rgba(232, 197, 106, 0.22);
    color: var(--text-cream);
}