/* ============================================
   mybadge.page - Pastoral Credential Garden
   ============================================ */
:root {
    --lavender-glass: #E8E0F0;
    --mint-veil: #D4EDE8;
    --slate-dew: #A8B8D0;
    --petal-blush: #E8A0B0;
    --meadow-sage: #7EB8A0;
    --graphite-mist: #3A3F50;
    --cloud-iron: #6B7280;
    --surface-glass: rgba(255, 255, 255, 0.35);
    --warm-grain: #F5F0F0;
    --soft-gold: #E8D090;
    --blue-haze: #8899AA;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    background: linear-gradient(165deg, var(--lavender-glass) 0%, var(--mint-veil) 55%, #C8D4E0 100%);
    color: var(--graphite-mist);
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.65;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Noise Background --- */
.noise-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.35;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* --- Grid-Line Overlay --- */
.grid-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 1;
    animation: gridBreathe 12s ease-in-out infinite;
}
@keyframes gridBreathe {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1.2; }
}

/* --- Meadow Header --- */
.meadow-header {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding: clamp(2rem, 4vw, 4rem);
}
.meadow-content {
    text-align: center;
    position: relative;
}
.hero-badge {
    margin: 0 auto 2rem;
    width: 120px;
    height: 120px;
    position: relative;
}
.hero-badge__inner {
    width: 100%;
    height: 100%;
    position: relative;
    animation: badgeFloat 8s ease-in-out infinite;
}
@keyframes badgeFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(2deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(-6px) rotate(-2deg); }
}
.hero-badge__hex {
    width: 100%;
    height: 100%;
    background: var(--surface-glass);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transform: rotate(15deg);
}
.hero-badge__glow {
    position: absolute;
    inset: -10px;
    border-radius: 40px;
    background: radial-gradient(circle, var(--soft-gold) 0%, transparent 70%);
    opacity: 0.15;
    animation: glowPulse 4s ease-in-out infinite;
}
@keyframes glowPulse {
    0%, 100% { opacity: 0.1; transform: scale(1); }
    50% { opacity: 0.2; transform: scale(1.05); }
}

.meadow-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(2.4rem, 5.5vw, 4.8rem);
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--graphite-mist);
    margin-bottom: 1rem;
}
.meadow-sub {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: var(--cloud-iron);
    max-width: 400px;
    margin: 0 auto;
}

/* Botanical accents */
.botanical {
    position: absolute;
    pointer-events: none;
}
.botanical--header {
    bottom: 15%;
    right: 10%;
}
.botanical--cell {
    position: absolute;
    bottom: 12px;
    right: 12px;
}

/* --- Bento Grid --- */
.badge-garden {
    position: relative;
    z-index: 2;
    padding: clamp(1rem, 3vw, 2rem);
    max-width: 1200px;
    margin: 0 auto;
}
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(16px, 3vw, 32px);
}
.bento-cell {
    background: var(--surface-glass);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border-radius: clamp(20px, 4vw, 40px);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-bottom-color: rgba(255, 255, 255, 0.2);
    border-right-color: rgba(255, 255, 255, 0.2);
    box-shadow:
        0 2px 8px rgba(58, 63, 80, 0.04),
        0 8px 24px rgba(58, 63, 80, 0.06),
        0 20px 60px rgba(168, 184, 208, 0.08);
    position: relative;
    overflow: hidden;
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 400ms ease;
}
.bento-cell:hover {
    transform: scale(1.02);
    box-shadow:
        0 4px 12px rgba(58, 63, 80, 0.06),
        0 12px 32px rgba(58, 63, 80, 0.08),
        0 28px 80px rgba(168, 184, 208, 0.12);
}
.bento-cell--wide {
    grid-column: span 2;
}
.bento-cell--tall {
    grid-row: span 2;
}

.badge-category {
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--meadow-sage);
    display: block;
    margin-bottom: 0.5rem;
}
.badge-name {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--graphite-mist);
    margin-bottom: 0.75rem;
}
.badge-desc {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
    line-height: 1.65;
    color: var(--cloud-iron);
    margin-bottom: 1rem;
}
.badge-meta {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--petal-blush);
}

/* --- Story Ribbon --- */
.story-ribbon {
    position: relative;
    z-index: 2;
    padding: clamp(3rem, 6vw, 6rem) clamp(1rem, 3vw, 2rem);
    max-width: 1200px;
    margin: 0 auto;
}
.ribbon-content {
    background: var(--surface-glass);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border-radius: clamp(20px, 4vw, 40px);
    padding: clamp(2rem, 4vw, 4rem);
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    gap: clamp(2rem, 4vw, 4rem);
    align-items: center;
    box-shadow:
        0 2px 8px rgba(58, 63, 80, 0.04),
        0 8px 24px rgba(58, 63, 80, 0.06);
}

/* Seed-to-bloom CSS animation */
.seed-to-bloom {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}
.seed {
    width: 12px;
    height: 12px;
    background: var(--petal-blush);
    border-radius: 50%;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}
.sprout {
    width: 2px;
    height: 40px;
    background: var(--meadow-sage);
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 1px;
}
.bloom {
    width: 30px;
    height: 30px;
    background: var(--soft-gold);
    border-radius: 50%;
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.7;
}

.ribbon-heading {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 2.5vw, 2.4rem);
    line-height: 1.3;
    color: var(--graphite-mist);
    margin-bottom: 1rem;
}
.ribbon-body {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    color: var(--cloud-iron);
}

/* --- Micro Grid --- */
.credential-landscape {
    position: relative;
    z-index: 2;
    padding: clamp(2rem, 4vw, 4rem) clamp(1rem, 3vw, 2rem);
    max-width: 1000px;
    margin: 0 auto;
}
.micro-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(12px, 2vw, 20px);
}
.micro-cell {
    background: var(--surface-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    border: 1px dotted rgba(136, 153, 170, 0.4);
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.micro-cell:hover {
    transform: scale(1.03);
}
.micro-badge {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    margin: 0 auto 0.75rem;
}
.micro-badge--blush { background: var(--petal-blush); }
.micro-badge--sage { background: var(--meadow-sage); }
.micro-badge--gold { background: var(--soft-gold); }
.micro-name {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--graphite-mist);
}

/* --- Mist Layer --- */
.mist-layer {
    position: relative;
    z-index: 2;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(3rem, 6vw, 6rem);
    overflow: hidden;
}
.fog-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.fog-dot {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    filter: blur(20px);
    will-change: transform;
}
.mist-quote {
    max-width: 600px;
    text-align: center;
    position: relative;
    z-index: 1;
}
.mist-quote__text {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    line-height: 1.5;
    color: var(--graphite-mist);
    font-style: italic;
}

/* --- Root Footer --- */
.root-footer {
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg, transparent 0%, #C8D4E0 30%, var(--slate-dew) 100%);
    padding: clamp(3rem, 6vw, 6rem) clamp(1rem, 3vw, 2rem);
}
.footer-bento {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(12px, 2vw, 20px);
}
.footer-cell {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 1.5rem;
}
.footer-label {
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--meadow-sage);
    display: block;
    margin-bottom: 0.5rem;
}
.footer-text {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--graphite-mist);
}
.handwritten-note {
    font-family: 'Caveat', cursive;
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--petal-blush);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* --- Reveal Animation --- */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
    transition: opacity 700ms cubic-bezier(0.34, 1.56, 0.64, 1), transform 700ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
[data-reveal].visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
    .bento-cell--wide { grid-column: span 1; }
    .bento-cell--tall { grid-row: span 1; }
    .micro-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-bento { grid-template-columns: 1fr; }
    .ribbon-content { flex-direction: column; }
    .seed-to-bloom { width: 80px; height: 80px; }
}
@media (max-width: 480px) {
    .micro-grid { grid-template-columns: repeat(2, 1fr); }
}
