/* CSS Variables */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --background-color: #ffffff;
    --surface-color: #f8fafc;
    --surface-dark: #e2e8f0;
    --text-color: #1e293b;
    --text-light: #64748b;
    --text-lighter: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Fira Code', monospace;
}

/* Dark mode variables */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #0f172a;
        --surface-color: #1e293b;
        --surface-dark: #334155;
        --text-color: #f1f5f9;
        --text-light: #cbd5e1;
        --text-lighter: #94a3b8;
        --border-color: #334155;
        --border-light: #1e293b;
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container {
        padding: 0 2rem;
    }
}

/* 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: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .navbar {
        background: rgba(15, 23, 42, 0.95);
    }
}

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

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

.nav-logo {
    width: 32px;
    height: 32px;
}

.nav-version {
    background: var(--primary-color);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 0.25rem;
}

.nav-toggle span {
    width: 1.5rem;
    height: 2px;
    background: var(--text-color);
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 1rem 4rem;
    background: linear-gradient(135deg, var(--background-color) 0%, var(--surface-color) 100%);
    position: relative;
}

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

@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-weight: 300;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

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

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

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

.btn-secondary:hover {
    background: var(--surface-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Terminal Demo */
.terminal {
    background: #1e293b;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    font-family: var(--font-mono);
    max-width: 600px;
}

.terminal-header {
    background: #334155;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.terminal-buttons {
    display: flex;
    gap: 0.5rem;
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-button-red { background: #ef4444; }
.terminal-button-yellow { background: #f59e0b; }
.terminal-button-green { background: #10b981; }

.terminal-title {
    color: #cbd5e1;
    font-size: 0.875rem;
    font-weight: 500;
}

.terminal-content {
    padding: 1.5rem;
    background: #1e293b;
}

.terminal-line {
    color: #10b981;
    margin-bottom: 1rem;
}

.terminal-output {
    color: #e2e8f0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.terminal-output div {
    margin-bottom: 0.25rem;
}

.grade-a {
    color: #10b981;
    font-weight: 600;
}

.success {
    color: #10b981;
}

/* Sections */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

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

.section-header p {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Features */
.features {
    padding: 6rem 1rem;
    background: var(--surface-color);
}

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

.feature-card {
    background: var(--background-color);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

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

.feature-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

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

/* Installation */
.installation {
    padding: 6rem 1rem;
}

.install-tabs {
    max-width: 800px;
    margin: 0 auto;
}

.tab-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.tab-button:hover,
.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.code-block {
    background: #1e293b;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    margin: 1rem 0;
}

.code-block pre {
    margin: 0;
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
}

.copy-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-button:hover {
    background: var(--primary-dark);
}

/* Usage */
.usage {
    padding: 6rem 1rem;
    background: var(--surface-color);
}

.usage-examples {
    display: grid;
    gap: 2rem;
    margin-bottom: 4rem;
}

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

.command-reference {
    background: var(--background-color);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.command-table {
    overflow-x: auto;
}

.command-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.command-table th,
.command-table td {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.command-table th {
    font-weight: 600;
    background: var(--surface-color);
    color: var(--text-color);
}

.command-table td {
    color: var(--text-light);
}

.command-table code {
    background: var(--surface-color);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

/* Footer */
.footer {
    background: var(--text-color);
    color: var(--background-color);
    padding: 4rem 1rem 2rem;
}

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

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

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

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

.footer-section a {
    color: var(--text-lighter);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-lighter);
}

/* Scroll indicator */
.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-indicator {
    width: 2rem;
    height: 3rem;
    border: 2px solid var(--text-light);
    border-radius: 1rem;
    position: relative;
}

.scroll-indicator span {
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--text-light);
    border-radius: 50%;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(1rem);
    }
}

/* Download links */
.download-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.download-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.download-link:hover {
    background: var(--surface-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.download-icon {
    font-size: 1.25rem;
}

/* Rules */
.rules {
    padding: 6rem 1rem;
}

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

.rule-card {
    background: var(--background-color);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

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

.rule-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.rule-icon {
    color: var(--primary-color);
    flex-shrink: 0;
}

.rule-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    flex: 1;
}

.rule-id {
    background: var(--surface-color);
    color: var(--text-light);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    font-weight: 500;
}

.rule-description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.rule-checks h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.rule-checks ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rule-checks li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
    line-height: 1.5;
}

.rule-checks li:last-child {
    border-bottom: none;
}

.rule-checks strong {
    color: var(--primary-color);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.rule-severity {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.rule-severity h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

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

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

.severity-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.severity-high {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.severity-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.severity-low {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.severity-item p {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Responsive design */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .rules-grid {
        grid-template-columns: 1fr;
    }
    
    .rule-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .severity-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-buttons {
        flex-wrap: wrap;
    }
    
    .hero-buttons {
        justify-content: center;
    }
}