/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --accent-color: #0ea5e9;
    --success-color: #10b981;
    --bg-color: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --code-bg: #1e293b;
    --code-text: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Accessibility */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
}

.skip-to-main:focus {
    left: 1rem;
    top: 1rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* Anchor Links */
.anchor-link {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.75em;
    opacity: 0;
    margin-left: 0.25em;
    transition: opacity 0.2s ease, color 0.2s ease;
    text-decoration: none;
    vertical-align: middle;
}

h2:hover .anchor-link,
.example-tab:hover .anchor-link,
.anchor-link:focus {
    opacity: 1;
}

.anchor-link:hover {
    color: var(--primary-color);
    opacity: 1;
}

.example-tab .anchor-link {
    font-size: 0.8em;
    font-weight: 400;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo {
    font-size: 2rem;
}

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

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

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

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    padding: 8rem 0 4rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    margin-top: 60px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-badges {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.875rem;
}

.badge-new {
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-block;
}

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

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

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

.hero-quick-start {
    animation: fadeInUp 0.6s ease 0.4s both;
}

.hero-quick-start code {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    display: inline-block;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
}

/* Features Section */
.features {
    padding: 5rem 0;
    background: var(--bg-color);
}

.features h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Quick Start Section */
.quick-start {
    padding: 5rem 0;
    background: var(--bg-secondary);
}

.quick-start h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.tabs {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    color: var(--text-secondary);
}

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

.tab-btn:hover {
    border-color: var(--primary-color);
}

.tab-content {
    position: relative;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 0;
}

code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Download Section */
.download {
    padding: 5rem 0;
    background: var(--bg-color);
}

.download h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.download-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.download-card h3 {
    margin-bottom: 1rem;
}

.version {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.release-date {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.download-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.download-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.download-link:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

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

.size {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.package-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.package-link {
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    transition: var(--transition);
}

.package-link:hover {
    border-color: var(--primary-color);
}

.release-notes {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.release-notes h3 {
    margin-bottom: 1rem;
}

.release-notes ul {
    list-style: none;
    margin-bottom: 1rem;
}

.release-notes li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

/* Documentation Section */
.documentation {
    padding: 5rem 0;
    background: var(--bg-secondary);
}

.documentation h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.doc-card {
    padding: 2rem;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    display: block;
}

.doc-card.featured {
    border-color: var(--primary-color);
    border-width: 2px;
}

.doc-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.doc-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.doc-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.doc-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0;
}

/* Examples Section */
.examples {
    padding: 5rem 0;
    background: var(--bg-color);
}

.examples h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.example-tabs {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.example-tab {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    color: var(--text-secondary);
}

.example-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.example-content {
    max-width: 800px;
    margin: 0 auto;
}

.example-pane {
    display: none;
}

.example-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Use Cases Section */
.use-cases {
    padding: 5rem 0;
    background: var(--bg-secondary);
}

.use-cases h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.use-case {
    padding: 2rem;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.use-case h3 {
    margin-bottom: 1rem;
}

.use-case p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Community Section */
.community {
    padding: 5rem 0;
    background: var(--bg-color);
}

.community h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.community-card {
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
    display: block;
}

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

.community-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.community-card h3 {
    margin-bottom: 0.5rem;
}

.community-card p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: var(--text-muted);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

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

.footer-section a:hover {
    color: white;
}

.footer-version {
    color: var(--primary-color);
    font-weight: 600;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }

    .hero {
        padding: 6rem 0 3rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .download-grid {
        grid-template-columns: 1fr;
    }

    .features-grid,
    .docs-grid,
    .use-cases-grid,
    .community-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-quick-start code {
        font-size: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .tabs,
    .example-tabs {
        flex-direction: column;
    }

    .tab-btn,
    .example-tab {
        width: 100%;
    }
}
