/* Winging AI v2 -- Visual Layer
   Particles, gradients, glows, sketch elements, depth, blend modes
   The stuff that makes it feel ALIVE
*/

/* ===== HERO CANVAS (particle network) ===== */
.hero-canvas-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

#hero-canvas {
    width: 100%;
    height: 100%;
    pointer-events: all;
}

.hero {
    position: relative;
}

.hero-left, .hero-right {
    position: relative;
    z-index: 2;
}

/* ===== AMBIENT GLOW MESHES ===== */
.glow-mesh {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    opacity: 0.4;
    z-index: 0;
}

.glow-amber {
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
}

.glow-violet {
    background: radial-gradient(circle, var(--violet-dim) 0%, transparent 70%);
}

.glow-teal {
    background: radial-gradient(circle, var(--teal-dim) 0%, transparent 70%);
}

/* Hero glows */
.hero .glow-mesh.g1 {
    width: 500px;
    height: 500px;
    top: 10%;
    left: -5%;
    background: radial-gradient(circle, rgba(232, 168, 48, 0.12) 0%, transparent 70%);
}

.hero .glow-mesh.g2 {
    width: 400px;
    height: 400px;
    bottom: 5%;
    right: 10%;
    background: radial-gradient(circle, rgba(147, 112, 219, 0.08) 0%, transparent 70%);
}

/* Story section glow */
.story {
    position: relative;
}

.story .glow-mesh {
    width: 600px;
    height: 600px;
    top: 30%;
    right: -20%;
    background: radial-gradient(circle, rgba(232, 168, 48, 0.06) 0%, transparent 70%);
}

/* System section glow */
.system {
    position: relative;
}

.system .glow-mesh {
    width: 800px;
    height: 800px;
    top: -10%;
    left: -15%;
    background: radial-gradient(circle, rgba(45, 212, 160, 0.05) 0%, transparent 70%);
}

/* ===== TERMINAL SCANLINES & GLOW ===== */
.terminal {
    position: relative;
}

.terminal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    pointer-events: none;
    border-radius: var(--radius-md);
    z-index: 1;
}

.terminal-body {
    position: relative;
    z-index: 2;
}

/* Terminal ambient glow */
.terminal-glow {
    position: absolute;
    bottom: -20px;
    left: 10%;
    right: 10%;
    height: 60px;
    background: radial-gradient(ellipse at center, rgba(232, 168, 48, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* ===== SVG SKETCH ANNOTATIONS ===== */
.sketch-annotation {
    position: absolute;
    pointer-events: none;
    z-index: 3;
}

/* SVG path draw animation */
.sketch-path path,
.sketch-path circle,
.sketch-path line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.5s ease;
}

.sketch-path.drawn path,
.sketch-path.drawn circle,
.sketch-path.drawn line {
    stroke-dashoffset: 0;
}

/* ===== AGENT CARD VISUAL EFFECTS ===== */
.sys-card {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Glow ring on hover */
.sys-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-md);
    background: linear-gradient(
        135deg,
        var(--agent-color, var(--accent)) 0%,
        transparent 50%,
        var(--agent-color, var(--accent)) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
    filter: blur(8px);
}

.sys-card:hover::after {
    opacity: 0.15;
}

/* ===== SECTION DIVIDERS (hand-drawn style) ===== */
.section-divider {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    overflow: visible;
}

.section-divider svg {
    width: 100%;
    height: 20px;
    overflow: visible;
}

.section-divider path {
    stroke: var(--border-hover);
    stroke-width: 1;
    fill: none;
    stroke-linecap: round;
}

/* ===== HERO HEADLINE EFFECTS ===== */
.hero h1 em {
    position: relative;
    font-style: normal;
    color: var(--accent);
}

/* Scribble underline on the accent word */
.hero h1 em::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: -4px;
    right: -4px;
    height: 12px;
    background: url("data:image/svg+xml,%3Csvg width='200' height='12' viewBox='0 0 200 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 8C20 2 40 10 60 5C80 0 100 10 120 4C140 -2 160 8 180 3C190 1 198 6 198 6' stroke='%23E8A830' stroke-width='2' stroke-linecap='round' opacity='0.3'/%3E%3C/svg%3E") no-repeat center;
    background-size: 100% 100%;
    pointer-events: none;
}

/* ===== STATS BAR VISUAL ===== */
.stat-item {
    position: relative;
    overflow: hidden;
}

.stat-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-item:hover::after {
    opacity: 1;
}

/* ===== POST CARD GRADIENT EDGE ===== */
.post-card.featured {
    position: relative;
    overflow: hidden;
}

.post-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--accent), var(--violet), var(--teal));
    opacity: 0.5;
}

/* ===== NEWSLETTER GENERATIVE BACKGROUND ===== */
.newsletter {
    position: relative;
    overflow: hidden;
}

.newsletter-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image:
        radial-gradient(circle at 20% 30%, var(--accent) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, var(--violet) 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, var(--text) 0.5px, transparent 0.5px);
    background-size: 60px 60px, 80px 80px, 40px 40px;
}

.newsletter-inner {
    position: relative;
    z-index: 2;
}

/* ===== BLOG FEATURED CARD VISUAL ===== */
.blog-featured-card {
    position: relative;
    overflow: hidden;
}

.blog-featured-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-dim) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.blog-featured-card > * {
    position: relative;
    z-index: 1;
}

/* ===== ABOUT PAGE VISUAL ===== */
.about-hero h1 {
    background: linear-gradient(135deg, var(--text) 0%, var(--text-2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== RESPONSIVE VISUAL ADJUSTMENTS ===== */
@media (max-width: 900px) {
    .hero .glow-mesh.g1 { width: 300px; height: 300px; }
    .hero .glow-mesh.g2 { display: none; }
    .hero-canvas-wrap { opacity: 0.5; }
}

@media (max-width: 640px) {
    .hero-canvas-wrap { display: none; }
    .terminal::after { display: none; }
    .sketch-annotation { display: none; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .hero-canvas-wrap { display: none; }
    .glow-mesh { display: none; }
    .sketch-path path,
    .sketch-path circle { transition: none; stroke-dashoffset: 0; }
    .sys-card { transition: none; }
    .terminal::after { display: none; }
}

/* ============================================================
   3D EFFECTS, FLOATING ELEMENTS, AND ILLUSTRATION CONTAINERS
   Added for Creative Offensive -- Visual Depth Layer
   ============================================================ */

/* ===== KEYFRAME ANIMATIONS ===== */

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes float-reverse {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(15px); }
}

@keyframes spin-slow {
    from { transform: rotateX(60deg) rotateZ(0deg); }
    to { transform: rotateX(60deg) rotateZ(360deg); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.3; }
}

@keyframes breathe {
    0%, 100% { transform: scale(0.98); }
    50% { transform: scale(1.02); }
}

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

/* ===== 1. 3D FLOATING GRADIENT ORBS ===== */

.float-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    width: 100px;
    height: 100px;
    filter: blur(40px);
    opacity: 0.18;
    animation: float 8s infinite ease-in-out;
    will-change: transform;
}

.float-orb.amber {
    background: radial-gradient(circle at 40% 40%, #E8A830, #E8A830aa, transparent 70%);
    width: 120px;
    height: 120px;
    opacity: 0.2;
    animation-duration: 7s;
}

.float-orb.violet {
    background: radial-gradient(circle at 40% 40%, #9370DB, #9370DBaa, transparent 70%);
    width: 90px;
    height: 90px;
    opacity: 0.17;
    animation-duration: 9s;
    animation-name: float-reverse;
}

.float-orb.teal {
    background: radial-gradient(circle at 40% 40%, #5BB8A6, #5BB8A6aa, transparent 70%);
    width: 80px;
    height: 80px;
    opacity: 0.15;
    animation-duration: 10s;
}

/* Pulse variant for extra ambient life */
.float-orb.pulse {
    animation: float 8s infinite ease-in-out, pulse-glow 5s infinite ease-in-out;
}

/* ===== 2. ISOMETRIC CARD ENHANCEMENT ===== */

.iso-card {
    transform: perspective(800px) rotateX(2deg) rotateY(-2deg);
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1),
                box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow:
        4px 8px 20px rgba(0, 0, 0, 0.25),
        1px 2px 6px rgba(0, 0, 0, 0.15);
    will-change: transform;
}

.iso-card:hover {
    transform: perspective(800px) rotateX(0deg) rotateY(0deg) scale(1.02);
    box-shadow:
        0px 12px 30px rgba(0, 0, 0, 0.3),
        0px 4px 10px rgba(0, 0, 0, 0.2);
}

/* ===== 3. 3D RING ELEMENTS ===== */

.ring-3d {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(232, 168, 48, 0.2);
    pointer-events: none;
    z-index: 0;
    animation: spin-slow 30s infinite linear;
    transform-style: preserve-3d;
    will-change: transform;
}

/* Sizes */
.ring-3d.small {
    width: 80px;
    height: 80px;
    border-width: 1.5px;
}

.ring-3d.medium {
    width: 150px;
    height: 150px;
    border-width: 2px;
    animation-duration: 25s;
}

.ring-3d.large {
    width: 250px;
    height: 250px;
    border-width: 2.5px;
    animation-duration: 35s;
    animation-direction: reverse;
}

/* Agent color variants */
.ring-3d.ivan {
    border-color: rgba(45, 212, 160, 0.18);
}

.ring-3d.beski {
    border-color: rgba(176, 124, 230, 0.18);
}

.ring-3d.arthur {
    border-color: rgba(90, 155, 230, 0.18);
}

.ring-3d.dafi {
    border-color: rgba(192, 132, 252, 0.18);
}

.ring-3d.luchi {
    border-color: rgba(230, 140, 58, 0.18);
}

.ring-3d.amber {
    border-color: rgba(232, 168, 48, 0.2);
}

.ring-3d.violet {
    border-color: rgba(147, 112, 219, 0.18);
}

.ring-3d.teal {
    border-color: rgba(91, 184, 166, 0.18);
}

/* ===== 4. GRADIENT MESH SECTION BACKGROUNDS ===== */

.gradient-mesh {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.gradient-mesh::before,
.gradient-mesh::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.gradient-mesh::before {
    width: 60%;
    height: 80%;
    top: -20%;
    left: -10%;
    background: radial-gradient(ellipse, rgba(232, 168, 48, 0.06) 0%, transparent 70%);
}

.gradient-mesh::after {
    width: 50%;
    height: 70%;
    bottom: -15%;
    right: -5%;
    background: radial-gradient(ellipse, rgba(147, 112, 219, 0.05) 0%, transparent 70%);
}

/* Color scheme variants */
.gradient-mesh.amber-violet::before {
    background: radial-gradient(ellipse, rgba(232, 168, 48, 0.07) 0%, transparent 70%);
}

.gradient-mesh.amber-violet::after {
    background: radial-gradient(ellipse, rgba(147, 112, 219, 0.05) 0%, transparent 70%);
}

.gradient-mesh.teal-violet::before {
    background: radial-gradient(ellipse, rgba(91, 184, 166, 0.06) 0%, transparent 70%);
}

.gradient-mesh.teal-violet::after {
    background: radial-gradient(ellipse, rgba(147, 112, 219, 0.04) 0%, transparent 70%);
}

.gradient-mesh.agent-mix::before {
    background: radial-gradient(ellipse, rgba(45, 212, 160, 0.05) 0%, transparent 70%);
}

.gradient-mesh.agent-mix::after {
    background: radial-gradient(ellipse, rgba(176, 124, 230, 0.05) 0%, transparent 70%);
}

.gradient-mesh.deep::before {
    background: radial-gradient(ellipse, rgba(90, 155, 230, 0.04) 0%, transparent 70%);
}

.gradient-mesh.deep::after {
    background: radial-gradient(ellipse, rgba(192, 132, 252, 0.04) 0%, transparent 70%);
}

/* ===== 5. AGENT AVATAR CONTAINER ===== */

.agent-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                box-shadow 0.4s ease;
    flex-shrink: 0;
}

.agent-avatar img,
.agent-avatar svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Glow ring -- default amber */
.agent-avatar::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: var(--agent-color, #E8A830);
    opacity: 0.2;
    z-index: -1;
    filter: blur(6px);
    transition: opacity 0.4s ease, filter 0.4s ease;
}

.agent-avatar:hover {
    transform: scale(1.1);
}

.agent-avatar:hover::before {
    opacity: 0.4;
    filter: blur(10px);
}

/* Agent-specific avatar glows */
.agent-avatar.ivan { --agent-color: #2DD4A0; }
.agent-avatar.beski { --agent-color: #B07CE6; }
.agent-avatar.arthur { --agent-color: #5A9BE6; }
.agent-avatar.dafi { --agent-color: #C084FC; }
.agent-avatar.luchi { --agent-color: #E68C3A; }

/* ===== 6. HERO ILLUSTRATION CONTAINER ===== */

.hero-illustration {
    position: relative;
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
    animation: breathe 8s infinite ease-in-out;
    will-change: transform;
}

.hero-illustration img,
.hero-illustration svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Glow underneath */
.hero-illustration::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 10%;
    right: 10%;
    height: 40px;
    background: radial-gradient(ellipse at center, rgba(232, 168, 48, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    filter: blur(12px);
}

/* Responsive constraints */
@media (max-width: 900px) {
    .hero-illustration {
        max-width: 400px;
    }
}

@media (max-width: 640px) {
    .hero-illustration {
        max-width: 300px;
    }
}

/* ===== 7. SECTION ILLUSTRATION ===== */

.section-illustration {
    max-height: 320px;
    width: auto;
    max-width: 45%;
    float: right;
    margin: 0 0 1.5rem 2rem;
    transform: translateZ(0);
    will-change: transform;
}

.section-illustration img,
.section-illustration svg {
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
    display: block;
}

@media (max-width: 900px) {
    .section-illustration {
        max-width: 60%;
        max-height: 240px;
    }

    .section-illustration img,
    .section-illustration svg {
        max-height: 240px;
    }
}

@media (max-width: 640px) {
    .section-illustration {
        float: none;
        max-width: 100%;
        width: 100%;
        margin: 0 auto 1.5rem auto;
        display: flex;
        justify-content: center;
        max-height: 200px;
    }

    .section-illustration img,
    .section-illustration svg {
        max-height: 200px;
        max-width: 280px;
    }
}

/* ===== 8. ANIMATED GRADIENT BORDER ===== */

.gradient-border {
    position: relative;
    background-clip: padding-box;
    border: 2px solid transparent;
    border-radius: var(--radius-md, 12px);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        #2DD4A0,
        #B07CE6,
        #5A9BE6,
        #C084FC,
        #E68C3A,
        #E8A830,
        #2DD4A0
    );
    background-size: 300% 100%;
    animation: gradient-shift 6s linear infinite;
    z-index: -1;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    padding: 2px;
    border-radius: inherit;
}

/* ===== 10. RESPONSIVE -- FLOATING ORBS & RINGS ===== */

@media (max-width: 900px) {
    /* Keep only a couple orbs on tablet */
    .float-orb:nth-child(n+3) {
        display: none;
    }

    .ring-3d.large {
        display: none;
    }
}

@media (max-width: 640px) {
    .float-orb {
        display: none;
    }

    .ring-3d {
        display: none;
    }
}

/* ===== 11. REDUCED MOTION -- 3D & FLOATING ELEMENTS ===== */

@media (prefers-reduced-motion: reduce) {
    .float-orb {
        animation: none;
    }

    .ring-3d {
        animation: none;
    }

    .iso-card {
        transform: none;
        transition: none;
    }

    .iso-card:hover {
        transform: none;
    }

    .hero-illustration {
        animation: none;
    }

    .gradient-border::before {
        animation: none;
        background-position: 0% 50%;
    }
}
