/* ==========================================================================
   Canyon Lake Labs - unified design system
   One look for every CLL surface: portal, docs, services, projects.
   Brand #14508c, neutral greys, tab + sidebar shell.
   Light + dark.
   ========================================================================== */

:root {
    /* brand */
    --brand: #14508c;
    --brand-hover: #0e3a66;
    --brand-soft: #eaf1f9;
    --brand-line: #c6d9ee;

    /* neutrals */
    --ink: #202124;
    --ink-2: #3c4043;
    --muted: #5f6368;
    --line: #dadce0;
    --line-2: #e8eaed;
    --surface: #ffffff;
    --surface-2: #f8f9fa;
    --surface-3: #f1f3f4;

    /* states */
    --ok: #188038;
    --ok-soft: #e6f4ea;
    --warn: #b06000;
    --warn-soft: #fef7e0;
    --err: #d93025;
    --err-soft: #fce8e6;

    --radius: 8px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(60, 64, 67, .18), 0 1px 3px 1px rgba(60, 64, 67, .08);
    --shadow-lg: 0 4px 16px rgba(60, 64, 67, .22);
    --max: 1440px;
    --top-h: 56px;
    --tabs-h: 44px;
    --font: "Inter", system-ui, "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
    --mono: "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
    --brand: #6ba4e8;
    --brand-hover: #8cbaf0;
    --brand-soft: #16263c;
    --brand-line: #2a4463;

    --ink: #e8eaed;
    --ink-2: #bdc1c6;
    --muted: #9aa0a6;
    --line: #2f3237;
    --line-2: #262a2f;
    --surface: #1b1d21;
    --surface-2: #16181b;
    --surface-3: #23262b;

    --ok: #5ad46a;
    --ok-soft: #16281a;
    --warn: #ffd166;
    --warn-soft: #2a2416;
    --err: #ff6b6b;
    --err-soft: #2c1a1a;

    --shadow: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-lg: 0 6px 20px rgba(0, 0, 0, .55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background: var(--surface-2);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100%;
    padding-top: calc(var(--top-h) + var(--tabs-h));
}
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: none; border-top: 1px solid var(--line); margin: 26px 0; }
::selection { background: var(--brand-soft); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 3px solid var(--surface-2); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ---------- Header: fixed, never hides ---------- */
.cll-header-wrap {
    position: fixed; top: 0; left: 0; right: 0; z-index: 60;
    background: var(--surface); border-bottom: 1px solid var(--line-2);
}
.cll-top {
    background: var(--surface); border-bottom: 1px solid var(--line-2);
}
.cll-top-inner {
    max-width: var(--max); margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; gap: 14px; height: var(--top-h);
}
.cll-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex: none; }
.cll-brand:hover { text-decoration: none; }
.cll-mark {
    width: 32px; height: 32px; border-radius: 8px; flex: none; display: block;
    object-fit: contain; background: #000; border: 1px solid var(--line-2);
}
.cll-brand b { font-size: 15.5px; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; }
.cll-brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .01em; }

.cll-search {
    display: flex; align-items: center; gap: 8px; flex: 0 1 380px;
    background: var(--surface-3); border: 1px solid transparent; border-radius: 999px;
    padding: 7px 12px; color: var(--muted); font-size: 13.5px;
}
.cll-search:focus-within { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.cll-search input { border: none; background: none; outline: none; font: inherit; color: var(--ink); width: 100%; }
.cll-search kbd {
    font-family: var(--mono); font-size: 11px; border: 1px solid var(--line);
    border-radius: 4px; padding: 1px 6px; color: var(--muted); background: var(--surface);
}

.cll-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.cll-iconbtn {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    background: none; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.cll-iconbtn:hover { background: var(--surface-3); text-decoration: none; color: var(--ink); }

/* dropdown (Info) */
.cll-menu { position: relative; }
.cll-menu .caret { font-size: 9px; opacity: .7; }
.cll-menu-pop {
    display: none; position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 6px; z-index: 70;
}
.cll-menu-pop.open { display: block; }
.cll-menu-label {
    display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .09em;
    text-transform: uppercase; color: var(--muted); padding: 6px 10px 4px;
}
.cll-menu-label.cll-menu-sep { border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 10px; }
.cll-menu-pop a { display: block; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13.5px; color: var(--ink); }
.cll-menu-pop a:hover { background: var(--surface-3); text-decoration: none; }

/* ---------- Tab row (inside the fixed header) ---------- */
.cll-tabs {
    background: var(--surface); border-bottom: 1px solid var(--line-2);
}
.cll-tabs-inner { max-width: var(--max); margin: 0 auto; padding: 0 20px; display: flex; gap: 2px; }
.cll-tabs a {
    position: relative; padding: 11px 14px; font-size: 13.5px; font-weight: 600;
    color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap;
}
.cll-tabs a:hover { color: var(--ink); text-decoration: none; }
.cll-tabs a.is-active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- Doc shell: sidebar | content | toc ---------- */
.cll-doc {
    max-width: var(--max); margin: 0 auto; padding: 0 20px 72px;
    display: grid; grid-template-columns: 252px minmax(0, 1fr) 224px; gap: 32px;
}
.cll-side { padding: 26px 0; position: sticky; top: calc(var(--top-h) + var(--tabs-h)); align-self: start; max-height: calc(100vh - var(--top-h) - var(--tabs-h)); overflow: auto; }
.cll-side h4 {
    font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
    font-weight: 700; margin: 18px 0 6px; padding: 0 10px;
}
.cll-side h4:first-child { margin-top: 0; }
.cll-side a {
    display: block; padding: 7px 10px; border-radius: var(--radius-sm);
    font-size: 13.5px; color: var(--ink-2); border-left: 2px solid transparent;
}
.cll-side a:hover { background: var(--surface-3); text-decoration: none; color: var(--ink); }
.cll-side a.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.cll-main { padding: 30px 0 0; min-width: 0; }
.cll-toc {
    padding: 52px 0 0;
}
.cll-toc-inner { width: fit-content; margin: 0 auto; }
.cll-toc h4 {
    font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
    font-weight: 700; margin-bottom: 10px;
}
.cll-toc a {
    display: block; padding: 4px 0 4px 12px; border-left: 2px solid var(--line-2);
    font-size: 13px; color: var(--muted);
}
.cll-toc a:hover { color: var(--brand); border-left-color: var(--brand); text-decoration: none; }

/* plain one-column pages (project/legal pages) */
.cll-container { max-width: var(--max); margin: 0 auto; padding: 30px 20px 72px; }
.cll-container.narrow { max-width: 940px; }
.cll-wrap { max-width: var(--max); margin: 0 auto; padding: 30px 20px 72px; }

/* ---------- Hero ---------- */
.cll-hero { background: var(--surface); border-bottom: 1px solid var(--line-2); }
.cll-hero-inner { max-width: var(--max); margin: 0 auto; padding: 40px 20px 34px; }
.cll-hero h1 { font-size: 30px; letter-spacing: -.5px; }
.cll-hero p { color: var(--ink-2); margin-top: 8px; max-width: 760px; font-size: 16px; }
.cll-eyebrow {
    display: inline-block; text-transform: uppercase; letter-spacing: .12em;
    font-size: 11px; font-weight: 700; color: var(--brand); margin-bottom: 10px;
}

/* ---------- Page head ---------- */
.cll-page-head { margin-bottom: 20px; }
.cll-page-head h1 { font-size: 27px; letter-spacing: -.5px; }
.cll-page-head p { color: var(--muted); margin-top: 5px; font-size: 15px; }

/* ---------- Panels / cards ---------- */
.cll-panel {
    background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
    padding: 22px; box-shadow: var(--shadow);
}
.cll-panel + .cll-panel { margin-top: 16px; }
.cll-panel h2 { font-size: 17px; margin: 0 0 6px; letter-spacing: -.2px; }
.cll-panel h3 { font-size: 14.5px; margin: 18px 0 4px; }
.cll-panel .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 12px; }

.cll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cll-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cll-grid.two > .cll-panel { margin-top: 0 !important; height: 100%; }
.cll-grid .cll-panel { margin-top: 0 !important; height: 100%; }

.cll-card {
    background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column;
    color: var(--ink); text-decoration: none;
}
.cll-card:hover { text-decoration: none; border-color: var(--brand-line); box-shadow: var(--shadow-lg); }
.cll-card h3 { font-size: 15px; margin-bottom: 6px; color: var(--ink); }
.cll-card p { color: var(--ink-2); font-size: 13.5px; flex: 1; }
.cll-card .foot { margin-top: auto; padding-top: 14px; }
.cll-card-mark {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    background: var(--brand-soft); color: var(--brand);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 12px; margin-bottom: 12px; letter-spacing: .02em;
}
.cll-card .meta { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.cll-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------- Buttons ---------- */
.cll-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
    background: var(--surface); color: var(--ink); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 9px 16px; font: inherit; font-size: 13.5px; font-weight: 600;
}
.cll-btn:hover { background: var(--surface-3); text-decoration: none; }
.cll-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.cll-btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.cll-btn.ghost { background: transparent; border-color: transparent; color: var(--brand); padding: 6px 4px; }
.cll-btn.ghost:hover { text-decoration: underline; }
.cll-btn.sm { padding: 6px 12px; font-size: 12.5px; }

/* ---------- Stats ---------- */
.cll-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 24px; }
.cll-stat .k { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.cll-stat .v { font-size: 15px; font-weight: 600; color: var(--ink); margin-top: 2px; }
.cll-stat .v.mono { font-family: var(--mono); font-size: 13px; font-weight: 500; }


/* ---------- Type ---------- */
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; font-weight: 700; }
h1 { font-size: 27px; letter-spacing: -.5px; }
h2 { font-size: 19px; margin: 28px 0 8px; letter-spacing: -.2px; }
h3 { font-size: 15px; margin: 20px 0 6px; }
p { margin: 9px 0; color: var(--ink-2); }
ul, ol { margin: 9px 0 9px 22px; color: var(--ink-2); }
li { margin: 5px 0; }
strong { color: var(--ink); }
.muted { color: var(--muted); font-size: 13.5px; }
code, .mono {
    font-family: var(--mono); font-size: 12.5px; background: var(--surface-3);
    border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 6px; color: var(--ink);
}
pre.cll-pre {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 16px; overflow: auto; font-family: var(--mono); font-size: 13px;
    line-height: 1.6; color: var(--ink); margin: 12px 0;
}
pre.cll-pre code { background: none; border: 0; padding: 0; }

/* ---------- Tables (docs style) ---------- */
table.cll-table {
    width: 100%; border-collapse: collapse; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.cll-table th, .cll-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; color: var(--ink-2); vertical-align: top; }
.cll-table th { background: var(--surface-2); font-weight: 700; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.cll-table tr:last-child td { border-bottom: none; }
.cll-table tr:hover td { background: var(--surface-2); }

/* ---------- Forms ---------- */
.cll-field { margin-bottom: 13px; }
.cll-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.cll-field input, .cll-field textarea, .cll-field select {
    width: 100%; padding: 10px 12px; font: inherit; color: var(--ink);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.cll-field input:focus, .cll-field textarea:focus, .cll-field select:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ---------- Notices ---------- */
.cll-notice { border-left: 3px solid var(--brand); background: var(--brand-soft); padding: 13px 16px; border-radius: 0 6px 6px 0; color: var(--ink-2); font-size: 13.5px; }
.cll-notice.warn { border-color: var(--warn); background: var(--warn-soft); }

/* ---------- Footer ---------- */
.cll-footer { border-top: 1px solid var(--line-2); background: var(--surface); }
.cll-footer-inner { max-width: var(--max); margin: 0 auto; padding: 34px 20px; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; gap: 26px; }
.cll-footer h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 20px 0 12px; }
.cll-footer h4:first-child { margin-top: 0; }
.cll-footer a { color: var(--ink-2); display: block; padding: 3px 0; font-size: 13.5px; }
.cll-footer a.cll-brand { display: flex; align-items: center; padding: 0; }
.cll-footer a:hover { color: var(--brand); text-decoration: none; }
.cll-footer-bottom {
    border-top: 1px solid var(--line-2); padding: 15px 20px; max-width: var(--max); margin: 0 auto;
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; color: var(--muted); font-size: 13px;
}
.cll-footer-socials { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.cll-footer-socials a { display: inline; padding: 0; }

/* ---------- SPA views ---------- */
.view { display: none; }
.view.is-active { display: block; }

/* ---------- Responsive: nothing hides ---------- */
@media (max-width: 1080px) {
    .cll-doc { grid-template-columns: 200px minmax(0, 1fr) 176px; gap: 22px; }
}
@media (max-width: 860px) {
    .cll-doc { grid-template-columns: 1fr; gap: 0; }
    .cll-side {
        position: static; max-height: none; padding-bottom: 10px;
        border-bottom: 1px solid var(--line-2); margin-bottom: 6px;
    }
    .cll-toc { padding-top: 18px; border-top: 1px solid var(--line-2); }
    .cll-tabs-inner { overflow-x: auto; }
    .cll-footer-inner { grid-template-columns: 1fr 1fr; }
    .cll-grid.two { grid-template-columns: 1fr; }
    .cll-search { flex: 1 1 auto; min-width: 0; }
    .cll-brand small { display: none; }
}
@media (max-width: 560px) {
    .cll-footer-inner { grid-template-columns: 1fr; }
    .cll-hero h1 { font-size: 25px; }
}
