/* ============================================
   pmt.report - Pop-Art Academic Design
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --deep-bg: #0B1224;
    --sidebar-panel: #101D3A;
    --pop-gold: #FFD700;
    --signal-red: #E63946;
    --electric-cyan: #00E5FF;
    --body-text: #C8CDE0;
    --display-text: #E8E8F0;
    --muted: #6B7DB3;
    --burst-bg: #1A2744;
    --neon-magenta: #FF2E9F;

    --sidebar-width: 280px;
    --content-max: 720px;
    --font-display: 'Anybody', sans-serif;
    --font-body: 'Literata', serif;
    --font-mono: 'DM Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-bg);
    color: var(--body-text);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.8;
    overflow-x: hidden;
}

/* --- Sidebar --- */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-panel);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.25rem;
    transition: opacity 0.4s ease;
}

#sidebar.semi-transparent {
    opacity: 0.4;
}

.sidebar-header {
    margin-bottom: 3rem;
}

.sidebar-logo {
    font-family: var(--font-display);
    font-weight: 900;
    font-variation-settings: 'wdth' 125;
    font-size: 1.8rem;
    color: var(--pop-gold);
    letter-spacing: -0.03em;
}

.sidebar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
}

.nav-item:hover {
    background: radial-gradient(circle, var(--pop-gold) 1px, transparent 1px);
    background-size: 8px 8px;
    background-color: rgba(255, 215, 0, 0.05);
}

.nav-item.active {
    background-color: rgba(255, 215, 0, 0.1);
}

.nav-shape {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--muted);
    transition: color 0.3s ease;
}

.nav-item.active .nav-shape {
    color: var(--pop-gold);
    animation: borderPulse 2s ease-in-out infinite;
}

.nav-item:hover .nav-shape {
    color: var(--electric-cyan);
}

@keyframes borderPulse {
    0%, 100% { color: var(--pop-gold); }
    33% { color: var(--signal-red); }
    66% { color: var(--electric-cyan); }
}

.nav-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color 0.3s ease;
}

.nav-item.active .nav-label {
    color: var(--display-text);
}

.nav-item:hover .nav-label {
    color: var(--display-text);
}

.sidebar-border-glow {
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--burst-bg), var(--neon-magenta), var(--burst-bg));
    background-size: 100% 200%;
    animation: glowShift 4s ease-in-out infinite;
}

@keyframes glowShift {
    0%, 100% { background-position: 0 0; }
    50% { background-position: 0 100%; }
}

/* --- Mobile Nav Toggle --- */
#mobile-nav-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 200;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--pop-gold);
    background: var(--sidebar-panel);
    color: var(--pop-gold);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

/* --- Main Content --- */
#content {
    margin-left: var(--sidebar-width);
    position: relative;
}

/* --- Sections --- */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.section-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 6rem 2rem;
    /* Offset slightly right for asymmetry */
    padding-left: 3rem;
}

/* --- Hero --- */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-left: 2rem;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-variation-settings: 'wdth' 125;
    font-size: clamp(3.5rem, 10vw, 8rem);
    color: var(--display-text);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: titleDetonate 1s ease-out 0.3s forwards;
}

@keyframes titleDetonate {
    0% {
        font-variation-settings: 'wdth' 75;
        opacity: 0;
        letter-spacing: 0.1em;
    }
    100% {
        font-variation-settings: 'wdth' 125;
        opacity: 1;
        letter-spacing: -0.03em;
    }
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: var(--muted);
    max-width: 500px;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 1s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.scroll-indicator {
    animation: pulseDown 2s ease-in-out infinite;
}

@keyframes pulseDown {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(10px); opacity: 1; }
}

/* --- Section Headings --- */
.section-heading {
    font-family: var(--font-display);
    font-weight: 800;
    font-variation-settings: 'wdth' 100;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--display-text);
    letter-spacing: -0.03em;
    margin-bottom: 2.5rem;
    position: relative;
    display: inline-block;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--pop-gold);
    transition: width 0.8s ease-out;
}

.section-heading.visible::after {
    width: 100%;
}

.section-heading.visible {
    animation: headingDetonate 0.6s ease-out forwards;
}

@keyframes headingDetonate {
    0% { font-variation-settings: 'wdth' 75; }
    100% { font-variation-settings: 'wdth' 110; }
}

/* --- Content Column --- */
.content-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.content-column p {
    color: var(--body-text);
    font-optical-sizing: auto;
}

/* --- Highlight Terms --- */
.highlight-term {
    position: relative;
    color: var(--display-text);
    font-weight: 700;
}

.highlight-term::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--pop-gold);
    transition: width 0.6s ease-out;
}

.highlight-term.visible::after {
    width: 100%;
}

/* --- Speech Bubbles --- */
.speech-bubble {
    position: relative;
    background: var(--burst-bg);
    border: 3px solid var(--deep-bg);
    border-radius: 16px;
    padding: 1.75rem 2rem;
    margin: 1rem 0;
    /* Ben-Day dot background */
    background-image: radial-gradient(circle, var(--pop-gold) 1px, transparent 1px);
    background-size: 8px 8px;
    background-color: var(--burst-bg);
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 40px;
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 16px solid var(--deep-bg);
}

.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 38px;
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 18px solid var(--deep-bg);
}

.bubble-text {
    font-family: var(--font-display);
    font-weight: 800;
    font-variation-settings: 'wdth' 125;
    font-size: clamp(1.1rem, 1.5vw, 1.4rem);
    color: var(--display-text);
    -webkit-text-stroke: 0.5px var(--pop-gold);
    line-height: 1.5;
}

.bubble-attribution {
    display: block;
    margin-top: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* --- Pop-Art Charts --- */
.chart-container {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--burst-bg);
    border: 3px solid var(--muted);
    border-radius: 8px;
}

.chart-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-variation-settings: 'wdth' 100;
    font-size: 1.2rem;
    color: var(--display-text);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Bar Chart */
.pop-art-chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1.5rem;
    height: 220px;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--muted);
}

.chart-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 60px;
    height: 100%;
    position: relative;
}

.bar-fill {
    width: 100%;
    height: var(--bar-height);
    border: 3px solid var(--deep-bg);
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 1s ease-out;
    /* Ben-Day dot pattern */
    background-image: radial-gradient(circle, rgba(255,255,255,0.3) 1px, transparent 1px);
    background-size: 6px 6px;
}

.chart-bar:nth-child(1) .bar-fill { background-color: var(--pop-gold); }
.chart-bar:nth-child(2) .bar-fill { background-color: var(--signal-red); }
.chart-bar:nth-child(3) .bar-fill { background-color: var(--electric-cyan); }
.chart-bar:nth-child(4) .bar-fill { background-color: var(--neon-magenta); }
.chart-bar:nth-child(5) .bar-fill { background-color: var(--muted); }

.bar-value {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--display-text);
    margin-bottom: 0.25rem;
}

.bar-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    position: absolute;
    bottom: -1.75rem;
    white-space: nowrap;
}

/* Pie Chart */
.pop-art-pie {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pie-svg {
    width: 180px;
    height: 180px;
}

.pie-segment {
    stroke-linecap: butt;
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--body-text);
    letter-spacing: 0.03em;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--deep-bg);
    flex-shrink: 0;
}

/* --- Burst Dividers --- */
.burst-divider {
    position: relative;
    height: 80px;
    overflow: hidden;
}

.divider-canvas {
    width: 100%;
    height: 100%;
}

/* --- Footer --- */
#footer {
    position: relative;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#footer-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.footer-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-text {
    font-family: var(--font-display);
    font-weight: 800;
    font-variation-settings: 'wdth' 110;
    font-size: 1.5rem;
    color: var(--display-text);
    letter-spacing: -0.02em;
}

.footer-year {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* --- Link Underline Animation --- */
a {
    color: var(--electric-cyan);
    text-decoration: none;
    background-image: linear-gradient(var(--electric-cyan), var(--electric-cyan));
    background-size: 0 2px;
    background-position: center bottom;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease;
}

a:hover {
    background-size: 100% 2px;
}

/* --- Hover Explosion Effect --- */
.nav-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, var(--pop-gold) 0%, transparent 70%);
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
}

.nav-item:hover::before {
    width: 120px;
    height: 120px;
    opacity: 0.08;
}

/* --- Border Cycling on Hover for Chart Container --- */
.chart-container:hover {
    animation: borderCycle 4s linear infinite;
}

@keyframes borderCycle {
    0% { border-color: var(--pop-gold); }
    25% { border-color: var(--signal-red); }
    50% { border-color: var(--electric-cyan); }
    75% { border-color: var(--neon-magenta); }
    100% { border-color: var(--pop-gold); }
}

/* --- Ben-Day Dot Overlay on Hero --- */
#hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, var(--pop-gold) 1px, transparent 1px);
    background-size: 8px 8px;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    z-index: 2;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    :root {
        --sidebar-width: 0px;
    }

    #sidebar {
        display: none;
    }

    #mobile-nav-toggle {
        display: flex;
    }

    #content {
        margin-left: 0;
    }

    .section-content {
        padding: 4rem 1.5rem;
        padding-left: 1.5rem;
    }

    .hero-title {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .pop-art-chart {
        gap: 0.75rem;
    }

    .chart-bar {
        width: 45px;
    }

    .pop-art-pie {
        flex-direction: column;
    }

    .speech-bubble {
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 500px) {
    .hero-title {
        font-size: clamp(2rem, 14vw, 3.5rem);
    }

    .section-heading {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .pop-art-chart {
        height: 160px;
        gap: 0.5rem;
    }

    .chart-bar {
        width: 36px;
    }
}
