:root {
    --bg: #ffffff;
    --fg: #0a0a0a;
    --muted: #6b7280;
    --accent: #000000;
    --card: #f4f4f5;
    --border: #e4e4e7;
    --bg-glass: rgba(255, 255, 255, 0.9);
    --shadow-xs: rgba(0, 0, 0, 0.05);
    --shadow-sm: rgba(0, 0, 0, 0.1);
    --shadow-md: rgba(0, 0, 0, 0.15);
    --transparent: transparent;
    --muted-error: #464b55;
}

:root[data-theme='light'] {
    --bg: #ffffff;
    --fg: #0a0a0a;
    --muted: #6b7280;
    --accent: #000000;
    --card: #f4f4f5;
    --border: #e4e4e7;
    --bg-glass: rgba(255, 255, 255, 0.9);
    --shadow-xs: rgba(0, 0, 0, 0.05);
    --shadow-sm: rgba(0, 0, 0, 0.1);
    --shadow-md: rgba(0, 0, 0, 0.15);
    --muted-error: #464b55;
}

:root[data-theme='dark'] {
    --bg: #050505;
    --fg: #f5f5f4;
    --muted: #a1a1aa;
    --accent: #f4f4f5;
    --card: #18181b;
    --border: #2a2a2e;
    --bg-glass: rgba(9, 9, 11, 0.85);
    --shadow-xs: rgba(0, 0, 0, 0.6);
    --shadow-sm: rgba(0, 0, 0, 0.7);
    --shadow-md: rgba(0, 0, 0, 0.8);
    --muted-error: #a1a1b6;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg: #050505;
        --fg: #f5f5f4;
        --muted: #a1a1aa;
        --accent: #f4f4f5;
        --card: #18181b;
        --border: #2a2a2e;
        --bg-glass: rgba(9, 9, 11, 0.85);
        --shadow-xs: rgba(0, 0, 0, 0.6);
        --shadow-sm: rgba(0, 0, 0, 0.7);
        --shadow-md: rgba(0, 0, 0, 0.8);
        --muted-error: #a1a1b6;
    }
}

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

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.5;
    height: 100%;
    color-scheme: light;
}

:root[data-theme='dark'] body {
    color-scheme: dark;
}

:root[data-theme='light'] body {
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) body {
        color-scheme: dark;
    }
}

h1,
h2,
h3,
h4 {
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.2;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 1.5rem;
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--fg);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo svg {
    width: 28px;
    height: 28px;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding: 6rem 2rem 2rem;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 10;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 14px;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

.hero h1 {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.1s forwards;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto 3rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.2s forwards;
}

/* Timeline Visual */
.timeline-visual {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto 3rem;
    height: 120px;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.3s forwards;
}

.timeline-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--card);
    border-radius: 4px;
    border: 1px solid var(--border);
}

.timeline-progress {
    height: 100%;
    width: 65%;
    background: var(--accent);
    border-radius: 4px;
    position: relative;
}

.timeline-progress::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(50%, -50%);
    width: 16px;
    height: 16px;
    background: var(--fg);
    border-radius: 50%;
    border: 1px solid var(--bg);
}

.note-marker {
    position: absolute;
    bottom: 24px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.note-marker::before {
    content: '';
    width: 2px;
    height: 20px;
    background: var(--border);
}

.note-bubble {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: default;
    box-shadow: 0 2px 8px var(--shadow-xs);
}

.note-bubble:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-sm);
}

.note-bubble strong {
    color: var(--accent);
    font-family: 'Space Grotesk', monospace;
}

/* CTA Buttons */
.cta-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.4s forwards;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: 'Inter', sans-serif;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--shadow-md);
}

.btn-secondary {
    background: var(--transparent);
    color: var(--fg);
    border: 1px solid var(--border);
}

.btn-compact {
    padding: 10px 20px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .btn-github-nav {
        padding: 5px 5px;
        border: none;
    }
}

.btn-language {
    padding: 0px;
    border: none;
}

.btn-language svg {
    width: 24px;
}

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

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 4px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--border);
}

@media (max-width: 768px) {
    .theme-toggle {
        gap: 0.1rem;
        padding: 2px;
    }

}

.theme-toggle .theme-toggle__option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--fg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    line-height: 0;
}

.theme-toggle .theme-toggle__option svg {
    width: 20px;
    height: 20px;
}

.theme-toggle .theme-toggle__option[aria-pressed='true'] {
    background: var(--fg);
    color: var(--bg);
    box-shadow: 0 4px 10px var(--shadow-xs);
    transform: translateY(-1px);
    opacity: 1;
}

.theme-toggle .theme-toggle__option[aria-pressed='false'] {
    opacity: 0.65;
}

.theme-toggle .theme-toggle__option:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Features Section */
.features {
    padding: 8rem 2rem;
    position: relative;
    z-index: 10;
    background: var(--card);
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 4rem;
}

.section-header h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--muted);
    font-size: 1.1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(30px);
}

.feature-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.feature-card:hover {
    border-color: var(--muted);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px var(--shadow-xs);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--fg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--bg);
}

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

.feature-card p {
    color: var(--muted);
}

/* Plugin Section */
.plugin-section {
    padding: 8rem 2rem;
    position: relative;
    z-index: 10;
}

.plugin-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 768px) {
    .plugin-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.plugin-content h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.plugin-content p {
    color: var(--muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.plugin-visual {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px var(--shadow-xs);
}

.plugin-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

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

.plugin-body {
    padding: 0;
    line-height: 0;
}

.plugin-demo {
    width: 100%;
    height: auto;
    display: block;
}

.plugin-demo--dark {
    display: none;
}

:root[data-theme='dark'] .plugin-demo--light {
    display: none;
}

:root[data-theme='dark'] .plugin-demo--dark {
    display: block;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .plugin-demo--light {
        display: none;
    }

    :root:not([data-theme]) .plugin-demo--dark {
        display: block;
    }
}

/* Footer */
footer {
    padding: 3rem 2rem;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 10;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.copyright-text {
    color: var(--muted);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

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

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 404 Page Specific Styles */
body.error-page {
    --muted: var(--muted-error);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

body.error-page main {
    max-width: 600px;
    width: 100%;
}

.error-code {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(6rem, 20vw, 12rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.05em;
    margin-bottom: 1.5rem;
}

.message h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.message p {
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 3rem;
}

.actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-primary:hover,
.btn-secondary:hover {
    cursor: pointer;
}


/* Items hidden on small screens */
@media (max-width: 768px) {
    .hide-on-small-screens {
        display: none !important;
    }
}