/* ============================================
   political.quest - Styles
   Generative | Sidebar | Retro-Futuristic
   ============================================ */

:root {
    /* Colors */
    --pq-bg-primary: #0d0d2b;
    --pq-bg-secondary: #1a1a3e;
    --pq-bg-sidebar: #08081e;
    --pq-accent-teal: #00e5cc;
    --pq-accent-magenta: #c850c0;
    --pq-accent-amber: #f5a623;
    --pq-text-body: #c8d0dc;
    --pq-text-heading: #eef2f7;
    --pq-text-muted: #5a6378;
    --pq-divider: #00b3a0;
    --pq-error: #ff4757;
    --pq-accent-teal-40: rgba(0, 229, 204, 0.4);
    --pq-accent-magenta-30: rgba(200, 80, 192, 0.3);

    /* Blur tokens */
    --pq-blur-inactive: 4px;
    --pq-blur-active: 0px;
    --pq-blur-hero: 12px;

    /* Layout */
    --sidebar-width: 280px;
    --header-height: 48px;
    --divider-height: 64px;
    --annotation-width: 180px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    color: var(--pq-text-body);
    background-color: var(--pq-bg-primary);
    overflow-x: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--pq-bg-sidebar);
    border-right: 1px solid var(--pq-accent-teal);
    display: flex;
    flex-direction: column;
    z-index: 100;
    animation: borderPulse 4s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% { border-right-color: rgba(0, 229, 204, 0.4); }
    50% { border-right-color: rgba(0, 229, 204, 1); }
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(0, 229, 204, 0.15);
}

.sidebar-logo {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--pq-accent-teal);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--pq-accent-teal);
    filter: blur(1.5px);
    opacity: 0.5;
    transition: filter 0.4s ease, opacity 0.4s ease;
}

.nav-item.active {
    filter: blur(0);
    opacity: 1;
}

.nav-item:hover {
    opacity: 0.8;
}

.nav-icon {
    width: 24px;
    height: 24px;
    color: var(--pq-accent-teal);
    flex-shrink: 0;
}

.nav-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.sidebar-status {
    padding: 12px 20px;
    border-top: 1px solid rgba(0, 229, 204, 0.1);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pq-accent-teal);
    animation: dotPulse 2s ease-in-out infinite;
}

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

.status-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--pq-text-muted);
}

.sidebar-chevron-bg {
    height: 80px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cline x1='0' y1='8' x2='8' y2='0' stroke='rgba(0,229,204,0.15)' stroke-width='1'/%3E%3Cline x1='8' y1='0' x2='16' y2='8' stroke='rgba(0,229,204,0.15)' stroke-width='1'/%3E%3Cline x1='0' y1='16' x2='8' y2='8' stroke='rgba(0,229,204,0.15)' stroke-width='1'/%3E%3Cline x1='8' y1='8' x2='16' y2='16' stroke='rgba(0,229,204,0.15)' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    opacity: 0.6;
}

.sidebar-canvas-wrap {
    padding: 12px 20px 20px;
    display: flex;
    justify-content: center;
}

#lissajous-canvas {
    width: 120px;
    height: 120px;
    border: 1px solid rgba(0, 229, 204, 0.1);
    border-radius: 4px;
}

/* ---- Mobile Toggle ---- */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    background: var(--pq-bg-sidebar);
    border: 1px solid rgba(0, 229, 204, 0.3);
    border-radius: 4px;
    padding: 10px 8px;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--pq-accent-teal);
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* ---- Hero ---- */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pq-bg-primary);
    overflow: hidden;
}

.hero-bubbles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 40px;
}

.hero-title {
    font-family: 'Righteous', cursive;
    font-size: clamp(3rem, 8vw, 6.5rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--pq-text-heading);
    filter: blur(var(--pq-blur-hero));
    transition: filter 1.8s ease-out;
}

.hero-title.focused {
    filter: blur(0);
}

.hero-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--pq-accent-teal);
    margin-top: 24px;
    opacity: 0;
    transition: opacity 0.6s ease 0.8s;
}

.hero-subtitle.visible {
    opacity: 1;
}

.cursor-blink {
    animation: blink 0.7s step-end infinite;
}

.cursor-blink.hidden {
    display: none;
}

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

/* ---- Section Dividers ---- */
.section-divider {
    height: var(--divider-height);
    background: var(--pq-bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.divider-circles {
    position: absolute;
    width: 100%;
    height: 100%;
}

/* ---- Content Sections ---- */
.content-section {
    position: relative;
    background: var(--pq-bg-primary);
    overflow: hidden;
}

.section-header {
    height: var(--header-height);
    background: linear-gradient(90deg, var(--pq-bg-primary), var(--pq-bg-secondary));
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 40px;
    position: relative;
}

.section-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
}

.section-header[data-pattern="pattern-hexagon-1"]::before {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='28'%3E%3Cpolygon points='16,0 30,7 30,21 16,28 2,21 2,7' fill='none' stroke='rgba(26,26,62,0.16)' stroke-width='1'/%3E%3C/svg%3E");
}

.section-header[data-pattern="pattern-hexagon-2"]::before {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='42'%3E%3Cpolygon points='24,0 45,10.5 45,31.5 24,42 3,31.5 3,10.5' fill='none' stroke='rgba(26,26,62,0.16)' stroke-width='1'/%3E%3C/svg%3E");
}

.section-header[data-pattern="pattern-hexagon-3"]::before {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='35'%3E%3Cpolygon points='20,0 37,8.75 37,26.25 20,35 3,26.25 3,8.75' fill='none' stroke='rgba(26,26,62,0.16)' stroke-width='1'/%3E%3C/svg%3E");
}

.section-header[data-pattern="pattern-hexagon-4"]::before {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='49'%3E%3Cpolygon points='28,0 53,12.25 53,36.75 28,49 3,36.75 3,12.25' fill='none' stroke='rgba(26,26,62,0.16)' stroke-width='1'/%3E%3C/svg%3E");
}

.section-number {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--pq-accent-teal);
    position: relative;
    z-index: 1;
}

.section-title {
    font-family: 'Righteous', cursive;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--pq-text-heading);
    position: relative;
    z-index: 1;
    filter: blur(6px);
    transition: filter 0.5s ease;
}

.section-title.focused {
    filter: blur(0);
}

.section-body {
    display: flex;
    padding: 40px;
    gap: 32px;
}

.annotation-column {
    width: var(--annotation-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.annotation-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.annotation-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--pq-divider);
}

.annotation-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    line-height: 1.6;
    color: var(--pq-text-muted);
}

.gen-diagram {
    display: block;
}

.reading-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.body-text {
    color: var(--pq-text-body);
}

.body-text.blur-target {
    filter: blur(3px);
    opacity: 0.5;
    transition: filter 0.4s ease, opacity 0.4s ease;
}

.body-text.blur-target.focused {
    filter: blur(0);
    opacity: 1;
}

.section-bubbles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.section-body {
    position: relative;
    z-index: 1;
}

/* ---- Bubble Elements ---- */
.bubble {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    transition: transform 3s ease-in-out;
}

.bubble.foreground {
    z-index: 1;
    opacity: 0.4;
}

.bubble.background {
    z-index: 0;
    opacity: 0.15;
    filter: blur(2px);
}

/* ---- Divider Circles (Generative) ---- */
.divider-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid;
    transition: filter 1.5s ease;
}

/* ---- Footer ---- */
.site-footer {
    position: relative;
    padding: 40px;
    background: var(--pq-bg-primary);
    border-top: 1px solid rgba(0, 229, 204, 0.1);
}

.footer-scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1' height='4'%3E%3Crect x='0' y='0' width='1' height='1' fill='rgba(0,229,204,0.05)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    pointer-events: none;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.footer-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--pq-text-muted);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 0;
        overflow: hidden;
        border-right: none;
        border-bottom: 1px solid var(--pq-accent-teal);
        transition: max-height 0.4s ease;
        z-index: 150;
        animation: none;
    }

    .sidebar.open {
        max-height: 100vh;
        overflow-y: auto;
    }

    .mobile-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding-top: 56px;
    }

    .section-body {
        flex-direction: column;
        padding: 24px 20px;
    }

    .annotation-column {
        width: 100%;
        border-left: 2px solid var(--pq-accent-teal);
        padding-left: 16px;
    }

    .hero-inner {
        padding: 0 20px;
    }

    .section-header {
        padding: 0 20px;
    }

    .footer-content {
        flex-direction: column;
        gap: 8px;
    }

    .sidebar-chevron-bg {
        height: 40px;
    }

    .sidebar-canvas-wrap {
        padding: 8px 20px 12px;
    }
}
