/* ================================================================
   sys-monitor landing page
   Brutalist dark + yellow theme
   ================================================================ */

/* ── Reset ─────────────────────────────────────────────────────── */

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

/* ── Tokens ────────────────────────────────────────────────────── */

:root {
    --bg: #0a0a0a;
    --bg-surface: #111111;
    --bg-raised: #1a1a1a;
    --border: #2a2a2a;
    --border-bold: #333333;

    --yellow: #f5d800;
    --yellow-dim: #bfa600;
    --yellow-hover: #ffe63b;

    --text: #e0e0e0;
    --text-dim: #888888;
    --text-muted: #555555;

    --mono: "JetBrains Mono", "Fira Code", "SF Mono", "Cascadia Code", "Consolas", monospace;
    --sans: "Inter", "Helvetica Neue", Arial, sans-serif;

    --max-w: 1080px;
    --gutter: 24px;
}

/* ── Base ──────────────────────────────────────────────────────── */

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.6;
}

body.no-scroll {
    overflow: hidden;
}

/* ── Loading Overlay ───────────────────────────────────────────── */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.terminal-loader {
    font-family: var(--mono);
    font-size: 1.2rem;
    color: var(--yellow);
    display: flex;
    align-items: center;
    gap: 8px;
}

.terminal-loader .loader-cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: var(--yellow);
    animation: blink 1s step-end infinite;
}

a {
    color: var(--yellow);
    text-decoration: none;
}

a:hover {
    color: var(--yellow-hover);
}

::selection {
    background: var(--yellow);
    color: var(--bg);
}

img {
    max-width: 100%;
    display: block;
}

/* ── Typography ────────────────────────────────────────────────── */

h1,
h2,
h3,
h4 {
    font-family: var(--mono);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2rem, 8vw, 4rem);
}

h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    margin-bottom: 16px;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

p {
    max-width: 640px;
}

code,
pre {
    font-family: var(--mono);
}

/* ── Layout ────────────────────────────────────────────────────── */

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section {
    padding: 80px 0;
}

/* ── Navigation ────────────────────────────────────────────────── */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-brand {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1rem;
    color: var(--yellow);
    letter-spacing: -0.02em;
}

.nav-chevron {
    color: var(--yellow);
}

.nav-cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.85rem;
    transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--yellow);
}

.nav-mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
}

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

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 56px;
    border-bottom: 2px solid var(--yellow);
}

.hero-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 64px;
    padding-top: 48px;
    padding-bottom: 48px;
}

.hero-text {
    width: 100%;
    max-width: 720px;
    min-width: 0;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-visual-wrapper {
    width: 100%;
    margin: 0 auto;
    perspective: 1200px;
    /* Provides the 3D space */
}

.hero-visual {
    position: relative;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--bg-surface);
    overflow: hidden;
    box-shadow: 6px 6px 0 var(--yellow);

    /* Animation defaults driven by JS */
    --scroll-progress: 0;

    transform:
        rotateX(calc((1 - var(--scroll-progress)) * 20deg)) scale(calc(0.85 + (var(--scroll-progress) * 0.15)));

    transform-origin: top center;
    will-change: transform;
    transition: box-shadow 0.2s;
}

.hero-visual:hover {
    box-shadow: 9px 9px 0 var(--yellow);
}

.hero-visual img {
    width: 100%;
    height: auto;
    display: block;
}

.hero-tag {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--yellow-dim);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 20px;
}

.hero h1 {
    color: var(--text);
    margin-bottom: 24px;
}

.hero h1 span {
    color: var(--yellow);
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-bottom: 48px;
    line-height: 1.7;
}

/* ── Install block ─────────────────────────────────────────────── */

.install-block {
    width: 100%;
    margin-bottom: 48px;
    text-align: left;
}

.install-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 0;
}

.install-tabs {
    display: flex;
    gap: 0;
}

.install-tab {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-bottom: none;
    padding: 10px 20px;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.install-tab:first-child {
    border-right: none;
}

.install-tab.active {
    background: var(--bg-surface);
    color: var(--yellow);
    border-top: 2px solid var(--yellow);
}

.view-script-link {
    background: none;
    border: none;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 10px 0;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color 0.15s;
}

.view-script-link:hover {
    color: var(--yellow);
}

.install-cmd {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.install-cmd code {
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
    width: 100%;
}

.install-cmd-hidden {
    display: none;
}

.copy-btn {
    background: none;
    border: 1px solid var(--border-bold);
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.75rem;
    padding: 6px 14px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.copy-btn:hover {
    border-color: var(--yellow);
    color: var(--yellow);
}

.copy-btn.copied {
    border-color: var(--yellow);
    color: var(--yellow);
}

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

.hero-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-links a {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    padding-bottom: 2px;
    transition: color 0.15s, border-color 0.15s;
}

.hero-links a:hover {
    color: var(--yellow);
    border-color: var(--yellow);
}

/* ── Features (below hero) ─────────────────────────────────────── */

.features {
    border-bottom: 1px solid var(--border);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
}

.feature-card {
    background: var(--bg);
    padding: 40px 32px;
}

.feature-card h3 {
    font-family: var(--mono);
    color: var(--yellow);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.6;
}

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

.footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-text {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.footer-links a {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: color 0.15s;
}

.footer-links a:hover {
    color: var(--yellow);
}

/* ================================================================
   DOCS PAGE
   ================================================================ */

.docs-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 48px;
    padding-top: 56px;
    min-height: 100vh;
}

.docs-sidebar {
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 32px 0;
    border-right: 1px solid var(--border);
}

.docs-sidebar-title {
    font-family: var(--mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding: 0 16px;
}

.docs-nav {
    list-style: none;
}

.docs-nav li a {
    display: block;
    padding: 8px 16px;
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--text-dim);
    border-left: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.docs-nav li a:hover,
.docs-nav li a.active {
    color: var(--yellow);
    border-left-color: var(--yellow);
}

.docs-content {
    padding: 40px 0 80px;
    max-width: 680px;
    min-width: 0;
}

.docs-content h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.docs-content .docs-subtitle {
    color: var(--text-dim);
    font-size: 1rem;
    margin-bottom: 48px;
}

.docs-content h2 {
    font-size: 1.3rem;
    margin-top: 56px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--yellow);
}

.docs-content h3 {
    font-size: 1rem;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--text);
}

.docs-content p {
    margin-bottom: 16px;
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.7;
}

.docs-content ul,
.docs-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.docs-content li {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 6px;
}

.docs-content pre {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 20px 24px;
    margin-bottom: 0;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text);
}

.code-block {
    position: relative;
    margin-bottom: 24px;
}

.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--bg-raised);
    border: 1px solid var(--border-bold);
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.7rem;
    padding: 4px 10px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, opacity 0.15s;
    opacity: 0;
    z-index: 1;
}

.code-block:hover .code-copy-btn {
    opacity: 1;
}

.code-copy-btn:hover {
    border-color: var(--yellow);
    color: var(--yellow);
}

.code-copy-btn.copied {
    border-color: var(--yellow);
    color: var(--yellow);
    opacity: 1;
}

.docs-content code {
    font-size: 0.85rem;
}

.docs-content p code,
.docs-content li code {
    background: var(--bg-raised);
    padding: 2px 6px;
    border: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--yellow);
}

.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 0.9rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.docs-content th {
    text-align: left;
    padding: 10px 16px;
    font-family: var(--mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--yellow-dim);
    border-bottom: 2px solid var(--border-bold);
}

.docs-content td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
}

.docs-content td code {
    background: var(--bg-raised);
    padding: 2px 6px;
    border: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text);
}

/* ── Modal ─────────────────────────────────────────────────────── */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-surface);
    border: 2px solid var(--yellow);
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--yellow);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.1s;
}

.modal-close:hover {
    color: var(--yellow);
}

.modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
    background: #0d0d0d;
}

.modal-body pre {
    margin: 0;
    padding: 24px;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-all;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

/* ================================================================
   PRIVACY / TERMS PAGE
   ================================================================ */

.legal-page {
    padding-top: 56px;
    min-height: 100vh;
}

.legal-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 64px var(--gutter) 80px;
}

.legal-content h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.legal-content .legal-updated {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 48px;
}

.legal-content h2 {
    font-size: 1.2rem;
    margin-top: 48px;
    margin-bottom: 12px;
    color: var(--yellow);
}

.legal-content p {
    margin-bottom: 16px;
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.7;
}

.legal-content ul {
    margin-bottom: 16px;
    padding-left: 24px;
}

.legal-content li {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 6px;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 768px) {
    :root {
        --gutter: 16px;
    }

    .section {
        padding: 60px 0;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: center;
        padding: 16px var(--gutter);
        gap: 12px;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-mobile-toggle {
        display: block;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .docs-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .docs-sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 24px 0;
    }

    .hero {
        min-height: auto;
        padding-top: 100px;
        padding-bottom: 60px;
    }

    .hero-content {
        gap: 48px;
    }

    .hero-links {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .install-cmd {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .install-cmd code {
        font-size: 0.78rem;
    }

    .footer-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 24px;
    }
}

@media (max-width: 480px) {
    .install-header {
        flex-wrap: wrap;
    }

    .install-tabs {
        width: 100%;
        order: 2;
        display: flex;
        flex-direction: row;
    }

    .view-script-link {
        width: 100%;
        order: 1;
        text-align: right;
        padding-top: 0;
        padding-bottom: 8px;
    }

    .install-tab {
        flex: 1;
        border: 1px solid var(--border);
        border-bottom: none;
    }

    .install-tab:first-child {
        border-right: none;
    }
}