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

:root {
    --primary-color: #4D4D4D;
    --primary-dark: #3c3c3c;
    --secondary-color: #64748b;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;

    --hero-light: #f8fafcaa;
    --hero-dark: #64748bcc;

    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-white);
    opacity: 0.95;
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
}

nav.scrolled {
    box-shadow: var(--shadow-lg);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    height: 32px;
    width: auto;
}

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

.nav-links li {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

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

.nav-links a:hover::after {
    width: 100%;
}

.github-link {
    background-color: var(--primary-color);
    color: var(--bg-white) !important;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.github-link:hover {
    background-color: var(--primary-dark);
}

.github-link::after {
    display: none;
}

/* Mobile menu toggle button */
.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-white);
    cursor: pointer;
}

.menu-toggle .bar {
    display: block;
    width: 22px;
    height: 3px;
    background: var(--secondary-color);
    margin: 3px 0;
    border-radius: 1rem;
}

body.no-scroll {
    overflow: hidden;
}

/* Hero Section */
.hero {
    margin-top: 80px;
    padding: 12rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--hero-light) 0%, var(--hero-dark) 100%), url('imgs/hero.png');

    background-position: center;
    background-repeat: no-repeat;
    color: var(--text-dark);
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-logo {
    width: 150px;
    height: 150px;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 5rem;
    animation: fadeInUp 0.8s ease;
    text-shadow: var(--border-color) 1px 1px 2px;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 0.8s ease 0.4s backwards;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
}

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

.btn-secondary {
    background-color: var(--bg-white);
    color: var(--primary-color);
    border: 2px solid var(--border-color);
    width: 200px;
}

.btn-secondary:hover {
    background-color: var(--bg-white);
    color: var(--primary-color);
    border: 2px solid var(--secondary-color);
}

/* Features Section */
.features {
    padding: 6rem 2rem;
    background-color: var(--bg-light);
}

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

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

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

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

    .page-actions {
        margin: 1rem 0 2rem;
    }

    .btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .code-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0.75rem;
    }

    border-color: var(--border-color);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-radius: 2rem;
    border-color: var(--secondary-color);
}


.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

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

/* Examples Gallery */
.examples {
    padding: 6rem 2rem;
    background-color: var(--bg-white);
}

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

/* Example detail pages */
.example-page {
    padding: 8rem 2rem 4rem;
    /* account for fixed navbar */
    background-color: var(--bg-light);
}

.example-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.panel {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    overflow: hidden;
}

.code-panel pre {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    padding: 12px;
    overflow: auto;
    font-size: 0.75rem !important;
    line-height: 1.5;
    max-height: 600px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    margin-bottom: 6px;
}

.result-panel {
    overflow: auto;
}

.result-panel canvas {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
    box-sizing: border-box;
    margin-top: 6px;
}

.example-card {
    background-color: var(--bg-light);
    overflow: hidden;
    border-radius: 1rem;
    border: 2px solid;
    border-color: var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: var(--shadow);
    text-decoration: none;
}

.example-card:hover {
    border-radius: 2rem;
    border-color: var(--secondary-color);
    text-decoration: none;
}

.example-card:visited {
    text-decoration: none;
}

.example-image {
    width: 100%;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-white);
    font-size: 3rem;
    overflow: hidden;
    position: relative;
}

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

/* Example tags */
.example-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* Overlay variant for gallery images */
.example-image .example-tags {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    z-index: 2;
}

.tag {
    --tag-bg: var(--secondary-color);
    background: var(--tag-bg);
    color: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    line-height: 1;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    white-space: nowrap;
}

.example-card:hover .example-image img {
    transform: scale(1.05);
}

.example-content {
    padding: 1.5rem;
}

.example-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.example-content p {
    color: var(--text-light);
}


/* Footer */
footer {
    background-color: var(--text-dark);
    color: var(--bg-white);
    padding: 3rem 2rem;
    text-align: center;
}

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

footer a:hover {
    text-decoration: underline;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle { display: inline-flex; }

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

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

    .nav-links li { width: 100%; }

    .nav-links a {
        padding: 0.75rem 0.5rem;
        width: 100%;
    }

    .hero-logo {
        width: 96px;
        height: 96px;
    }

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

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .section-title {
        font-size: 2rem;
    }

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

    /* Compact the example page padding on small screens */
    .example-page {
        padding: 6rem 1rem 3rem;
    }

    .panel {
        padding: 1rem;
    }

    .code-panel pre {
        max-height: 400px;
        font-size: 0.7rem !important;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 1rem;
    }

    .nav-links {
        gap: 0.5rem;
        font-size: 0.9rem;
    }

    .github-link {
        padding: 0.4rem 1rem;
    }

    .example-page {
        padding: 5rem 0.5rem 2rem;
    }

    .code-panel pre {
        max-height: 300px;
        font-size: 0.65rem !important;
    }
}