:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg: #ffffff;
    --text: #0f172a;
    --text-muted: #475569; /* Increased contrast for A11y */
    --card-bg: #f8fafc;
    --code-bg: #0f172a;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --border: #e2e8f0;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 1rem;
    --scroll-margin: 5rem;
}

[data-theme="dark"] {
    --bg: #020617;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --card-bg: #0f172a;
    --nav-bg: rgba(2, 6, 23, 0.8);
    --border: #1e293b;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html { 
    scroll-behavior: smooth;
    scroll-padding-top: var(--scroll-margin);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
    font-size: clamp(1rem, 1.1vw, 1.125rem); /* Fluid Base Font */
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    scroll-margin-top: var(--scroll-margin);
    padding: clamp(3rem, 10vh, 6rem) 0;
}

/* Skeleton Loader */
.skeleton-text {
    display: inline-block;
    height: 1em;
    width: 20px;
    background: linear-gradient(90deg, var(--border) 25%, var(--card-bg) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    vertical-align: middle;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Navigation */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.25rem;
    text-decoration: none;
    color: var(--text);
}

.nav-logo img { width: 32px; height: 32px; }

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

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--primary); }

.github-stars {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 0.3rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.85rem !important;
    color: var(--text) !important;
    text-decoration: none;
}

.github-stars:hover {
    border-color: var(--primary);
    background: var(--bg);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.theme-toggle:hover { background: var(--card-bg); }

/* Header / Hero */
header {
    padding: clamp(4rem, 15vh, 8rem) 0 4rem;
    text-align: center;
}

h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: var(--text);
}

h1 span {
    display: block;
    font-family: 'Fira Code', monospace;
    font-size: 0.4em;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    -webkit-text-fill-color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 600;
}

.tagline {
    font-size: clamp(1.125rem, 3vw, 1.25rem);
    color: var(--text-muted);
    max-width: 550px;
    margin: 2rem auto;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

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

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

/* Terminal Mockup */
.terminal {
    background: #0f172a;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    margin: 4rem auto;
    max-width: 650px;
    overflow: hidden;
    text-align: left;
    border: 1px solid #334155;
}

.terminal-header {
    background: #1e293b;
    padding: 0.8rem 1.2rem;
    display: flex;
    gap: 0.6rem;
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.terminal-body {
    padding: 1.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #cbd5e1;
    min-height: 200px;
}

.prompt { color: #4ade80; font-weight: bold; }
.command { color: #f8fafc; }
.error { color: #f87171; white-space: pre-wrap; margin: 0.5rem 0; }
.system-msg { color: #94a3b8; font-style: italic; margin: 0.5rem 0; opacity: 0.8; }
.ai-response { 
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--primary);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

/* Terminal Syntax Highlighting */
.hl-type { color: #f472b6; }
.hl-file { color: #60a5fa; text-decoration: underline; }
.hl-line { color: #fbbf24; }
.hl-key { color: #fb7185; font-weight: bold; }

/* Installation Section */
.installation {
    max-width: 650px;
    margin: 0 auto;
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-link {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem 1.5rem;
    border-radius: 2rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tab-link:hover:not(.active) {
    border-color: var(--primary);
    background: var(--bg);
}

.tab-link.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.tab-content { display: none; }
.tab-content.show { display: block; }

.code-block {
    background: var(--code-bg);
    color: #f8fafc;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    position: relative;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    overflow: hidden;
}

.code-block code {
    overflow-x: auto;
    white-space: nowrap;
    padding-right: 1rem;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: all 0.2s;
}

.copy-btn:hover { background: rgba(255, 255, 255, 0.2); }

/* Features */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.feature-card h3 {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--text);
    color: var(--bg);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 99;
}

.back-to-top.visible { opacity: 1; visibility: visible; }

footer {
    padding: 4rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer a { color: var(--primary); text-decoration: none; font-weight: 500; }

@media (max-width: 640px) {
    header { padding: 4rem 0 2rem; }
    h1 { font-size: 2.5rem; }
    .hero-actions { flex-direction: column; }
    .code-block { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .copy-btn { width: 100%; text-align: center; }
}
