/* ==========================================================================
   ZSM Status — Public Status Page
   Design system: ZSM Digital (dark minimal, monochromatic, Inter + Playfair)
   ========================================================================== */

/* ── Variables & Reset ── */
:root {
    --bg-color: #050505;
    --card-bg-top: #0a0a0b;
    --card-bg-bottom: #111113;
    --accent-glow: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text-main: #ffffff;
    --text-secondary: #999999;
    --text-muted: #888888;
    --accent-color: #ffffff;
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.10);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.10);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.10);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── Navbar ─────────────────────────────────────────────────────────── */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(5, 5, 5, 0.85);
    padding: 16px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(20px);
    z-index: 1000;
    transition: all 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: url('/static/images/logo.png') center/contain no-repeat;
    filter: brightness(1.2);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-last-check {
    color: #555;
    font-size: 12px;
    font-weight: 400;
}

/* ── Hero ───────────────────────────────────────────────────────────── */

.hero {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 140px 20px 80px;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(255, 255, 255, 0.02) 0%, transparent 70%),
        var(--bg-color);
}

/* Dot texture — ZSM Digital signature pattern */
.hero-dot-texture {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 24px 24px;
    z-index: 1;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, black 20%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, black 20%, transparent 72%);
    pointer-events: none;
}

/* Subtle centre glow */
.hero-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.015) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    opacity: 0;
    transform: translateY(30px);
    animation: heroReveal 1s cubic-bezier(0.23, 1, 0.32, 1) 0.3s forwards;
}

@keyframes heroReveal {
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-content {
        animation: none;
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 120px 20px 60px;
        min-height: 40vh;
    }

    .hero-content {
        max-width: 100%;
    }
}
/* ── Hero Logo ─────────────────────────────────────────────────────── */

.hero-logo {
    display: block;
    width: 150px;
    max-width: 40vw;
    margin: 0 auto 40px;
    object-fit: contain;
}

@keyframes heroLogo {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ── Overall Badge ──────────────────────────────────────────────────── */

.overall-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    border-radius: 2px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}

/* Subtle shine across badge */
.overall-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0.02) 100%);
    pointer-events: none;
}

.overall-badge.operational {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.15);
}

.overall-badge.degraded {
    background: var(--warning-soft);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.overall-badge.outage {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.overall-badge.unknown {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}


.hero-subtitle {
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.6;
}

.hero-subtitle em {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ── Container & Sections ──────────────────────────────────────────── */

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 40px 0;
}

.section-label {
    font-family: 'Inter', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: block;
    padding-left: 2px;
}

/* ── Service Group ─────────────────────────────────────────────────── */

.service-group {
    margin-bottom: 40px;
}

/* ── Service Card ──────────────────────────────────────────────────── */

.service-card {
    position: relative;
    background: var(--card-bg-top);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 12px;
    transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
}

/* Gradient shine overlay — same as ZSM Digital bento cells */
.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0.015) 100%);
    pointer-events: none;
    z-index: 1;
}

.service-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px) translateZ(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.service-card-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px;
    position: relative;
    z-index: 2;
}

.service-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-indicator-wrap {
    position: relative;
    width: 14px;
    height: 14px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.status-indicator.operational {
    background: var(--success);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.status-indicator.degraded {
    background: var(--warning);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.status-indicator.down {
    background: var(--danger);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.status-indicator.unknown {
    background: var(--text-muted);
}

/* Animated ring around operational dot */
.indicator-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid var(--success);
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: ringPulse 2.5s ease-out infinite;
}

@keyframes ringPulse {
    0% { width: 10px; height: 10px; opacity: 0.5; }
    100% { width: 28px; height: 28px; opacity: 0; }
}

.service-identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.service-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.service-status-text {
    font-size: 12px;
    font-weight: 400;
}

.service-status-text.operational { color: var(--success); }
.service-status-text.degraded { color: var(--warning); }
.service-status-text.down { color: var(--danger); }
.service-status-text.unknown { color: var(--text-muted); }

.service-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.service-metric {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.metric-value {
    font-size: 18px;
    font-weight: 300;
    letter-spacing: -0.03em;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.metric-unit {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.metric-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    font-weight: 500;
}

.metric-divider {
    width: 1px;
    height: 32px;
    background: var(--border-color);
}

/* ── Uptime Bar ────────────────────────────────────────────────────── */

.uptime-bar {
    height: 2px;
    background: rgba(255, 255, 255, 0.04);
    position: relative;
    z-index: 2;
}

.uptime-bar-fill {
    height: 100%;
    transition: width 1s cubic-bezier(0.23, 1, 0.32, 1);
}

.uptime-bar-fill.operational {
    background: linear-gradient(90deg, var(--success), rgba(34, 197, 94, 0.4));
}

.uptime-bar-fill.degraded {
    background: linear-gradient(90deg, var(--warning), rgba(245, 158, 11, 0.4));
}

.uptime-bar-fill.down {
    background: linear-gradient(90deg, var(--danger), rgba(239, 68, 68, 0.4));
}

/* ── Incidents ─────────────────────────────────────────────────────── */

.incident-card {
    background: var(--card-bg-top);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: 24px 28px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
}

.incident-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0.01) 100%);
    pointer-events: none;
}

.incident-card:hover {
    border-color: var(--border-hover);
}

.incident-card.severity-critical {
    border-left: 3px solid var(--danger);
}

.incident-card.severity-warning {
    border-left: 3px solid var(--warning);
}

.incident-card.severity-info {
    border-left: 3px solid var(--text-muted);
}

.incident-card.resolved {
    border-left: 3px solid var(--success);
    opacity: 0.6;
}

.incident-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.incident-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 10px;
    border-radius: 2px;
}

.incident-badge.critical {
    background: var(--danger-soft);
    color: var(--danger);
}

.incident-badge.warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.incident-badge.info {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.incident-badge.resolved {
    background: var(--success-soft);
    color: var(--success);
}

.incident-title {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-main);
}

.incident-time {
    font-size: 12px;
    color: #555;
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.incident-message {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

/* ── Footer ────────────────────────────────────────────────────────── */

.footer {
    background: rgba(0, 0, 0, 0.4);
    padding: 60px 24px 30px;
    margin-top: 80px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    font-weight: 500;
    margin-bottom: 14px;
    font-size: 0.85rem;
    color: #fff;
}

.footer-col a {
    color: #555;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.footer-col a:hover {
    color: #999;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 10px;
}

.footer-logo .logo-icon {
    width: 24px;
    height: 24px;
}

.footer-desc {
    color: #555;
    font-size: 13px;
    line-height: 1.6;
    max-width: 340px;
}

.footer-bottom {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #444;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-refresh {
    color: #444;
    font-size: 12px;
}

/* ── Scroll Reveal Animations (ZSM Digital style) ──────────────────── */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children */
.stagger-children > .reveal:nth-child(1) { transition-delay: 0.05s; }
.stagger-children > .reveal:nth-child(2) { transition-delay: 0.12s; }
.stagger-children > .reveal:nth-child(3) { transition-delay: 0.19s; }
.stagger-children > .reveal:nth-child(4) { transition-delay: 0.26s; }
.stagger-children > .reveal:nth-child(5) { transition-delay: 0.33s; }
.stagger-children > .reveal:nth-child(6) { transition-delay: 0.40s; }
.stagger-children > .reveal:nth-child(7) { transition-delay: 0.47s; }

/* ── Responsive ────────────────────────────────────────────────────── */

/* ── Chrome / Molten Metal Blobs ───────────────────────────────────── */

.chrome-blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.12;
    background:
        /* Top-left specular highlight */
        radial-gradient(ellipse 40% 35% at 28% 22%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.4) 30%, transparent 65%),
        /* Secondary reflected light from bottom-right */
        radial-gradient(ellipse 50% 40% at 72% 78%, rgba(200,200,210,0.5) 0%, transparent 55%),
        /* Rim light — edge catch */
        radial-gradient(ellipse 90% 90% at 50% 50%, transparent 60%, rgba(255,255,255,0.15) 80%, transparent 100%),
        /* Core chrome sweep */
        conic-gradient(from 200deg at 48% 48%, #e8e8e8 0deg, #777 50deg, #fff 100deg, #999 150deg, #e0e0e0 200deg, #888 260deg, #f5f5f5 310deg, #ccc 360deg);
    box-shadow:
        inset 0 0 40px rgba(255,255,255,0.08),
        inset 0 -20px 40px rgba(0,0,0,0.3),
        0 0 60px rgba(255,255,255,0.03);
    animation: blobFloat 20s ease-in-out infinite;
}

/* Specular highlight — hot spot */
.chrome-blob::before {
    content: '';
    position: absolute;
    width: 45%;
    height: 35%;
    top: 12%;
    left: 18%;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.2) 40%, transparent 70%);
    filter: blur(6px);
    transform: rotate(-15deg);
}

/* Reflected environment light — bottom edge */
.chrome-blob::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 30%;
    bottom: 12%;
    right: 10%;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 60%, rgba(180,180,200,0.35) 0%, transparent 70%);
    filter: blur(10px);
    transform: rotate(8deg);
}

.blob-1 {
    width: 320px;
    height: 280px;
    top: -60px;
    right: -80px;
    border-radius: 60% 40% 55% 45% / 55% 60% 40% 45%;
    opacity: 0.10;
    animation-duration: 22s;
    animation-delay: 0s;
    box-shadow:
        inset 20px -15px 50px rgba(0,0,0,0.4),
        inset -10px 10px 30px rgba(255,255,255,0.1),
        0 0 80px rgba(255,255,255,0.04);
}

.blob-2 {
    width: 200px;
    height: 200px;
    bottom: 20px;
    left: -60px;
    border-radius: 45% 55% 60% 40% / 40% 45% 55% 60%;
    opacity: 0.07;
    animation-duration: 26s;
    animation-delay: -5s;
    box-shadow:
        inset 15px -10px 40px rgba(0,0,0,0.35),
        inset -8px 8px 25px rgba(255,255,255,0.08),
        0 0 60px rgba(255,255,255,0.03);
}

.blob-3 {
    width: 140px;
    height: 140px;
    top: 35%;
    left: 15%;
    border-radius: 50% 50% 45% 55% / 55% 40% 60% 45%;
    opacity: 0.06;
    animation-duration: 18s;
    animation-delay: -10s;
    box-shadow:
        inset 12px -8px 30px rgba(0,0,0,0.35),
        inset -6px 6px 20px rgba(255,255,255,0.08),
        0 0 50px rgba(255,255,255,0.025);
}

.blob-4 {
    width: 260px;
    height: 220px;
    top: 80px;
    right: -100px;
    border-radius: 55% 45% 50% 50% / 45% 55% 45% 55%;
    opacity: 0.06;
    animation-duration: 24s;
    animation-delay: -3s;
    box-shadow:
        inset 18px -12px 45px rgba(0,0,0,0.38),
        inset -8px 8px 28px rgba(255,255,255,0.08),
        0 0 70px rgba(255,255,255,0.03);
}

.blob-5 {
    width: 180px;
    height: 180px;
    bottom: 100px;
    left: -60px;
    border-radius: 40% 60% 55% 45% / 60% 40% 55% 45%;
    opacity: 0.05;
    animation-duration: 28s;
    animation-delay: -8s;
    box-shadow:
        inset 14px -10px 35px rgba(0,0,0,0.35),
        inset -7px 7px 22px rgba(255,255,255,0.08),
        0 0 55px rgba(255,255,255,0.025);
}

@keyframes blobFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    25% {
        transform: translate(15px, -20px) rotate(5deg) scale(1.05);
    }
    50% {
        transform: translate(-10px, 10px) rotate(-3deg) scale(0.97);
    }
    75% {
        transform: translate(8px, 15px) rotate(4deg) scale(1.03);
    }
}

/* Sections need relative positioning for blob containment */
.services-section {
    position: relative;
    overflow: hidden;
}


@media (max-width: 640px) {
    .chrome-blob {
        display: none;
    }

    .navbar {
        padding: 14px 20px;
    }

    .hero {
        padding: 120px 20px 60px;
        min-height: 40vh;
    }

    .overall-badge {
        padding: 12px 20px;
        font-size: 14px;
    }

    .service-card-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 18px 20px;
    }

    .service-right {
        width: 100%;
        justify-content: flex-start;
    }

    .service-metric {
        align-items: flex-start;
    }

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

    .incident-time {
        margin-left: 0;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

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