/* CSS Variables */
:root {
    --color-bg: #0a0e14;
    --color-surface: #1a1f28;
    --color-surface-alt: #0f1318;
    --color-border: #2d3541;
    --color-text: #c5cdd9;
    --color-text-dim: #7d8799;
    --color-primary: #6db5ff;
    --color-accent: #00d4aa;
    --color-code-bg: #0d1117;
    /* Glassmorphism */
    --glass-bg: rgba(26, 31, 40, 0.55);
    --glass-elevated-bg: rgba(26, 31, 40, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --glass-blur: 12px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    --border-radius: 8px;
    --max-width: 1200px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    /* Subtle gradient backdrop for depth */
    background:
        radial-gradient(1200px 800px at 10% -10%, rgba(109,181,255,0.08), transparent 60%),
        radial-gradient(1000px 700px at 110% 10%, rgba(0,212,170,0.07), transparent 55%),
        linear-gradient(180deg, #0a0e14 0%, #0a0e14 100%);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    padding-top: 90px; /* Reduced for more compact header */
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    width: 100%;
    box-sizing: border-box;
}

/* Header */
header {
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    width: 100%;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--glass-shadow);
}

.header-content {
    padding: var(--spacing-xs) 0; /* More compact padding */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Hide burger on desktop */
.burger {
    display: none;
}

.brand h1 {
    font-size: 1.5rem; /* More compact font size */
    color: var(--color-primary);
    margin-bottom: 0.1rem; /* Reduced margin */
}

.brand .tagline {
    color: var(--color-text-dim);
    font-size: 0.85rem; /* More compact tagline */
}

.site-nav {
    display: flex;
    gap: var(--spacing-md);
    padding: 0.25rem 0; /* More compact padding */
    border-top: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.site-nav .container {
    display: flex;
    gap: var(--spacing-md);
}

.site-nav a {
    color: var(--color-text);
    text-decoration: none;
    padding: 0.4rem var(--spacing-sm); /* More compact padding */
    border-radius: var(--border-radius);
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    font-size: 0.9rem; /* Slightly smaller font */
    border: 1px solid transparent; /* Prevent hover border pop-in */
}

.site-nav a:hover,
.site-nav a.active {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border-color: var(--glass-highlight);
    color: var(--color-primary);
}

/* Link styles */
a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* Sections */
.hero {
    padding: var(--spacing-xl) 0;
    text-align: center;
    background: linear-gradient(135deg, var(--color-surface-alt) 0%, var(--color-bg) 100%);
    border-bottom: 1px solid var(--color-border);
}

.hero h2 {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.hero-image {
    max-width: 100%;
    height: auto;
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    margin-bottom: var(--spacing-lg);
    display: block;
}

.hero p {
    font-size: 1.2rem;
    color: var(--color-text);
    max-width: 800px;
    margin: 0 auto;
}

.content-section {
    padding: var(--spacing-xl) 0;
    border-bottom: 1px solid var(--color-border);
}

.content-section.alt {
    background-color: var(--color-surface-alt);
}

.content-section h2 {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

.subtitle {
    color: var(--color-text-dim);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
}

.repo-link {
    margin-bottom: var(--spacing-lg);
}

.repo-link a {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.repo-link a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.feature-card {
    background: var(--glass-elevated-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--glass-shadow);
}

.feature-card h3 {
    color: var(--color-accent);
    margin-bottom: var(--spacing-sm);
    font-size: 1.2rem;
}

.feature-card p {
    color: var(--color-text);
    font-size: 0.95rem;
}

.content-block {
    margin: var(--spacing-lg) 0;
}

.content-block h3 {
    color: var(--color-accent);
    margin-bottom: var(--spacing-sm);
}

pre {
    background-color: var(--color-code-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    overflow-x: auto;
}

code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.5;
}

/* Prism.js syntax highlighting overrides for dark theme */
pre[class*="language-"] {
    background-color: var(--color-code-bg) !important;
    border: 1px solid var(--color-border);
}

code[class*="language-"] {
    color: var(--color-text);
}

/* Override Prism theme colors to match our design */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #6a9955;
}

.token.punctuation {
    color: #d4d4d4;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #b5cea8;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #ce9178;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #d4d4d4;
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #569cd6;
}

.token.function,
.token.class-name {
    color: #dcdcaa;
}

.token.regex,
.token.important,
.token.variable {
    color: #d16969;
}

/* Tech Specs */
.content-block h3,
.architecture h3 {
    color: var(--color-accent);
    margin-bottom: var(--spacing-sm);
}

.content-block ul {
    list-style: none;
    margin-left: var(--spacing-md);
}

.content-block li {
    margin: var(--spacing-xs) 0;
    padding-left: var(--spacing-md);
    position: relative;
}

.content-block li:before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--color-primary);
}

/* Screenshot Grid */
.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.screenshot {
    background: var(--glass-elevated-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--glass-shadow);
}

.screenshot img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid var(--color-border);
    cursor: zoom-in;
}

.screenshot p {
    padding: var(--spacing-md);
    color: var(--color-text-dim);
    font-size: 0.9rem;
}

/* Building Blocks */
.building-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.building-blocks > div {
    background: var(--glass-elevated-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--glass-shadow);
}

.building-blocks strong {
    color: var(--color-primary);
    display: block;
    margin-bottom: var(--spacing-xs);
}

/* Documentation Grid */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--spacing-md);
}

.doc-card {
    background: var(--glass-elevated-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--glass-shadow);
}

.doc-card h3 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.doc-card ul {
    list-style: none;
}

.doc-card li {
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--color-border);
}

.doc-card li:last-child {
    border-bottom: none;
}

/* Getting Started */
.getting-started {
    margin: var(--spacing-lg) 0;
}

.getting-started h3 {
    color: var(--color-accent);
    margin-bottom: var(--spacing-md);
}

.start-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.start-card h4 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

/* Footer */
footer {
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    padding: var(--spacing-md) 0;
    text-align: center;
    color: var(--color-text-dim);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    /* Burger button */
    .burger {
        display: inline-flex;
        flex-direction: column;
        gap: 5px;
        width: 44px;
        height: 36px;
        background: transparent;
        border: 1px solid var(--color-border);
        border-radius: 8px;
        padding: 10px;
        cursor: pointer;
    }
    .burger span {
        display: block;
        height: 2px;
        background: var(--color-text);
        border-radius: 2px;
    }

    /* Collapsible nav */
    .site-nav {
        display: none;
        flex-direction: column;
        gap: 0;
        border-top: 1px solid var(--glass-border);
        background: var(--glass-bg);
        backdrop-filter: blur(var(--glass-blur));
        -webkit-backdrop-filter: blur(var(--glass-blur));
    }
    
    .site-nav .container {
        flex-direction: column;
        gap: 0;
    }
    .site-nav.open {
        display: flex;
    }
    .site-nav a {
        padding: 12px var(--spacing-sm);
        border-bottom: 1px solid var(--color-border);
    }
    
    .feature-grid,
    .screenshot-grid,
    .doc-grid,
    .start-grid {
        grid-template-columns: 1fr;
    }
    
    .screenshot-grid {
        gap: var(--spacing-sm);
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Offset anchored scroll positions to account for fixed header */
section[id] {
    scroll-margin-top: 58px; /* Position sections so separators align with header bottom */
}

/* Extra spacing for mobile to prevent top section cutoff */
@media (max-width: 768px) {
    
    section[id] {
        scroll-margin-top: 120px; /* Position sections so separators align with mobile header bottom */
    }
}

/* Selection */
::selection {
    background-color: var(--color-primary);
    color: var(--color-bg);
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.lightbox[aria-hidden="false"] {
    display: flex;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    margin: 0 var(--spacing-md);
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.lightbox-content figcaption {
    text-align: center;
    color: var(--color-text-dim);
    margin-top: var(--spacing-xs);
}

.lightbox-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    font-size: 20px;
}

.lightbox-close:hover {
    background: var(--color-surface-alt);
    color: var(--color-primary);
}

