/* Brand layer over site.css: tokens, header/footer, and the home page. Mobile first. */
:root {
  color-scheme: light dark;
  --bg: #ffffff; --fg: #12141c; --muted: #5a6072; --line: #e4e6ee; --panel: #f6f7fb; --field-line: #858b9c;
  --accent: #4f46e5; --accent-2: #7c3aed; --accent-fg: #ffffff;
  /* primary buttons keep the saturated pair in both schemes: white on it is ≥5.7:1 */
  --btn-1: #4f46e5; --btn-2: #7c3aed;
  --crit: #e11d48; --high: #ea580c; --good: #16a34a;
  /* the dark bands (hero, final CTA) look the same in both schemes */
  --ink: #0b0d14; --ink-2: #131726; --ink-line: #2c3149; --ink-fg: #eef0f8; --ink-muted: #a3a9c2;
  --radius: 14px; --wrap: 1160px; --gutter: 16px;
  --pad-x: max(var(--gutter), calc((100% - var(--wrap)) / 2));
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1018; --fg: #e8eaf3; --muted: #a0a6bc; --line: #252a3b; --panel: #151927; --field-line: #6e7590;
    --accent: #8b8cf8; --accent-2: #a78bfa; --accent-fg: #0b0d14; --crit: #fb7185; --high: #fb923c; --good: #4ade80;
    --ink: #07080d; }
}
@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1200px) { :root { --gutter: 32px; } }
/* ≥1360 the column widens so the embedded report (two columns from 1280px inside) fits beside the sections' edge */
@media (min-width: 1360px) { :root { --wrap: 1296px; } }
@media (min-width: 1920px) { :root { --wrap: 1400px; } }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-wrap: break-word; }
main code { overflow-wrap: anywhere; }
h1, h2, h3 { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
main p, main li { max-width: 68ch; }
img, video { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
/* on the dark bands and cards the accent ring is too close to the background and the buttons */
:is(.band, .finding, .demo-card, pre.code) :focus-visible, .demo-card:focus-visible { outline-color: #a5b4fc; }
.skip, .skip-embed { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-fg); padding: 10px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.skip-embed:focus { position: relative; left: 0; top: 0; display: inline-block; margin-bottom: 8px; }

/* header: opaque enough to stay clean over the dark bands */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); background: color-mix(in srgb, var(--bg) 97%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 8px var(--pad-x); gap: 4px 16px;
  flex-wrap: wrap; }
.top .brand { display: inline-flex; align-items: center; gap: 8px; letter-spacing: -.01em; flex-shrink: 0; white-space: nowrap; min-height: 44px; }
.top nav { gap: 2px 18px; font-size: .95rem; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.top nav a { padding: 6px 0; white-space: nowrap; }
@media (hover: hover) { .top nav a:hover { color: var(--fg); } }
.top nav a[aria-current] { color: var(--fg); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--accent); }
.top nav a.btn { padding: 6px 14px; min-height: 36px; color: #fff; }
.btn.small { font-size: .9rem; }
/* em breakpoints follow the reader's text size. Links leave the header (they stay in the footer and the
   hero) in this order: Docs and Self-host, Sign in, Demo; the word mark stays. site.js adds .tight and
   then .static when the row would still wrap (e.g. a larger root font size). */
@media (max-width: 48em) { .top nav .opt { display: none; } }
@media (max-width: 36em) { .top nav .signin { display: none; } .top nav { gap: 2px 14px; font-size: .9rem; } }
@media (max-width: 27em) { .top nav .nav-demo { display: none; } }
@media (max-width: 23.5em) { .top { gap: 4px 10px; } .top nav { gap: 2px 12px; } .top nav a.btn { padding: 6px 10px; } }
@media (max-width: 22.4em) { .top .brand img { display: none; } }
@media (max-width: 19.9em) { .top { position: static; } .top nav a[href="/pricing"] { display: none; } }
.top.tight nav :is(.opt, .signin, .nav-demo) { display: none; }
.top.static { position: static; }
.top.static nav a[href="/pricing"] { display: none; }

main { max-width: calc(var(--wrap) + 2 * var(--gutter)); padding: 32px var(--gutter) 64px; }
.page-home main { max-width: none; padding: 0; }

/* buttons */
.btn { border-radius: 10px; padding: 10px 18px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(135deg, var(--btn-1), var(--btn-2)); border: 1px solid transparent; color: #fff;
  transition: filter .15s, border-color .15s; }
@media (hover: hover) { .btn:hover { filter: brightness(1.12); } .btn.ghost:hover { border-color: var(--ink-fg); filter: none; } }
.btn.secondary { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.btn.ghost { background: transparent; border: 1px solid #5b6285; color: var(--ink-fg); }
@media (forced-colors: active) { .btn { border: 1px solid ButtonText; } }

/* home sections */
.page-home section { padding: 48px var(--gutter); }
.page-home section > * { max-width: var(--wrap); margin-left: auto; margin-right: auto; }
.page-home h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.2rem); letter-spacing: -.02em; line-height: 1.15; margin-top: 0; margin-bottom: 24px; }
.page-home h3 { font-size: 1.05rem; margin: 0 0 6px; }
.page-home p { margin-top: 0; margin-bottom: 10px; }
@media (min-width: 900px) { .page-home section { padding-top: 64px; padding-bottom: 64px; } }

.band { background: radial-gradient(1200px 500px at 85% -10%, #4f46e540, transparent 60%),
  radial-gradient(900px 400px at 0% 110%, #7c3aed30, transparent 60%), var(--ink); color: var(--ink-fg); }
.band a:not(.btn) { color: #b4b6ff; }

.page-home .hero { display: grid; gap: 32px; padding-top: 40px; padding-bottom: 48px; }
.page-home .hero > * { margin: 0; max-width: none; }
.page-home .hero-copy { max-width: 40rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 600; color: #b4b6ff; }
.hero h1 { font-size: clamp(2.1rem, 1.2rem + 4.2vw, 4rem); line-height: 1.04; letter-spacing: -.035em; margin: 8px 0 18px; max-width: none; }
.hero .lead { color: var(--ink-muted); font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); max-width: 34rem; }
.hero .actions { margin: 26px 0 12px; }
.fine { font-size: .9rem; color: var(--ink-muted); }

@media (min-width: 900px) {
  .page-home .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 56px;
    padding: 88px var(--pad-x) 96px; }
  /* the h1 sits in half the width here */
  .hero h1 { font-size: clamp(2.5rem, .4rem + 3.6vw, 4rem); }
}
/* phone landscape: short screens get the CTA above the fold */
@media (max-height: 500px) and (orientation: landscape) {
  .top { position: static; }
  .page-home .hero { padding-top: 24px; padding-bottom: 32px; }
  .hero h1 { font-size: clamp(1.8rem, 1rem + 2.6vw, 2.6rem); margin-bottom: 10px; }
  .hero .actions { margin-top: 14px; }
}

/* "Try it on your machine": the two commands, copyable, inside the hero */
.try { margin-top: 28px; max-width: 36rem; }
.try-head { margin: 0 0 8px !important; color: var(--ink-fg); }
.try-head span { margin-left: 8px; font-size: .85rem; color: var(--ink-muted); }
.try .cmd pre { margin: 0; background: #05060a; border: 1px solid var(--ink-line); border-radius: 10px; padding: 12px 14px;
  color: #e6e8f5; font-size: .85rem; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (min-width: 641px) { .try .cmd pre { padding-right: 5.5rem; } }
.try .cmd pre code { font-size: inherit; }
.try .ln::before { content: "$ "; color: #a78bfa; user-select: none; }
.try .cmd .copy { color: var(--ink-fg); background: var(--ink-2); border-color: var(--ink-line); }
.try .cmd .copy:hover { border-color: var(--ink-muted); }
.try .fine { margin: 8px 0 0 !important; }

/* the finding card: the evidence re-set as text, readable at any width */
.finding { margin: 0; background: var(--ink-2); border: 1px solid var(--ink-line); border-radius: 18px; padding: 18px;
  box-shadow: 0 30px 80px -30px #000c, 0 0 0 1px #ffffff08 inset; min-width: 0; }
.finding-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.run-id { font-size: .85rem; color: var(--ink-muted); }
.sev { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; border-radius: 999px; padding: 3px 10px; }
.sev.high { background: #ea580c26; color: #fdba74; border: 1px solid #ea580c66; }
.sev.critical { background: #e11d4826; color: #fda4af; border: 1px solid #e11d4866; }
.finding-title { font-size: clamp(1.1rem, 1rem + .5vw, 1.35rem); font-weight: 650; line-height: 1.3; margin: 12px 0 16px !important; letter-spacing: -.01em; }
.receipts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 10px; }
.receipts dl { margin: 0; padding: 12px 14px; border-radius: 10px; background: #0b0d14; border: 1px solid var(--ink-line);
  font-size: .9rem; font-variant-numeric: tabular-nums; }
.receipts dt { font-weight: 600; margin-bottom: 6px; color: var(--ink-fg); }
.receipts dt span { font-weight: 400; color: var(--ink-muted); font-size: .85em; margin-left: 4px; }
.receipts dd { margin: 0; display: flex; justify-content: space-between; gap: 12px; color: var(--ink-muted); padding: 1px 0; }
.receipts .nw { white-space: nowrap; }
.receipts dd.sum { border-top: 1px solid var(--ink-line); margin-top: 6px; padding-top: 6px; color: var(--ink-fg); font-weight: 600; }
.receipts dd.sum b { font-size: 1.1em; }
b.bad, .bad { color: #fb7185; }
.warn { color: #fdba74; }
.ok { color: #86efac; }
.evidence { font-size: .85rem; color: var(--ink-muted); margin: 14px 0 0 !important; }
.evidence a { white-space: nowrap; margin-left: 4px; }

/* how it works */
.step-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; counter-reset: s; }
.step-list li { counter-increment: s; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--panel);
  min-width: 0; max-width: none; display: flex; flex-direction: column; }
.step-list li::before { content: counter(s); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  font-weight: 700; font-size: .9rem; color: var(--accent); border: 1px solid var(--line); background: var(--bg); margin-bottom: 12px; }
.step-list p { color: var(--muted); }
.step-list .code { margin-top: auto; }
/* tablets: words left, snippet right inside each card */
@media (min-width: 640px) and (max-width: 899px) {
  .step-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); grid-template-rows: auto auto 1fr; column-gap: 24px; }
  .step-list li > * { grid-column: 1; }
  .step-list li::before { grid-column: 1; }
  .step-list .code { grid-column: 2; grid-row: 1 / span 3; margin: 0; align-self: start; }
}
/* phones: the snippet runs edge to edge in its card, so 32-character lines fit at 320 px */
@media (max-width: 30em) {
  .step-list li { padding: 16px 12px; }
  .step-list .code { margin-inline: -12px; margin-bottom: -16px; border-inline: 0; border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 10px 12px; }
}
.steps-more { margin: 16px auto 0 !important; }
@media (min-width: 900px) {
  .step-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* subgrid lines the code blocks up across the three cards */
  @supports (grid-template-rows: subgrid) {
    .step-list li { display: grid; grid-row: span 4; grid-template-rows: subgrid; gap: 0; }
    .step-list .code { margin-top: 12px; align-self: start; }
  }
}

pre.code, pre.term { background: var(--ink); color: #d6d9ea; border: 1px solid var(--ink-line); border-radius: 10px; color-scheme: dark;
  padding: 14px 16px; font-size: .82rem; line-height: 1.6; overflow-x: auto; margin: 12px 0 0; }
pre.code code, pre.term code { white-space: pre; overflow-wrap: normal; }
pre.code code, pre.term code { font-size: inherit; }
.code .k { color: #a5b4fc; } .code .c, .term .dim { color: #8a90b0; }
.term .p { color: #a78bfa; } .term .link { color: #93c5fd; }

/* the demo run: the full report from 1100 px (where it is two columns inside, ~1,050 px tall), a link card
   below. The frame reserves that height before the report posts its own (no layout shift), then fits it. */
.watch h2 { margin-bottom: 20px; }
.demo-frame { position: relative; display: none; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel);
  box-shadow: 0 24px 60px -30px #0006; height: 1110px; }
@media (min-width: 1200px) { .demo-frame { height: 1090px; } }
@media (min-width: 1360px) { .demo-frame { height: 1050px; } }
.demo-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.demo-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.demo-frame:not(.active) iframe { pointer-events: none; }
/* sized to the report's content (it posts its height): no inner scroller, so no click-to-activate */
.demo-frame.fit { height: auto; }
.demo-frame.fit iframe { position: static; display: block; }
.demo-activate { position: absolute; inset: 0; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding: 20px; }
.demo-activate span { background: var(--ink); color: var(--ink-fg); border-radius: 999px; padding: 8px 16px; font-size: .9rem; font-weight: 600;
  box-shadow: 0 8px 24px -8px #0008; opacity: .9; transition: opacity .15s; }
@media (hover: hover) { .demo-activate:hover span { opacity: 1; } }
.demo-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px; border-radius: var(--radius); max-width: 34rem;
  margin-left: 0 !important; background: var(--ink-2); color: var(--ink-fg); border: 1px solid var(--ink-line); text-decoration: none; }
.demo-card b { font-size: 1.1rem; }
.demo-card span { color: var(--ink-muted); }
.demo-card .go { color: #b4b6ff; font-weight: 600; margin-top: 6px; }
@media (max-width: 1099px) { .skip-embed { display: none; } }
@media (min-width: 1100px) { .demo-frame { display: block; } .demo-card { display: none; } }

/* tiles */
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.tiles article { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.tiles p { color: var(--muted); }
.tiles p:last-child { margin-bottom: 0; }
.tiles.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

.byok { margin-top: 20px !important; color: var(--muted); }

.page-home .cta { text-align: center; padding: 64px var(--gutter); }
.cta h2 { max-width: 22ch; }
.cta .actions { justify-content: center; }

/* footer */
.foot { display: grid; gap: 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 32px var(--gutter);
  max-width: var(--wrap); margin: 0 auto; border-top: 0; }
body > .foot { border-top: 1px solid var(--line); max-width: none; padding-left: var(--pad-x); padding-right: var(--pad-x); }
.foot-brand { grid-column: 1 / -1; }
.foot-brand .brand { color: var(--fg); font-size: 1rem; display: inline-flex; align-items: center; gap: 8px; }
.foot-brand p { margin: 6px 0 0; }
.foot nav { display: flex; flex-direction: column; gap: 4px; }
.foot nav h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--fg); margin: 0 0 4px; }
.foot nav a { text-decoration: none; padding: 3px 0; }
@media (hover: hover) { .foot nav a:hover { color: var(--fg); } }
.foot-legal { grid-column: 1 / -1; margin: 0; }
/* phones: link rows instead of tall columns */
@media (max-width: 719px) { .foot { gap: 16px; } .foot nav { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; column-gap: 18px; } .foot nav h2 { flex-basis: 100%; } }
@media (min-width: 720px) { .foot { grid-template-columns: 2fr 1fr 1fr; } .foot-brand { grid-column: auto; } }

/* touch: 44px targets for nav, footer and arrow links */
@media (pointer: coarse) {
  .top nav a, .foot nav a, .foot-brand .brand { display: inline-flex; align-items: center; min-height: 44px; }
  /* links standing alone get 44 px; links inside a sentence get a taller hit box that leaves the line spacing alone */
  a.more { display: inline-block; padding-block: 10px; }
  :is(.fine, .evidence, .byok) a { padding-block: 10px; }
  .top nav a.btn { min-height: 44px; }
  .foot nav { row-gap: 0; }
}

/* legal pages */
.toc { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 16px 0 24px; font-size: .92rem; }
.toc summary { font-weight: 600; padding: 11px 0; margin: -11px 0; }
@media (pointer: coarse) { .toc a { display: inline-block; padding: 8px 0; } }
.legal { overflow-wrap: break-word; }
.legal code, .legal .unset { overflow-wrap: anywhere; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; gap: 0; } .facts dt { margin-top: 10px; } }
.toc ol, .toc ul { margin: 6px 0 0; padding-left: 20px; columns: 2 14rem; }
.unset { background: var(--warn-bg); color: var(--warn-fg); border-radius: 4px; padding: 0 4px; font-size: .9em; }
.legal h2 { scroll-margin-top: 72px; }
.address { white-space: pre-line; }

@media print {
  .top, .foot, .skip, .skip-embed, .watch, .actions, .toc, button.copy { display: none !important; }
  /* black on white: browsers drop backgrounds when printing, so the dark bands, cards and code go plain */
  body, .band, .band *, .finding *, pre, pre * { color: #000 !important; background: none !important; box-shadow: none !important; }
  .finding, .receipts dl, pre, .step-list li, .tiles article, .sev { border-color: #999 !important; box-shadow: none !important; }
  .finding, pre, .step-list li, .tiles article { break-inside: avoid; }
  .page-home section { padding-top: 16px; padding-bottom: 16px; }
  a { color: inherit !important; }
  .legal { max-width: none; }
  .legal a[href^="http"]::after, .legal a[href^="mailto:"]::after { content: " (" attr(href) ")"; }
}
