/* CSS Design System - Vercel Next.js Premium Aesthetics */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Geist+Mono:wght@300;400;500;600;700&display=swap');

:root {
    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Geist Mono', 'JetBrains Mono', 'Fira Code', monospace;

    /* Theme Tokens - Default OLED Dark Mode (Vercel Black) */
    --bg: #000000;
    --bg-alt: #0a0a0a;
    --card-bg: #0a0a0a;
    --card-bg-hover: #161616;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --border-accent: rgba(255, 255, 255, 0.25);
    
    --text-primary: #ffffff;
    --text-secondary: #a1a1a1;
    --text-muted: #666666;
    
    --brand: #ffffff;
    --brand-hover: #eaeaea;
    --brand-accent: #0070f3; /* Vercel Blue */
    --brand-accent-glow: rgba(0, 112, 243, 0.15);

    --success: #0070f3;
    --success-glow: rgba(0, 112, 243, 0.10);
    --warning: #f5a623;
    --error: #ee0000;

    /* Layout & Motion */
    --sidebar-width: 260px;
    --content-max-width: 800px;
    --ease-linear: cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.8);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.9);
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg: #ffffff;
    --bg-alt: #fafafa;
    --card-bg: #ffffff;
    --card-bg-hover: #f5f5f7;
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --border-accent: rgba(0, 0, 0, 0.25);
    
    --text-primary: #000000;
    --text-secondary: #666666;
    --text-muted: #888888;
    
    --brand: #000000;
    --brand-hover: #1f1f1f;
    --brand-accent: #0070f3;
    --brand-accent-glow: rgba(0, 112, 243, 0.08);

    --success-glow: rgba(0, 112, 243, 0.08);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg);
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text-secondary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Subtle Geometric Grid Background - Vercel Style */
body::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.8;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4.75rem);
    font-weight: 800;
}

h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    margin-bottom: 1.5rem;
    font-weight: 800;
}

h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s var(--ease-linear);
}

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg-alt);
    padding: 0.2em 0.4em;
    border-radius: 5px;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

/* Layout container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2.5rem;
    width: 100%;
}

/* Background Gradients */
.glow-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    filter: blur(160px);
    opacity: 0.15;
    mix-blend-mode: screen;
}

.orb-1 {
    background: radial-gradient(circle, var(--text-primary) 0%, transparent 65%);
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
}

.orb-2 {
    background: radial-gradient(circle, #38bdf8 0%, transparent 70%);
    bottom: 20%;
    left: -10%;
    opacity: 0.08;
}

/* Premium Vercel Sticky Full-Width Navbar */
.nav-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(var(--bg) === '#ffffff' ? '255,255,255' : '0,0,0', 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    pointer-events: auto;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2.5rem;
    pointer-events: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.05em;
    color: var(--text-primary);
}

.logo-symbol {
    width: 24px;
    height: 24px;
    background: var(--text-primary);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    transition: transform 0.4s var(--ease-linear);
}

.logo:hover .logo-symbol {
    transform: rotate(180deg);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-cta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* Premium Vercel-style Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease-linear);
    position: relative;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg);
    border: 1px solid var(--text-primary);
}

.btn-primary:hover {
    background: var(--bg);
    color: var(--text-primary);
}

.btn-secondary {
    background: var(--bg-alt);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--card-bg-hover);
    border-color: var(--border-hover);
}

.btn-arrow {
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s var(--ease-linear);
}

.btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* Hero Section (Next.js inspired) */
.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 10rem 2.5rem 5rem;
    z-index: 10;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    transition: border-color 0.2s var(--ease-linear);
}

.hero-badge:hover {
    border-color: var(--border-hover);
}

.hero-title {
    max-width: 950px;
    line-height: 1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.06em;
    font-weight: 900;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.2vw, 1.35rem);
    max-width: 720px;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: -0.01em;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 4rem;
}

/* Vercel Shell Widget styling */
.nested-shell {
    position: relative;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 1px;
    border-radius: 12px;
    width: 100%;
    max-width: 850px;
    box-shadow: var(--shadow-md);
    margin-top: 1rem;
}

.nested-core {
    background: var(--bg);
    border-radius: 11px;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Interactive Showcase Terminal */
.terminal {
    background: #000000;
    color: #eaeaea;
    font-family: var(--font-mono);
    text-align: left;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #000000;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
}

.terminal-tabs {
    display: flex;
    gap: 1.5rem;
}

.terminal-tab {
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s var(--ease-linear);
    position: relative;
    padding-bottom: 0.5rem;
    top: 0.25rem;
}

.terminal-tab.active {
    color: var(--text-primary);
}

.terminal-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--text-primary);
}

.terminal-body {
    padding: 2rem;
    font-size: 0.85rem;
    line-height: 1.7;
    min-height: 240px;
    overflow-y: auto;
}

.prompt {
    color: var(--text-muted);
    margin-right: 0.75rem;
    user-select: none;
}

.command-line {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.cmd {
    color: var(--text-primary);
    font-weight: 600;
}

.cursor {
    display: inline-block;
    width: 6px;
    height: 15px;
    background: var(--text-primary);
    margin-left: 5px;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

#terminal-output {
    color: var(--text-secondary);
}

.output-success { color: #0070f3; font-weight: 500; }
.output-info { color: var(--text-secondary); }

/* Sections */
.section {
    padding: 8rem 0;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 10;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-eyebrow {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    display: block;
    margin-bottom: 0.75rem;
}

.section-header h2 {
    letter-spacing: -0.05em;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0.5rem auto 0;
}

/* Path Traversal Visualizer Playground */
.playground-area {
    display: flex;
    gap: 2.5rem;
}

.tree-explorer {
    flex: 1;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    user-select: none;
}

.tree-node {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-mono);
    transition: all 0.2s var(--ease-linear);
    border: 1px solid transparent;
}

.tree-node:hover {
    background: var(--card-bg-hover);
    color: var(--text-primary);
}

.tree-node.active {
    background: var(--bg);
    color: var(--text-primary);
    border-color: var(--border);
}

.tree-node.file {
    cursor: default;
    padding-left: 2rem;
}

.tree-node.file:hover {
    background: transparent;
    color: var(--text-secondary);
}

.flow-visualizer {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.flow-step {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    transition: all 0.3s var(--ease-linear);
}

.flow-step.active {
    border-color: var(--border-accent);
    background: var(--card-bg-hover);
}

.flow-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.3s var(--ease-linear);
}

.flow-step.active .flow-number {
    background: var(--text-primary);
    color: var(--bg);
}

.flow-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.flow-step.active .flow-desc {
    color: var(--text-secondary);
}

/* Premium Bento Grid - Vercel Next.js Style */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.bento-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.2s var(--ease-linear), background-color 0.2s var(--ease-linear);
    position: relative;
    overflow: hidden;
}

.bento-card:hover {
    border-color: var(--border-accent);
    background: var(--card-bg-hover);
}

.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }

.bento-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.bento-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.bento-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Marquee Continuous Slider */
.marquee-container {
    margin-top: 2rem;
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 0.5rem 0;
}

.marquee-track {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    animation: marquee 25s linear infinite;
}

@keyframes marquee {
    to { transform: translateX(-50%); }
}

.ecosystem-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    border-radius: 99px;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* High Fidelity Performance Bar chart */
.perf-compare {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 2rem;
}

.perf-bar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.perf-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.perf-bar-container {
    height: 8px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    width: 100%;
}

.perf-bar {
    height: 100%;
    border-radius: 99px;
    width: 0%;
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.perf-bar.dr { background: var(--text-primary); }
.perf-bar.npm { background: var(--text-muted); }
.perf-bar.yarn { background: var(--border-hover); }

/* Bottom Call to Action Section (Vercel Style) */
.cta-section {
    position: relative;
    text-align: center;
    padding: 10rem 2.5rem;
    border-top: 1px solid var(--border);
    z-index: 10;
}

.cta-section h2 {
    margin-bottom: 1.5rem;
}

/* Footer style */
.footer {
    border-top: 1px solid var(--border);
    padding: 4rem 0;
    background: var(--bg-alt);
    font-size: 0.85rem;
    color: var(--text-muted);
    position: relative;
    z-index: 10;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Documentation Layout Styling */
.docs-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 5rem;
}

.docs-sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 4.5rem;
    bottom: 0;
    left: 0;
    border-right: 1px solid var(--border);
    padding: 3rem 2.5rem 3rem 0;
    overflow-y: auto;
    background: var(--bg);
    z-index: 90;
    margin-left: 2.5rem;
}

.docs-nav-group {
    margin-bottom: 2.25rem;
}

.docs-nav-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.docs-nav-item {
    display: block;
    padding: 0.4rem 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    border-radius: 6px;
    margin-bottom: 1px;
    transition: all 0.15s var(--ease-linear);
}

.docs-nav-item:hover {
    color: var(--text-primary);
    background: var(--border);
}

.docs-nav-item.active {
    color: var(--text-primary);
    background: var(--border);
    font-weight: 600;
}

.docs-content {
    margin-left: calc(var(--sidebar-width) + 2.5rem);
    padding: 3rem 5rem 6rem;
    flex: 1;
    max-width: 1000px;
}

.docs-article {
    max-width: var(--content-max-width);
}

.docs-header {
    margin-bottom: 3.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.docs-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.05em;
    font-weight: 800;
}

.docs-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
}

.docs-section {
    margin-bottom: 4rem;
}

.docs-section h2 {
    font-size: 1.65rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.docs-section h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

pre {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

pre code {
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Custom Alert Boxes (Vercel style) */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin: 2rem 0;
    font-size: 0.9rem;
    background: var(--bg-alt);
}

.alert-note {
}

.alert-tip {
}

.alert-warning {
}

/* Beautiful Interactive Installation Widget */
.install-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-alt);
    overflow: hidden;
    margin: 2rem 0;
}

.install-nav {
    display: flex;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

.install-tab-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-right: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s var(--ease-linear);
}

.install-tab-btn:hover {
    color: var(--text-primary);
    background: var(--card-bg-hover);
}

.install-tab-btn.active {
    background: var(--bg);
    color: var(--text-primary);
}

.install-payload {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--bg);
}

.install-copy-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s var(--ease-linear);
}

.install-copy-btn:hover {
    background: var(--card-bg-hover);
    border-color: var(--border-hover);
}

/* Responsive Overrides */
@media (max-width: 992px) {
    .bento-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    .bento-card {
        grid-column: span 1 !important;
        padding: 2rem;
    }
    .playground-area {
        flex-direction: column;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.5rem;
    }
    .container {
        padding: 0 1.5rem;
    }
    .logo {
        font-size: 1.15rem;
    }
    .nav-links {
        display: none;
    }
    .docs-layout {
        flex-direction: column;
        padding-top: 4.5rem;
    }
    .docs-sidebar {
        position: static;
        width: 100%;
        margin-left: 0;
        padding: 1.5rem 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
        display: none;
    }
    .docs-sidebar.mobile-open {
        display: block;
    }
    .docs-content {
        margin-left: 0;
        padding: 2rem 0;
    }
    .hero {
        padding: 8rem 1.5rem 4rem;
    }
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    .btn {
        width: 100%;
        justify-content: center;
    }
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}