/* ============================================================
   linux-hpc-security — Global Styles
   Dark "terminal" theme. Structure mirrors the AI-ML site,
   palette shifted to emerald/cyan for a systems-engineering feel.
   ============================================================ */

/* NOTE: webfonts load via async <link> in each page <head> (no @import — render-blocking). */

:root {
    --bg:               #0a0e14;
    --surface:          #10151f;
    --surface-hover:    #161d2b;
    --surface-card:     #131a27;
    --border:           #2b3648;
    --border-light:     rgba(255, 255, 255, 0.08);
    --text-main:        #f4f7fb;
    --text-muted:       #9aa7b8;
    --text-dim:         #64748b;
    --primary:          #10b981;
    --primary-glow:     rgba(16, 185, 129, 0.3);
    --accent:           #22d3ee;
    --cyan:             #22d3ee;
    --green:            #10b981;
    --amber:            #f59e0b;
    --red:              #f87171;
    --gradient-primary: linear-gradient(135deg, #10b981, #22d3ee);
    --shadow-card:      0 10px 30px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
p { margin-bottom: 1rem; }

code { font-family: 'JetBrains Mono', Consolas, monospace; font-size: 0.9em; }
code.inline {
    background: rgba(34, 211, 238, 0.14);
    color: var(--cyan);
    padding: 0.15em 0.45em;
    border-radius: 4px;
    font-size: 0.85em;
}
pre {
    background: #070b11;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1rem 0;
}
pre code { background: none; color: #cbd5e1; padding: 0; font-size: 0.85rem; }

.container { width: min(100% - 32px, 1200px); margin-inline: auto; padding: 0 16px; }

/* ---- Header / Navigation ---- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(10, 14, 20, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 14px 0;
}
.nav-container { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--gradient-primary);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px var(--primary-glow);
    font-size: 1.3rem;
}
.brand-text {
    font-weight: 800; font-size: 1.15rem;
    font-family: 'JetBrains Mono', monospace;
    background: linear-gradient(90deg, #ffffff, #6ee7b7);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-sub { font-size: 0.75rem; color: var(--text-dim); font-weight: 300; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
    color: var(--text-muted); font-size: 0.9rem; font-weight: 500;
    transition: color 0.2s ease; position: relative;
}
.nav-links a:hover { color: var(--text-main); }
.nav-links a::after {
    content: ''; position: absolute; bottom: -4px; left: 0;
    width: 0; height: 2px; background: var(--primary); transition: width 0.2s ease;
}
.nav-links a:hover::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 12px; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: 10px; font-size: 0.9rem;
    font-weight: 600; border: 1px solid transparent;
    transition: all 0.25s ease; overflow: hidden;
}
.btn-primary {
    background: var(--gradient-primary); color: #04120c;
    box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}
.btn-outline {
    background: transparent; border-color: var(--border); color: var(--text-main);
}
.btn-outline:hover {
    background: var(--surface-hover); border-color: var(--primary); color: var(--primary);
}
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text-main); background: var(--surface-hover); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-code { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; }

/* ---- Cards ---- */
.card {
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: 16px; padding: 28px;
    transition: all 0.3s ease; box-shadow: var(--shadow-card);
}
.card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-glow);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}
.card-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.card-icon {
    width: 48px; height: 48px; border-radius: 12px;
    background: rgba(16, 185, 129, 0.14);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; flex-shrink: 0;
}
.card-title { font-size: 1.2rem; font-weight: 700; color: var(--text-main); }
.card-meta { font-size: 0.8rem; color: var(--text-dim); margin-top: 4px; }

/* ---- Badge ---- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 999px; font-size: 0.78rem;
    font-weight: 600; border: 1px solid var(--border-light);
}
.badge-primary { background: rgba(16, 185, 129, 0.18); color: var(--primary); }
.badge-green { background: rgba(16, 185, 129, 0.2); color: var(--green); }
.badge-purple { background: rgba(34, 211, 238, 0.18); color: var(--accent); }

/* ---- Hero ---- */
.hero { padding: 100px 0 60px; text-align: center; }
.hero .container { max-width: 820px; }
.hero h1 {
    background: linear-gradient(90deg, #ffffff 0%, #6ee7b7 50%, #67e8f9 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}
.hero .subtitle { font-size: 1.22rem; color: var(--text-muted); max-width: 700px; margin: 0 auto 32px; line-height: 1.7; }
.hero .hero-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-bottom: 32px; }
.hero .badge-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---- Sections ---- */
.section { padding: 72px 0; }
.section-sm { padding: 48px 0; }
.section-alt { background: var(--surface); }
.section-title { text-align: center; margin-bottom: 8px; }
.section-title .highlight {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.section-subtitle { text-align: center; color: var(--text-muted); font-size: 1.05rem; max-width: 740px; margin: 0 auto 48px; }

/* ---- Grid ---- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---- Phase Cards ---- */
.phase-card { position: relative; overflow: hidden; }
.phase-card::before {
    content: attr(data-phase);
    position: absolute; top: 0; right: 0;
    background: var(--gradient-primary); color: #04120c;
    font-size: 0.7rem; font-weight: 700; padding: 4px 14px;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}
.phase-number {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--gradient-primary); color: #04120c;
    font-weight: 700; font-size: 0.9rem; margin-bottom: 16px;
    font-family: 'JetBrains Mono', monospace;
}

/* ---- Timeline ---- */
.timeline { position: relative; padding: 32px 0 0; }
.timeline::before {
    content: ''; position: absolute; top: 0; bottom: 0;
    width: 2px; background: var(--border); left: 30px;
}
.timeline-item { position: relative; padding-left: 80px; margin-bottom: 32px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
    position: absolute; left: 22px; top: 2px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--gradient-primary);
    box-shadow: 0 0 12px var(--primary-glow);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
}
.timeline-content {
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: 12px; padding: 20px 24px;
}
.timeline-title {
    font-size: 1.05rem; font-weight: 600; margin-bottom: 4px;
    display: flex; align-items: center; gap: 8px;
}
.timeline-desc { color: var(--text-muted); font-size: 0.9rem; }

/* ---- Stats Bar ---- */
.stats-bar { display: flex; flex-wrap: wrap; gap: 32px; justify-content: center; padding: 24px 0; }
.stat-item { text-align: center; }
.stat-value {
    font-size: 1.8rem; font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    background: var(--gradient-primary);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 0.8rem; color: var(--text-dim); font-weight: 500; }

/* ---- Doc Table ---- */
.doc-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.doc-table th, .doc-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border-light); }
.doc-table th { color: var(--text-dim); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.doc-table td { color: var(--text-muted); }
.doc-table a { color: var(--cyan); }
.doc-table a:hover { color: var(--primary); }

/* ---- Scroll indicator ---- */
.scroll-indicator { display: flex; justify-content: center; align-items: center; margin-top: 40px; gap: 8px; color: var(--text-dim); font-size: 0.8rem; }
.scroll-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); animation: pulse-dot 2s infinite; }
.scroll-dot:nth-child(2) { animation-delay: 0.2s; }
.scroll-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse-dot { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ---- Command blocks with copy button ---- */
.cmd-row { position: relative; }
.cmd-row pre { margin: 12px 0 0; padding-right: 96px; }
.cmd-row pre code { font-size: 0.8rem; }
.copy-btn {
    position: absolute; top: 12px; right: 12px;
    padding: 4px 12px; border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.75rem; font-weight: 600;
    transition: all 0.2s ease;
}
.copy-btn:hover { color: var(--text-main); border-color: var(--primary); }

/* ---- Playground CTA ---- */
.playground-cta { display: flex; gap: 14px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }

/* ---- Footer ---- */
.site-footer { background: #05080c; border-top: 1px solid var(--border-light); padding: 48px 0 24px; text-align: center; }
.footer-content { margin-bottom: 24px; }
.footer-logo { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 16px; }
.footer-text { color: var(--text-muted); font-size: 0.85rem; max-width: 660px; margin: 0 auto; line-height: 1.7; }
.social-links { display: flex; gap: 16px; justify-content: center; }
.social-link {
    display: flex; align-items: center; justify-content: center;
    padding: 0 14px; height: 40px; border-radius: 10px;
    background: var(--surface); border: 1px solid var(--border-light);
    color: var(--text-muted); transition: all 0.2s ease; font-size: 0.85rem; gap: 6px;
}
.social-link:hover { background: var(--primary); color: #04120c; transform: translateY(-2px); }
.copyright { color: var(--text-dim); font-size: 0.8rem; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hero { padding: 80px 0 40px; }
    .hero h1 { font-size: 1.8rem; }
    .nav-links { display: none; }
    .hero .hero-actions { flex-direction: column; gap: 10px; }
}

/* ---- Scroll reveal animation ---- */
.js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .revealed {
    opacity: 1;
    transform: translateY(0);
}
.js .reveal.delay-1 { transition-delay: 0.1s; }
.js .reveal.delay-2 { transition-delay: 0.2s; }
.js .reveal.delay-3 { transition-delay: 0.3s; }
