/* QadEng Website Styles
 * Colors matched to the native macOS app icon
 * Primary accent: #5B7FD3 (blue) to #8B5DC7 (purple)
 */

:root {
    /* Accent colors matching the app icon gradient */
    --accent: #5B7FD3;
    --accent-light: #7A6ECF;
    --accent-gradient: linear-gradient(135deg, #5B7FD3 0%, #8B5DC7 100%);

    /* Status colors matching the app */
    --status-green: #34C759;
    --status-red: #FF3B30;
    --status-yellow: #FFCC00;
    --status-orange: #FF9500;
    --status-blue: #007AFF;
    --status-purple: #AF52DE;

    /* Light mode colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F7;
    --bg-tertiary: #E8E8ED;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --text-tertiary: #AEAEB2;
    --border: rgba(0, 0, 0, 0.1);
    --card-bg: #FFFFFF;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);

    /* Window chrome colors */
    --window-bg: #F6F6F6;
    --window-border: #D4D4D4;
    --sidebar-bg: #F0F0F0;
    --sidebar-item-hover: rgba(0, 0, 0, 0.05);
    --sidebar-item-active: rgba(91, 127, 211, 0.15);

    /* Code colors (light mode from EditorTheme) */
    --code-keyword: #AB1D91;
    --code-string: #C41A16;
    --code-comment: #5D6C79;
    --code-number: #1C00CF;
    --code-function: #006E85;
    --code-type: #1C5C8C;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Border radius (matching macOS native) */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --accent: #7A6ECF;
        --accent-light: #9B8AD8;

        --bg-primary: #1D1D1F;
        --bg-secondary: #2C2C2E;
        --bg-tertiary: #3A3A3C;
        --text-primary: #F5F5F7;
        --text-secondary: #A1A1A6;
        --text-tertiary: #6E6E73;
        --border: rgba(255, 255, 255, 0.1);
        --card-bg: #2C2C2E;
        --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);

        --window-bg: #2D2D2D;
        --window-border: #3D3D3D;
        --sidebar-bg: #252525;
        --sidebar-item-hover: rgba(255, 255, 255, 0.05);
        --sidebar-item-active: rgba(100, 166, 242, 0.2);

        /* Code colors (dark mode from EditorTheme) */
        --code-keyword: #FC73A0;
        --code-string: #FAC778;
        --code-comment: #73858C;
        --code-number: #D1ADF5;
        --code-function: #66D4C5;
        --code-type: #59C5F5;
    }
}

/* Reset */
*, *::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: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-light);
}

img {
    max-width: 100%;
    height: auto;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

@media (prefers-color-scheme: dark) {
    .nav {
        background: rgba(29, 29, 31, 0.8);
    }
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    font-size: 18px;
    color: var(--text-primary);
}

.nav-logo:hover {
    color: var(--text-primary);
}

.logo-icon {
    width: 28px;
    height: 28px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

.nav-cta {
    background: var(--accent);
    color: white !important;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
}

.nav-cta:hover {
    background: var(--accent-light);
    color: white !important;
}

.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-mobile-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
}

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

    .nav-mobile-toggle {
        display: flex;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(60, 138, 229, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(60, 138, 229, 0.5);
    color: white;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border);
    color: var(--text-primary);
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 160px 0 100px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(60, 138, 229, 0.15), transparent);
    pointer-events: none;
}

@media (prefers-color-scheme: dark) {
    .hero-bg {
        background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(100, 166, 242, 0.1), transparent);
    }
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: var(--space-3xl);
    align-items: center;
}

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

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 14px;
    background: var(--bg-secondary);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-green);
}

.hero h1 {
    font-size: 64px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-lg);
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 42px;
    }
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-xl);
    max-width: 500px;
}

@media (max-width: 1024px) {
    .hero-subtitle {
        max-width: 100%;
    }
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

@media (max-width: 768px) {
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
}

.hero-requirements {
    display: flex;
    gap: var(--space-md);
    font-size: 13px;
    color: var(--text-tertiary);
}

@media (max-width: 1024px) {
    .hero-requirements {
        justify-content: center;
    }
}

.separator {
    opacity: 0.5;
}

/* Hero Visual - App Window */
.hero-visual {
    position: relative;
}

@media (max-width: 1024px) {
    .hero-visual {
        display: none;
    }
}

.window-frame {
    background: var(--window-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--window-border);
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.12),
        0 12px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    .window-frame {
        box-shadow:
            0 24px 48px rgba(0, 0, 0, 0.4),
            0 12px 24px rgba(0, 0, 0, 0.3);
    }
}

.window-titlebar {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--window-bg);
    border-bottom: 1px solid var(--border);
}

.window-buttons {
    display: flex;
    gap: 8px;
}

.window-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.window-btn.close { background: #FF5F57; }
.window-btn.minimize { background: #FEBC2E; }
.window-btn.maximize { background: #28C840; }

.window-title {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.window-content {
    display: flex;
    min-height: 320px;
}

.app-sidebar {
    width: 180px;
    background: var(--sidebar-bg);
    padding: var(--space-sm);
    border-right: 1px solid var(--border);
}

.sidebar-section {
    margin-bottom: var(--space-md);
}

.sidebar-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    margin-bottom: 4px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 8px;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: default;
}

.sidebar-item.active {
    background: var(--sidebar-item-active);
    color: var(--accent);
}

.sidebar-icon {
    font-size: 12px;
    opacity: 0.7;
}

.app-main {
    flex: 1;
    padding: var(--space-md);
    background: var(--bg-primary);
}

.status-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.status-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 500;
    margin-bottom: var(--space-sm);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-indicator.running {
    background: var(--status-green);
    box-shadow: 0 0 8px var(--status-green);
}

.status-endpoint {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-endpoint .label {
    font-size: 12px;
    color: var(--text-tertiary);
}

.status-endpoint code {
    font-size: 12px;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

.service-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: var(--font-mono);
}

.status-dot.green {
    background: var(--status-green);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-header h2 {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
}

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

/* Features Section */
.features {
    padding: var(--space-3xl) 0;
    background: var(--bg-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

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

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

.feature-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
    .feature-card:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

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

/* Services Section */
.services {
    padding: var(--space-3xl) 0;
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.service-row {
    display: flex;
    gap: var(--space-xl);
    align-items: flex-start;
    padding: var(--space-xl);
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: border-color 0.2s ease;
}

.service-row:hover {
    border-color: var(--accent);
}

@media (max-width: 640px) {
    .service-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

.service-icon-large {
    width: 56px;
    height: 56px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.service-icon-large svg {
    width: 28px;
    height: 28px;
    stroke: var(--accent);
}

.service-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.service-info p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.6;
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

@media (max-width: 640px) {
    .service-tags {
        justify-content: center;
    }
}

.tag {
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Code Example Section */
.code-example {
    padding: var(--space-3xl) 0;
    background: var(--bg-secondary);
}

.state-benefits {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    max-width: 900px;
    margin: 0 auto var(--space-2xl);
}

@media (max-width: 768px) {
    .state-benefits {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
}

.state-benefit {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    text-align: left;
}

.state-benefit svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent);
    flex-shrink: 0;
    margin-top: 2px;
}

.state-benefit h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.state-benefit p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.code-window {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.code-titlebar {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--window-bg);
    border-bottom: 1px solid var(--border);
}

.code-filename {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.code-content {
    padding: var(--space-lg);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.7;
    overflow-x: auto;
    background: var(--bg-primary);
}

.code-content code {
    background: none;
    padding: 0;
}

/* YAML syntax highlighting */
.yaml-key {
    color: var(--code-keyword);
}

.yaml-number {
    color: var(--code-number);
}

.yaml-bool {
    color: var(--code-function);
}

.yaml-string {
    color: var(--code-string);
}

/* Directory tree highlighting */
.tree-folder {
    color: var(--accent);
    font-weight: 500;
}

.tree-file {
    color: var(--text-primary);
}

.tree-comment {
    color: var(--code-comment);
    font-style: italic;
}

/* CTA Section */
.cta {
    padding: var(--space-3xl) 0;
    text-align: center;
}

.cta h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.cta p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.cta-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

@media (max-width: 640px) {
    .cta-actions {
        flex-direction: column;
        align-items: center;
    }
}

/* Footer */
.footer {
    padding: var(--space-3xl) 0 var(--space-xl);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: var(--space-3xl);
    margin-bottom: var(--space-2xl);
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
        text-align: center;
    }
}

.footer-brand p {
    margin-top: var(--space-md);
    font-size: 14px;
    color: var(--text-secondary);
}

.footer-column h4 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.footer-column a {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: var(--space-sm);
}

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

.footer-bottom {
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-bottom p {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-mono { font-family: var(--font-mono); }

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

.hero-content,
.hero-visual {
    animation: fadeInUp 0.6s ease forwards;
}

.hero-visual {
    animation-delay: 0.2s;
}
