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

:root {
    /* Unified Dark Mode Palette */
    --bg-primary: #09090b;
    --bg-secondary: #0c0c0e;
    --bg-tertiary: #141416;

    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.2);

    --shadow-color: rgba(0, 0, 0, 0.5);
    --nav-bg: rgba(9, 9, 11, 0.85);

    --primary: #6366f1;
    /* Indigo */
    --primary-600: #4f46e5;
    --primary-700: #4338ca;

    --success: #10b981;
    --success-700: #059669;

    --radius: 12px;
    --radius-lg: 18px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, .4);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, .6);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Anchor target offset for sticky header */
[id] {
    scroll-margin-top: 90px;
}

/* Prevent image copying and dragging */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none;
}

/* Re-enable pointer events for clickable images if needed */
.logo-img {
    pointer-events: auto;
}

/* Header and Navigation */
header {
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.logo .logo-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 .25rem;
}

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

.github-link {
    background: #24292e;
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.github-link:hover {
    background: #0366d6;
    color: white !important;
}

/* Focus styles */
:where(a, button, .btn):focus-visible {
    outline: 3px solid color-mix(in oklab, var(--primary), white 20%);
    outline-offset: 2px;
    border-radius: 10px;
}

/* Hero Section */
/* Hero Section Redesign */
.hero {
    position: relative;
    overflow: hidden;
    padding: 8rem 0 7rem;
    background-color: #0c0c0e;
    color: white;
}

.hero-mesh-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    filter: blur(80px);
    opacity: 0.6;
}

.mesh-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    animation: mesh-drift 20s infinite alternate ease-in-out;
}

.mesh-1 {
    width: 400px;
    height: 400px;
    background: #6366f1;
    top: -100px;
    left: -100px;
    opacity: 0.4;
}

.mesh-2 {
    width: 500px;
    height: 500px;
    background: #7c3aed;
    bottom: -150px;
    right: -100px;
    opacity: 0.3;
    animation-delay: -5s;
}

.mesh-3 {
    width: 300px;
    height: 300px;
    background: #0ea5e9;
    top: 20%;
    left: 40%;
    opacity: 0.2;
    animation-delay: -12s;
}

@keyframes mesh-drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 30px) scale(1.1);
    }
}

.hero .container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 4rem;
}

.hero h1 {
    font-size: 3.75rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.text-gradient {
    background: linear-gradient(135deg, #60a5fa 0%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.35rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2.5rem;
    line-height: 1.5;
    max-width: 540px;
}

.icon-wrapper {
    animation: float 6s infinite ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.btn svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

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

.btn-secondary:hover svg {
    transform: translateX(2px) rotate(-10deg);
}

.app-icon {
    width: 240px;
    height: 240px;
    border-radius: 48px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--primary);
    background: linear-gradient(180deg, #818cf8, var(--primary));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: var(--primary-600);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-download {
    background: var(--success);
    background: linear-gradient(180deg, color-mix(in oklab, var(--success), white 10%), var(--success));
    color: white;
    font-size: 1.125rem;
    padding: 1rem 2rem;
}

.btn-download:hover {
    background: var(--success-700);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 199, 89, 0.3);
}

.download-icon {
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
}

.btn-download:hover .download-icon {
    transform: translateY(2px);
}

.btn-github {
    background: #181717;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-github:hover {
    background: #24292e;
    border-color: var(--primary);
}

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

.features h2 {
    text-align: center;
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 4rem;
    color: var(--text-primary);
}

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

.feature {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    backdrop-filter: blur(10px);
}

.feature:hover {
    transform: translateY(-10px);
    border-color: var(--border-glow);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.feature-icon {
    margin: 0 auto 1.5rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-icon svg {
    width: 36px;
    height: 36px;
    stroke-width: 2.5px;
    filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.4));
    transition: all 0.3s ease;
}

/* Feature Specific Corrections & Gradients */
.feature-run svg {
    stroke: var(--primary);
    transform: rotate(-45deg);
}

.feature-custom svg {
    stroke: #ff2d55;
    transform: rotate(-10deg);
    /* Counter-rotate palette slightly for better balance */
}

.feature-folder svg {
    stroke: #34c759;
}

.feature-interpreter svg {
    stroke: #818cf8;
}

.feature-custom svg {
    stroke: #ff2d55;
}

.feature-process svg {
    stroke: #fbbf24;
}

.feature-badge svg {
    stroke: #a855f7;
}

.feature:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
}

.feature:hover .feature-icon {
    transform: scale(1.15);
    /* Remove rotate(5deg) */
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.feature:hover svg {
    filter: drop-shadow(0 0 12px currentColor);
}

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

.feature p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Popular Scripts Preview */
.popular-scripts {
    padding: 5.5rem 0;
    background: var(--bg-primary);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

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

.script-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(10px);
}

.script-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.script-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    width: fit-content;
}

.script-card h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
}

.script-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    flex-grow: 1;
    margin: 0;
}

.script-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.python-version {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.script-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.view-all-container {
    text-align: center;
}

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

.use-cases h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

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

.use-case {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.use-case:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.use-case h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.use-case ul {
    list-style: none;
}

.use-case li {
    padding: 0.5rem 0;
    position: relative;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.use-case li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

/* Download Section */
.download {
    padding: 8rem 0;
    background: var(--bg-primary);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.download h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.download>p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.download-options {
    margin-bottom: 3rem;
    display: grid;
    place-items: center;
}

.download-info {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.download-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.installation-note {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    text-align: left;
    max-width: 700px;
    margin: 0 auto 3rem auto;
    box-shadow: var(--shadow-md);
}

.installation-note h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.installation-note p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.installation-note em {
    color: var(--primary);
    font-style: italic;
    font-weight: 500;
}

/* GitHub Section */
.github-section {
    padding: 8rem 0;
    background: var(--bg-primary);
    text-align: center;
}

.github-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.github-section>p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

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

/* Additional Links Section */
.additional-links {
    padding: 3rem 0;
    background: var(--bg-primary);
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.additional-links-grid {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Footer */
footer {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 4rem 0 3rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

footer p {
    margin: 0.5rem 0;
}

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

    .hero .container {
        flex-direction: column;
        text-align: center;
        gap: 3rem;
    }

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

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .app-icon {
        width: 160px;
        height: 160px;
    }

    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

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

    .use-cases-grid {
        grid-template-columns: 1fr;
    }

    .download-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .github-links {
        flex-direction: column;
        align-items: center;
    }

    .additional-links-grid {
        flex-direction: column;
        align-items: center;
    }

    .hero-buttons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.85rem;
    }

    .features h2,
    .use-cases h2,
    .download h2,
    .github-section h2 {
        font-size: 2rem;
    }

    .container {
        padding: 0 15px;
    }
}

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

    .feature:hover,
    .use-case:hover,
    .btn-download:hover,
    .btn-primary:hover {
        transform: none !important;
    }
}