/* ═══════════════════════════════════════════════════════════════
   THE COUNCIL - ANIMATED BACKGROUND
   Japanese Ink Wash × Linkin Park Intensity
   No humans. Pure art. Three souls converging.
   ═══════════════════════════════════════════════════════════════ */

/* Container for the entire animated background */
.art-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: 
        url('../images/backgrounds/convergence-flames.png') center center / cover no-repeat,
        #0a0a0a;
    pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────
   INK WASH LAYER - Flowing sumi-e streams
   ───────────────────────────────────────────────────────────────── */
.ink-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.6;
}

.ink-stream {
    position: absolute;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse 80% 40% at 20% 30%, rgba(30, 30, 35, 0.8) 0%, transparent 50%),
        radial-gradient(ellipse 60% 50% at 70% 60%, rgba(25, 25, 30, 0.7) 0%, transparent 45%),
        radial-gradient(ellipse 90% 30% at 50% 80%, rgba(20, 20, 25, 0.9) 0%, transparent 40%);
    animation: ink-flow 25s ease-in-out infinite;
    transform-origin: center center;
}

.ink-stream-2 {
    background: 
        radial-gradient(ellipse 70% 60% at 80% 20%, rgba(35, 30, 40, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse 50% 70% at 30% 70%, rgba(30, 25, 35, 0.5) 0%, transparent 45%);
    animation: ink-flow-reverse 30s ease-in-out infinite;
    animation-delay: -10s;
}

@keyframes ink-flow {
    0%, 100% { transform: translate(-10%, -10%) rotate(0deg) scale(1); }
    25% { transform: translate(5%, -5%) rotate(3deg) scale(1.05); }
    50% { transform: translate(-5%, 5%) rotate(-2deg) scale(0.98); }
    75% { transform: translate(10%, 0%) rotate(2deg) scale(1.02); }
}

@keyframes ink-flow-reverse {
    0%, 100% { transform: translate(5%, 5%) rotate(0deg) scale(1.02); }
    33% { transform: translate(-10%, 0%) rotate(-3deg) scale(0.97); }
    66% { transform: translate(0%, -10%) rotate(2deg) scale(1.04); }
}

/* ─────────────────────────────────────────────────────────────────
   SMOKE/MIST LAYER - Breathing atmosphere
   ───────────────────────────────────────────────────────────────── */
.smoke-layer {
    position: absolute;
    width: 100%;
    height: 100%;
}

.smoke-wisp {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0;
    animation: smoke-rise 20s ease-in-out infinite;
}

/* Cassie's Steam - Cool blue-gray, eastern flow */
.smoke-wisp.cassie {
    background: radial-gradient(circle, rgba(120, 140, 160, 0.4) 0%, transparent 70%);
    width: 300px;
    height: 400px;
    left: 10%;
    bottom: -100px;
    animation-delay: 0s;
}

.smoke-wisp.cassie-2 {
    background: radial-gradient(circle, rgba(100, 130, 150, 0.3) 0%, transparent 70%);
    width: 250px;
    height: 350px;
    left: 5%;
    bottom: -80px;
    animation-delay: -7s;
    animation-duration: 25s;
}

/* Steve's Fire - Warm amber, intense pulse */
.smoke-wisp.steve {
    background: radial-gradient(circle, rgba(180, 120, 60, 0.35) 0%, rgba(140, 80, 40, 0.2) 40%, transparent 70%);
    width: 280px;
    height: 380px;
    right: 15%;
    bottom: -100px;
    animation-delay: -5s;
}

.smoke-wisp.steve-2 {
    background: radial-gradient(circle, rgba(200, 140, 70, 0.25) 0%, transparent 70%);
    width: 220px;
    height: 300px;
    right: 20%;
    bottom: -60px;
    animation-delay: -12s;
    animation-duration: 22s;
}

/* Sarah's Earth - Deep terracotta, grounded warmth */
.smoke-wisp.sarah {
    background: radial-gradient(circle, rgba(160, 90, 70, 0.3) 0%, rgba(130, 70, 50, 0.15) 50%, transparent 70%);
    width: 320px;
    height: 420px;
    left: 45%;
    bottom: -120px;
    transform: translateX(-50%);
    animation-delay: -3s;
}

.smoke-wisp.sarah-2 {
    background: radial-gradient(circle, rgba(140, 80, 60, 0.25) 0%, transparent 70%);
    width: 200px;
    height: 280px;
    left: 50%;
    bottom: -50px;
    animation-delay: -15s;
    animation-duration: 28s;
}

@keyframes smoke-rise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-120vh) scale(1.8);
        opacity: 0;
    }
}

/* ─────────────────────────────────────────────────────────────────
   GOLD ACCENT LAYER - Energy veins
   ───────────────────────────────────────────────────────────────── */
.gold-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.15;
}

.gold-vein {
    position: absolute;
    background: linear-gradient(90deg, transparent 0%, rgba(201, 169, 89, 0.4) 50%, transparent 100%);
    height: 1px;
    animation: vein-pulse 8s ease-in-out infinite;
}

.gold-vein:nth-child(1) {
    width: 30%;
    top: 20%;
    left: 10%;
    transform: rotate(-5deg);
    animation-delay: 0s;
}

.gold-vein:nth-child(2) {
    width: 25%;
    top: 45%;
    right: 15%;
    transform: rotate(8deg);
    animation-delay: -2s;
}

.gold-vein:nth-child(3) {
    width: 35%;
    top: 70%;
    left: 20%;
    transform: rotate(-3deg);
    animation-delay: -4s;
}

.gold-vein:nth-child(4) {
    width: 20%;
    top: 85%;
    right: 25%;
    transform: rotate(12deg);
    animation-delay: -6s;
}

@keyframes vein-pulse {
    0%, 100% { opacity: 0.1; transform: scaleX(0.8) translateX(-10%); }
    50% { opacity: 0.5; transform: scaleX(1.2) translateX(10%); }
}

/* ─────────────────────────────────────────────────────────────────
   PARTICLE LAYER - Floating embers/dust
   ───────────────────────────────────────────────────────────────── */
.particle-layer {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    opacity: 0;
    animation: particle-float 15s ease-in-out infinite;
}

/* Gold particles */
.particle.gold {
    background: rgba(201, 169, 89, 0.8);
    box-shadow: 0 0 6px rgba(201, 169, 89, 0.5);
}

/* Ember particles */
.particle.ember {
    background: rgba(200, 100, 50, 0.7);
    box-shadow: 0 0 4px rgba(200, 100, 50, 0.4);
}

/* Ash particles */
.particle.ash {
    background: rgba(150, 150, 160, 0.5);
    width: 2px;
    height: 2px;
}

/* Distribute particles */
.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 25%; animation-delay: -3s; }
.particle:nth-child(3) { left: 40%; animation-delay: -6s; }
.particle:nth-child(4) { left: 55%; animation-delay: -9s; }
.particle:nth-child(5) { left: 70%; animation-delay: -12s; }
.particle:nth-child(6) { left: 85%; animation-delay: -2s; }
.particle:nth-child(7) { left: 15%; animation-delay: -5s; }
.particle:nth-child(8) { left: 35%; animation-delay: -8s; }
.particle:nth-child(9) { left: 60%; animation-delay: -11s; }
.particle:nth-child(10) { left: 80%; animation-delay: -4s; }
.particle:nth-child(11) { left: 5%; animation-delay: -7s; }
.particle:nth-child(12) { left: 95%; animation-delay: -10s; }

@keyframes particle-float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 0.8;
    }
    95% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-20vh) rotate(360deg);
        opacity: 0;
    }
}

/* ─────────────────────────────────────────────────────────────────
   BRUSH STROKE LAYER - Sumi-e accent strokes
   ───────────────────────────────────────────────────────────────── */
.brush-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.08;
}

.brush-stroke {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(201, 169, 89, 0.6) 20%, 
        rgba(201, 169, 89, 0.8) 50%, 
        rgba(201, 169, 89, 0.6) 80%, 
        transparent 100%
    );
    transform-origin: left center;
    animation: brush-draw 12s ease-out infinite;
}

.brush-stroke:nth-child(1) {
    width: 40%;
    top: 15%;
    left: 5%;
    transform: rotate(-8deg);
    animation-delay: 0s;
}

.brush-stroke:nth-child(2) {
    width: 30%;
    top: 35%;
    right: 10%;
    left: auto;
    transform: rotate(5deg);
    transform-origin: right center;
    animation-delay: -4s;
}

.brush-stroke:nth-child(3) {
    width: 50%;
    top: 60%;
    left: 15%;
    transform: rotate(-2deg);
    animation-delay: -8s;
}

@keyframes brush-draw {
    0%, 100% {
        clip-path: inset(0 100% 0 0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
    60% {
        opacity: 1;
    }
    90% {
        clip-path: inset(0 0 0 100%);
        opacity: 0.5;
    }
}

/* ─────────────────────────────────────────────────────────────────
   DRAGON ESSENCE - Subtle mythic energy (🐉)
   ───────────────────────────────────────────────────────────────── */
.dragon-essence {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.04;
    background: 
        radial-gradient(ellipse 100% 50% at 50% 100%, rgba(201, 169, 89, 0.3) 0%, transparent 50%);
    animation: dragon-breathe 10s ease-in-out infinite;
}

@keyframes dragon-breathe {
    0%, 100% { 
        opacity: 0.02; 
        transform: scale(1) translateY(0);
    }
    50% { 
        opacity: 0.06; 
        transform: scale(1.1) translateY(-5%);
    }
}

/* ─────────────────────────────────────────────────────────────────
   CONVERGENCE POINT - Where three become one
   ───────────────────────────────────────────────────────────────── */
.convergence {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    opacity: 0.1;
    pointer-events: none;
}

.convergence-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid;
    animation: converge-pulse 6s ease-in-out infinite;
}

.convergence-ring:nth-child(1) {
    width: 200px;
    height: 200px;
    border-color: rgba(120, 140, 160, 0.3); /* Cassie - blue-gray */
    animation-delay: 0s;
}

.convergence-ring:nth-child(2) {
    width: 300px;
    height: 300px;
    border-color: rgba(160, 90, 70, 0.3); /* Sarah - terracotta */
    animation-delay: -2s;
}

.convergence-ring:nth-child(3) {
    width: 400px;
    height: 400px;
    border-color: rgba(180, 120, 60, 0.3); /* Steve - amber */
    animation-delay: -4s;
}

@keyframes converge-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.6;
    }
}

/* ─────────────────────────────────────────────────────────────────
   NOISE TEXTURE OVERLAY - Grain for depth
   ───────────────────────────────────────────────────────────────── */
.noise-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────
   VIGNETTE - Frame the darkness
   ───────────────────────────────────────────────────────────────── */
.vignette {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.6) 100%);
    pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────
   RESPONSIVE - Scale for different screens
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .smoke-wisp {
        filter: blur(40px);
    }
    
    .convergence {
        width: 300px;
        height: 300px;
    }
    
    .convergence-ring:nth-child(1) { width: 100px; height: 100px; }
    .convergence-ring:nth-child(2) { width: 150px; height: 150px; }
    .convergence-ring:nth-child(3) { width: 200px; height: 200px; }
}

/* ─────────────────────────────────────────────────────────────────
   REDUCED MOTION - Respect accessibility
   ───────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .ink-stream,
    .smoke-wisp,
    .gold-vein,
    .particle,
    .brush-stroke,
    .dragon-essence,
    .convergence-ring {
        animation: none;
        opacity: 0.3;
    }
}
