/* =========================================
   JJUGGL.com - Graffiti Luxury Design
   ========================================= */

/* --- RESET & BASE --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background-color: #0D0D0D;
    color: #FFFFFF;
    font-family: 'Archivo', sans-serif;
    font-size: 16px;
    line-height: 1.75;
    font-weight: 400;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- NOISE GRAIN CANVAS --- */
#noise-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    image-rendering: pixelated;
}

/* --- FACADE / HERO SECTION --- */
#facade {
    width: 100%;
    height: 100vh;
    background-color: #0D0D0D;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#wordmark-container {
    width: 520px;
    max-width: 90vw;
}

#wordmark-svg {
    width: 100%;
    height: auto;
}

#wordmark-svg .letter {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    fill: none;
    transition: fill 400ms ease;
}

#wordmark-svg .letter.drawn {
    stroke-dashoffset: 0;
}

#wordmark-svg .letter.filled {
    fill: #C8A951;
}

#drip {
    opacity: 0;
    transition: transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

#drip.falling {
    opacity: 1;
    transform: translateY(60px);
}

/* Scroll indicator */
#scroll-indicator {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 600ms ease 2000ms;
}

#scroll-indicator.visible {
    opacity: 1;
}

.scroll-text {
    font-family: 'Archivo', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3em;
    color: #B0B0B0;
}

.scroll-arrow {
    width: 1px;
    height: 24px;
    background: linear-gradient(to bottom, #C8A951, transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(6px); }
}

/* --- TIMELINE SECTION --- */
#timeline {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 0 160px 0;
}

/* Central gold spine */
#timeline-spine {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #C8A951;
    transform: translateX(-50%);
    transform-origin: top center;
}

/* --- TIMELINE PANELS --- */
.timeline-panel {
    position: relative;
    width: 420px;
    margin-bottom: 120px;
    opacity: 0;
    transition: opacity 500ms ease, transform 500ms ease;
}

.timeline-panel.panel-left {
    margin-right: auto;
    margin-left: calc(50% - 460px);
    transform: translateX(-40px);
}

.timeline-panel.panel-right {
    margin-left: auto;
    margin-right: calc(50% - 460px);
    transform: translateX(40px);
}

.timeline-panel.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Panel content block */
.panel-content {
    background-color: #0D0D0D;
    border: 1px solid #2A2A2A;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

/* Panel height variants */
.timeline-panel .panel-content {
    min-height: 160px;
}

.timeline-panel.panel-hero .panel-content {
    min-height: 320px;
}

/* --- TIMELINE NODES --- */
.timeline-node {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at center, #C8A951 30%, #0D0D0D 100%);
    z-index: 10;
    transition: box-shadow 400ms ease;
}

.panel-left .timeline-node {
    right: -48px;
    top: 40px;
}

.panel-right .timeline-node {
    left: -48px;
    top: 40px;
}

.timeline-node.pulsed {
    box-shadow: 0 0 20px rgba(200, 169, 81, 0.6);
}

/* --- PANEL LABELS (Permanent Marker) --- */
.panel-label {
    font-family: 'Permanent Marker', cursive;
    font-size: 20px;
    display: inline-block;
    margin-bottom: 12px;
}

[data-accent="gold"] .panel-label {
    color: #C8A951;
}

[data-accent="magenta"] .panel-label {
    color: #E6175C;
}

[data-accent="cyan"] .panel-label {
    color: #00E5FF;
}

/* --- PANEL TITLES --- */
.panel-title {
    font-family: 'Alfa Slab One', serif;
    font-size: 56px;
    font-weight: 400;
    letter-spacing: -0.03em;
    color: #FFFFFF;
    margin-bottom: 16px;
    line-height: 1.1;
}

/* --- PANEL BODY TEXT --- */
.panel-body {
    font-family: 'Archivo', sans-serif;
    font-size: 16px;
    line-height: 1.75;
    font-weight: 400;
    color: #B0B0B0;
}

/* --- ACCENT-SPECIFIC BORDERS --- */
[data-accent="gold"] .panel-content {
    border-color: #2A2A2A;
    box-shadow: inset 0 0 40px rgba(200, 169, 81, 0.04);
}

[data-accent="magenta"] .panel-content {
    border-color: #2A2A2A;
    box-shadow: inset 0 0 40px rgba(230, 23, 92, 0.04);
}

[data-accent="cyan"] .panel-content {
    border-color: #2A2A2A;
    box-shadow: inset 0 0 40px rgba(0, 229, 255, 0.04);
}

/* --- OVERSPRAY HALO --- */
[data-accent="gold"] .panel-content::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(ellipse at center, rgba(200, 169, 81, 0.08) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

[data-accent="magenta"] .panel-content::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(ellipse at center, rgba(230, 23, 92, 0.08) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

[data-accent="cyan"] .panel-content::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(ellipse at center, rgba(0, 229, 255, 0.08) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* --- PIXACAO VERTICAL BORDER --- */
.pixacao-border {
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    opacity: 0.15;
    background-image:
        linear-gradient(0deg, transparent 0%, transparent 5%, #2A2A2A 5%, #2A2A2A 6%, transparent 6%, transparent 12%, #2A2A2A 12%, #2A2A2A 13%, transparent 13%, transparent 20%, #2A2A2A 20%, #2A2A2A 21%, transparent 21%, transparent 28%, #2A2A2A 28%, #2A2A2A 30%, transparent 30%, transparent 38%, #2A2A2A 38%, #2A2A2A 39%, transparent 39%, transparent 46%, #2A2A2A 46%, #2A2A2A 48%, transparent 48%, transparent 55%, #2A2A2A 55%, #2A2A2A 56%, transparent 56%, transparent 63%, #2A2A2A 63%, #2A2A2A 65%, transparent 65%, transparent 72%, #2A2A2A 72%, #2A2A2A 73%, transparent 73%, transparent 80%, #2A2A2A 80%, #2A2A2A 82%, transparent 82%, transparent 90%, #2A2A2A 90%, #2A2A2A 91%, transparent 91%);
}

.panel-left .pixacao-border {
    right: auto;
    left: 0;
}

/* --- CHOLO SCRIPT FLOURISH --- */
.cholo-flourish {
    width: 180px;
    height: 50px;
    margin-top: 20px;
    opacity: 0.7;
}

.cholo-flourish path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 1.2s ease;
}

.visible .cholo-flourish path {
    stroke-dashoffset: 0;
}

/* --- STENCIL MOTIF --- */
.stencil-motif {
    width: 120px;
    height: 120px;
    margin-top: 24px;
    opacity: 0.5;
}

/* --- GLITCH IMAGE --- */
.glitch-image {
    width: 100%;
    height: 160px;
    margin-top: 24px;
    position: relative;
    background-color: #1A1A1A;
    overflow: hidden;
}

.glitch-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 3px,
        rgba(255, 255, 255, 0.02) 3px,
        rgba(255, 255, 255, 0.02) 4px
    );
    z-index: 2;
}

.glitch-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-r {
    background: linear-gradient(
        135deg,
        rgba(230, 23, 92, 0.15) 0%,
        rgba(200, 169, 81, 0.1) 30%,
        transparent 50%,
        rgba(230, 23, 92, 0.1) 70%,
        rgba(200, 169, 81, 0.15) 100%
    );
    mix-blend-mode: screen;
    transform: translateX(-2px);
}

.glitch-b {
    background: linear-gradient(
        225deg,
        rgba(0, 229, 255, 0.15) 0%,
        transparent 40%,
        rgba(0, 229, 255, 0.1) 60%,
        rgba(200, 169, 81, 0.1) 80%,
        transparent 100%
    );
    mix-blend-mode: screen;
    transform: translateX(2px);
}

/* Scan-line effect within glitch images */
.glitch-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: rgba(0, 229, 255, 0.3);
    z-index: 3;
    animation: scanLine 3s linear infinite;
}

@keyframes scanLine {
    0% { top: 0; }
    100% { top: 100%; }
}

/* --- DRIP ELEMENT --- */
.drip-element {
    position: absolute;
    bottom: -40px;
    left: 30%;
    width: 60px;
    height: 80px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 600ms ease;
}

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

.drip-element::before {
    width: 8px;
    height: 8px;
    background-color: rgba(230, 23, 92, 0.7);
    top: 0;
    left: 10px;
    box-shadow:
        4px 14px 0 rgba(230, 23, 92, 0.6),
        -2px 28px 0 3px rgba(230, 23, 92, 0.5),
        6px 42px 0 1px rgba(230, 23, 92, 0.4),
        0px 58px 0 2px rgba(230, 23, 92, 0.3);
}

.drip-element::after {
    width: 6px;
    height: 6px;
    background-color: rgba(230, 23, 92, 0.65);
    top: 8px;
    left: 30px;
    box-shadow:
        -3px 16px 0 2px rgba(230, 23, 92, 0.5),
        2px 32px 0 rgba(230, 23, 92, 0.4),
        -1px 48px 0 1px rgba(230, 23, 92, 0.3);
}

.visible .drip-element {
    opacity: 1;
}

/* --- MORPH DIVIDERS --- */
.morph-divider {
    width: 100%;
    height: 40px;
    margin: 0 0 120px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.morph-divider svg {
    width: 100%;
    height: 40px;
    overflow: visible;
}

.morph-line {
    transition: d 600ms cubic-bezier(0.65, 0, 0.35, 1);
}

.morph-divider.morphed .morph-line {
    d: path("M0 20 Q150 -15 300 20 Q400 45 500 10 Q600 -20 700 30 Q800 50 900 15 Q1000 -10 1100 25 L1200 20");
}

/* --- GLITCH HOVER EFFECT --- */
.panel-content {
    position: relative;
}

.panel-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: rgba(0, 229, 255, 0.4);
    z-index: 5;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 150ms ease;
    pointer-events: none;
}

@media (hover: hover) {
    .panel-content:hover {
        animation: glitchJitter 150ms ease;
    }

    .panel-content:hover::after {
        opacity: 1;
        animation: glitchScan 200ms linear forwards;
    }
}

@keyframes glitchJitter {
    0% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    50% { transform: translateX(1px); }
    75% { transform: translateX(-1px); }
    100% { transform: translateX(0); }
}

@keyframes glitchScan {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(calc(100% + 10px)); opacity: 0; }
}

/* --- FOOTER --- */
#footer {
    position: relative;
    width: 100%;
    padding: 80px 0 60px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#footer-node {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle at center, #C8A951 30%, #0D0D0D 100%);
    margin-bottom: 24px;
    box-shadow: 0 0 30px rgba(200, 169, 81, 0.4);
}

#footer-line {
    width: 0;
    height: 1px;
    background-color: #C8A951;
    transition: width 800ms cubic-bezier(0.65, 0, 0.35, 1);
}

#footer-line.expanded {
    width: 100%;
}

#footer-text {
    font-family: 'Alfa Slab One', serif;
    font-size: 14px;
    letter-spacing: 0.3em;
    color: #C8A951;
    margin-top: 24px;
    opacity: 0.4;
}

/* --- MOBILE ADAPTATION (below 768px) --- */
@media (max-width: 768px) {
    #timeline {
        padding: 60px 0 120px 0;
    }

    #timeline-spine {
        left: 24px;
        transform: none;
    }

    .timeline-panel {
        width: calc(100% - 72px);
        margin-left: 56px !important;
        margin-right: 16px !important;
    }

    .timeline-panel.panel-left,
    .timeline-panel.panel-right {
        transform: translateX(30px);
    }

    .timeline-panel.visible {
        transform: translateX(0);
    }

    .panel-left .timeline-node,
    .panel-right .timeline-node {
        left: -40px;
        right: auto;
        top: 40px;
    }

    .panel-title {
        font-size: 32px;
    }

    .panel-content {
        padding: 28px;
    }

    #wordmark-container {
        width: 320px;
    }

    .panel-hero .panel-content {
        min-height: 240px;
    }
}

/* --- TABLET ADJUSTMENT --- */
@media (max-width: 1024px) and (min-width: 769px) {
    .timeline-panel {
        width: 340px;
    }

    .timeline-panel.panel-left {
        margin-left: calc(50% - 380px);
    }

    .timeline-panel.panel-right {
        margin-right: calc(50% - 380px);
    }

    .panel-title {
        font-size: 42px;
    }
}

/* --- RGB CHANNEL SPLIT ON HOVER (Desktop) --- */
@media (hover: hover) {
    .panel-content {
        position: relative;
    }

    .panel-content:hover .glitch-r {
        transform: translateX(-4px);
        transition: transform 150ms ease;
    }

    .panel-content:hover .glitch-b {
        transform: translateX(4px);
        transition: transform 150ms ease;
    }
}
