/* xity.one — Glassmorphism Frosted Smart City Dashboard */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0F1729;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(52,211,153,0.05) 0%, transparent 50%),
        linear-gradient(180deg, #0F1729 0%, #1B2A4A 50%, #0F1729 100%);
}

/* ===== PARTICLE CANVAS ===== */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ===== GLASS PANEL BASE ===== */
.glass-panel {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
}

@supports not (backdrop-filter: blur(16px)) {
    .glass-panel {
        background: rgba(15,23,42,0.9);
    }
}

/* Glass pill badges */
.glass-pill {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.65rem;
    font-weight: 500;
    color: #E0E7FF;
    display: inline-block;
}

/* ===== TYPOGRAPHY ===== */
.section-heading {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #FFFFFF;
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: 0.01em;
}

/* ===== STATUS INDICATORS ===== */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.green {
    background: #34D399;
    box-shadow: 0 0 8px rgba(52,211,153,0.4);
}

.status-dot.amber {
    background: #FBBF24;
    box-shadow: 0 0 8px rgba(251,191,36,0.4);
}

.status-dot.red {
    background: #EF4444;
    box-shadow: 0 0 8px rgba(239,68,68,0.4);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    vertical-align: middle;
}

.status-indicator.green {
    background: #34D399;
    box-shadow: 0 0 6px rgba(52,211,153,0.5);
}

/* Color utility classes */
.green { color: #34D399; }
.amber { color: #FBBF24; }
.red { color: #EF4444; }

.data-num {
    font-family: 'Space Mono', monospace;
    font-weight: 500;
}

/* ===== SECTION 1: HERO ===== */
.hero {
    position: relative;
    z-index: 1;
    padding: 4rem 2rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-perspective {
    perspective: 1200px;
    position: relative;
    max-width: 750px;
    width: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-panel {
    padding: 3rem 2.5rem;
    text-align: center;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 0 40px rgba(99,102,241,0.1);
    transform-style: preserve-3d;
}

.small-panel {
    padding: 0.75rem 1rem;
    position: absolute;
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
}

.small-panel:hover {
    transform: translateZ(40px) scale(1.05);
}

.metric-float.top-left { top: 10px; left: 0; }
.metric-float.top-right { top: 10px; right: 0; }
.metric-float.bottom-left { bottom: 10px; left: 0; }
.metric-float.bottom-right { bottom: 10px; right: 0; }

.metric-label {
    font-size: 0.7rem;
    color: #E0E7FF;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-val {
    font-family: 'Space Mono', monospace;
    font-weight: 500;
    font-size: 0.85rem;
    color: #FFFFFF;
}

.hero-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    color: #FFFFFF;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.hero-sub {
    font-size: 0.95rem;
    color: #E0E7FF;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.cta-btn {
    display: inline-block;
    background: #6366F1;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.7rem 1.8rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}

.cta-btn:hover {
    background: #4F46E5;
    box-shadow: 0 6px 25px rgba(99,102,241,0.5);
    transform: translateY(-2px);
}

/* ===== SECTION 2: DOMAINS ===== */
.domains {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.domain-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.domain-card {
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.domain-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(99,102,241,0.12);
}

.domain-card:nth-child(1) { transform: translateZ(0); }
.domain-card:nth-child(2) { transform: translateZ(0); }
.domain-card:nth-child(3) { transform: translateZ(0); }
.domain-card:nth-child(4) { transform: translateZ(0); }

.domain-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.domain-name {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: #FFFFFF;
    flex: 1;
}

.domain-badge {
    margin-left: auto;
}

.domain-metrics {
    margin-bottom: 0.75rem;
}

.dm-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.dm-label {
    font-size: 0.8rem;
    color: #E0E7FF;
}

.dm-val {
    font-family: 'Space Mono', monospace;
    font-weight: 500;
    font-size: 0.8rem;
    color: #FFFFFF;
}

.mini-chart {
    height: 32px;
    margin: 0.75rem 0;
    position: relative;
}

.mini-chart canvas {
    width: 100%;
    height: 100%;
}

.deep-link {
    font-size: 0.8rem;
    color: #6366F1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.deep-link:hover {
    color: #818CF8;
}

/* ===== SECTION 3: INTELLIGENCE ===== */
.intelligence {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Correlation Dashboard */
.correlation-dashboard {
    margin-bottom: 2rem;
}

.correlation-panel {
    padding: 2rem;
}

.correlation-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #FFFFFF;
    margin-bottom: 1.25rem;
    text-align: center;
}

.correlation-svg {
    width: 100%;
    max-height: 200px;
    margin-bottom: 1.5rem;
}

.corr-node {
    fill: rgba(255,255,255,0.08);
    stroke: rgba(255,255,255,0.2);
    stroke-width: 1.5;
    transition: fill 0.3s ease;
}

.corr-node:hover {
    fill: rgba(99,102,241,0.2);
}

.transit-node { stroke: #6366F1; }
.energy-node { stroke: #FBBF24; }
.safety-node { stroke: #34D399; }
.env-node { stroke: #34D399; }

.corr-node-label {
    fill: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

.corr-line {
    fill: none;
    stroke: rgba(99,102,241,0.4);
    stroke-width: 1.5;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: drawLine 2s ease forwards;
}

.corr-line.line-transit-energy { stroke: rgba(99,102,241,0.5); animation-delay: 0.2s; }
.corr-line.line-energy-safety { stroke: rgba(251,191,36,0.4); animation-delay: 0.5s; }
.corr-line.line-safety-env { stroke: rgba(52,211,153,0.4); animation-delay: 0.8s; }
.corr-line.line-transit-env { stroke: rgba(99,102,241,0.3); stroke-dasharray: 4 4; animation-delay: 1.1s; }

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

.corr-link-label {
    fill: #E0E7FF;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    text-anchor: middle;
    opacity: 0;
    animation: fadeLabel 0.5s ease forwards;
    animation-delay: 2s;
}

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

.correlation-insights {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.insight-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.insight-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.insight-indicator.green {
    background: #34D399;
    box-shadow: 0 0 6px rgba(52,211,153,0.4);
}

.insight-indicator.amber {
    background: #FBBF24;
    box-shadow: 0 0 6px rgba(251,191,36,0.4);
}

.insight-text {
    font-size: 0.8rem;
    color: #E0E7FF;
    line-height: 1.4;
}

/* City Map */
.city-map-wrapper {
    margin-bottom: 2rem;
}

.map-panel {
    padding: 1.5rem;
    overflow: hidden;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.map-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #FFFFFF;
}

.map-toggles {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.map-toggle {
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    color: #E0E7FF;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    transition: all 0.25s ease;
}

.map-toggle:hover {
    background: rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.3);
}

.map-toggle.active {
    background: rgba(99,102,241,0.2);
    border-color: #6366F1;
    color: #FFFFFF;
}

.map-container {
    background: rgba(15,23,41,0.5);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}

.city-map-svg {
    width: 100%;
    display: block;
}

.grid-line {
    stroke: rgba(255,255,255,0.04);
    stroke-width: 0.5;
}

/* Transit layer */
.map-layer {
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.map-layer.active {
    opacity: 1;
    pointer-events: auto;
}

.transit-route {
    fill: none;
    stroke: #6366F1;
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 0.7;
}

.transit-stop {
    fill: #6366F1;
    opacity: 0.8;
}

.transit-hub {
    fill: #6366F1;
    stroke: rgba(99,102,241,0.4);
    stroke-width: 3;
}

/* Energy layer */
.energy-zone {
    opacity: 0.5;
    rx: 4;
}

.energy-zone.high { fill: #FBBF24; }
.energy-zone.medium { fill: #6366F1; opacity: 0.4; }
.energy-zone.low { fill: #34D399; opacity: 0.3; }

.energy-grid-line {
    stroke: #FBBF24;
    stroke-width: 1;
    opacity: 0.3;
    stroke-dasharray: 4 4;
}

/* Safety layer */
.safety-zone {
    fill: rgba(52,211,153,0.08);
    stroke: #34D399;
    stroke-width: 1;
    stroke-dasharray: 4 4;
    opacity: 0.6;
}

.safety-icon {
    fill: #34D399;
}

/* Environment layer */
.env-green-zone {
    fill: rgba(52,211,153,0.15);
    stroke: #34D399;
    stroke-width: 1;
    opacity: 0.6;
}

/* City Score */
.score-wrapper {
    max-width: 650px;
    margin: 0 auto;
}

.score-panel {
    padding: 2rem;
    display: flex;
    gap: 2.5rem;
    align-items: center;
    box-shadow: 0 0 40px rgba(99,102,241,0.08);
}

.score-display {
    text-align: center;
    min-width: 130px;
}

.score-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 0.5rem;
}

.score-ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.08);
    stroke-width: 6;
}

.score-ring-fill {
    fill: none;
    stroke: #34D399;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s ease;
}

.score-num {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Space Mono', monospace;
    font-weight: 500;
    font-size: 2.5rem;
    color: #34D399;
}

.score-label {
    font-size: 0.75rem;
    color: #E0E7FF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.score-breakdown {
    flex: 1;
}

.sb-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.sb-label {
    font-size: 0.8rem;
    color: #E0E7FF;
    min-width: 5.5rem;
}

.sb-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}

.sb-fill {
    height: 100%;
    background: #6366F1;
    border-radius: 3px;
    width: 0;
    transition: width 1.2s ease;
}

.sb-fill.amber-fill {
    background: #FBBF24;
}

.sb-val {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: #FFFFFF;
    min-width: 1.5rem;
    text-align: right;
}

/* ===== SECTION 4: OPERATIONS ===== */
.operations {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.alerts-panel {
    padding: 1.5rem;
}

.alerts-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #FFFFFF;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alerts-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #34D399;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(52,211,153,0.5);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.alert-stream {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.alert-stream::-webkit-scrollbar {
    width: 4px;
}

.alert-stream::-webkit-scrollbar-track {
    background: transparent;
}

.alert-stream::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.04);
    transition: background 0.2s ease;
}

.alert-item:hover {
    background: rgba(255,255,255,0.06);
}

.alert-item.new-alert {
    animation: slideInAlert 0.4s ease;
}

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

.alert-time {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: rgba(224,231,255,0.6);
    min-width: 3rem;
}

.alert-domain {
    font-size: 0.6rem;
    min-width: 4.5rem;
    text-align: center;
}

.alert-msg {
    font-size: 0.8rem;
    color: #E0E7FF;
    flex: 1;
}

/* ===== FOOTER ===== */
.footer {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
    background: linear-gradient(180deg, transparent 0%, rgba(15,23,41,0.8) 100%);
}

.footer-panel {
    padding: 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.footer-col-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    color: #FFFFFF;
    margin-bottom: 0.25rem;
}

.flink {
    font-size: 0.8rem;
    color: #E0E7FF;
    text-decoration: none;
    transition: color 0.2s ease;
}

.flink:hover {
    color: #6366F1;
}

.footer-bottom {
    text-align: center;
}

.footer-copy {
    font-size: 0.7rem;
    color: rgba(224,231,255,0.6);
}

/* ===== FADE-IN ANIMATION ===== */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .domain-grid {
        grid-template-columns: 1fr;
    }

    .score-panel {
        flex-direction: column;
        text-align: center;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .map-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 640px) {
    .small-panel {
        position: static;
        margin-bottom: 0.5rem;
    }

    .hero-perspective {
        flex-direction: column;
        min-height: auto;
        gap: 0.75rem;
        perspective: none;
    }

    .hero {
        min-height: auto;
        padding: 3rem 1.5rem;
    }

    .correlation-svg {
        max-height: 150px;
    }

    .alert-item {
        flex-wrap: wrap;
    }
}
