/* HTMQL product site — layered over missing.css */

:root {
    --site-accent: #0b6e4f;        /* deep green — swap when branding lands */
    --site-accent-dark: #084c37;
    --site-ink: #1d2530;
    --site-muted: #5b6472;
    --site-surface: #ffffff;
    --site-tint: #f2f7f5;          /* pale accent tint for alternating bands */
    --site-code-bg: #10151c;
    --site-max: 72rem;
}

body {
    margin: 0;
    color: var(--site-ink);
    background: var(--site-surface);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--site-surface);
    border-bottom: 1px solid #e3e7ec;
    /* missing.css pads `body > header` in to its --eff-line-length (40rem),
       which shrinks the inner flex row below --site-max and pushes the nav
       out of line with .band-inner */
    padding-inline: 0;
}

.site-header-inner {
    max-width: var(--site-max);
    margin: 0 auto;
    padding: 0.6rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--site-ink);
    text-decoration: none;
}

.site-brand .tm { font-size: 0.55em; font-weight: 400; color: var(--site-muted); }

.brand-wordmark { height: 34px; width: auto; display: block; }

.hero-logo {
    display: block;
    margin: 0 auto;
    width: min(26rem, 80vw);
    height: auto;
}

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

.site-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1.4rem;
}

/* .site-header prefix outranks missing.css's nested `nav :is(a...)` rule,
   which otherwise recolors nav links blue */
.site-header .site-nav a {
    color: var(--site-ink);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.site-header .site-nav a:hover { color: var(--site-accent); }

.site-header .site-nav a.cta {
    background: var(--site-accent);
    color: #fff;
    padding: 0.4rem 0.95rem;
    border-radius: 6px;
}

.site-header .site-nav a.cta:hover { background: var(--site-accent-dark); color: #fff; }

.site-nav-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: 1px solid #d4dae1;
    border-radius: 6px;
    font-size: 1.2rem;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
}

@media (max-width: 46rem) {
    .site-nav-toggle { display: block; }
    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--site-surface);
        border-bottom: 1px solid #e3e7ec;
        padding: 0.5rem 0;
    }
    .site-nav a { padding: 0.7rem 1.25rem; }
    body.nav-open .site-nav { display: flex; }
}

/* ---------- page bands & layout ---------- */

.site-main {
    min-height: 60vh;
    /* missing.css clamps <main> to its --eff-line-length; lift that so
       .band-inner / --site-max control the content width instead */
    max-inline-size: none;
}

.band { padding: 3.5rem 1.25rem; }

/* keep anchor-jump targets clear of the sticky header */
section[id] { scroll-margin-top: 4.5rem; }
.band-inner { max-width: var(--site-max); margin: 0 auto; }
.band.tint { background: var(--site-tint); }
.band.dark { background: var(--site-code-bg); color: #e8edf3; }
.band.dark h2 { color: #fff; }

.band h2 {
    font-size: 1.9rem;
    margin: 0 0 0.4rem 0;
}

.band .kicker {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--site-accent);
    margin: 0 0 0.3rem 0;
}

.band.dark .kicker { color: #7fd7b7; }

/* ---------- hero ---------- */

.hero { padding: 1.5rem 1.25rem; text-align: center; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin: 0.5rem 0; }
.hero .tagline {
    font-size: 1.25rem;
    color: var(--site-muted);
    max-width: 60rem;
    margin: 0.8rem auto 2rem;
}

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

.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
}

.btn-primary { background: var(--site-accent); color: #fff; }
.btn-primary:hover { background: var(--site-accent-dark); color: #fff; }
.btn-secondary { border: 2px solid var(--site-accent); color: var(--site-accent); }
.btn-secondary:hover { background: var(--site-tint); }

.badge-beta {
    display: inline-block;
    background: var(--site-tint);
    color: var(--site-accent);
    border: 1px solid var(--site-accent);
    border-radius: 999px;
    padding: 0.15rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ---------- feature grid ---------- */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.feature-card {
    background: var(--site-surface);
    border: 1px solid #e3e7ec;
    border-radius: 10px;
    padding: 1.1rem 1.2rem;
}

.feature-card h3 { margin: 0 0 0.35rem 0; font-size: 1.02rem; }
.feature-card p { margin: 0; color: var(--site-muted); font-size: 0.93rem; }

/* ---------- code samples ---------- */

pre {
    background: var(--site-code-bg);
    color: #dce4ee;
    border-radius: 10px;
    padding: 1.1rem 1.3rem;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.55;
}

pre code { background: none; color: inherit; padding: 0; }

code {
    background: #eef1f4;
    border-radius: 4px;
    padding: 0.1em 0.35em;
    font-size: 0.9em;
}

.band.dark pre { border: 1px solid #2a3542; }

/* inline code pills sit on a light background by default; on dark bands
   flip them to a translucent-light chip so they don't glow washed-out */
.band.dark code {
    background: rgba(255, 255, 255, 0.10);
    color: #e8edf3;
}

/* HTMQL syntax tokens — JetBrains-dark inspired palette */
.tok-mod   { color: #FF6B6B; font-weight: bold; }                  /* ! and !! modifiers */
.tok-alias { color: #7CFC98; font-weight: bold; font-style: italic; } /* $ and | alias modifiers */
.tok-res   { color: #FFD166; font-weight: bold; text-decoration: underline; } /* reserved aliases */
.tok-allow { color: #7DD3FC; font-weight: bold; }                  /* +role */
.tok-deny  { color: #56A8F5; }                                     /* -role */
.tok-var   { color: #F2E85E; font-weight: bold; }                  /* @variables — tmBundle yellow */
.tok-menu  { color: #C084FC; font-weight: bold; }                  /* # menu directives */
.tok-sql   { color: #CF8E6D; }                                     /* SQL keywords */
.tok-num   { color: #2AACB8; font-style: italic; }                 /* numeric literals */
/* embedded-SQL fragment tint, like an IDE language injection */
.tok-sqlbg { background: rgba(188, 190, 196, 0.09); border-radius: 3px; }

/* HTML portion of code samples */
.tok-t    { color: #E8BF6A; }  /* tag names and brackets */
.tok-attr { color: inherit; }  /* attribute names — default text */
.tok-str  { color: #6AAB73; }  /* attribute values / strings */
.tok-tmpl { color: inherit; }  /* Go template actions — default text */
.tok-kw   { color: #CF8E6D; }  /* template keywords: range, if, else, end */

/* ---------- image placeholders ---------- */

.img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-linear-gradient(45deg, #eef1f4, #eef1f4 12px, #e4e9ee 12px, #e4e9ee 24px);
    border: 2px dashed #b9c2cc;
    border-radius: 10px;
    color: var(--site-muted);
    font-weight: 600;
    min-height: 16rem;
    text-align: center;
    padding: 1rem;
}

.screenshot {
    display: block;
    width: 100%;
    max-width: 30rem;
    margin-inline: auto;
    height: auto;
    border: 1px solid #dfe4ea;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(29, 37, 48, 0.10);
}

.screenshot-wide { max-width: 100%; }

/* ---------- two-column split ---------- */

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 50rem) { .split { grid-template-columns: 1fr; } }

/* ---------- misc content ---------- */

.example-list { list-style: none; padding: 0; margin: 1rem 0 0 0; }
.example-list li { padding: 0.45rem 0; border-bottom: 1px solid #e9edf1; }
.example-list li strong { color: var(--site-ink); }

.aside-note {
    border-left: 4px solid var(--site-accent);
    background: var(--site-tint);
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
    margin-top: 1.5rem;
}

.aside-note h3 { margin-top: 0; }

/* ---------- security checklist ---------- */

.security-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(24rem, 100%), 1fr));
    gap: 0.85rem 2.25rem;
}

.security-list li {
    position: relative;
    padding-left: 1.65rem;
    color: var(--site-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.security-list li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--site-accent);
    font-weight: 700;
}

.security-list li strong { color: var(--site-ink); }

/* ---------- footer ---------- */

.site-footer {
    background: var(--site-code-bg);
    color: #aeb8c4;
    margin-top: 0;
    /* same missing.css `body > footer` clamp as .site-header; without this the
       grid is squeezed to --eff-line-length (40rem) instead of --site-max */
    padding-inline: 0;
}

.site-footer a { color: #7fd7b7; }

.site-footer-inner {
    max-width: var(--site-max);
    margin: 0 auto;
    padding: 2.5rem 1.25rem;
    display: grid;
    /* explicit tracks so all three stay on one row; License gets the extra width */
    grid-template-columns: 1.5fr 1fr 2fr;
    gap: 2.5rem;
    font-size: 0.9rem;
}

@media (max-width: 46rem) {
    .site-footer-inner { grid-template-columns: 1fr; gap: 1.75rem; }
}

.site-footer strong { color: #e8edf3; }
.footer-fineprint { font-size: 0.82rem; line-height: 1.5; }

.site-footer-bar {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-width: var(--site-max);
    margin: 0 auto;
    padding: 1.1rem 1.25rem;
    font-size: 0.78rem;
    color: #8590a0;
    line-height: 1.5;
}

/* ---------- docs layout ---------- */

.docs-layout {
    max-width: var(--site-max);
    margin: 0 auto;
    padding: 2rem 1.25rem;
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 50rem) { .docs-layout { grid-template-columns: 1fr; } }

.docs-nav {
    position: sticky;
    top: 4.5rem;
    /* Cap to the viewport and scroll internally so a long TOC (e.g. Security)
       stays fully reachable without scrolling the article to the bottom. */
    max-height: calc(100vh - 5.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    font-size: 0.9rem;
}

.docs-nav ul { list-style: none; padding: 0; margin: 0; }
.docs-nav li { margin: 0; }
.docs-layout .docs-nav a {
    display: block;
    padding: 0.32rem 0.6rem;
    border-radius: 6px;
    color: var(--site-ink);
    text-decoration: none;
}
.docs-layout .docs-nav a:hover { background: var(--site-tint); }
.docs-layout .docs-nav a[aria-current="page"] {
    background: var(--site-tint);
    color: var(--site-accent);
    font-weight: 600;
}
.docs-layout .docs-nav .docs-nav-sub a { padding-left: 1.5rem; font-size: 0.85rem; color: var(--site-muted); }
.docs-layout .docs-nav .docs-nav-sub a[aria-current="page"] { color: var(--site-accent); }

/* In-page heading list expanded under the currently focused page. */
.docs-nav-toc { margin: 0.15rem 0 0.35rem 0 !important; padding-left: 0.6rem !important; border-left: 2px solid var(--site-tint); }
.docs-layout .docs-nav .docs-nav-toc a { font-size: 0.82rem; padding-top: 0.2rem; padding-bottom: 0.2rem; color: var(--site-muted); }
.docs-layout .docs-nav .docs-nav-toc a:hover { color: var(--site-ink); }
.docs-layout .docs-nav .docs-nav-toc-d0 a { padding-left: 0.6rem; }
.docs-layout .docs-nav .docs-nav-toc-d1 a { padding-left: 1.5rem; }
.docs-layout .docs-nav .docs-nav-toc-d2 a { padding-left: 2.4rem; }
.docs-nav-title {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--site-muted);
    margin: 0 0 0.5rem 0.6rem;
}

.docs-content { min-width: 0; }
.docs-content h1 { font-size: 2rem; margin-top: 0; }
/* Offset anchored jumps so headings clear the sticky site header. */
.docs-content :is(h1, h2, h3, h4, h5, h6)[id] { scroll-margin-top: 1rem; }
.docs-content table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 0.92rem; }
.docs-content th, .docs-content td { border: 1px solid #dfe4ea; padding: 0.45rem 0.7rem; text-align: left; vertical-align: top; }
.docs-content th { background: var(--site-tint); }

.docs-pager {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e3e7ec;
}

.docs-pager a { text-decoration: none; font-weight: 600; }

.file-tree .tree-root { color: #7fd7b7; font-weight: 700; }
.file-tree .tree-folder { color: #8ab4f8; font-weight: 700; }
.file-tree .tree-exe { color: #d2a8ff; }
.file-tree .tree-config { color: #f2cc60; }
.file-tree .tree-page { color: #9be9a8; }
.file-tree .tree-sql { color: #d19a66; }
.file-tree .tree-html { color: #e5c07b; }
.file-tree .tree-line,
.file-tree .tree-muted { color: #768390; }
