/* ===== KarmaBadge — Graffiti-Mystic Dreamscape ===== */
/* Compliance notes: Space Grotesk" (Google Fonts (500); IBM Plex Mono" (Google Fonts (300). Interactions:** Interactions: Interactions Interactionss IntersectionObserver` is used instead of scroll event listeners to trigger entrance animations as elements scroll into view. Badge cards start with `opacity: 0 before reveal. IntersectionObserver`: karma wheel. */

:root {
    --bg-primary: #0d0d12;
    --bg-card: #12121a;
    --aurora-green: #6ee7b7;
    --aurora-teal: #22d3ee;
    --aurora-magenta: #c084fc;
    --aurora-violet: #818cf8;
    --text-primary: #e8ecf2;
    --text-secondary: #8b92a5;
    --text-body: #c4c9d4;
    --spray-gold: #fbbf24;
    --glow-haze: rgba(110, 231, 183, 0.12);
    --aurora-gradient: linear-gradient(135deg, #6ee7b7 0%, #22d3ee 25%, #818cf8 50%, #c084fc 75%, #6ee7b7 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-weight: 400;
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    overflow-x: hidden;
    line-height: 1.7;
    font-size: clamp(0.875rem, 1.2vw, 1.05rem);
    letter-spacing: 0.04em;
    background-image:
        radial-gradient(circle at 18% 12%, rgba(110, 231, 183, 0.10), transparent 28vw),
        radial-gradient(circle at 86% 28%, rgba(192, 132, 252, 0.10), transparent 30vw),
        radial-gradient(circle at 50% 72%, rgba(34, 211, 238, 0.07), transparent 36vw),
        linear-gradient(180deg, #0d0d12 0%, #0b0b10 52%, #0d0d12 100%);
}

/* Noise texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ===== Cultural Watermarks ===== */
.watermark {
    position: fixed;
    font-family: 'Noto Sans Devanagari', sans-serif;
    font-weight: 400;
    opacity: 0.04;
    background: var(--aurora-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    pointer-events: none;
    z-index: 0;
    user-select: none;
}

.watermark-1 {
    font-size: 30vw;
    top: 10%;
    left: -5%;
    animation: watermark-drift-1 60s ease-in-out infinite alternate;
}

.watermark-2 {
    font-size: 25vw;
    top: 40%;
    right: -5%;
    animation: watermark-drift-2 55s ease-in-out infinite alternate;
}

.watermark-3 {
    font-size: 20vw;
    bottom: 5%;
    left: 20%;
    animation: watermark-drift-3 65s ease-in-out infinite alternate;
}

.spray-tag {
    position: fixed;
    z-index: 0;
    pointer-events: none;
    font-family: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: clamp(0.75rem, 1.2vw, 1rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(232, 236, 242, 0.09);
    border: 1px dashed rgba(110, 231, 183, 0.13);
    padding: 0.7rem 1rem;
    transform: rotate(-8deg);
    filter: blur(0.2px);
}

.tag-one {
    top: 22vh;
    right: 7vw;
}

.tag-two {
    left: 5vw;
    bottom: 16vh;
    transform: rotate(6deg);
    color: rgba(251, 191, 36, 0.10);
}

@keyframes watermark-drift-1 {
    from { transform: translateY(0); }
    to { transform: translateY(-80px); }
}

@keyframes watermark-drift-2 {
    from { transform: translateY(0); }
    to { transform: translateY(60px); }
}

@keyframes watermark-drift-3 {
    from { transform: translateY(0); }
    to { transform: translateY(-50px); }
}

/* ===== Particles ===== */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

#particles .particle {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
}

/* ===== Entrance Mural ===== */
.entrance-mural {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    overflow: hidden;
}

.entrance-mural::before,
.entrance-mural::after {
    content: '';
    position: absolute;
    top: 0;
    width: 1px;
    height: 22vh;
    opacity: 0.38;
}

.entrance-mural::before {
    left: 18vw;
    background: linear-gradient(to bottom, #c084fc, transparent);
}

.entrance-mural::after {
    right: 24vw;
    height: 16vh;
    background: linear-gradient(to bottom, #6ee7b7, transparent);
}

.paint-halo {
    position: absolute;
    width: 42vw;
    height: 42vw;
    border-radius: 50%;
    filter: blur(46px);
    opacity: 0.18;
    mix-blend-mode: screen;
}

.paint-halo-left {
    left: -16vw;
    top: 18vh;
    background: #22d3ee;
}

.paint-halo-right {
    right: -14vw;
    bottom: 6vh;
    background: #c084fc;
}

.hero-title {
    position: relative;
    font-family: 'Space Grotesk', Impact, 'Arial Black', system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 0.95;
    color: transparent;
    -webkit-text-stroke: 1px rgba(110, 231, 183, 0.6);
    background: var(--aurora-gradient);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: aurora-flow 8s ease infinite;
    filter: drop-shadow(0 0 22px rgba(110, 231, 183, 0.18));
}

.hero-title::before,
.hero-title::after {
    content: 'KarmaBadge';
    position: absolute;
    inset: 0;
    pointer-events: none;
    -webkit-text-stroke: 1px rgba(251, 191, 36, 0.24);
    color: transparent;
    transform: translate(0.035em, 0.035em);
    opacity: 0.45;
}

.hero-title::after {
    -webkit-text-stroke-color: rgba(192, 132, 252, 0.24);
    transform: translate(-0.03em, -0.025em);
    opacity: 0.32;
}

.hero-subtitle {
    font-family: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 1vw, 0.9rem);
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    margin-top: 1.5rem;
    text-transform: uppercase;
}

/* Hero Mandala */
.hero-mandala {
    position: absolute;
    bottom: 15vh;
    width: 120px;
    height: 120px;
}

.mandala-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid;
    top: 50%;
    left: 50%;
}

.mandala-ring-outer {
    width: 120px;
    height: 120px;
    margin: -60px 0 0 -60px;
    border-color: rgba(110, 231, 183, 0.3);
    animation: mandala-spin 120s linear infinite;
}

.mandala-ring-mid {
    width: 80px;
    height: 80px;
    margin: -40px 0 0 -40px;
    border-color: rgba(34, 211, 238, 0.3);
    animation: mandala-spin 80s linear infinite reverse;
}

.mandala-ring-inner {
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border-color: rgba(192, 132, 252, 0.3);
    animation: mandala-spin 45s linear infinite;
}

.mandala-spokes {
    position: absolute;
    width: 120px;
    height: 120px;
    top: 50%;
    left: 50%;
    margin: -60px 0 0 -60px;
    animation: mandala-spin 120s linear infinite;
}

.spoke {
    position: absolute;
    width: 1px;
    height: 100%;
    left: 50%;
    top: 0;
    background: linear-gradient(to bottom, rgba(110, 231, 183, 0.3), transparent 40%, transparent 60%, rgba(110, 231, 183, 0.3));
}

.spoke:nth-child(1) { transform: rotate(0deg); }
.spoke:nth-child(2) { transform: rotate(22.5deg); }
.spoke:nth-child(3) { transform: rotate(45deg); }
.spoke:nth-child(4) { transform: rotate(67.5deg); }
.spoke:nth-child(5) { transform: rotate(90deg); }
.spoke:nth-child(6) { transform: rotate(112.5deg); }
.spoke:nth-child(7) { transform: rotate(135deg); }
.spoke:nth-child(8) { transform: rotate(157.5deg); }

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 5vh;
    animation: pulse-fade 2s ease-in-out infinite;
}

@keyframes pulse-fade {
    0%, 100% { opacity: 0.2; transform: translateY(0); }
    50% { opacity: 0.8; transform: translateY(8px); }
}

/* ===== Aurora Animations ===== */
@keyframes aurora-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes mandala-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== Badge Wall ===== */
.badge-wall {
    position: relative;
    z-index: 1;
    padding: 8vh 4vw;
    min-height: 210vh;
}

.section-heading {
    font-family: 'Space Grotesk', Impact, 'Arial Black', system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 0.95;
    color: var(--text-primary);
    margin-bottom: 6vh;
    text-align: center;
}

.wall-fragment {
    max-width: 680px;
    margin: -3vh auto 7vh;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 300;
    font-size: clamp(0.78rem, 1.15vw, 1rem);
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Badge Cards */
.badge-card {
    transform: translateY(30px) rotate(var(--card-rotation, 0deg));
    opacity: 0;
    transition: opacity 0s;
    position: relative;
    border-radius: 4px;
    padding: 2px;
    background: var(--aurora-gradient);
    background-size: 400% 400%;
    animation: aurora-flow 8s ease infinite;
}

.badge-card:nth-child(3n) { margin-top: -18px; }
.badge-card:nth-child(4n) { margin-left: -14px; }
.badge-card:nth-child(5n) { margin-right: -18px; }

.badge-card.revealed {
    opacity: 1;
    transform: rotate(var(--card-rotation, 0deg));
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.badge-card:hover {
    transform: translateY(-8px) rotate(0deg);
    box-shadow: 0 12px 40px rgba(110, 231, 183, 0.15), 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: aurora-flow 4s ease infinite;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-inner {
    background: var(--bg-card);
    border-radius: 3px;
    padding: 24px;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.card-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 22% 18%, rgba(110, 231, 183, 0.10), transparent 35%),
        linear-gradient(120deg, transparent 0 42%, rgba(232, 236, 242, 0.025) 43% 44%, transparent 45%);
    pointer-events: none;
}

.badge-icon {
    position: relative;
    z-index: 1;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.badge-icon svg {
    animation: mandala-spin 45s linear infinite;
}

.badge-card:hover .badge-icon svg {
    animation-duration: 10s;
}

.badge-title {
    position: relative;
    z-index: 1;
    font-family: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    letter-spacing: 0.12em;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.badge-desc {
    position: relative;
    z-index: 1;
    font-family: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    line-height: 1.7;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.karma-constellation {
    position: relative;
    z-index: 1;
    opacity: 0.7;
}

/* Drip Lines between sections */
.badge-wall::after {
    content: '';
    display: block;
    margin: 8vh auto 0;
    width: 1px;
    height: 100px;
    background: linear-gradient(to bottom, var(--aurora-green), transparent);
    opacity: 0.4;
}

/* ===== Meditation Corridor ===== */
.meditation-corridor {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, var(--bg-primary), #0a2a1f);
}

.corridor-mandala {
    margin-bottom: 4rem;
}

.corridor-mandala svg {
    opacity: 0.6;
}

.mandala-layer-1 { animation: mandala-spin 120s linear infinite; transform-origin: 150px 150px; }
.mandala-layer-2 { animation: mandala-spin 80s linear infinite reverse; transform-origin: 150px 150px; }
.mandala-layer-3 { animation: mandala-spin 45s linear infinite; transform-origin: 150px 150px; }
.mandala-layer-4 { animation: mandala-spin 30s linear infinite reverse; transform-origin: 150px 150px; }

.corridor-text {
    font-family: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.4rem);
    line-height: 2;
    text-align: center;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

.corridor-text.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Drip decoration before corridor */
.meditation-corridor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 30%;
    width: 1px;
    height: 80px;
    background: linear-gradient(to bottom, var(--aurora-teal), transparent);
    opacity: 0.3;
}

.meditation-corridor::after {
    content: '';
    position: absolute;
    top: 0;
    right: 25%;
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--aurora-magenta), transparent);
    opacity: 0.3;
}

/* ===== Karma Cycle ===== */
.karma-cycle {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #0a2a1f, var(--bg-primary));
}

.karma-wheel-container {
    position: relative;
    width: 500px;
    height: 500px;
    max-width: 90vw;
    max-height: 90vw;
}

.karma-wheel-svg {
    width: 100%;
    height: 100%;
}

.karma-path {
    stroke-dasharray: 1260;
    stroke-dashoffset: 1260;
    transition: stroke-dashoffset 3s cubic-bezier(0.65, 0, 0.35, 1);
}

.karma-path.visible {
    stroke-dashoffset: 0;
}

.karma-path-inner {
    stroke-dasharray: 1005;
    stroke-dashoffset: 1005;
    transition: stroke-dashoffset 3.5s cubic-bezier(0.65, 0, 0.35, 1) 0.5s;
}

.karma-path-inner.visible {
    stroke-dashoffset: 0;
}

.karma-path-inner-2 {
    stroke-dasharray: 754;
    stroke-dashoffset: 754;
    transition: stroke-dashoffset 4s cubic-bezier(0.65, 0, 0.35, 1) 1s;
}

.karma-path-inner-2.visible {
    stroke-dashoffset: 0;
}

.karma-text-lines {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 80%;
}

.karma-line {
    font-family: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    margin-bottom: 0.6em;
    line-height: 1.6;
}

.karma-line.visible {
    opacity: 1;
    transform: translateY(0);
}

.karma-line:last-child {
    font-family: 'Noto Sans Devanagari', 'IBM Plex Mono', 'SFMono-Regular', Consolas, sans-serif;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--aurora-green);
    margin-top: 0.5em;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .badge-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .badge-card {
        grid-column: auto !important;
        grid-row: auto !important;
        margin: 0 !important;
    }

    .karma-wheel-container {
        width: 300px;
        height: 300px;
    }

    .corridor-mandala svg {
        width: 200px;
        height: 200px;
    }
}
