@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css");
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --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 25px 50px -12px rgb(0 0 0 / 0.25);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #334155;
    --border-hover: #475569;
}

/* Dark theme link colors */
[data-theme="dark"] a {
    color: var(--secondary-color);
}

[data-theme="dark"] a:hover {
    color: var(--accent-color);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    /* max-width: 1100px; */
    margin: 0 auto;
    padding: 0 1.75rem;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

[data-theme="dark"] .header {
    background: rgba(15, 23, 42, 0.95);
}

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

/* Center the main navigation between logo and controls by default */
.header-content .header-nav {
    margin: 0 auto;
}

/* Docs pages use a more left-aligned layout; override there */
/* body.docs-body .header-content {
    justify-content: flex-start;
    gap: 2rem;
}

body.docs-body .header-content .header-nav {
    margin: 0;
} */

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--primary-color);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow-lg);
    font-size: 1rem;
}

.header-nav {
    display: flex;
    gap: 1.5rem;
}

.docs-header-search {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-secondary);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.docs-header-search:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.docs-header-search-icon {
    font-size: 0.95rem;
}

.docs-header-search-text {
    display: none;
}

.docs-header-search-kbd {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.kbd-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.2rem;
    padding: 0.1rem 0.25rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
}

@media (min-width: 768px) {
    .docs-header-search-text {
        display: inline;
    }
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

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

.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.4rem 0.55rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.15rem;
}

.theme-toggle:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

/* Hero */
.hero {
    padding: 5rem 0 4rem;
    text-align: center;
    background:
        radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 55%),
        linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23e2e8f0" stroke-width="0.5" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>') repeat;
    animation: gridMove 20s linear infinite;
    z-index: -1;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(10px, 10px); }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow-lg);
}

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

.hero-pronunciation {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
    font-style: italic;
    letter-spacing: 0.02em;
}

.hero-tagline {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    border: 2px solid transparent;
}

.cta-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-lg);
}

.cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.cta-secondary {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.cta-secondary:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.hero-demo {
    max-width: 640px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    text-align: left;
}

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

.demo-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.demo-dot.red { background: #ff5f57; }
.demo-dot.yellow { background: #ffbd2e; }
.demo-dot.green { background: #28ca42; }

.demo-title {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

.demo-code {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.demo-line {
    display: block;
    margin-bottom: 0.35rem;
}

.demo-prompt {
    color: var(--secondary-color);
    font-weight: 600;
}

.demo-command {
    color: var(--primary-color);
    font-weight: 500;
}

.demo-output {
    color: var(--text-secondary);
}

/* Sections */
.section {
    padding: 3.5rem 0;
}

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

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

.section-description {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto;
}

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

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.75rem;
    text-align: left;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

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

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

.feature-icon {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    display: block;
}

.feature-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

code {
     color: var(--text-secondary);
}
.code-block {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    margin-top: 0.85rem;
    overflow-x: auto;
}

.list {
    list-style: none;
    margin-top: 1rem;
}

.list-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.list-bullet {
    color: var(--secondary-color);
    font-size: 1rem;
    margin-top: 0.1rem;
}

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

.footer-content {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.footer-content a {
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.footer-link {
    color: var(--primary-color);
    text-decoration: none;
}

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1.1rem;
    }

    .hero-title {
        font-size: 2.4rem;
    }

    .hero-tagline {
        font-size: 1.2rem;
    }

    .header-nav {
        display: none;
    }
}



/* Docs search overlay */
.docs-search-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1300;
    display: none;
}

.docs-search-overlay.is-open {
    display: block;
}

.docs-search-backdrop {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(15, 23, 42, 0.65);
}

.docs-search-dialog {
    position: relative;
    max-width: 640px;
    margin: 8vh auto 0 auto;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1rem 1.25rem 1.25rem 1.25rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
}

.docs-search-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    padding: 0.45rem 0.75rem;
}

.docs-search-icon {
    font-size: 0.95rem;
    color: var(--text-tertiary);
}

.docs-search-input-row input[type="search"] {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.docs-search-input-row input[type="search"]::placeholder {
    color: var(--text-tertiary);
}

.docs-search-close {
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0.15rem 0.4rem;
}

.docs-search-results {
    margin-top: 0.75rem;
    max-height: 55vh;
    overflow-y: auto;
}

.markspresso-search-result {
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
}

.markspresso-search-result a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.markspresso-search-result:hover {
    background: var(--bg-tertiary);
}

.markspresso-search-result:hover a {
    color: var(--text-primary);
}
