/* ============================================
   mybadge.id — Gilded Herbarium Styles
   ============================================ */

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

:root {
    --gold-primary: #c5a044;
    --gold-light: #e8d5a0;
    --gold-dark: #8a6f2a;
    --black-primary: #0d0b08;
    --parchment: #f9f4ec;
    --cream: #faf3e4;
    --ink: #3a3429;
    --muted: #8a7d6b;
    --rose: #c4787a;
    --teal: #5a9e8c;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    color: var(--ink);
    background: var(--cream);
    overflow-x: hidden;
}

/* ============================================
   Navigation
   ============================================ */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 1.5rem 2rem;
    background: rgba(250, 243, 228, 0.85);
    backdrop-filter: blur(8px);
    transition: background 0.5s;
}

.nav-link {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--gold-primary);
}

/* ============================================
   Hero: The Conservatory
   ============================================ */
#hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--cream);
}

#hero-wash {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200vmax;
    height: 200vmax;
    transform: translate(-50%, -50%) scale(0.1);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(197, 160, 68, 0.15) 0%, rgba(250, 243, 228, 0.8) 50%, var(--parchment) 100%);
    opacity: 0;
    animation: washExpand 1.2s 0.2s ease-out forwards;
}

@keyframes washExpand {
    0% { transform: translate(-50%, -50%) scale(0.1); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

#hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

#hero-title-svg {
    width: clamp(300px, 60vw, 700px);
    height: auto;
    display: block;
    margin: 0 auto;
}

#title-clip-rect {
    animation: titleReveal 1.5s 0.8s ease-out forwards;
}

@keyframes titleReveal {
    0% { y: 100; }
    100% { y: 0; }
}

#hero-subtitle {
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--muted);
    letter-spacing: 0.06em;
    opacity: 0;
    animation: fadeIn 0.8s 1.8s ease-out forwards;
    margin-top: 1rem;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Bubbles */
#bubbles-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(232, 213, 160, 0.4), rgba(197, 160, 68, 0.1), transparent);
    box-shadow: inset 0 -4px 8px rgba(255, 255, 255, 0.3);
    animation: float var(--duration) var(--delay) infinite ease-in-out;
    opacity: 0;
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% { opacity: 0.7; }
    90% { opacity: 0.7; }
    100% {
        transform: translateY(calc(-100vh - 200px)) translateX(var(--drift));
        opacity: 0;
    }
}

/* ============================================
   Watercolor Transitions
   ============================================ */
.watercolor-transition {
    height: 100px;
    overflow: hidden;
    position: relative;
}

.watercolor-transition svg {
    display: block;
}

/* ============================================
   Collection: Badge Grid
   ============================================ */
#collection {
    background: var(--parchment);
    padding: 6rem 4rem;
    position: relative;
}

.section-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 3.5vw, 2.8rem);
    letter-spacing: 0.04em;
    color: var(--black-primary);
    text-align: center;
    margin-bottom: 4rem;
}

#badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: minmax(320px, auto);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Badge Cards */
.badge-card {
    background: linear-gradient(135deg, var(--parchment), var(--cream));
    border-radius: 4px;
    padding: 2rem;
    position: relative;
    opacity: 0;
    transform: translateY(60px) scale(0.9);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
    box-shadow: 4px 4px 20px rgba(196, 120, 122, 0.15), -3px 6px 25px rgba(90, 158, 140, 0.1);
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge-card.visible {
    animation: bounceIn 700ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: calc(var(--stagger-index) * 100ms);
}

@keyframes bounceIn {
    0% { opacity: 0; transform: translateY(60px) scale(0.9); }
    50% { opacity: 1; transform: translateY(-12px) scale(1.02); }
    75% { transform: translateY(4px) scale(0.99); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.badge-card:hover {
    transform: translateY(-6px);
    box-shadow: 6px 8px 30px rgba(196, 120, 122, 0.25), -4px 8px 35px rgba(90, 158, 140, 0.18);
    border-color: rgba(197, 160, 68, 0.3);
}

.badge-card:hover .gold-seal {
    animation: shimmer 2s ease infinite;
}

.badge-card:hover .badge-svg path,
.badge-card:hover .badge-svg circle,
.badge-card:hover .badge-svg ellipse {
    transition: stroke-dashoffset 0.8s ease;
}

.badge-card.wide {
    grid-column: span 2;
}

.badge-card.tall {
    grid-row: span 2;
}

/* Badge watercolor area */
.badge-watercolor {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.badge-svg {
    width: 100%;
    height: 100%;
    max-height: 280px;
}

.badge-card.wide .badge-svg {
    max-height: 160px;
}

/* Gold seal */
.gold-seal {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c5a044, #e8d5a0, #c5a044, #8a6f2a);
    background-size: 200% 200%;
    box-shadow: 0 2px 6px rgba(197, 160, 68, 0.4);
}

.gold-seal-ribbon {
    width: 50px;
    height: 30px;
    border-radius: 3px;
}

@keyframes shimmer {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

/* Badge text */
.badge-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 1.3rem;
    letter-spacing: 0.04em;
    color: var(--black-primary);
    margin-top: 1.2rem;
    text-align: center;
}

.badge-caption {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(0.8rem, 1.4vw, 1rem);
    line-height: 1.5;
    color: var(--muted);
    margin-top: 0.5rem;
    text-align: center;
}

.badge-date {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* Gold speckles on cards */
.badge-card::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gold-primary);
    opacity: 0.4;
    top: calc(15% + var(--stagger-index) * 7%);
    left: calc(10% + var(--stagger-index) * 12%);
    box-shadow:
        20px 30px 0 0 rgba(197, 160, 68, 0.3),
        60px 10px 0 1px rgba(197, 160, 68, 0.2),
        80px 50px 0 0 rgba(197, 160, 68, 0.35),
        30px 70px 0 1px rgba(197, 160, 68, 0.25);
}

/* ============================================
   About: The Gilding Workshop
   ============================================ */
#about {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--cream);
    position: relative;
    overflow: hidden;
}

#about-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    position: relative;
}

#about-left::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: var(--gold-light);
    clip-path: polygon(0 0, 100% 2%, 100% 15%, 0 18%, 100% 22%, 0 30%, 100% 35%, 0 42%, 100% 48%, 0 55%, 100% 60%, 0 68%, 100% 72%, 0 80%, 100% 85%, 0 92%, 100% 95%, 0 100%);
}

#rotating-badge {
    width: 300px;
    height: 300px;
    animation: gentleRotate 60s linear infinite;
    perspective: 600px;
}

@keyframes gentleRotate {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.large-badge {
    width: 100%;
    height: 100%;
}

.gold-circle-accent,
.gold-star-accent {
    animation: shimmer 4s ease infinite;
}

#about-right {
    flex: 1;
    padding: 4rem;
    max-width: 600px;
}

.about-text {
    color: var(--ink);
    margin-bottom: 1.5rem;
}

.accent-text {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--gold-dark);
    line-height: 1.6;
}

/* ============================================
   Footer: The Bubble Garden
   ============================================ */
#footer {
    position: relative;
    min-height: 60vh;
    background: var(--black-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 6rem 2rem;
}

#footer-bubbles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.footer-bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(232, 213, 160, 0.25), rgba(197, 160, 68, 0.08), transparent);
    box-shadow: inset 0 -4px 12px rgba(255, 255, 255, 0.15);
    animation: floatUp var(--duration) var(--delay) infinite ease-in-out;
    opacity: 0;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }
    10% { opacity: 0.6; }
    85% { opacity: 0.6; transform: translateY(calc(-60vh)) translateX(var(--drift)) scale(1); }
    100% {
        transform: translateY(calc(-70vh)) translateX(var(--drift)) scale(1.2);
        opacity: 0;
    }
}

#footer-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.footer-heading {
    color: var(--gold-primary);
}

.footer-text {
    color: #d4c9b5;
    max-width: 500px;
    margin: 1.5rem auto;
}

.footer-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.footer-links a {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold-light);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--teal);
}

.footer-colophon {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 3rem;
}

/* ============================================
   Mobile
   ============================================ */
@media (max-width: 768px) {
    #main-nav {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 1rem;
    }

    #collection {
        padding: 4rem 1.5rem;
    }

    #badge-grid {
        grid-template-columns: 1fr;
    }

    .badge-card.wide {
        grid-column: span 1;
    }

    .badge-card.tall {
        grid-row: span 1;
    }

    #about {
        flex-direction: column;
    }

    #about-left {
        padding: 3rem 2rem;
    }

    #about-left::after {
        display: none;
    }

    #about-right {
        padding: 2rem;
    }

    #rotating-badge {
        width: 200px;
        height: 200px;
    }

    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}
