:root {
    --primary: #D97706;
    --primary-hover: #F59E0B;
    --primary-light: #FCD34D;
    --primary-bg: rgba(217, 119, 6, 0.08);
    --primary-glow: rgba(217, 119, 6, 0.25);
    --text: #1c1b1f;
    --text-secondary: #6B5A3E;
    --text-tertiary: #938F99;
    --surface: #ffffff;
    --surface-alt: #FFFBEB;
    --border: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(217, 119, 6, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 8px 32px rgba(217, 119, 6, 0.2);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 24px;
    --radius-full: 100px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-height: 72px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --text: #FDF4E3;
        --text-secondary: #D4C5A9;
        --text-tertiary: #938F99;
        --surface: #1A1520;
        --surface-alt: #241F2D;
        --border: rgba(255, 255, 255, 0.06);
        --border-hover: rgba(253, 224, 71, 0.25);
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
        --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    }
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--surface);
    color: var(--text);
    line-height: 1.7;
    font-size: 16px;
    transition: background-color var(--transition), color var(--transition);
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navigation */
nav {
    height: var(--nav-height);
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

@media (prefers-color-scheme: dark) {
    nav {
        background: rgba(20, 18, 24, 0.85);
    }

    .nav-links {
        background: rgba(20, 18, 24, 0.98);
    }
}

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

.logo {
    font-weight: 800;
    font-size: 22px;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.3px;
    transition: opacity var(--transition);
}

.logo:hover {
    opacity: 0.85;
}

.logo span {
    color: var(--primary-light);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    transition: all var(--transition);
    position: relative;
}

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

.nav-links .btn-outline-small {
    border: 1.5px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
    padding: 7px 16px;
}

.nav-links .btn-outline-small:hover {
    background: var(--primary);
    color: #fff;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Anchor offset */
.section, .cta-section {
    scroll-margin-top: 80px;
}

/* Hero */
.hero {
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, rgba(253, 224, 71, 0.12) 0%, transparent 70%);
    transform: translate(-50%, -10%);
    pointer-events: none;
    animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% { transform: translate(-50%, -10%) scale(1); opacity: 0.8; }
    100% { transform: translate(-40%, -20%) scale(1.15); opacity: 1; }
}

.hero-blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.4;
}

.hero-blob-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.08) 0%, transparent 70%);
    top: -80px;
    right: -60px;
    animation: floatBlob 12s ease-in-out infinite;
}

.hero-blob-2 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(253, 224, 71, 0.1) 0%, transparent 70%);
    bottom: -40px;
    left: -40px;
    animation: floatBlob 15s ease-in-out infinite reverse;
}

@keyframes floatBlob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -20px) scale(1.05); }
    66% { transform: translate(-10px, 15px) scale(0.95); }
}

.hero > .container {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    margin-bottom: 24px;
    letter-spacing: 0.3px;
    animation: fadeInUp 0.6s ease-out both;
}

.hero h1 {
    font-size: 60px;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.12;
    letter-spacing: -1.5px;
    color: var(--text);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero h1 .gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, #F59E0B 40%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 6s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 36px;
    line-height: 1.7;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    outline: none;
    position: relative;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 8px 28px rgba(217, 119, 6, 0.4);
}

.btn-secondary {
    background: var(--surface);
    color: var(--primary);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.1);
}

.btn-github {
    background: #1c1b1f;
    color: #fff;
}

.btn-github:hover {
    background: #2e2c33;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 56px;
    margin-top: 64px;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-top: 4px;
}

/* Section common */
.section {
    padding: 100px 0;
}

.section-alt {
    background: var(--surface-alt);
    transition: background var(--transition);
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-header h2 {
    font-size: 38px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
    letter-spacing: -0.8px;
    line-height: 1.2;
}

.section-header p {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: opacity var(--transition);
}

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

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-bg);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: all var(--transition);
}

.feature-card:hover .feature-icon {
    background: rgba(217, 119, 6, 0.15);
    transform: scale(1.05);
}

.feature-icon svg {
    transition: transform var(--transition);
}

.feature-card:hover .feature-icon svg {
    transform: scale(1.1);
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Why section */
.why-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.why-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: var(--surface);
    padding: 28px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.why-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: var(--border-hover);
}

.why-marker {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), #F59E0B);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    margin-top: 2px;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}

.why-item h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.why-item p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Open Source section */
.oss-content {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}

.oss-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.8;
}

.license-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    margin-bottom: 28px;
}

.oss-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Legal pages */
.legal-page {
    padding: 80px 0;
}

.legal-page h1 {
    font-size: 36px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.legal-page .last-updated {
    color: var(--text-tertiary);
    font-size: 14px;
    margin-bottom: 48px;
}

.legal-page section {
    margin-bottom: 40px;
}

.legal-page h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.legal-page h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    margin-top: 20px;
}

.legal-page p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}

.legal-page ul {
    margin: 8px 0 16px 24px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.8;
}

.legal-page ul li {
    margin-bottom: 4px;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, #F59E0B 100%);
    padding: 88px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
}

.cta-section > .container {
    position: relative;
    z-index: 1;
}

.cta-section h2 {
    font-size: 38px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.cta-section p {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.85);
    max-width: 500px;
    margin: 0 auto 36px;
}

.cta-section .btn {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-size: 16px;
    padding: 16px 36px;
}

.cta-section .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
    background: #1c1b1f;
    color: #cac4d0;
    padding: 56px 0 32px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand .logo {
    display: inline-block;
    margin-bottom: 12px;
    color: #FCD34D;
}

.footer-brand .logo span {
    color: #FEF3C7;
}

.footer-brand p {
    font-size: 14px;
    color: #938F99;
    line-height: 1.8;
    max-width: 280px;
}

.footer-col h4 {
    color: #e6e1e5;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-col a {
    display: block;
    color: #938F99;
    text-decoration: none;
    font-size: 14px;
    padding: 5px 0;
    transition: all var(--transition);
}

.footer-col a:hover {
    color: #FCD34D;
    transform: translateX(4px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-bottom p {
    font-size: 13px;
    color: #938F99;
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Responsive */
@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

    .hero h1 {
        font-size: 44px;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        flex-direction: column;
        padding: 16px 24px 24px;
        gap: 4px;
        border-bottom: 1px solid var(--border);
        transform: translateY(-110%);
        opacity: 0;
        transition: all var(--transition);
        pointer-events: none;
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links a {
        font-size: 15px;
        padding: 12px 16px;
        width: 100%;
        text-align: center;
    }

    .hero {
        min-height: auto;
        padding: 80px 0 64px;
    }

    .hero-blob-1, .hero-blob-2 {
        display: none;
    }
}

@media (max-width: 640px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

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

    .hero {
        padding: 64px 0 48px;
    }

    .hero h1 {
        font-size: 32px;
        letter-spacing: -0.8px;
    }

    .hero p {
        font-size: 16px;
    }

    .hero-stats {
        gap: 28px;
        margin-top: 40px;
    }

    .section {
        padding: 64px 0;
    }

    .section-header {
        margin-bottom: 40px;
    }

    .section-header h2 {
        font-size: 28px;
    }

    .cta-section {
        padding: 60px 0;
    }

    .cta-section h2 {
        font-size: 28px;
    }

    .cta-section .btn {
        width: 100%;
        justify-content: center;
    }

    .legal-page h1 {
        font-size: 28px;
    }

    .why-item {
        padding: 20px;
    }

    .footer-col a:hover {
        transform: none;
    }
}
