/* ----- Z LAG color variables ----- */
:root {
    --bg: #03040c;
    --bg-soft: #070a16;
    --panel: rgba(5, 9, 23, 0.72);
    --panel-strong: rgba(8, 12, 29, 0.9);
    --line: rgba(126, 148, 255, 0.32);
    --line-bright: rgba(109, 151, 255, 0.72);
    --text: #f8fbff;
    --muted: #a9b0c5;
    --blue: #25a8ff;
    --blue-soft: #6db7ff;
    --purple: #9b55ff;
    --violet: #6d38ff;
    --pink: #d35cff;
    --green: #2ecc71;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --font-sans: 'Space Grotesk', Arial, sans-serif;
    --font-display: 'Orbitron', monospace;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ----- Register custom property for snake animation ----- */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* ----- Reset & base ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: radial-gradient(ellipse at 12% 92%, rgba(24, 91, 255, 0.24), transparent 32%),
                radial-gradient(ellipse at 95% 8%, rgba(119, 43, 255, 0.22), transparent 28%),
                linear-gradient(180deg, #03040d 0%, #02030a 48%, #03040c 100%);
    color: var(--text);
    font-family: var(--font-sans);
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
body::-webkit-scrollbar {
    display: none;
}

/* subtle grid overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 92px 92px;
    opacity: 0.12;
}

/* vignette */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(2, 3, 10, 0.84), transparent 16%, transparent 84%, rgba(2, 3, 10, 0.86)),
        linear-gradient(180deg, rgba(2, 3, 10, 0.5), transparent 24%, rgba(2, 3, 10, 0.92));
}

a {
    color: inherit;
    text-decoration: none;
}
button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== ANIMATED GLOW (AtlasOS Style) ===== */
@keyframes pulseGlow {
    0% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(0.95);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(0.95);
    }
}

.hero-glow {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1000px;
    height: 80%;
    background: radial-gradient(ellipse at center, rgba(37, 168, 255, 0.15), rgba(155, 85, 255, 0.08) 50%, transparent 80%);
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
    animation: pulseGlow 4s ease-in-out infinite;
}

/* ----- Header ----- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 14px 0;
    background: rgba(3, 4, 12, 0.6);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(126, 148, 255, 0.12);
    transition: background 0.3s;
}
.site-header.scrolled {
    background: rgba(3, 4, 12, 0.94);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: 0.02em;
}
.logo .z {
    color: var(--blue);
    text-shadow: 0 0 20px rgba(37, 168, 255, 0.4);
}
.logo .lag {
    color: #fff;
}
.logo .os {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
    margin-left: 4px;
    font-family: var(--font-sans);
}
.logo .badge {
    font-size: 0.55rem;
    background: rgba(37, 168, 255, 0.18);
    color: var(--blue-soft);
    padding: 2px 10px;
    border-radius: 30px;
    margin-left: 6px;
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid rgba(37, 168, 255, 0.12);
}

.nav {
    display: flex;
    align-items: center;
    gap: 28px;
}
.nav a {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--muted);
    transition: color 0.2s;
    position: relative;
}
.nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--blue);
    transition: width 0.2s;
}
.nav a:hover {
    color: #fff;
}
.nav a:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s;
    border: 1px solid transparent;
}
.btn-primary {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: #fff;
    box-shadow: 0 4px 24px rgba(37, 168, 255, 0.25);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 40px rgba(37, 168, 255, 0.4);
}
.btn-ghost {
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
}
.btn-github {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text);
}
.btn-github:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.menu-toggle {
    display: none;
    font-size: 1.6rem;
    color: var(--text);
}

/* ----- Hero ----- */
.hero {
    padding: 140px 0 70px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 20px;
    border-radius: 40px;
    background: rgba(37, 168, 255, 0.10);
    border: 1px solid rgba(37, 168, 255, 0.15);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--blue-soft);
    letter-spacing: 0.04em;
    margin-bottom: 24px;
    backdrop-filter: blur(4px);
    position: relative;
    z-index: 1;
}
.hero-badge i {
    color: var(--blue);
}
.hero h1 {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 38%, var(--blue-soft) 78%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}
.hero h1 .highlight {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero .subtitle {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 680px;
    margin: 0 auto 12px;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}
.hero .framework {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--blue-soft);
    background: rgba(37, 168, 255, 0.06);
    display: inline-block;
    padding: 4px 16px;
    border-radius: 20px;
    border: 1px solid rgba(37, 168, 255, 0.08);
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}
.hero-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 48px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
.hero-stats .stat {
    text-align: center;
}
.hero-stats .stat .number {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-stats .stat .label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 4px;
}

.warning-banner {
    background: rgba(255, 180, 50, 0.06);
    border: 1px solid rgba(255, 180, 50, 0.15);
    border-radius: var(--radius-sm);
    padding: 16px 24px;
    max-width: 760px;
    margin: 32px auto 0;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-align: left;
    backdrop-filter: blur(4px);
    position: relative;
    z-index: 1;
}
.warning-banner i {
    color: #f1c40f;
    font-size: 1.3rem;
    margin-top: 2px;
    flex-shrink: 0;
}
.warning-banner .warn-text {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.6;
}
.warning-banner .warn-text strong {
    color: #f1c40f;
    font-weight: 600;
}
.warning-banner .warn-text .highlight-warn {
    color: #ff6b6b;
    font-weight: 600;
}

/* ----- Section common ----- */
section {
    padding: 70px 0;
}
.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--blue-soft);
    margin-bottom: 10px;
}
.section-title {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 14px;
    line-height: 1.2;
}
.section-title .highlight {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.section-desc {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 660px;
    line-height: 1.7;
}
.text-center {
    text-align: center;
}
.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* ----- Architecture / Matrix ----- */
.matrix-wrap {
    overflow-x: auto;
    margin-top: 36px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(126, 148, 255, 0.08);
}
.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 560px;
}
.matrix-table th {
    text-align: left;
    padding: 16px 20px;
    background: rgba(37, 168, 255, 0.06);
    color: var(--blue-soft);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid rgba(126, 148, 255, 0.08);
}
.matrix-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(126, 148, 255, 0.05);
    color: var(--text);
    line-height: 1.5;
}
.matrix-table tr:last-child td {
    border-bottom: none;
}
.matrix-table td:first-child {
    font-weight: 600;
    color: var(--blue-soft);
}
.matrix-table td:last-child {
    color: var(--muted);
}

/* ----- Features grid ----- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 40px;
}
.feature-card {
    background: var(--panel);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(126, 148, 255, 0.10);
    border-radius: var(--radius-lg);
    padding: 30px 26px;
    transition: all 0.3s;
}
.feature-card:hover {
    border-color: rgba(37, 168, 255, 0.25);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.feature-card .icon {
    font-size: 1.8rem;
    color: var(--blue);
    margin-bottom: 14px;
}
.feature-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.feature-card p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

/* ----- Tech highlights ----- */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 36px;
}
.tech-item {
    background: var(--panel-strong);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-sm);
    padding: 24px 20px;
    border: 1px solid rgba(126, 148, 255, 0.06);
    transition: border-color 0.3s;
}
.tech-item:hover {
    border-color: rgba(37, 168, 255, 0.15);
}
.tech-item .tech-icon {
    font-size: 1.6rem;
    color: var(--blue);
    margin-bottom: 8px;
}
.tech-item h4 {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}
.tech-item p {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}

/* ===== WALLPAPER SHOWCASE (Smooth, Slow Snake Border) ===== */
.showcase-wrapper {
    position: relative;
    display: inline-block;
    margin-top: 40px;
    padding: 20px;
}

/* Animated Outer Glow */
.desktop-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110%;
    max-width: 1000px;
    aspect-ratio: 16 / 9;
    background: radial-gradient(ellipse at center, rgba(37, 168, 255, 0.25), rgba(155, 85, 255, 0.15) 50%, transparent 80%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    animation: pulseGlow 6s ease-in-out infinite; /* slower glow too */
}

/* The frame – now bigger and with a slow snake */
.desktop-frame {
    position: relative;
    z-index: 1;
    width: 92%; /* relative to container */
    max-width: 1000px; /* was 820px – now larger */
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    padding: 3px; /* thin border track */
    /* Conic gradient: a small colored segment (the snake) */
    background: conic-gradient(
        from var(--angle),
        transparent 0%,
        #25a8ff 3%,
        #9b55ff 6%,
        #d35cff 10%,
        transparent 10%,
        transparent 100%
    );
    animation: rotateSnake 8s linear infinite; /* slower, smooth */
    /* Enhanced glow on the snake itself */
    filter: drop-shadow(0 0 18px rgba(37, 168, 255, 0.9)) drop-shadow(0 0 40px rgba(155, 85, 255, 0.5));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    margin: 0 auto;
}

/* Inner container clips the image */
.desktop-frame-inner {
    width: 100%;
    height: 100%;
    border-radius: calc(var(--radius-lg) - 2px);
    overflow: hidden;
    background: #0a0e1a;
}

.desktop-frame-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Keyframes for the rotating snake */
@keyframes rotateSnake {
    to {
        --angle: 360deg;
    }
}

.showcase-caption {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--muted);
    position: relative;
    z-index: 1;
}

/* ----- Installation steps ----- */
.steps-list {
    max-width: 760px;
    margin: 32px auto 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}
.step-item {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    background: var(--panel);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(126, 148, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 18px 24px;
    transition: border-color 0.3s;
}
.step-item:hover {
    border-color: rgba(37, 168, 255, 0.12);
}
.step-num {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--blue);
    flex-shrink: 0;
    width: 32px;
    text-align: center;
    opacity: 0.7;
}
.step-content {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
}
.step-content strong {
    color: var(--text);
    font-weight: 600;
}
.step-content .code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--blue-soft);
}
.critical-box {
    background: rgba(255, 80, 80, 0.06);
    border-left: 3px solid #ff6b6b;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin: 8px 0 4px;
}
.critical-box strong {
    color: #ff6b6b;
}

/* ----- Post-deployment ----- */
.post-list {
    max-width: 680px;
    margin: 28px auto 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}
.post-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 20px;
    background: var(--panel);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(126, 148, 255, 0.05);
}
.post-item i {
    color: var(--green);
    font-size: 1.1rem;
    margin-top: 2px;
    flex-shrink: 0;
}
.post-item span {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}
.post-item span strong {
    color: var(--text);
}

/* ----- CTA / Download ----- */
.cta-section {
    background: radial-gradient(ellipse at 50% 50%, rgba(37, 168, 255, 0.06), transparent 60%);
    border-top: 1px solid rgba(126, 148, 255, 0.06);
    border-bottom: 1px solid rgba(126, 148, 255, 0.06);
}
.cta-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-top: 28px;
}
.cta-card {
    background: var(--panel-strong);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(126, 148, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    min-width: 220px;
    transition: border-color 0.3s, transform 0.3s;
}
.cta-card:hover {
    border-color: rgba(37, 168, 255, 0.2);
    transform: translateY(-4px);
}
.cta-card .cta-icon {
    font-size: 2.4rem;
    color: var(--blue);
    margin-bottom: 12px;
}
.cta-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.cta-card p {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 16px;
}
.cta-card .btn {
    width: 100%;
    justify-content: center;
}

/* ----- Footer ----- */
.site-footer {
    border-top: 1px solid rgba(126, 148, 255, 0.08);
    padding: 40px 0 32px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}
.site-footer .brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 8px;
}
.site-footer .brand .z {
    color: var(--blue);
}
.site-footer .links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin: 16px 0;
}
.site-footer .links a {
    color: var(--muted);
    transition: color 0.2s;
    font-size: 0.9rem;
}
.site-footer .links a:hover {
    color: #fff;
}
.site-footer .license {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-top: 6px;
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .nav {
        display: none;
        flex-direction: column;
        background: var(--panel-strong);
        backdrop-filter: blur(12px);
        position: absolute;
        top: 68px;
        left: 16px;
        right: 16px;
        border-radius: var(--radius-lg);
        padding: 24px;
        gap: 16px;
        border: 1px solid rgba(126, 148, 255, 0.08);
    }
    .nav.open {
        display: flex;
    }
    .menu-toggle {
        display: block;
    }
    .hero h1 {
        font-size: 2.4rem;
    }
    .hero-stats {
        gap: 24px;
    }
    .section-title {
        font-size: 1.8rem;
    }
    .header-actions .btn-ghost {
        display: none;
    }
    .warning-banner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 16px;
    }
    .step-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .step-num {
        width: auto;
        font-size: 1.1rem;
    }
    .cta-card {
        min-width: 100%;
    }
    .matrix-table {
        font-size: 0.85rem;
        min-width: 400px;
    }
    .matrix-table th,
    .matrix-table td {
        padding: 12px 14px;
    }
    .desktop-frame {
        max-width: 100%;
        border-radius: var(--radius-md);
    }
    .desktop-frame-inner {
        border-radius: calc(var(--radius-md) - 2px);
    }
    .showcase-wrapper {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    .hero .subtitle {
        font-size: 0.95rem;
    }
    .btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .desktop-frame {
        border-radius: var(--radius-sm);
    }
    .desktop-frame-inner {
        border-radius: calc(var(--radius-sm) - 2px);
    }
    .showcase-wrapper {
        padding: 8px;
    }
}