:root {
    --primary-color: #f97316;
    --primary-dark: #ea580c;
    --secondary-color: #64748b;
    --text-color: #1e293b;
    --text-light: #64748b;
    --heading1-color: #0f172a;  /* very dark slate */
    --heading2-color: #1f2937;  /* dark blue/ash */
    --heading3-color: #6b7280;  /* medium-dark ash for h3 */
    --bg-color: #ffffff;
    --bg-light: #f8fafc;
    --bg-dark: #0b0b0f;
    --border-color: #e2e8f0;
    --code-bg: #111827;
    --code-text: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    /* Dark theme: black & ash (neutral grays), no blue tint */
    --text-color: #e5e5e5;
    --text-light: #a3a3a3;
    --bg-color: #050505;
    --bg-light: #111111;
    --bg-dark: #000000;
    --border-color: #27272a;
    --code-bg: #111111;
    --code-text: #e5e5e5;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.8);
}

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

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -9999px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
    font-weight: 600;
    clip: rect(0, 0, 0, 0);
    overflow: hidden;
}

.skip-link:focus {
    top: 0;
    clip: auto;
    overflow: visible;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s, color 0.3s;
}

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

/* Navigation */
.navbar {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: background-color 0.3s, border-color 0.3s;
}

[data-theme="dark"] .navbar {
    background-color: rgba(0, 0, 0, 0.9);
}

.navbar .container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-color);
}

.nav-brand a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-color);
}

.logo {
    height: 52px;
    width: auto;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin-left: auto; /* push nav items (and following actions) to the right */
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

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

.nav-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-left: 1.5rem;
}

.theme-toggle {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.theme-toggle:hover {
    background: var(--border-color);
    transform: scale(1.05);
}

[data-theme="dark"] .theme-toggle {
    background: var(--bg-light);
    border-color: var(--border-color);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.5rem;
    color: var(--text-color);
    transition: color 0.3s;
    z-index: 1001;
}

.mobile-menu-toggle:hover {
    color: var(--primary-color);
}

.mobile-menu-toggle .icon-bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background-color: var(--text-color);
    transition: all 0.3s;
    border-radius: 2px;
}

.mobile-menu-toggle.active .icon-bar:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active .icon-bar:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .icon-bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-outline {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.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: var(--bg-light);
    color: var(--text-color);
    border-color: var(--border-color);
}

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

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

/* Ensure primary buttons on content/subpages always use white text */
.page-content .btn-primary,
.text-center .btn-primary {
    color: #ffffff !important;
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #fed7aa 100%);
    transition: background 0.3s;
}

[data-theme="dark"] .hero {
    /* Lighter ash background for hero in dark mode */
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-text {
    flex: 1;
    text-align: left;
}

.hero-illustration {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.duck-documents-img {
    width: 100%;
    max-width: 500px;
    height: auto;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-color);
    line-height: 1.2;
    text-align: left;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 700px;
    margin-bottom: 2rem;
    text-align: left;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.hero-code {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1.5rem;
    border-radius: 0.5rem;
    max-width: 600px;
    text-align: left;
}

.hero-code pre {
    margin: 0;
    font-family: 'Monaco', 'Courier New', monospace;
}

.hero-code code {
    font-size: 1rem;
}

/* Features */
.features-preview {
    padding: 4rem 0;
}

.features-preview h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

/* Home section headings should share same style as features title */
.use-cases h2,
.technology h2,
.performance h2,
.community h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

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

.feature-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    transition: all 0.3s;
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-icon-inline {
    font-size: 1.8rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

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

.feature-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.link-arrow {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.link-arrow:hover {
    text-decoration: underline;
}

/* Code Blocks */
.code-block {
    background: var(--code-bg);
    border-radius: 0.5rem;
    overflow: hidden;
    margin: 2rem 0;
}

.code-header {
    background: #334155;
    padding: 0.75rem 1rem;
    color: var(--code-text);
    font-weight: 600;
}

.code-block pre {
    margin: 0;
    padding: 1.5rem;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--code-text);
}

/* Quick Start */
.quick-start {
    padding: 4rem 0;
    background: var(--bg-light);
}

.quick-start h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.text-center {
    text-align: center;
    margin-top: 2rem;
}

.text-center a {
    margin: 0 0.5rem;
}

/* Formats */
.supported-formats {
    padding: 4rem 0;
}

.supported-formats h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.format-item {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.format-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Specific link styling inside supported formats section */
.supported-formats .text-center a {
    color: var(--primary-color);
    font-weight: 600;
}

.supported-formats .text-center a:hover {
    text-decoration: underline;
}

/* Export Formats */
.export-formats {
    padding: 4rem 0;
    background: var(--bg-light);
}

.export-formats h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-intro {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

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

.export-item {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.export-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.export-item p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* CTA Section */
.cta-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

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

.cta-section .btn-primary:hover {
    background: var(--bg-light);
}

.cta-section .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.cta-section .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cta-section .btn-outline {
    color: white;
    border-color: white;
}

.cta-section .btn-outline:hover {
    background: white;
    color: var(--primary-color);
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 3rem 0 1rem;
}

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

.footer-section h3, .footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
}

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

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

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

/* Page Content */
.page-header {
    padding: 3rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #fed7aa 100%);
    text-align: center;
    transition: background 0.3s;
}

[data-theme="dark"] .page-header {
    /* Lighter ash background for page headers in dark mode (match hero style) */
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--heading1-color);
}

[data-theme="dark"] .page-header h1 {
    color: #e5e7eb; /* light ash for strong contrast on dark bg */
}

.page-header p {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto;
}

.page-content {
    padding: 3rem 0;
    max-width: 900px;
    margin: 0 auto;
}

.page-content h2 {
    font-size: 2rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
    color: var(--heading2-color);
}

[data-theme="dark"] .page-content h2 {
    color: #facc15; /* light yellow for h2 in dark mode */
}

.page-content h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--heading3-color);
}

[data-theme="dark"] .page-content h3 {
    color: #d1d5db; /* slightly dimmer than h2 but still readable */
}

.page-content h4 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.page-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.page-content ul, .page-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.page-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

/* Attractive bullet styling for subpages */
.page-content ul li {
    list-style-type: disc;
}

.page-content ul ul li {
    list-style-type: circle;
}

.page-content ol li {
    list-style-type: decimal;
}

.page-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.page-content a:hover {
    text-decoration: underline;
}

.page-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-style: italic;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

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

table th {
    background: var(--bg-light);
    font-weight: 600;
}

table tr:hover {
    background: var(--bg-light);
}

/* Additional Sections */
.use-cases, .technology, .performance, .community {
    padding: 4rem 0;
}

.use-cases {
    background: var(--bg-light);
}

[data-theme="dark"] .use-cases {
    background: var(--bg-dark);
}

.technology {
    background: var(--bg-color);
}

.performance {
    background: var(--bg-light);
}

[data-theme="dark"] .performance {
    background: var(--bg-dark);
}

.community {
    background: var(--bg-color);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    /* Mobile Navigation */
    .mobile-menu-toggle {
        display: block;
        order: 3;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-color);
        border-top: 1px solid var(--border-color);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: var(--shadow-lg);
        z-index: 999;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
    
    .nav-menu li {
        width: 100%;
        padding: 0.75rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-menu a {
        display: block;
        width: 100%;
        padding: 0.5rem 0;
    }
    
    .nav-actions {
        order: 2;
        margin-left: auto;
    }
    
    .navbar .container {
        flex-wrap: wrap;
        position: relative;
    }
    
    /* Hero Section */
    .hero {
        padding: 2rem 0;
    }
    
    .hero-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-text {
        text-align: center;
    }
    
    .hero-illustration {
        order: -1;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .duck-documents-img {
        max-width: 100%;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
        text-align: center;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
        text-align: center;
        margin: 0 auto 1.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        padding: 0 1rem;
        justify-content: center;
    }
    
    .hero-actions .btn-primary,
    .hero-actions .btn-secondary,
    .hero-actions .btn-outline {
        width: 100%;
        text-align: center;
    }
    
    .hero-code {
        margin: 1rem auto;
        padding: 1rem;
        overflow-x: auto;
        max-width: 100%;
    }
    
    .hero-code code {
        font-size: 0.85rem;
    }
    
    /* Features Grid */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .feature-icon {
        font-size: 2.5rem;
    }
    
    /* Formats Grid */
    .formats-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
    }
    
    .format-item {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
    
    /* Export Grid */
    .export-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Page Header */
    .page-header {
        padding: 2rem 0;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-header p {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    /* Page Content */
    .page-content {
        padding: 2rem 0;
    }
    
    .page-content h2 {
        font-size: 1.75rem;
        margin-top: 2rem;
    }
    
    .page-content h3 {
        font-size: 1.25rem;
        margin-top: 1.5rem;
    }
    
    .page-content h4 {
        font-size: 1.1rem;
    }
    
    .page-content p {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    .page-content ul,
    .page-content ol {
        margin-left: 1.5rem;
        padding-right: 1rem;
    }
    
    /* Code Blocks */
    .code-block {
        margin: 1.5rem 0;
        overflow-x: auto;
    }
    
    .code-block pre {
        padding: 1rem;
        font-size: 0.85rem;
    }
    
    .code-block code {
        font-size: 0.85rem;
    }
    
    /* Tables */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    table th,
    table td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    /* Buttons */
    .btn-primary,
    .btn-secondary,
    .btn-outline {
        padding: 0.625rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .text-center {
        padding: 0 1rem;
    }
    
    .text-center a {
        display: inline-block;
        margin: 0.25rem;
    }
    
    /* CTA Section */
    .cta-section {
        padding: 3rem 0;
    }
    
    .cta-section h2 {
        font-size: 2rem;
    }
    
    .cta-section p {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .cta-actions {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 1rem;
    }
    
    .cta-actions .btn-primary,
    .cta-actions .btn-secondary,
    .cta-actions .btn-outline {
        width: 100%;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Sections */
    .use-cases,
    .technology,
    .performance,
    .community {
        padding: 2rem 0;
    }
    
    .quick-start,
    .supported-formats,
    .export-formats {
        padding: 2rem 0;
    }
    
    .features-preview {
        padding: 2rem 0;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .page-content h2 {
        font-size: 1.5rem;
    }
    
    .logo {
        height: 36px;
    }
    
    .formats-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .format-item {
        font-size: 0.85rem;
        padding: 0.5rem 0.25rem;
    }
}
