/* CSS Variables */
:root {
    /* Colors */
    --bg-black: #0a0b0d;
    --bg-secondary: #0f1114;
    --bg-tertiary: #1a1b1e;
    --border-dark: #1a1b1e;
    --border-hover: #2a2b2e;
    --text-white: #e8e8e8;
    --text-muted: #6b7280;
    --text-dark: #4b5563;
    --accent: #00D26A;
    --accent-dim: rgba(0, 210, 106, 0.1);
    --accent-glow: rgba(0, 210, 106, 0.3);
    --code-bg: #0f1114;
    --code-border: #1a1b1e;

    /* Spacing (8px grid system) */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 40px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Layout */
    --sidebar-width: 220px;
    --header-height: 48px;
    --border-radius-sm: 4px;
    --border-radius-md: 6px;
    --border-radius-lg: 8px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-Index Hierarchy */
    --z-sidebar-toggle: 10;
    --z-theme-toggle: 100;
    --z-overlay: 900;
    --z-sidebar: 1000;
    --z-hamburger: 1100;
}

[data-theme="light"] {
    --bg-black: #fafafa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f4f4f5;
    --border-dark: #e4e4e7;
    --border-hover: #d4d4d8;
    --text-white: #18181b;
    --text-muted: #71717a;
    --text-dark: #a1a1aa;
    --accent: #10b981;
    --accent-dim: rgba(16, 185, 129, 0.1);
    --accent-glow: rgba(16, 185, 129, 0.2);
    --code-bg: #f5f5f5;
    --code-border: #e5e5e5;
}

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

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-black);
    color: var(--text-white);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    letter-spacing: -0.01em;
}

h1 { font-size: 45px; }
h2 { font-size: 32px; }
h3 { font-size: 22px; }
h4 { font-size: 19px; }
h5 { font-size: 17px; }
h6 { font-size: 15px; }

/* ======================  */
/* APP LAYOUT */
/* ====================== */
.app {
    display: flex;
    height: 100vh;
}

/* ======================  */
/* SIDEBAR */
/* ====================== */
.sidebar {
    width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-dark);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed {
    margin-left: -220px;
    pointer-events: none;
}

.sidebar-toggle {
    position: fixed;
    top: 50%;
    left: 220px;
    transform: translateY(-50%);
    z-index: var(--z-sidebar-toggle);
    width: 32px;
    height: 80px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 0 8px 8px 0;
    border-left: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.3s ease, transform 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
}

.sidebar-toggle:hover {
    border-color: var(--accent);
    background: var(--bg-tertiary);
}

.sidebar-toggle svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.sidebar-toggle:hover svg {
    color: var(--accent);
}

.sidebar-toggle.active {
    left: 0;
    transform: translateY(-50%);
}

.sidebar-toggle.active svg {
    transform: rotate(180deg);
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-dark);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    cursor: pointer;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-black);
    border: 1px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    color: var(--accent);
    font-size: 10px;
    border-radius: 0;
    transition: all 0.3s;
}

.logo:hover .logo-icon {
    background: var(--accent);
    color: var(--bg-black);
}

.logo-text {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: -0.01em;
}

.logo-version {
    font-size: 10px;
    color: var(--accent);
    margin-top: 1px;
    font-family: 'Fira Code', monospace;
}

/* Navigation */
.sidebar-nav {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-dark);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-white);
}

.nav-item.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-left-color: var(--accent);
}

.nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
    opacity: 1;
}

.nav-badge {
    margin-left: auto;
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Sidebar Spacer */
.sidebar-spacer {
    flex: 1;
}

/* Stats HUD */
.sidebar-stats {
    padding: var(--space-sm);
    flex: 1;
}

.stats-hud {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    padding: var(--space-xs);
}

.stats-title {
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 11px;
    border-bottom: 1px solid var(--border-dark);
}

.stats-row:last-child {
    border-bottom: none;
}

.stats-label {
    color: var(--text-muted);
}

.stats-value {
    font-family: 'Fira Code', monospace;
}

.stats-value.accent {
    color: var(--accent);
}

.stats-value.info {
    color: #7dcfff;
}

/* Contacts */
.sidebar-contacts {
    padding: var(--space-xs) var(--space-sm);
    border-top: 1px solid var(--border-dark);
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    font-size: 11px;
    color: var(--text-muted);
    border-radius: 4px;
    transition: all 0.2s;
}

.contact-link:hover {
    color: var(--accent);
    background: var(--accent-dim);
}

.contact-link svg {
    width: 12px;
    height: 12px;
    opacity: 0.6;
}

.contact-link:hover svg {
    opacity: 1;
}

.status-line {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    color: var(--text-dark);
}

.status-dot {
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Sidebar Bottom */
.sidebar-bottom {
    padding: var(--space-xs) var(--space-sm);
    border-top: 1px solid var(--border-dark);
    display: flex;
    gap: 8px;
}

.theme-toggle-sidebar {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: var(--border-radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
    flex-shrink: 0;
}

.theme-toggle-sidebar:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.theme-toggle-sidebar svg {
    width: 16px;
    height: 16px;
}

/* Theme Toggle Fixed (Top Right) */
.theme-toggle-fixed {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--z-theme-toggle);
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--border-radius-md);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-toggle-fixed:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-tertiary);
    box-shadow: 0 4px 12px rgba(0, 210, 106, 0.15);
}

.theme-toggle-fixed svg {
    width: 18px;
    height: 18px;
}

.cta-btn {
    display: block;
    width: 100%;
    padding: var(--space-sm) var(--space-sm);
    background: var(--accent);
    border: none;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--bg-black);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
}

.cta-btn:hover,
.cta-btn:active {
    filter: brightness(1.15);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* ======================  */
/* MAIN CONTENT */
/* ====================== */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Content */
.content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-2xl) var(--space-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.content > * {
    width: 100%;
    max-width: 1200px;
}

/* ======================  */
/* HERO SECTION */
/* ====================== */
.hero {
    max-width: 900px;
    margin-bottom: var(--space-3xl);
}

.hero--projects {
    margin-bottom: 48px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 8px 16px;
    background: var(--accent-dim);
    border: 1px solid var(--border-dark);
    border-radius: 20px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: var(--accent);
    margin-bottom: var(--space-md);
}

.hero-badge .dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.hero-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 45px;
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.hero-title .accent {
    color: var(--accent);
}

.hero-subtitle {
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}

/* Install Section */
.install-section {
    max-width: 800px;
    margin-bottom: 48px;
}

.command-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
}

.tab-btn {
    padding: 9px 22px;
    background: none;
    border: 1px solid var(--border-dark);
    color: var(--text-muted);
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
}

.tab-btn:hover,
.tab-btn:active {
    color: var(--text-white);
    border-color: var(--border-hover);
}

.tab-btn.active {
    color: var(--text-white);
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

.command-wrapper {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 8px;
    overflow: hidden;
}

.command-line {
    display: none;
    padding: var(--space-md);
    margin: 0;
    overflow-x: auto;
}

.command-line.active {
    display: block;
}

.command-line code {
    font-family: 'Fira Code', monospace;
    font-size: 15px;
    color: var(--text-white);
    line-height: 1.6;
    font-variant-ligatures: normal;
    font-feature-settings: "calt" 1, "liga" 1;
}

.command-line .cmd {
    color: var(--text-muted);
}

.command-line .url {
    color: #7AA2F7;
}

.command-line .pkg {
    color: #BB9AF7;
}

/* Code Demo */
.code-demo {
    max-width: 900px;
}

.code-window {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.code-window:hover {
    transform: translateY(-2px);
}

.window-header {
    display: flex;
    align-items: center;
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--code-border);
    gap: var(--space-sm);
}

.window-controls {
    display: flex;
    gap: 6px;
}

.window-controls span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-dark);
}

.window-title {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: var(--text-muted);
}

.code-content {
    padding: 24px;
    overflow-x: auto;
}

.code-content pre {
    margin: 0;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.8;
    font-variant-ligatures: normal;
    font-feature-settings: "calt" 1, "liga" 1;
}

.code-content code {
    color: var(--text-white);
}

.line-number {
    color: var(--text-dark);
    margin-right: 16px;
    user-select: none;
}

.keyword {
    color: #BB9AF7;
}

.function {
    color: #7AA2F7;
}

.variable {
    color: #E0AF68;
}

.string {
    color: #9ECE6A;
}

.operator {
    color: var(--text-muted);
}

.param {
    color: #E0AF68;
}

.property {
    color: #7DCFFF;
}

/* ======================  */
/* SECTIONS */
/* ====================== */
.section {
    margin-bottom: var(--space-3xl);
    max-width: 900px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    font-family: 'Fira Code', monospace;
}

.section-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.section-title {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
}

.section-line {
    flex: 1;
    height: 1px;
    background: var(--border-dark);
}

/* Features List */
.features-list {
    max-width: 700px;
    margin-bottom: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.checkbox {
    width: 20px;
    height: 20px;
    border: 1px solid var(--border-dark);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    color: var(--accent);
    transition: var(--transition-base);
}

.feature-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-muted);
}

.feature-text strong {
    color: var(--text-white);
    font-weight: 600;
}

.btn-docs {
    padding: var(--space-sm) var(--space-md);
    background: var(--accent);
    color: var(--bg-black);
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-base);
}

.btn-docs:hover,
.btn-docs:active {
    filter: brightness(1.1);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
}

.stat-card {
    text-align: center;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: var(--border-radius-lg);
    transition: var(--transition-base);
}

.stat-card:hover,
.stat-card:active {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.stat-icon {
    margin-bottom: var(--space-sm);
    color: var(--text-dark);
    display: flex;
    justify-content: center;
}

.stat-number {
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'Fira Code', monospace;
}

.stat-number .highlight {
    font-size: 38px;
    font-weight: 400;
    color: var(--text-white);
    display: block;
    margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace;
}

/* Project Filters */
.project-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: var(--border-radius-lg);
}

.filter-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-dark);
    border-radius: var(--border-radius-sm);
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-base);
}

.filter-btn:hover,
.filter-btn:active {
    color: var(--text-white);
    border-color: var(--border-hover);
    background: var(--bg-black);
}

.filter-btn.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-md);
}

.project-card.hidden {
    display: none;
}

.project-card {
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: var(--border-radius-lg);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.project-card:hover,
.project-card:active {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 210, 106, 0.12);
}

.project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xs);
}

.project-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    color: var(--accent);
}

.project-category {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dark);
    background: var(--bg-black);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-dark);
}

.project-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 400;
    color: var(--text-white);
    margin-bottom: var(--space-xs);
    line-height: 1.3;
}

.project-description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    flex: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: var(--space-xs);
}

.tag {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    padding: 4px 8px;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 3px;
    border: 1px solid transparent;
    transition: var(--transition-base);
}

.tag:hover {
    border-color: var(--accent);
    background: rgba(0, 210, 106, 0.15);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: var(--accent);
    margin-top: var(--space-sm);
    transition: var(--transition-base);
    width: fit-content;
}

.project-link:hover,
.project-link:active {
    gap: 8px;
    text-decoration: underline;
}

/* Project Thumbnail */
.project-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-thumbnail img {
    transform: scale(1.05);
}

.project-category-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-dark);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
}

.project-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    flex: 1;
}

/* Privacy Content */
.privacy-content {
    max-width: 700px;
}

.privacy-content p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.8;
}

.privacy-content a {
    color: var(--accent);
    text-decoration: underline;
}

/* FAQ */
.faq-list {
    max-width: 800px;
}

.faq-item {
    border-bottom: 1px solid var(--border-dark);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-base);
}

.faq-question:hover,
.faq-question:active {
    color: var(--accent);
}

.faq-icon {
    font-size: 20px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding-bottom: 20px;
}

.faq-answer p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
}

.faq-answer code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
}

/* Newsletter */
.newsletter-section {
    max-width: 600px;
}

.newsletter-section h2 {
    margin-bottom: var(--space-sm);
}

.newsletter-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: var(--space-md);
}

.newsletter-form {
    display: flex;
    gap: var(--space-sm);
}

.email-input {
    flex: 1;
    padding: 14px 20px;
    background: var(--code-bg);
    border: 1px solid var(--border-dark);
    border-radius: var(--border-radius-md);
    color: var(--text-white);
    font-size: 14px;
    outline: none;
    transition: var(--transition-base);
}

.email-input:focus {
    border-color: var(--accent);
}

.email-input::placeholder {
    color: var(--text-dark);
}

.btn-subscribe {
    padding: 14px 28px;
    background: var(--accent);
    color: var(--bg-black);
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
}

.btn-subscribe:hover,
.btn-subscribe:active {
    filter: brightness(1.1);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Footer */
.footer {
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--border-dark);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-dark);
    flex-shrink: 0;
    width: 100%;
    max-width: none;
}

.footer-left,
.footer-right {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.footer a {
    color: var(--text-muted);
    transition: var(--transition-base);
}

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

/* ======================  */
/* ANIMATIONS */
/* ====================== */
@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-black);
}

::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dark);
}

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

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

/* Hamburger Menu Button */
.hamburger {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: var(--z-hamburger);
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.hamburger:hover {
    border-color: var(--accent);
    background: var(--bg-tertiary);
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--accent);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: var(--z-overlay);
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.sidebar-overlay.active {
    display: block;
    pointer-events: auto;
}

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .content {
        padding: 32px;
    }

    .hero-title {
        font-size: 40px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    h2 {
        font-size: 30px;
    }

    h3 {
        font-size: 21px;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
}

/* Tablet Portrait and Mobile Landscape (max-width: 768px) */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: -220px;
        top: 0;
        height: 100vh;
        z-index: var(--z-sidebar);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
    }

    .sidebar.open {
        left: 0;
    }

    .content {
        padding: 24px 20px;
        padding-top: 72px; /* Space for hamburger */
    }

    .hero {
        margin-bottom: 48px;
    }

    .hero-title {
        font-size: 36px;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 15px;
    }

    .section {
        margin-bottom: 56px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .command-tabs {
        flex-wrap: wrap;
        gap: 6px;
    }

    .tab-btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    .feature-grid {
        gap: var(--space-sm);
    }

    .footer {
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-md);
        text-align: center;
    }

    .footer-left,
    .footer-right {
        flex-direction: column;
        gap: var(--space-sm);
    }
}

/* Mobile Portrait (max-width: 480px) */
@media (max-width: 480px) {
    .content {
        padding: 16px;
        padding-top: 64px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    h2 {
        font-size: 24px;
    }

    h3 {
        font-size: 20px;
    }

    .hero-badge {
        padding: 6px 12px;
        font-size: 11px;
    }

    .command-line code {
        font-size: 13px;
    }

    .code-content pre {
        font-size: 12px;
    }

    .tab-btn {
        flex: 1;
        min-width: calc(50% - 3px);
        text-align: center;
    }

    .stat-number .highlight {
        font-size: 36px;
    }

    .email-input,
    .btn-subscribe {
        padding: var(--space-sm);
    }

    .section-header {
        margin-bottom: var(--space-md);
    }
}

/* Large Desktop (min-width: 1440px) */
@media (min-width: 1440px) {
    .content {
        padding: var(--space-2xl) var(--space-3xl);
    }

    .hero {
        max-width: 1000px;
    }

    .section {
        max-width: 1000px;
    }
}

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

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
}

/* Improve touch targets on mobile */
@media (max-width: 768px) {
    button,
    a,
    .nav-item,
    .tab-btn,
    .faq-question {
        min-height: 44px; /* Apple's recommended touch target size */
    }
}

/* Focus visible for better accessibility */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-dark: #3a3a3a;
        --text-muted: #888888;
    }
}

/* Mobile Landscape (orientation: landscape and max-height: 600px) */
@media (max-height: 600px) and (orientation: landscape) {
    .sidebar {
        overflow-y: auto;
    }

    .hero-title {
        font-size: 32px;
    }

    .section {
        margin-bottom: var(--space-xl);
    }

    .content {
        padding: var(--space-md);
    }
}

/* Print styles */
@media print {
    .sidebar,
    .hamburger,
    .sidebar-overlay,
    .footer {
        display: none !important;
    }

    .content {
        padding: 0;
        overflow: visible;
    }

    .code-window,
    .stat-card,
    .faq-item {
        page-break-inside: avoid;
    }
}

/* ======================  */
/* PROJECT CASE PAGES */
/* ====================== */
.case-hero {
    margin-bottom: 48px;
}

.case-meta {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.case-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.case-meta-label {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-dark);
    letter-spacing: 0.05em;
}

.case-meta-value {
    font-size: 15px;
    color: var(--text-white);
}

.case-screenshot {
    margin: 48px 0;
}

.browser-window {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 8px;
    overflow: hidden;
}

.browser-header {
    display: flex;
    align-items: center;
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--code-border);
    gap: var(--space-sm);
}

.browser-controls {
    display: flex;
    gap: 6px;
}

.browser-controls span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-dark);
}

.browser-url {
    flex: 1;
    background: var(--bg-black);
    padding: 6px 12px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: var(--text-muted);
}

.browser-content {
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 700;
    /* Note: background gradient is unique per project page */
}

.case-section {
    margin-bottom: 48px;
}

.case-section h2 {
    font-size: 28px;
    margin-bottom: 16px;
}

.case-section p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.case-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin: 32px 0;
}

.case-feature {
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
}

.case-feature h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--accent);
}

.case-feature p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.case-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin: 32px 0;
}

.case-result {
    text-align: center;
    padding: 16px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
}

.case-result-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.case-result-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.4;
}

/* ======================
   Hero CTA Buttons
   ====================== */

.install-section {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 40px 0;
}

.install-section .cta-btn {
    display: inline-block;
    width: auto;
}

.install-section .cta-btn:hover {
    transform: translateY(-2px);
    transition: all 0.2s;
}

@media (max-width: 768px) {
    .install-section {
        flex-direction: column;
        align-items: stretch;
    }

    .install-section .cta-btn {
        width: 100%;
        text-align: center;
    }
}

/* ======================
   Services Grid
   ====================== */

@media (max-width: 1024px) {
    #services .code-demo > div {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 640px) {
    #services .code-demo > div {
        grid-template-columns: 1fr !important;
    }
}
