/* ========================================
   localcop.dev — Styles
   Bauhaus + Nocturnal Surveillance
   ======================================== */

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

:root {
    --bg-deep: #0d0b1a;
    --bg-surface: #161230;
    --grid-line: #1a1535;
    --text-primary: #e8f0ff;
    --text-body: #b0bec5;
    --accent-teal: #48d1cc;
    --accent-magenta: #c74dab;
    --accent-blue: #4169e1;
    --accent-amber: #e8a840;
    --aurora: linear-gradient(90deg, #48d1cc, #4169e1, #c74dab, #e8a840);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-deep);
    color: var(--text-body);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.7;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

/* Background Grid */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    animation: gridFadeIn 0.6s 0.3s forwards;
}

@keyframes gridFadeIn {
    to { opacity: 1; }
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.03; }
    50% { opacity: 0.08; }
}

.bg-grid rect {
    animation: gridPulse 12s linear infinite;
}

/* Fixed Badge Logo */
.badge-logo {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
}

.badge-hex {
    filter: drop-shadow(0 0 6px rgba(72, 209, 204, 0.3));
}

.badge-text {
    font-family: 'Commissioner', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Fixed Zone Indicator */
.zone-indicator {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

#zone-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    color: var(--accent-teal);
    letter-spacing: 0.1em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

/* Zones General */
.zone {
    position: relative;
    z-index: 1;
}

.zone-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 5.5vw, 4.8rem);
    letter-spacing: -0.04em;
    line-height: 1.0;
    text-transform: uppercase;
    color: var(--text-primary);
    text-shadow: 0 0 30px rgba(72, 209, 204, 0.15);
    margin-bottom: 3rem;
    padding: 0 5%;
}

/* Aurora Divider Band */
.aurora-band {
    width: 100%;
    height: 4px;
    background: var(--aurora);
    background-size: 300% 100%;
    animation: auroraSweep 6s linear infinite;
}

@keyframes auroraSweep {
    0% { background-position: 0% 0%; }
    100% { background-position: 300% 0%; }
}

/* Zone 1: Dispatch */
.zone-dispatch {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 100% 93%, 0 100%);
    padding-bottom: 7vh;
}

.hero-star {
    position: absolute;
    width: 80vmin;
    height: 80vmin;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.6;
    animation: heroStarDraw 2s ease-out 0.6s forwards, heroStarRotate 720s linear infinite, heroStarColorCycle 20s linear infinite;
}

#hero-star-poly {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: starDraw 2s ease-out 0.6s forwards;
}

@keyframes starDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes heroStarRotate {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes heroStarColorCycle {
    0% { stroke: #48d1cc; }
    25% { stroke: #4169e1; }
    50% { stroke: #c74dab; }
    75% { stroke: #e8a840; }
    100% { stroke: #48d1cc; }
}

#hero-star-poly {
    animation: starDraw 2s ease-out 0.6s forwards, heroStarColorCycle 20s linear infinite;
}

.dispatch-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 6vw, 5rem);
    color: var(--text-primary);
    letter-spacing: -0.04em;
    line-height: 1.0;
    text-transform: none;
    text-shadow: 0 0 40px rgba(72, 209, 204, 0.2);
    min-height: 1.2em;
}

.hero-tagline {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text-body);
    margin-top: 1.5rem;
    opacity: 0;
    text-shadow: 0 0 20px rgba(72, 209, 204, 0.15);
    animation: taglineFade 0.8s ease-out 3.2s forwards;
}

@keyframes taglineFade {
    to { opacity: 1; }
}

.zone-dispatch .aurora-band {
    position: absolute;
    bottom: 0;
    left: 0;
}

/* Zone 2: Beat */
.zone-beat {
    padding: 8rem 5% 4rem;
    clip-path: polygon(0 0, 100% 0, 100% 93%, 0 100%);
    padding-bottom: 10vh;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.badge-tile {
    background: var(--bg-surface);
    padding: 2rem;
    min-height: 40vh;
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
    position: relative;
    transform: scaleY(0.01);
    transform-origin: center;
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.badge-tile.visible {
    transform: scaleY(1);
}

.section-star {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    transition: stroke 0.3s ease;
}

.badge-tile:hover .section-star polygon {
    stroke: var(--accent-magenta);
}

.tile-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.tile-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-body);
    line-height: 1.7;
}

.zone-beat .aurora-band {
    position: absolute;
    bottom: 0;
    left: 0;
}

/* Zone 3: Evidence */
.zone-evidence {
    padding: 8rem 5% 4rem;
    clip-path: polygon(0 0, 100% 0, 100% 93%, 0 100%);
    padding-bottom: 10vh;
}

.code-block-wrapper {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-surface);
    border-left: 3px solid var(--accent-teal);
    overflow-x: auto;
    animation: codeLeftBorder 6s linear infinite;
}

@keyframes codeLeftBorder {
    0% { border-left-color: #48d1cc; }
    25% { border-left-color: #4169e1; }
    50% { border-left-color: #c74dab; }
    75% { border-left-color: #e8a840; }
    100% { border-left-color: #48d1cc; }
}

.code-block {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    letter-spacing: 0.03em;
    color: var(--text-body);
    padding: 2rem;
    white-space: pre;
    overflow-x: auto;
}

.code-keyword { color: #48d1cc; }
.code-string { color: #e8a840; }
.code-type { color: #c74dab; }
.code-variable { color: #e8f0ff; }
.code-comment { color: #8892b0; }

.zone-evidence .aurora-band {
    position: absolute;
    bottom: 0;
    left: 0;
}

/* Zone 4: Precinct */
.zone-precinct {
    padding: 8rem 5% 4rem;
    clip-path: polygon(0 0, 100% 0, 100% 93%, 0 100%);
    padding-bottom: 10vh;
}

.architecture-diagram {
    max-width: 900px;
    margin: 0 auto;
}

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

.arch-line {
    stroke-dasharray: 8 4;
    animation: archLinePulse 2s linear infinite;
    filter: drop-shadow(0 0 4px rgba(72, 209, 204, 0.4));
}

@keyframes archLinePulse {
    to { stroke-dashoffset: -24; }
}

.zone-precinct .aurora-band {
    position: absolute;
    bottom: 0;
    left: 0;
}

/* Zone 5: Badge (Footer) */
.zone-badge {
    padding: 8rem 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.morph-badge {
    width: 200px;
    height: 200px;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 12px rgba(72, 209, 204, 0.3));
}

.footer-domain {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.footer-copy {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: var(--text-body);
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
    .tile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .badge-tile {
        min-height: 30vh;
    }
    .zone-indicator {
        display: none;
    }
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
