/* ============================================
   monopole.city - Retro-Futuristic Urban Design
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #141020;
    color: #F0E0D0;
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1vw, 17px);
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3 {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
}

h2 {
    font-size: clamp(28px, 4vw, 56px);
    line-height: 1.15;
    margin-bottom: 0.5em;
    color: #F0E0D0;
}

.mono {
    font-family: 'Overpass Mono', monospace;
    font-weight: 400;
    font-size: 12px;
}

.dot {
    color: #E84080;
}

/* --- HERO SECTION --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(180deg, #2A0830 0%, #D84020 60%, #F8A840 100%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 20px;
}

#logotype {
    font-size: clamp(40px, 8vw, 100px);
    letter-spacing: -0.02em;
    color: #F0E0D0;
    text-shadow: 0 0 40px rgba(248, 168, 64, 0.4), 0 4px 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    animation: fadeInLogotype 800ms ease-out 200ms forwards;
}

#hero-tagline {
    font-family: 'Work Sans', sans-serif;
    font-size: clamp(14px, 1.5vw, 20px);
    color: #C0C8D0;
    margin-top: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInLogotype 600ms ease-out 800ms forwards;
}

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

/* --- ISOMETRIC ICONS (Hero) --- */
#isometric-icons {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.iso-icon {
    opacity: 0;
    animation: iconDrift 400ms ease-out forwards;
}

.iso-icon:nth-child(1) { animation-delay: 600ms; }
.iso-icon:nth-child(2) { animation-delay: 680ms; }
.iso-icon:nth-child(3) { animation-delay: 760ms; }
.iso-icon:nth-child(4) { animation-delay: 840ms; }
.iso-icon:nth-child(5) { animation-delay: 920ms; }
.iso-icon:nth-child(6) { animation-delay: 1000ms; }

@keyframes iconDrift {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 0.8;
        transform: translateY(0);
    }
}

/* --- HERO CITYSCAPE --- */
#hero-cityscape {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    z-index: 1;
}

.city-windows rect {
    animation: windowFlicker 3s ease-in-out infinite alternate;
}

.city-windows rect:nth-child(odd) {
    animation-delay: 0.5s;
}

.city-windows rect:nth-child(3n) {
    animation-delay: 1.2s;
}

.city-windows rect:nth-child(5n) {
    animation-delay: 2s;
    animation-duration: 4s;
}

@keyframes windowFlicker {
    0% { opacity: 0.3; }
    30% { opacity: 0.9; }
    50% { opacity: 0.5; }
    70% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* --- CITYSCAPE DIVIDERS --- */
.cityscape-divider {
    width: 100%;
    line-height: 0;
    position: relative;
    z-index: 2;
}

.cityscape-divider svg {
    width: 100%;
    height: auto;
    display: block;
}

/* --- SPLIT-SCREEN SECTIONS --- */
.split-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 80vh;
    position: relative;
}

.split-section:nth-child(even) .split-left {
    order: 2;
}

.split-section:nth-child(even) .split-right {
    order: 1;
}

.split-left,
.split-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
}

/* Dark panel (text side) */
.split-content {
    max-width: 500px;
    width: 100%;
}

/* Section with text on left, visual on right */
#section-districts .split-left {
    background: #141020;
}

#section-districts .split-right {
    background: linear-gradient(180deg, #2A0830, #D84020 80%, #F8A840);
}

/* Section with visual on left, text on right (reversed) */
#section-infrastructure .split-left {
    background: linear-gradient(180deg, #2A0830, #D84020 80%, #F8A840);
}

#section-infrastructure .split-right {
    background: #141020;
}

/* Data section */
#section-data .split-left {
    background: #141020;
}

#section-data .split-right {
    background: linear-gradient(135deg, #2A0830, #1A0520);
}

/* Future section */
#section-future .split-left {
    background: linear-gradient(180deg, #2A0830 0%, #D84020 80%, #F8A840 100%);
}

#section-future .split-right {
    background: #141020;
}

/* --- SECTION LABELS --- */
.section-label {
    color: #E84080;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 16px;
    font-size: 11px;
}

/* --- STAT GRIDS --- */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 32px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #F8A840;
    font-family: 'Overpass Mono', monospace;
}

.stat-label {
    font-size: 12px;
    color: #C0C8D0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- CITY VISUALS (right panels) --- */
.city-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
    padding: 20px;
}

/* Build animation for isometric buildings */
.iso-building {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.iso-building.visible {
    opacity: 1;
    transform: translateY(0);
}

.iso-building:nth-child(1) { transition-delay: 0ms; }
.iso-building:nth-child(2) { transition-delay: 120ms; }
.iso-building:nth-child(3) { transition-delay: 240ms; }

/* --- DATA TERMINAL --- */
.data-terminal {
    margin-top: 32px;
    border: 1px solid #2A0830;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(20, 16, 32, 0.8);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #2A0830;
    border-bottom: 1px solid rgba(248, 168, 64, 0.15);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-title {
    margin-left: auto;
    color: #C0C8D0;
    font-size: 10px;
    letter-spacing: 0.1em;
}

.terminal-body {
    padding: 16px 14px;
}

.terminal-line {
    color: #F8A840;
    font-size: 13px;
    line-height: 2;
    letter-spacing: 0.05em;
}

.terminal-line.blink {
    animation: cursorBlink 1s step-end infinite;
}

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

/* --- BAR CHART --- */
.data-viz {
    width: 100%;
    max-width: 400px;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    height: 250px;
    padding: 20px 0;
}

.bar {
    width: 30px;
    height: 0;
    background: var(--bar-color);
    border-radius: 3px 3px 0 0;
    position: relative;
    transition: height 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.85;
}

.bar.animated {
    height: calc(var(--bar-height, 0) * 1%);
}

.bar:hover {
    opacity: 1;
    filter: brightness(1.2);
}

.bar-label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    color: #C0C8D0;
    font-size: 10px;
    white-space: nowrap;
}

.chart-label {
    text-align: center;
    color: #C0C8D0;
    margin-top: 36px;
    font-size: 10px;
    letter-spacing: 0.15em;
}

/* --- FUTURE GRID --- */
.future-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 320px;
}

.future-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.future-cell.visible {
    opacity: 1;
    transform: scale(1);
}

.future-cell:nth-child(1) { transition-delay: 0ms; }
.future-cell:nth-child(2) { transition-delay: 100ms; }
.future-cell:nth-child(3) { transition-delay: 200ms; }
.future-cell:nth-child(4) { transition-delay: 300ms; }

.future-label {
    color: #C0C8D0;
    font-size: 10px;
    letter-spacing: 0.15em;
}

.future-cell svg {
    filter: drop-shadow(0 0 8px rgba(248, 168, 64, 0.3));
}

/* --- FOOTER --- */
#footer {
    position: relative;
    background: #141020;
    text-align: center;
    padding-bottom: 60px;
}

.footer-cityscape {
    width: 100%;
    line-height: 0;
}

.footer-cityscape svg {
    width: 100%;
    height: auto;
    display: block;
}

.footer-content {
    padding: 40px 20px;
}

#footer-logo {
    font-size: clamp(24px, 3vw, 40px);
    color: #F0E0D0;
    margin-bottom: 16px;
}

.footer-status {
    color: #F8A840;
    font-size: 11px;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
}

.footer-copy {
    color: #C0C8D0;
    font-size: 12px;
    opacity: 0.6;
}

/* --- SCROLL REVEAL ANIMATION (applied via JS) --- */
.split-section .split-content {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 700ms ease-out, transform 700ms ease-out;
}

.split-section .split-content.visible {
    opacity: 1;
    transform: translateX(0);
}

/* For reversed sections, content slides from right */
#section-infrastructure .split-content,
#section-future .split-content {
    transform: translateX(30px);
}

#section-infrastructure .split-content.visible,
#section-future .split-content.visible {
    transform: translateX(0);
}

/* --- GLOBAL SUNSET GLOW ACCENTS --- */
.split-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 50%, rgba(248, 168, 64, 0.03) 0%, transparent 70%);
}

/* --- SCROLLBAR STYLING --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #141020;
}

::-webkit-scrollbar-thumb {
    background: #2A0830;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #D84020;
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    .split-section {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .split-section:nth-child(even) .split-left {
        order: 1;
    }

    .split-section:nth-child(even) .split-right {
        order: 2;
    }

    .split-left,
    .split-right {
        padding: 40px 24px;
        min-height: 50vh;
    }

    /* On mobile, always show text first, visual second */
    #section-infrastructure .split-left {
        order: 2;
    }
    #section-infrastructure .split-right {
        order: 1;
    }

    #section-future .split-left {
        order: 2;
    }
    #section-future .split-right {
        order: 1;
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .stat-value {
        font-size: 22px;
    }

    #isometric-icons {
        gap: 12px;
    }

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

    .bar-chart {
        height: 180px;
        gap: 8px;
    }

    .bar {
        width: 22px;
    }

    .future-grid {
        gap: 20px;
        max-width: 240px;
    }

    .city-visual {
        gap: 12px;
    }

    .iso-building {
        transform: scale(0.8) translateY(30px);
    }

    .iso-building.visible {
        transform: scale(0.8) translateY(0);
    }

    #hero-content {
        padding: 0 16px;
    }

    .split-content {
        max-width: 100%;
    }

    .data-terminal {
        font-size: 11px;
    }
}

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

    .bar-chart {
        height: 140px;
        gap: 6px;
    }

    .bar {
        width: 18px;
    }

    #isometric-icons {
        gap: 8px;
    }

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

/* --- SELECTION STYLING --- */
::selection {
    background: #E84080;
    color: #F0E0D0;
}
