/* ================================================
   adhoc.quest - Graffiti Tactical Operations
   Aurora Gradient System
   ================================================ */

:root {
    --deep-void: #0A0F0D;
    --concrete-dust: #3B3F3A;
    --aurora-green: #39FF85;
    --aurora-teal: #14B8A6;
    --aurora-violet: #8B5CF6;
    --aurora-pink: #EC4899;
    --concrete-light: #E8E4DF;
    --tag-yellow: #FACC15;
}

/* ================================================
   Reset & Base
   ================================================ */

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

html {
    scroll-behavior: auto;
    overflow-x: hidden;
}

body {
    background: var(--deep-void);
    color: var(--concrete-light);
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.75;
    letter-spacing: 0.04em;
    overflow-x: hidden;
}

/* Concrete Noise Texture (applied globally) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' 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='256' height='256' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}

/* ================================================
   Navigation Strip
   ================================================ */

#nav-strip {
    position: fixed;
    left: 0;
    top: 0;
    width: 24px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    z-index: 1000;
    background: rgba(10, 15, 13, 0.4);
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--concrete-dust);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    animation: dotPulse 4s ease-in-out infinite;
}

.nav-dot.active {
    background: var(--aurora-green);
    transform: scale(1.4);
    box-shadow: 0 0 8px var(--aurora-green);
}

@keyframes dotPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ================================================
   Wall / Section Base
   ================================================ */

.wall {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.wall-tall {
    height: 120vh;
}

/* Parallax Layers */
.parallax-bg {
    position: absolute;
    top: -20%;
    left: -5%;
    width: 110%;
    height: 140%;
    z-index: 1;
    will-change: transform;
}

.parallax-mid {
    position: absolute;
    top: -10%;
    left: -5%;
    width: 110%;
    height: 120%;
    z-index: 2;
    will-change: transform;
}

.parallax-fg {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ================================================
   Section Backgrounds (Radial Gradient Spotlights)
   ================================================ */

#wall-tag .parallax-bg {
    background: radial-gradient(ellipse at 50% 50%, var(--deep-void) 0%, var(--concrete-dust) 120%);
}

#wall-brief .parallax-bg {
    background: radial-gradient(ellipse at 30% 40%, var(--deep-void) 0%, var(--concrete-dust) 130%);
}

#wall-grid .parallax-bg {
    background: radial-gradient(ellipse at 60% 50%, var(--deep-void) 0%, var(--concrete-dust) 110%);
}

#wall-signal .parallax-bg {
    background: radial-gradient(ellipse at 50% 50%, var(--deep-void) 0%, var(--concrete-dust) 100%);
}

#wall-trace .parallax-bg {
    background: radial-gradient(ellipse at 50% 30%, var(--deep-void) 0%, #000000 100%);
}

/* ================================================
   Retro Pattern Overlays
   ================================================ */

/* Section 1: Diagonal hash marks */
[data-pattern="hash"] .pattern-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 14px,
        var(--aurora-green) 14px,
        var(--aurora-green) 16px
    );
    animation: patternDriftX 30s linear infinite;
}

/* Section 2: Dot matrix grid */
[data-pattern="dots"] .pattern-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background: radial-gradient(circle 2px at center, var(--aurora-teal) 100%, transparent 100%);
    background-size: 24px 24px;
}

/* Section 3: Cross-hatch lattice */
[data-pattern="crosshatch"] .pattern-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.09;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 11px,
            var(--aurora-violet) 11px,
            var(--aurora-violet) 12px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 11px,
            var(--aurora-violet) 11px,
            var(--aurora-violet) 12px
        );
}

/* Section 4: Chevron stripes */
[data-pattern="chevron"] .pattern-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.08;
    background:
        linear-gradient(60deg, transparent 46%, var(--aurora-pink) 46%, var(--aurora-pink) 47%, transparent 47%),
        linear-gradient(-60deg, transparent 46%, var(--aurora-pink) 46%, var(--aurora-pink) 47%, transparent 47%);
    background-size: 40px 40px;
    animation: patternPulse 6s ease-in-out infinite;
}

/* Section 5: Circuit-trace pattern */
[data-pattern="circuit"] .pattern-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.07;
    background:
        linear-gradient(0deg, transparent 49%, var(--tag-yellow) 49%, var(--tag-yellow) 50%, transparent 50%),
        linear-gradient(90deg, transparent 49%, var(--tag-yellow) 49%, var(--tag-yellow) 50%, transparent 50%);
    background-size: 60px 60px;
}

@keyframes patternDriftX {
    0% { transform: translateX(0); }
    100% { transform: translateX(40px); }
}

@keyframes patternPulse {
    0%, 100% { opacity: 0.06; }
    50% { opacity: 0.12; }
}

/* ================================================
   Seam Elements (Section Dividers)
   ================================================ */

.seam {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    z-index: 10;
    pointer-events: none;
}

.seam-drip {
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 20%,
        var(--aurora-green) 20%,
        var(--aurora-green) 22%,
        transparent 22%,
        transparent 50%,
        var(--aurora-teal) 50%,
        var(--aurora-teal) 52%,
        transparent 52%
    );
    opacity: 0.3;
}

.seam-drip-violet {
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 15%,
        var(--aurora-violet) 15%,
        var(--aurora-violet) 17%,
        transparent 17%,
        transparent 55%,
        var(--aurora-pink) 55%,
        var(--aurora-pink) 57%,
        transparent 57%
    );
    opacity: 0.3;
}

.seam-stencil {
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 20px,
            var(--aurora-teal) 20px,
            var(--aurora-teal) 24px,
            transparent 24px,
            transparent 30px
        );
    opacity: 0.2;
    height: 6px;
}

.seam-stencil-pink {
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 15px,
            var(--aurora-pink) 15px,
            var(--aurora-pink) 19px,
            transparent 19px,
            transparent 28px
        );
    opacity: 0.25;
}

/* ================================================
   WALL 1: THE TAG
   ================================================ */

#wall-tag .parallax-fg {
    justify-content: center;
    align-items: center;
    padding-left: 24px;
}

.tag-title {
    font-family: 'Russo One', sans-serif;
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--concrete-light);
    -webkit-text-stroke: 1px var(--aurora-green);
    transform: rotate(-2deg);
    position: relative;
    white-space: nowrap;
}

.tag-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(-80px);
}

.tag-title .letter.animate {
    animation: bounceEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.tag-title .dot-letter {
    color: var(--aurora-green);
    -webkit-text-stroke: 0;
}

/* Aurora shimmer on title */
.tag-title.shimmer {
    animation: auroraShimmer 8s ease-in-out infinite;
}

@keyframes auroraShimmer {
    0%, 100% {
        -webkit-text-stroke-color: var(--aurora-green);
        text-shadow: 0 0 20px rgba(57, 255, 133, 0.1);
    }
    33% {
        -webkit-text-stroke-color: var(--aurora-teal);
        text-shadow: 0 0 20px rgba(20, 184, 166, 0.15);
    }
    66% {
        -webkit-text-stroke-color: var(--aurora-violet);
        text-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
    }
}

.tag-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: var(--concrete-light);
    opacity: 0;
    margin-top: 1.5rem;
    letter-spacing: 0.06em;
    transform: rotate(-2deg);
    transition: opacity 0.8s ease;
}

.tag-subtitle.visible {
    opacity: 0.85;
}

/* ================================================
   WALL 2: THE BRIEF
   ================================================ */

#wall-brief .parallax-fg {
    flex-direction: row;
    justify-content: flex-end;
    align-items: stretch;
    padding: 5vh 5vw 5vh calc(24px + 5vw);
    position: relative;
}

.pull-quote {
    font-family: 'Permanent Marker', cursive;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--aurora-pink);
    transform: rotate(-6deg);
    position: absolute;
    left: calc(24px + 3vw);
    top: 15vh;
    max-width: 280px;
    line-height: 1.4;
    opacity: 0;
}

.pull-quote.bounced {
    opacity: 1;
}

.brief-content {
    max-width: 42ch;
    align-self: center;
    margin-left: auto;
    padding-right: 3vw;
    opacity: 0;
}

.brief-content.bounced {
    opacity: 1;
}

.brief-content p {
    margin-bottom: 1.2em;
    color: var(--concrete-light);
}

.brief-content p:last-child {
    margin-bottom: 0;
}

/* Isometric Icon Clusters (midground) */
.iso-cluster {
    position: absolute;
    display: flex;
    gap: 10px;
    opacity: 0.6;
}

.iso-icon {
    width: 60px;
    height: 60px;
}

.cluster-1 {
    top: 20%;
    left: 15%;
    transform: rotate(-5deg);
}

.cluster-2 {
    top: 50%;
    left: 8%;
    transform: rotate(3deg);
}

.cluster-3 {
    bottom: 15%;
    left: 25%;
    transform: rotate(-8deg);
}

/* ================================================
   WALL 3: THE GRID
   ================================================ */

#wall-grid .parallax-fg {
    justify-content: center;
    align-items: center;
    padding: 4vh 5vw 4vh calc(24px + 3vw);
}

.iso-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1000px;
    width: 100%;
    transform: perspective(1200px) rotateX(2deg) rotateY(-3deg);
}

.data-panel {
    background: rgba(10, 15, 13, 0.85);
    border: 1px solid var(--aurora-teal);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.data-panel.bounced {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.data-panel:hover {
    border-color: var(--aurora-green);
    box-shadow: 0 0 15px rgba(57, 255, 133, 0.1), inset 0 0 15px rgba(57, 255, 133, 0.03);
}

.panel-icon {
    width: 48px;
    height: 48px;
}

.panel-title {
    font-family: 'Russo One', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--aurora-teal);
    -webkit-text-stroke: 0.5px var(--aurora-teal);
}

.panel-desc {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--concrete-light);
    opacity: 0.8;
}

/* ================================================
   WALL 4: THE SIGNAL
   ================================================ */

#wall-signal .parallax-fg {
    justify-content: center;
    align-items: center;
    padding: 0 5vw;
    position: relative;
}

.signal-text {
    text-align: center;
    max-width: 800px;
    opacity: 0;
}

.signal-text.bounced {
    opacity: 1;
}

.signal-text p {
    font-family: 'Russo One', sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.3;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.signal-word {
    display: inline-block;
    animation: wordColorCycle 12s ease-in-out infinite;
    animation-delay: calc(var(--word-index) * -0.9s);
}

@keyframes wordColorCycle {
    0%, 100% { color: var(--concrete-light); }
    20% { color: var(--aurora-green); }
    40% { color: var(--aurora-teal); }
    60% { color: var(--aurora-violet); }
    80% { color: var(--aurora-pink); }
}

.drip-frame {
    position: absolute;
    top: 0;
    height: 100%;
    width: 30px;
    z-index: 4;
}

.drip-frame svg {
    width: 100%;
    height: 100%;
}

.drip-left {
    left: 5vw;
}

.drip-right {
    right: 5vw;
}

/* ================================================
   WALL 5: THE TRACE
   ================================================ */

#wall-trace .parallax-fg {
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 2rem;
}

.circuit-trace-svg {
    position: absolute;
    top: 10%;
    left: 5%;
    width: 90%;
    height: 80%;
    z-index: 2;
    pointer-events: none;
}

.circuit-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 3s ease-out;
}

.circuit-path.drawn {
    stroke-dashoffset: 0;
}

.circuit-node {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.circuit-node.visible {
    opacity: 0.6;
}

.trace-line {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--concrete-light);
    letter-spacing: 0.06em;
    opacity: 0;
    z-index: 5;
}

.trace-line.bounced {
    opacity: 0.9;
}

.trace-signoff {
    font-family: 'Permanent Marker', cursive;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    color: var(--aurora-pink);
    opacity: 0;
    z-index: 5;
}

.trace-signoff.bounced {
    opacity: 0.85;
}

.trace-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--aurora-green);
    box-shadow: 0 0 12px var(--aurora-green), 0 0 24px rgba(57, 255, 133, 0.3);
    animation: tracePulse 2s ease-in-out infinite;
    cursor: pointer;
    z-index: 5;
    opacity: 0;
}

.trace-dot.bounced {
    opacity: 1;
}

@keyframes tracePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 12px var(--aurora-green), 0 0 24px rgba(57, 255, 133, 0.3);
    }
    50% {
        transform: scale(1.3);
        box-shadow: 0 0 20px var(--aurora-green), 0 0 40px rgba(57, 255, 133, 0.5);
    }
}

.fade-to-black {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to bottom, transparent, #000000);
    z-index: 4;
    pointer-events: none;
}

/* ================================================
   Bounce-Enter Animation
   ================================================ */

@keyframes bounceEnter {
    0% {
        opacity: 0;
        transform: translateY(-80px);
    }
    60% {
        opacity: 1;
        transform: translateY(12px);
    }
    75% {
        transform: translateY(-5px);
    }
    90% {
        transform: translateY(2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceEnterFromBelow {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    60% {
        opacity: 1;
        transform: translateY(-8px) scale(1.02);
    }
    75% {
        transform: translateY(3px) scale(0.99);
    }
    90% {
        transform: translateY(-1px) scale(1.005);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bounce-target.bounced {
    animation: bounceEnterFromBelow 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ================================================
   Responsive
   ================================================ */

@media (max-width: 768px) {
    .iso-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        transform: none;
    }

    #wall-brief .parallax-fg {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 5vh 5vw;
    }

    .pull-quote {
        position: relative;
        left: auto;
        top: auto;
        margin-bottom: 2rem;
        max-width: none;
        text-align: center;
        transform: rotate(-3deg);
    }

    .brief-content {
        max-width: 100%;
        margin-left: 0;
        padding-right: 0;
    }

    .iso-cluster {
        display: none;
    }

    .drip-frame {
        display: none;
    }

    .signal-text p {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

    .data-panel {
        padding: 16px 14px;
    }

    .panel-icon {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .iso-grid {
        grid-template-columns: 1fr;
    }

    .tag-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    #nav-strip {
        width: 18px;
    }
}
