/* SocialDebug.Org - Styles */
/* Colors: #FFF5E6 cream, #EDE4F5 lavender, #FF8A9E coral, #A8E6CF mint, #9BB5F0 periwinkle, #2D1B3D plum, #7A6B8A mauve, #FFB366 tangerine, #D4A0A0 rose */
/* Fonts: Outfit (headlines), Nunito (body), Victor Mono (annotations) */

:root {
    --cream: #FFF5E6;
    --lavender: #EDE4F5;
    --coral: #FF8A9E;
    --mint: #A8E6CF;
    --periwinkle: #9BB5F0;
    --plum: #2D1B3D;
    --mauve: #7A6B8A;
    --tangerine: #FFB366;
    --rose: #D4A0A0;
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Nunito', sans-serif;
    --font-mono: 'Victor Mono', monospace;
}

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

html {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

body {
    font-family: var(--font-body);
    background: var(--cream);
    color: var(--plum);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Main horizontal scroll container */
#main-scroll {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    height: 100vh;
    width: 100vw;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

#main-scroll::-webkit-scrollbar {
    display: none;
}

#main-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Panel base */
.panel {
    min-width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-shrink: 0;
}

/* Alternate panel backgrounds */
.panel-detect { background: var(--cream); }
.panel-identify { background: var(--lavender); }
.panel-isolate { background: var(--cream); }
.panel-analyze { background: var(--lavender); }
.panel-patch { background: var(--cream); }
.panel-deploy { background: var(--lavender); }
.panel-monitor { background: var(--cream); }

/* Zone system - diagonal clip paths */
.zone-left, .zone-right {
    position: absolute;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

/* Odd panels: left text, right illustration */
.panel-detect .zone-left,
.panel-isolate .zone-left,
.panel-patch .zone-left,
.panel-monitor .zone-left {
    left: 0;
    width: 55%;
    clip-path: polygon(0 0, 75% 0, 55% 100%, 0 100%);
    z-index: 2;
}

.panel-detect .zone-right,
.panel-isolate .zone-right,
.panel-patch .zone-right,
.panel-monitor .zone-right {
    right: 0;
    width: 60%;
    clip-path: polygon(35% 0, 100% 0, 100% 100%, 15% 100%);
    z-index: 1;
}

/* Even panels: left illustration, right text (reversed diagonal) */
.panel-identify .zone-left,
.panel-analyze .zone-left,
.panel-deploy .zone-left {
    left: 0;
    width: 60%;
    clip-path: polygon(0 0, 85% 0, 65% 100%, 0 100%);
    z-index: 1;
}

.panel-identify .zone-right,
.panel-analyze .zone-right,
.panel-deploy .zone-right {
    right: 0;
    width: 55%;
    clip-path: polygon(25% 0, 100% 0, 100% 100%, 45% 100%);
    z-index: 2;
}

/* Zone content */
.zone-content {
    max-width: 500px;
    position: relative;
    z-index: 3;
}

/* Typography */
.headline {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 96px);
    font-weight: 700;
    color: var(--plum);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    transition: font-weight 0.3s ease;
}

.debug-label {
    font-family: var(--font-mono);
    font-size: clamp(12px, 1.2vw, 16px);
    color: var(--mauve);
    display: block;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.body-text {
    font-family: var(--font-body);
    font-size: clamp(16px, 1.8vw, 22px);
    font-weight: 400;
    line-height: 1.7;
    color: var(--plum);
    margin-bottom: 20px;
}

.annotation {
    font-family: var(--font-mono);
    font-style: italic;
    font-size: clamp(11px, 1vw, 14px);
    color: var(--mauve);
    display: block;
    margin-top: 16px;
    opacity: 0.8;
}

/* Data annotations (Analyze panel) */
.data-annotations {
    margin: 16px 0;
    padding: 16px;
    background: rgba(45, 27, 61, 0.05);
    clip-path: polygon(0 0, 100% 5%, 98% 100%, 2% 95%);
}

.data-row {
    font-family: var(--font-mono);
    font-size: clamp(12px, 1.1vw, 15px);
    color: var(--plum);
    padding: 4px 0;
    display: flex;
    gap: 8px;
}

.data-key {
    color: var(--coral);
}

.data-val {
    color: var(--mauve);
}

/* Before/After (Patch panel) */
.before-after {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

.ba-item {
    text-align: center;
}

.ba-label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--mauve);
    display: block;
    margin-bottom: 8px;
}

.ba-indicator {
    width: 80px;
    height: 40px;
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
}

.ba-indicator.broken {
    background: linear-gradient(135deg, var(--coral) 40%, transparent 40%, transparent 45%, var(--coral) 45%);
}

.ba-indicator.fixed {
    background: var(--mint);
}

.ba-arrow {
    font-size: 24px;
    color: var(--tangerine);
}

/* Bug illustrations */
.bug-illustration {
    width: 100%;
    max-width: 350px;
    height: auto;
}

.illustration-zone {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bug draw animation */
.bug-draw path,
.bug-draw line,
.bug-draw circle,
.bug-draw ellipse,
.bug-draw polygon {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.panel.active .bug-draw path,
.panel.active .bug-draw line,
.panel.active .bug-draw circle,
.panel.active .bug-draw ellipse,
.panel.active .bug-draw polygon {
    opacity: 1;
}

/* Bug breathing animation */
.panel.active .bug-illustration {
    animation: bug-breathe 3s ease-in-out infinite;
}

@keyframes bug-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* Scan lines animation for detect panel */
.scan-lines line {
    animation: scan-sweep 2s ease-in-out infinite;
}

.scan-lines line:nth-child(2) { animation-delay: 0.3s; }
.scan-lines line:nth-child(3) { animation-delay: 0.6s; }

@keyframes scan-sweep {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.6; }
}

/* Deploy panel - mini bugs layout */
.deploy-celebration {
    display: flex !important;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: center;
    max-width: 400px;
}

.deploy-celebration .mini-bug {
    width: 100px;
    height: 100px;
}

.deploy-celebration .mini-listener { animation: celebrate-bob 2s ease-in-out infinite; }
.deploy-celebration .mini-echo { animation: celebrate-bob 2.2s ease-in-out infinite 0.2s; }
.deploy-celebration .mini-null { animation: celebrate-bob 1.8s ease-in-out infinite 0.4s; }
.deploy-celebration .mini-loop { animation: celebrate-bob 2.4s ease-in-out infinite 0.6s; }
.deploy-celebration .mini-patch { animation: celebrate-bob 2.1s ease-in-out infinite 0.8s; }

@keyframes celebrate-bob {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(3deg); }
    75% { transform: translateY(5px) rotate(-2deg); }
}

/* Monitor display */
.monitor-display {
    width: 300px;
    height: 200px;
    position: relative;
    background: rgba(45, 27, 61, 0.08);
    clip-path: polygon(5% 0, 100% 3%, 95% 100%, 0 97%);
    padding: 20px;
    overflow: hidden;
}

.monitor-line {
    height: 2px;
    background: var(--mint);
    margin: 20px 0;
    position: relative;
    opacity: 0.6;
}

.monitor-line::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--coral);
    border-radius: 50%;
    top: -3px;
    left: 0;
    animation: monitor-trace 3s ease-in-out infinite;
}

.monitor-line:nth-child(2)::after { animation-delay: 0.5s; }
.monitor-line:nth-child(3)::after { animation-delay: 1s; }

@keyframes monitor-trace {
    0% { left: 0; }
    50% { left: calc(100% - 8px); }
    100% { left: 0; }
}

.monitor-pulse {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--mint);
    border-radius: 50%;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(168, 230, 207, 0.4); }
    50% { box-shadow: 0 0 20px 10px rgba(168, 230, 207, 0.1); }
}

/* Background decorations */
.panel-bg-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Static ripples - background decoration */
.static-ripple {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 1px solid var(--rose);
    opacity: 0.08;
}

.static-ripple::before,
.static-ripple::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--rose);
}

.static-ripple::before {
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
}

.static-ripple::after {
    top: 40px;
    left: 40px;
    right: 40px;
    bottom: 40px;
}

/* Triangle scatter decoration */
.triangle-scatter {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Ripple effect on panel entry */
.ripple {
    position: absolute;
    border: 2px solid var(--coral);
    border-radius: 50%;
    animation: ripple-expand 1.2s ease-out forwards;
    pointer-events: none;
    z-index: 10;
    transform: translate(-50%, -50%);
}

@keyframes ripple-expand {
    from {
        width: 0;
        height: 0;
        opacity: 0.3;
    }
    to {
        width: 120vmax;
        height: 120vmax;
        opacity: 0;
    }
}

/* Bug counter badge */
.bug-counter {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--plum);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.bug-counter-text {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--cream);
    letter-spacing: 0.05em;
    text-align: center;
    line-height: 1.3;
    z-index: 2;
    position: relative;
}

.bug-counter-ripple {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--periwinkle);
    opacity: 0.1;
    animation: badge-ripple 2s ease-out infinite;
}

@keyframes badge-ripple {
    0% {
        transform: scale(1);
        opacity: 0.1;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Navigation arrows */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    background: rgba(45, 27, 61, 0.1);
    border: 1px solid var(--rose);
    color: var(--plum);
    width: 48px;
    height: 48px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(20% 0, 100% 0, 80% 100%, 0 100%);
    transition: background 0.3s ease;
}

.nav-arrow:hover {
    background: rgba(255, 138, 158, 0.2);
}

.nav-arrow-left {
    left: 16px;
}

.nav-arrow-right {
    right: 16px;
}

/* Progress rail */
.progress-rail {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 32px;
    z-index: 100;
    background: rgba(45, 27, 61, 0.05);
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.progress-chevrons {
    display: flex;
    gap: 0;
    width: 100%;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.chevron {
    font-size: 14px;
    color: var(--rose);
    opacity: 0.3;
    transition: opacity 0.4s ease, color 0.4s ease;
}

.chevron.active {
    opacity: 1;
    color: var(--coral);
}

.progress-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--coral), var(--periwinkle), var(--mint));
    transition: width 0.4s ease;
    width: 0%;
    animation: progress-pulse 2s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Confetti particles for Deploy panel */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 15px solid var(--coral);
    opacity: 0;
}

.confetti-piece.falling {
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(-20px) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

/* Panel entry animations */
.panel .zone-content {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

.panel.active .zone-content {
    opacity: 1;
    transform: translateX(0);
}

.panel .zone-left .zone-content {
    transform: translateX(-30px);
}

.panel.active .zone-left .zone-content {
    transform: translateX(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .zone-left, .zone-right {
        padding: 30px;
    }

    .panel-detect .zone-left,
    .panel-isolate .zone-left,
    .panel-patch .zone-left,
    .panel-monitor .zone-left {
        clip-path: polygon(0 0, 100% 0, 100% 55%, 0 65%);
        width: 100%;
        height: 60%;
    }

    .panel-detect .zone-right,
    .panel-isolate .zone-right,
    .panel-patch .zone-right,
    .panel-monitor .zone-right {
        clip-path: polygon(0 45%, 100% 35%, 100% 100%, 0 100%);
        width: 100%;
        height: 55%;
        top: auto;
        bottom: 0;
    }

    .panel-identify .zone-left,
    .panel-analyze .zone-left,
    .panel-deploy .zone-left {
        clip-path: polygon(0 0, 100% 0, 100% 55%, 0 65%);
        width: 100%;
        height: 55%;
    }

    .panel-identify .zone-right,
    .panel-analyze .zone-right,
    .panel-deploy .zone-right {
        clip-path: polygon(0 45%, 100% 35%, 100% 100%, 0 100%);
        width: 100%;
        height: 60%;
        top: auto;
        bottom: 0;
    }

    .bug-counter {
        width: 70px;
        height: 70px;
        top: 12px;
        right: 12px;
    }

    .bug-counter-text {
        font-size: 10px;
    }

    .bug-illustration {
        max-width: 200px;
    }

    .headline {
        font-size: clamp(28px, 8vw, 52px);
    }
}
