/* ==========================================================================
   Vigilance — documentation site
   Emerald "technical dark" brand, self-contained (no CDN / web-font fetch).
   ========================================================================== */

:root {
    --bg: #08080b;
    --bg-2: #0d0d11;
    --surface: #131316;
    --surface-2: #1b1b20;
    --border: #26262b;
    --border-strong: #34343b;
    --text: #e4e4e7;
    --strong: #fafafa;
    --muted: #a1a1aa;
    --faint: #888891;
    --accent: #10b981;
    --accent-strong: #34d399;
    --accent-soft: rgba(16, 185, 129, 0.12);
    --amber: #fbbf24;
    --rose: #fb7185;
    --sky: #38bdf8;
    --violet: #a78bfa;
    --radius: 14px;
    --maxw: 1120px;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    /* Subtle emerald glow behind the hero + faint grid. */
    background-image:
        radial-gradient(900px 480px at 50% -120px, rgba(16, 185, 129, 0.14), transparent 70%),
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 100% 100%, 44px 44px, 44px 44px;
    background-position: 0 0, 0 0, 0 0;
    background-attachment: fixed, scroll, scroll;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--strong); line-height: 1.15; letter-spacing: -0.022em; margin: 0; }

::selection { background: var(--accent); color: #04140c; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* selective scrollbars */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border: 3px solid transparent; border-radius: 8px; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: content-box; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }

/* --- A11y utilities ------------------------------------------------------- */
.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; }
.skip { position: fixed; left: 12px; top: -80px; z-index: 100; background: var(--accent-strong); color: #04140c; font-weight: 700; padding: 11px 18px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.5); transition: top .18s ease; }
.skip:focus { top: 12px; text-decoration: none; outline-offset: 2px; }
main:focus { outline: none; }
main:focus-visible { outline: none; }

/* --- Nav ------------------------------------------------------------------ */
.nav {
    position: sticky; top: 0; z-index: 50;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.nav__inner { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--strong); font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(145deg, #34d399, #059669); color: #04140c; font-weight: 800; box-shadow: 0 2px 12px rgba(16, 185, 129, 0.35); }
.brand__v { font-size: 13px; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-family: var(--mono); font-size: 11px; font-weight: 600; }
.nav__links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav__links a { color: var(--muted); font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.nav__links a:hover { color: var(--strong); background: var(--surface-2); text-decoration: none; }
.nav__cta { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px !important; border: 1px solid var(--border-strong); color: var(--strong) !important; }
.nav__cta:hover { background: var(--surface-2); border-color: var(--faint); }
.nav__toggle { display: none; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 8px; }

/* --- Buttons -------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; padding: 12px 22px; border-radius: 11px; border: 1px solid transparent; cursor: pointer; transition: transform .12s ease, background .15s, border-color .15s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: linear-gradient(145deg, #34d399, #059669); color: #04140c; box-shadow: 0 6px 24px rgba(16, 185, 129, 0.3); }
.btn--primary:hover { box-shadow: 0 8px 30px rgba(16, 185, 129, 0.42); }
.btn--ghost { background: var(--surface); border-color: var(--border-strong); color: var(--strong); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--faint); }
.btn svg { width: 18px; height: 18px; }

/* --- Hero ----------------------------------------------------------------- */
.hero { padding: 84px 0 56px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--accent-strong); background: var(--accent-soft); border: 1px solid rgba(16, 185, 129, 0.25); padding: 6px 14px; border-radius: 999px; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.hero h1 { font-size: clamp(38px, 6vw, 66px); font-weight: 800; margin: 22px auto 0; max-width: 16ch; letter-spacing: -0.035em; }
.hero h1 .grad { background: linear-gradient(120deg, #34d399, #38bdf8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__sub { font-size: clamp(17px, 2.4vw, 21px); color: var(--muted); max-width: 60ch; margin: 22px auto 0; }
.hero__cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.hero__meta { margin-top: 22px; font-size: 13px; color: var(--faint); }
.hero__meta strong { color: var(--muted); font-weight: 600; }

/* --- Code / terminal ------------------------------------------------------ */
.terminal { max-width: 640px; margin: 36px auto 0; text-align: left; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: #0a0a0d; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5); }
.terminal__bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.terminal__bar i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.terminal__bar i:nth-child(1) { background: #ef4444; } .terminal__bar i:nth-child(2) { background: #f59e0b; } .terminal__bar i:nth-child(3) { background: #22c55e; }
.terminal__bar span { margin-left: auto; font-size: 11px; color: var(--faint); font-family: var(--mono); }
.terminal pre { margin: 0; padding: 18px 20px; font-family: var(--mono); font-size: 13.5px; line-height: 1.7; overflow-x: auto; color: var(--text); }
.terminal .c { color: var(--faint); }
.terminal .p { color: var(--accent-strong); }
.terminal .k { color: var(--sky); }

pre.code { margin: 0; padding: 18px 20px; font-family: var(--mono); font-size: 13.5px; line-height: 1.7; overflow-x: auto; background: #0a0a0d; border: 1px solid var(--border); border-radius: 12px; color: var(--text); }
code.inline { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 2px 7px; border-radius: 6px; color: var(--accent-strong); }
.copy { position: relative; }
.copy__btn { position: absolute; top: 8px; right: 8px; font-size: 11px; font-family: var(--mono); color: var(--muted); background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 7px; padding: 6px 11px; min-height: 32px; cursor: pointer; opacity: 0; transition: opacity .15s, color .15s; touch-action: manipulation; }
.copy:hover .copy__btn,
.copy:focus-within .copy__btn,
.copy__btn:focus-visible { opacity: 1; }
.copy__btn:hover { color: var(--strong); }
/* Touch devices have no hover — keep the copy control visible. */
@media (hover: none) { .copy__btn { opacity: 1; } }
.tok-c { color: var(--faint); } .tok-k { color: var(--violet); } .tok-s { color: var(--accent-strong); } .tok-v { color: var(--sky); } .tok-f { color: var(--amber); }

/* --- Sections ------------------------------------------------------------- */
.section { padding: 72px 0; border-top: 1px solid var(--border); }
.section__head { text-align: center; max-width: 60ch; margin: 0 auto 48px; }
.section__head h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
.section__head p { color: var(--muted); font-size: 17px; margin-top: 14px; }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-strong); }

/* --- Feature grid --------------------------------------------------------- */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: border-color .15s, transform .15s, background .15s; }
.card:hover { border-color: var(--border-strong); transform: translateY(-3px); background: var(--surface-2); }
.card__icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 16px; }
.card__icon svg { width: 22px; height: 22px; }
.card h3 { font-size: 17px; font-weight: 700; }
.card p { color: var(--muted); font-size: 14.5px; margin: 8px 0 0; }

/* --- Split feature (text + code) ------------------------------------------ */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
/* Let grid items shrink below their content width so inner code blocks scroll
   internally instead of stretching the page (CSS Grid min-width:auto trap). */
.split > * { min-width: 0; }
.split + .split { margin-top: 64px; }
.split__text h3 { font-size: clamp(24px, 3vw, 30px); font-weight: 800; margin-top: 14px; }
.split__text p { color: var(--muted); font-size: 16px; margin-top: 14px; }
.checklist { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 11px; }
.checklist li { display: flex; gap: 11px; align-items: flex-start; color: var(--text); font-size: 15px; }
.checklist li svg { width: 19px; height: 19px; color: var(--accent-strong); flex: 0 0 auto; margin-top: 2px; }

/* --- Comparison table ----------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.cmp { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 640px; }
table.cmp th, table.cmp td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); }
table.cmp thead th { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
table.cmp thead th.vig { color: var(--accent-strong); }
table.cmp tbody tr:last-child td { border-bottom: 0; }
table.cmp td:first-child { color: var(--muted); }
table.cmp td.vig { color: var(--strong); font-weight: 600; }
.yes { color: var(--accent-strong); } .no { color: var(--faint); }

/* --- Pills / badges ------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); border: 1px solid rgba(16, 185, 129, 0.22); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pill--neutral { background: var(--surface-2); color: var(--muted); border-color: var(--border); }

/* --- Commands ------------------------------------------------------------- */
.cmd-group { margin-top: 30px; }
.cmd-group > h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-strong); margin: 0 0 12px; }
.cmd { display: grid; grid-template-columns: 230px 1fr; gap: 16px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 8px; align-items: baseline; }
.cmd code { font-family: var(--mono); font-size: 13px; color: var(--accent-strong); }
.cmd span { color: var(--muted); font-size: 14px; }

/* --- CTA band ------------------------------------------------------------- */
.band { text-align: center; border: 1px solid var(--border-strong); border-radius: 20px; padding: 56px 24px; background: radial-gradient(700px 300px at 50% -40px, rgba(16, 185, 129, 0.16), transparent 70%), var(--surface); }
.band h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
.band p { color: var(--muted); font-size: 17px; margin: 14px auto 0; max-width: 50ch; }

/* --- Footer --------------------------------------------------------------- */
.footer { border-top: 1px solid var(--border); padding: 48px 0 64px; margin-top: 40px; }
.footer__grid { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
.footer__col h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 0 0 14px; }
.footer__col a { display: block; color: var(--muted); font-size: 14px; padding: 4px 0; }
.footer__col a:hover { color: var(--strong); }
.footer__bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; color: var(--faint); font-size: 13px; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* --- Showcase (dashboard mockup) ------------------------------------------ */
.showcase { padding: 8px 0 8px; margin-top: -8px; }
.window {
    max-width: 1000px; margin: 0 auto; border: 1px solid var(--border-strong); border-radius: 16px;
    overflow: hidden; background: var(--bg-2);
    box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(16, 185, 129, 0.06), 0 0 80px -40px rgba(16, 185, 129, 0.4);
}
.window__bar { display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.window__dots { display: inline-flex; gap: 7px; }
.window__dots i { width: 11px; height: 11px; border-radius: 50%; }
.window__dots i:nth-child(1) { background: #ef4444; } .window__dots i:nth-child(2) { background: #f59e0b; } .window__dots i:nth-child(3) { background: #22c55e; }
.window__url { display: inline-flex; align-items: center; gap: 7px; margin: 0 auto; font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--bg); border: 1px solid var(--border); padding: 5px 16px; border-radius: 8px; }
.window__url svg { color: var(--accent-strong); }

.app { display: grid; grid-template-columns: 196px 1fr; min-height: 460px; }
.app__side { border-right: 1px solid var(--border); padding: 16px 12px; background: var(--bg-2); }
.app__brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--strong); font-size: 14px; padding: 4px 8px 16px; }
.app__brand .brand__mark { width: 24px; height: 24px; font-size: 13px; }
.app__nav { display: flex; flex-direction: column; gap: 1px; }
.app__grp { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 14px 9px 6px; }
.app__link { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 8px; font-size: 13px; color: var(--muted); cursor: default; }
.app__link svg { width: 16px; height: 16px; opacity: .8; flex: 0 0 auto; }
.app__link.is-active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.app__link.is-active svg { opacity: 1; }
.app__badge { margin-left: auto; font-size: 10px; font-style: normal; font-weight: 700; background: var(--rose); color: #1a0508; padding: 1px 7px; border-radius: 999px; }

.app__main { padding: 22px 24px; overflow: hidden; }
.app__head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.app__head .app__title { display: block; font-size: 18px; font-weight: 700; color: var(--strong); }
.app__head span { font-size: 12px; color: var(--faint); }
.app__live { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; color: var(--accent-strong); background: var(--accent-soft); border: 1px solid rgba(16, 185, 129, 0.25); padding: 4px 10px; border-radius: 999px; }
.app__live .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25); animation: pulse 2.4s ease-in-out infinite; }

.app__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.mstat { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 13px 14px; }
.mstat span { display: block; font-size: 11px; color: var(--faint); font-weight: 600; }
.mstat strong { display: block; font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--strong); margin: 5px 0 4px; letter-spacing: -.02em; }
.mstat strong small { font-size: 13px; color: var(--faint); font-weight: 500; }
.mstat em { font-size: 11px; font-style: normal; font-weight: 600; }
.mstat .up { color: var(--accent-strong); } .mstat .down { color: var(--muted); } .mstat .flat { color: var(--sky); }

.app__panel { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 14px 16px; margin-bottom: 16px; }
.app__panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.app__panel-head > span:first-child { font-size: 13px; font-weight: 600; color: var(--text); }
.app__legend { display: inline-flex; align-items: center; gap: 12px; font-size: 11px; color: var(--faint); }
.app__legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--accent); margin-right: 4px; vertical-align: -1px; }
.app__legend i.b { background: var(--rose); }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 96px; }
.chart span { flex: 1; background: linear-gradient(180deg, var(--accent-strong), rgba(16, 185, 129, 0.25)); border-radius: 4px 4px 0 0; min-width: 0; transition: opacity .15s; }
.chart span:hover { opacity: .7; }

.app__table { font-size: 12.5px; }
.trow { display: grid; grid-template-columns: 1.6fr 1fr .8fr .9fr; gap: 12px; align-items: center; padding: 9px 6px; border-bottom: 1px solid var(--border); }
.trow:last-child { border-bottom: 0; }
.trow--head { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 700; }
.trow span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .mono { font-family: var(--mono); color: var(--text); }
.tag { font-family: var(--sans); font-size: 11px; font-weight: 600; font-style: normal; padding: 2px 9px; border-radius: 999px; }
.tag--ok { background: var(--accent-soft); color: var(--accent-strong); }
.tag--run { background: rgba(56, 189, 248, 0.12); color: var(--sky); }
.tag--fail { background: rgba(251, 113, 133, 0.12); color: var(--rose); }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 860px) {
    .grid { grid-template-columns: 1fr 1fr; }
    .split { grid-template-columns: 1fr; gap: 28px; }
    .nav__links { position: fixed; inset: 62px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 10px 16px 18px; display: none; }
    .nav__links.open { display: flex; }
    .nav__links a { padding: 13px 12px; border-radius: 9px; }
    .nav__toggle { display: inline-flex; margin-left: auto; }
    .cmd { grid-template-columns: 1fr; gap: 4px; }
    .app { grid-template-columns: 1fr; }
    .app__side { display: none; }
    .app__stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .grid { grid-template-columns: 1fr; }
    .hero { padding: 56px 0 40px; }
    .window__url { font-size: 11px; padding: 5px 10px; }
    .app__main { padding: 18px 16px; }
    .trow { grid-template-columns: 1fr auto; }
    .trow span:nth-child(2), .trow span:nth-child(3) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
}
