/* ============================================================
   HTTL-S Documentation — Design System
   Clean, solid colors, no gradients, no clutter
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
    /* Background layers */
    --bg-primary: #0f1117;
    --bg-secondary: #161922;
    --bg-tertiary: #1c1f2e;
    --bg-card: #1a1d2b;
    --bg-code: #12141d;

    /* Text */
    --text-primary: #e8eaf0;
    --text-secondary: #9298a8;
    --text-muted: #5c6270;

    /* Accent */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-muted: #1e3a5f;

    /* Semantic */
    --green: #22c55e;
    --red: #ef4444;
    --orange: #f59e0b;
    --purple: #8b5cf6;
    --cyan: #06b6d4;

    /* Borders */
    --border: #252836;
    --border-hover: #3b82f6;

    /* Spacing */
    --container: 1100px;
    --section-gap: 6rem;
    --card-radius: 10px;

    /* Transition */
    --ease: cubic-bezier(.25, .46, .45, .94);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

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

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

img {
    max-width: 100%;
    display: block;
}

/* ── Container ───────────────────────────────────────────── */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    height: 64px;
    display: flex;
    align-items: center;
}

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

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.navbar-brand i {
    color: var(--accent);
    font-size: 1.4rem;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    list-style: none;
}

.navbar-links a {
    color: var(--text-secondary);
    font-size: .875rem;
    font-weight: 500;
    transition: color .2s var(--ease);
}

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

.navbar-links .btn-sm {
    background: var(--accent);
    color: #fff;
    padding: .4rem 1rem;
    border-radius: 6px;
    font-size: .8125rem;
    font-weight: 600;
}

.navbar-links .btn-sm:hover {
    background: var(--accent-hover);
    color: #fff;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
    padding: 10rem 0 6rem;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    background: var(--bg-tertiary);
    color: var(--accent);
    font-size: .8125rem;
    font-weight: 600;
    padding: .35rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    letter-spacing: .02em;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.03em;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.hero h1 span {
    color: var(--accent);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-family: 'Inter', sans-serif;
    font-size: .9375rem;
    font-weight: 600;
    padding: .75rem 1.75rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all .2s var(--ease);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

/* ── Hero Code Demo ──────────────────────────────────────── */
.hero-demo {
    max-width: 680px;
    margin: 3.5rem auto 0;
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    overflow: hidden;
    text-align: left;
}

.demo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.demo-dots {
    display: flex;
    gap: 6px;
}

.demo-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
}

.demo-dots span:nth-child(1) {
    background: #ef4444;
}

.demo-dots span:nth-child(2) {
    background: #f59e0b;
}

.demo-dots span:nth-child(3) {
    background: #22c55e;
}

.demo-title {
    font-size: .75rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.demo-body {
    padding: 1.25rem 1.5rem;
}

.demo-body pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: .8125rem;
    line-height: 1.8;
    color: var(--text-secondary);
    overflow-x: auto;
}

/* ── Syntax colors (manual) ──────────────────────────────── */
.syn-tag {
    color: #ef4444;
}

.syn-attr {
    color: #f59e0b;
}

.syn-str {
    color: #22c55e;
}

.syn-kw {
    color: #c084fc;
}

.syn-fn {
    color: #60a5fa;
}

.syn-cmt {
    color: #4b5563;
    font-style: italic;
}

.syn-var {
    color: #e8eaf0;
}

.syn-num {
    color: #f59e0b;
}

/* ── Section common ──────────────────────────────────────── */
.section {
    padding: var(--section-gap) 0;
}

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

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin-bottom: .75rem;
}

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

.section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--accent-muted);
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* ── How It Works ────────────────────────────────────────── */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: border-color .25s var(--ease), transform .25s var(--ease);
}

.step-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: .9375rem;
    margin-bottom: 1.25rem;
}

.step-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: .5rem;
}

.step-card p {
    color: var(--text-secondary);
    font-size: .9rem;
}

.step-card code {
    display: inline-block;
    background: var(--bg-code);
    color: var(--accent);
    padding: .15rem .5rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: .8125rem;
    margin-top: .5rem;
}

/* ── Feature Grid ────────────────────────────────────────── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 1.75rem 1.5rem;
    transition: border-color .25s var(--ease), transform .25s var(--ease);
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: .5rem;
}

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

/* Feature icon color variants */
.fi-blue {
    background: var(--accent-muted);
    color: var(--accent);
}

.fi-green {
    background: #14532d;
    color: var(--green);
}

.fi-purple {
    background: #2e1065;
    color: var(--purple);
}

.fi-orange {
    background: #451a03;
    color: var(--orange);
}

.fi-cyan {
    background: #083344;
    color: var(--cyan);
}

.fi-red {
    background: #450a0a;
    color: var(--red);
}

/* ── Positioning Table (What Is / Is Not) ────────────────── */
.positioning {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.positioning-col {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 2rem;
}

.positioning-col h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.positioning-col h3 i.fa-check-circle {
    color: var(--green);
}

.positioning-col h3 i.fa-times-circle {
    color: var(--red);
}

.positioning-col ul {
    list-style: none;
}

.positioning-col li {
    padding: .5rem 0;
    color: var(--text-secondary);
    font-size: .9rem;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    border-bottom: 1px solid var(--border);
}

.positioning-col li:last-child {
    border-bottom: none;
}

.positioning-col li i {
    margin-top: 3px;
    font-size: .75rem;
}

.pos-yes i {
    color: var(--green);
}

.pos-no i {
    color: var(--red);
}

/* ── Good For / Not For ──────────────────────────────────── */
.use-cases {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.use-case-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 2rem;
}

.use-case-box h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.use-case-box h3 .fa-thumbs-up {
    color: var(--green);
}

.use-case-box h3 .fa-thumbs-down {
    color: var(--red);
}

/* ── Install Section ─────────────────────────────────────── */
.install-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 720px;
    margin: 0 auto;
}

.install-step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    overflow: hidden;
}

.install-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1.25rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.install-step-header .step-label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: .8125rem;
    display: flex;
    align-items: center;
    gap: .35rem;
    font-family: 'Inter', sans-serif;
    transition: color .2s var(--ease);
}

.copy-btn:hover {
    color: var(--text-primary);
}

.install-step pre {
    padding: 1rem 1.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: .8125rem;
    line-height: 1.8;
    color: var(--text-secondary);
    overflow-x: auto;
}

/* ── API Table ───────────────────────────────────────────── */
.api-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
}

.api-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.api-table thead {
    background: var(--bg-secondary);
}

.api-table th {
    text-align: left;
    padding: .85rem 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: .8125rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border);
}

.api-table td {
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.api-table tr:last-child td {
    border-bottom: none;
}

.api-table tr:hover td {
    background: var(--bg-tertiary);
}

.api-table code {
    background: var(--bg-code);
    color: var(--accent);
    padding: .1rem .4rem;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: .8125rem;
}

.api-table .api-desc {
    color: var(--text-secondary);
}

/* ── Comparison Table ────────────────────────────────────── */
.comparison-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.comparison-table thead {
    background: var(--bg-secondary);
}

.comparison-table th {
    text-align: center;
    padding: .85rem 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: .8125rem;
    border-bottom: 1px solid var(--border);
}

.comparison-table th:first-child {
    text-align: left;
}

.comparison-table td {
    text-align: center;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.comparison-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--text-primary);
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table tr:hover td {
    background: var(--bg-tertiary);
}

.cmp-yes {
    color: var(--green);
}

.cmp-no {
    color: var(--red);
}

.cmp-partial {
    color: var(--orange);
}

.comparison-table .highlight-col {
    background: var(--accent-muted);
}

/* ── Playground ──────────────────────────────────────────── */
.playground-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    overflow: hidden;
    min-height: 380px;
}

.playground-editor,
.playground-preview {
    display: flex;
    flex-direction: column;
}

.playground-editor {
    border-right: 1px solid var(--border);
}

.playground-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .65rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    font-size: .75rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.playground-editor textarea {
    flex: 1;
    resize: none;
    border: none;
    outline: none;
    background: transparent;
    color: transparent;
    caret-color: #e8eaf0;
    font-family: 'JetBrains Mono', monospace;
    font-size: .8125rem;
    line-height: 1.7;
    padding: 1rem;
    tab-size: 2;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    white-space: pre;
    overflow: auto;
}

.playground-editor textarea::selection {
    background: rgba(59, 130, 246, 0.3);
    color: transparent;
}

.editor-container {
    position: relative;
    flex: 1;
    min-height: 300px;
}

.editor-highlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 1rem;
    background: var(--bg-code);
    font-family: 'JetBrains Mono', monospace;
    font-size: .8125rem;
    line-height: 1.7;
    tab-size: 2;
    color: var(--text-secondary);
    overflow: auto;
    z-index: 1;
    pointer-events: none;
    white-space: pre;
    word-wrap: normal;
}

.editor-highlight code {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    background: none;
    padding: 0;
}

/* ── Highlight token colors (playground) ─────────────────── */
.hl-tag {
    color: #ef4444;
}

.hl-attr {
    color: #f59e0b;
}

.hl-str {
    color: #22c55e;
}

.hl-kw {
    color: #c084fc;
}

.hl-fn {
    color: #60a5fa;
}

.hl-cmt {
    color: #4b5563;
    font-style: italic;
}

.hl-num {
    color: #f59e0b;
}

.hl-expr {
    color: #06b6d4;
}

.playground-preview-content {
    flex: 1;
    padding: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: .9rem;
    overflow: auto;
}

/* ── Live Demo Counter (hero section proof) ──────────────── */
.live-demo-inline {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .5rem 1.25rem;
    margin-top: 2rem;
    font-size: .875rem;
    color: var(--text-secondary);
}

.live-demo-inline .demo-count {
    font-weight: 700;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}

.live-demo-inline button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: .3rem .75rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: .8125rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: background .2s var(--ease);
}

.live-demo-inline button:hover {
    background: var(--accent-hover);
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    font-size: .8125rem;
    margin-bottom: .35rem;
}

.footer a {
    color: var(--text-secondary);
}

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

.footer-built {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: .75rem;
    padding: .3rem .75rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    margin-top: 1rem;
}

.footer-built i {
    color: var(--accent);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 850px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .steps-grid,
    .features-grid {
        grid-template-columns: 1fr 1fr;
    }

    .positioning,
    .use-cases {
        grid-template-columns: 1fr;
    }

    .playground-wrap {
        grid-template-columns: 1fr;
    }

    .playground-editor {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .navbar-links {
        display: none;
    }

    .nav-toggle {
        display: block;
    }

    .navbar-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        padding: 1rem 1.5rem;
        gap: 1rem;
    }
}

@media (max-width: 550px) {
    .hero h1 {
        font-size: 2rem;
    }

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

    .steps-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 3.5rem 0;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    :root {
        --section-gap: 4rem;
    }
}

/* ── Utility ─────────────────────────────────────────────── */
.text-accent {
    color: var(--accent);
}

.text-green {
    color: var(--green);
}

.text-red {
    color: var(--red);
}

.mt-1 {
    margin-top: .5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}