/* Attestyx website. One shared stylesheet, no external fonts or resources. */

:root {
  --page: #f9f9f7;
  --surface: #ffffff;
  --surface-2: #f3f2ee;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #64635e;
  --line: #e1e0d9;
  --line-2: #c3c2b7;
  --link: #1d5fb3;
  --focus: #2a78d6;
  --brand: #0b0b0b;
  --crit: #c2302f;
  --high: #b4501f;
  --high-dot: #ec835a;
  --med: #7a5200;
  --med-dot: #fab219;
  --low: #52514e;
  --low-dot: #9a998f;
  --code-bg: #f3f2ee;
  --pre-bg: #16161a;
  --pre-ink: #ecebe6;
  --pre-line: transparent;
  --copy-bg: #2b2b30;
  --copy-line: #45454c;
  --copy-hover: #3a3a41;
  --on-ink: #ffffff;
  --ink-hover: #2b2b2b;
  --mark-bg: #0b0b0b;
  --mark-dot: #fcfcfb;
  --shot-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 28px rgba(0, 0, 0, 0.06);
  --shot-filter: none;
  color-scheme: light;
  --radius: 10px;
  --max: 1160px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* Dark theme. The same values twice: once for the system setting, once for the header toggle (data-theme on <html>). */
:root[data-theme="dark"] {
  --page: #0e0e10;
  --surface: #17171a;
  --surface-2: #1f1f23;
  --ink: #f1f0ea;
  --ink-2: #c4c3bb;
  --muted: #9c9b92;
  --line: #2a2a2f;
  --line-2: #3f3f46;
  --link: #8ab8f5;
  --focus: #7fb2f0;
  --brand: #f1f0ea;
  --crit: #ff7b75;
  --high: #ff9d66;
  --high-dot: #ec835a;
  --med: #f3c24f;
  --med-dot: #fab219;
  --low: #b5b4ab;
  --low-dot: #8b8a82;
  --code-bg: #1f1f23;
  --pre-bg: #08080a;
  --pre-ink: #ecebe6;
  --pre-line: #2a2a2f;
  --copy-bg: #1f1f23;
  --copy-line: #3f3f46;
  --copy-hover: #2a2a2f;
  --on-ink: #0e0e10;
  --ink-hover: #ffffff;
  --mark-bg: #f1f0ea;
  --mark-dot: #0e0e10;
  --shot-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 8px 28px rgba(0, 0, 0, 0.5);
  --shot-filter: brightness(0.88);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0e0e10;
    --surface: #17171a;
    --surface-2: #1f1f23;
    --ink: #f1f0ea;
    --ink-2: #c4c3bb;
    --muted: #9c9b92;
    --line: #2a2a2f;
    --line-2: #3f3f46;
    --link: #8ab8f5;
    --focus: #7fb2f0;
    --brand: #f1f0ea;
    --crit: #ff7b75;
    --high: #ff9d66;
    --high-dot: #ec835a;
    --med: #f3c24f;
    --med-dot: #fab219;
    --low: #b5b4ab;
    --low-dot: #8b8a82;
    --code-bg: #1f1f23;
    --pre-bg: #08080a;
    --pre-ink: #ecebe6;
    --pre-line: #2a2a2f;
    --copy-bg: #1f1f23;
    --copy-line: #3f3f46;
    --copy-hover: #2a2a2f;
    --on-ink: #0e0e10;
    --ink-hover: #ffffff;
    --mark-bg: #f1f0ea;
    --mark-dot: #0e0e10;
    --shot-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 8px 28px rgba(0, 0, 0, 0.5);
    --shot-filter: brightness(0.88);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}

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

a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.01em; margin: 1.6em 0 0.5em; }
h1 { font-size: 2.1rem; margin-top: 0; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.12rem; }
p, ul, ol { margin: 0 0 1em; }
li + li { margin-top: 0.3em; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}

.code-block { position: relative; margin: 0 0 1.2em; }
pre {
  margin: 0;
  background: var(--pre-bg);
  color: var(--pre-ink);
  box-shadow: inset 0 0 0 1px var(--pre-line);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.55;
}
.code-block pre { padding-right: 76px; }
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; overflow-wrap: normal; }
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font: 600 12px/1 var(--font);
  color: var(--pre-ink);
  background: var(--copy-bg);
  border: 1px solid var(--copy-line);
  border-radius: 6px;
  padding: 6px 9px;
  cursor: pointer;
}
.copy-btn:hover { background: var(--copy-hover); }

.visually-hidden { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--ink);
  color: var(--on-ink);
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 100;
}
.skip-link:focus { top: 12px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--page);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand-mark { flex: none; }
.mark-bg { fill: var(--mark-bg); }
.mark-dot { fill: var(--mark-dot); }
.main-nav { margin-left: auto; }

/* Theme toggle: one icon button. It shows the theme you switch to (sun in dark mode, moon in light mode).
   Hidden until theme.js enables it. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle svg { display: none; flex: none; }
.theme-toggle[data-mode="dark"] .ti-light,
.theme-toggle[data-mode="light"] .ti-dark { display: block; }
.main-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.main-nav li + li { margin-top: 0; }
.main-nav a { white-space: nowrap; display: block; padding: 6px 10px; border-radius: 7px; color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: 15px; }
.main-nav a:hover { background: var(--surface-2); color: var(--ink); }
.main-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 8px;
  font-weight: 650;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid var(--ink);
  line-height: 1.2;
}
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--ink-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Home */
.hero { padding: 64px 0 40px; }
.eyebrow { font-size: 13px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); max-width: 18ch; margin-bottom: 18px; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 62ch; }
.hero .btn-row { margin: 28px 0 16px; }
.hero-note { font-size: 14px; color: var(--muted); margin: 0; }
.hero-shot { margin-top: 44px; }

.shot {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shot-shadow);
}
.shot img { filter: var(--shot-filter); }
.shot figcaption { padding: 12px 16px; font-size: 14px; color: var(--ink-2); border-top: 1px solid var(--line); }

.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section-alt { background: var(--surface); }
.section h2 { margin-top: 0; font-size: 1.8rem; }
.section-intro { color: var(--ink-2); max-width: 64ch; font-size: 1.05rem; margin-bottom: 32px; }

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.section-alt .card { background: var(--page); }
.card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card p, .card li { color: var(--ink-2); font-size: 15px; }
.card ul { padding-left: 1.2em; }

/* Flow diagram: collect, score, review */
.flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; counter-reset: flow; }
.flow > li { margin: 0; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.section-alt .flow > li { background: var(--page); }
.flow > li + li::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 50%;
  width: 24px;
  height: 2px;
  background: var(--line-2);
}
.flow > li + li::after {
  content: "";
  position: absolute;
  left: -14px;
  top: calc(50% - 5px);
  border: 6px solid transparent;
  border-left: 8px solid var(--line-2);
  border-right: 0;
}
.flow-step { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; }
.flow-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--ink); color: var(--on-ink); font-size: 14px; }
.flow p { color: var(--ink-2); font-size: 15px; margin: 0 0 0.6em; }
.flow ul { padding-left: 1.1em; margin: 0; color: var(--ink-2); font-size: 15px; }
.flow-where { font-size: 12px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

/* Architecture diagram (docs) */
.arch { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.25fr); gap: 16px; align-items: center; margin: 8px 0 24px; }
.arch-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.arch-box h3 { margin: 0 0 8px; font-size: 1rem; }
.arch-box ul, .arch-box ol { margin: 0; padding-left: 1.2em; font-size: 14.5px; color: var(--ink-2); }
.arch-link { display: grid; gap: 6px; font-size: 13px; color: var(--muted); text-align: center; }
.arch-arrow { font-weight: 700; color: var(--ink-2); }

.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.shots .shot-tall img { max-height: 760px; width: 100%; object-fit: cover; object-position: top; }
.shot-wide { grid-column: 1 / -1; }

.try { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 32px; align-items: center; }
.try .code-block { margin: 0; }

.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { margin: 0; }

/* Site footer: one block with the brand, three link groups and the Liceron line. */
.site-footer { padding: 28px 0 32px; font-size: 14.5px; color: var(--ink-2); background: var(--page); }
.footer-panel { max-width: calc(var(--max) - 16px); margin: 0 auto; padding: 36px 8px 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 32px 28px; }
.footer-tag { margin-top: 12px; max-width: 24em; line-height: 1.5; }
.footer-h { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-col li + li { margin-top: 0; }
.footer-col a { color: var(--ink); text-decoration: none; font-weight: 550; }
.footer-col a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-footer p { margin: 0; }
.site-footer .footer-tag { margin-top: 12px; }
.site-footer .footer-h { margin-bottom: 12px; }
.footer-base { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; align-items: center; margin-top: 34px; font-size: 13px; }
.powered-by { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); text-decoration: none; }
.powered-by img { display: block; height: 24px; width: auto; }
.powered-name { color: var(--ink); font-weight: 650; letter-spacing: 0.01em; }
.powered-by:hover .powered-name { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1200px) { .footer-panel { margin: 0 16px; } }
@media (max-width: 760px) {
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
  .footer-panel { padding: 28px 0 20px; }
}
@media (max-width: 340px) { .footer-top { grid-template-columns: minmax(0, 1fr); } }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); font-weight: 650; font-size: 13.5px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; overflow-wrap: normal; }
td.wrap code { white-space: normal; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }

/* Severity badges: coloured dot, dark readable text */
.sev { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; letter-spacing: 0.03em; white-space: nowrap; }
.sev::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.sev-critical { color: var(--crit); }
.sev-high { color: var(--high); }
.sev-high::before { background: var(--high-dot); }
.sev-medium { color: var(--med); }
.sev-medium::before { background: var(--med-dot); }
.sev-low { color: var(--low); }
.sev-low::before { background: var(--low-dot); }

.docs-content .sev-scale, .sev-scale { padding-left: 0; }
.sev-scale { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; padding: 0; list-style: none; }
.sev-scale li { margin: 0; background: var(--surface); border: 1px solid var(--line); border-top-width: 4px; border-radius: var(--radius); padding: 14px 16px; font-size: 14.5px; color: var(--ink-2); }
.sev-scale li.lv-critical { border-top-color: var(--crit); }
.sev-scale li.lv-high { border-top-color: var(--high-dot); }
.sev-scale li.lv-medium { border-top-color: var(--med-dot); }
.sev-scale li.lv-low { border-top-color: var(--low-dot); }
.sev-scale .sev { display: flex; margin-bottom: 6px; font-size: 13px; }

/* Docs layout */
.docs-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 48px; padding-top: 32px; padding-bottom: 64px; }
.docs-sidebar { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; font-size: 15px; }
.docs-sidebar h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 22px 0 6px 10px; }
.docs-sidebar h2:first-child { margin-top: 0; }
.docs-sidebar ul { list-style: none; margin: 0; padding: 0; }
.docs-sidebar li { margin: 0; }
.docs-sidebar a { display: block; padding: 6px 10px; border-radius: 7px; color: var(--ink-2); text-decoration: none; }
.docs-sidebar a:hover { background: var(--surface-2); color: var(--ink); }
.docs-sidebar a[aria-current="page"] { background: var(--surface-2); color: var(--ink); font-weight: 650; }
.sidebar-toggle { display: none; }

.docs-content { min-width: 0; max-width: 820px; }
.docs-content h2 { padding-top: 8px; border-top: 1px solid var(--line); margin-top: 2em; padding-top: 1.2em; }
.docs-content h1 + p, .docs-content .lead { font-size: 1.08rem; color: var(--ink-2); }
.docs-content ul, .docs-content ol { padding-left: 1.3em; }

.callout { border: 1px solid var(--line); border-left: 4px solid var(--ink); background: var(--surface); border-radius: 8px; padding: 14px 16px; margin: 0 0 1.4em; font-size: 15px; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout-warn { border-left-color: var(--med-dot); }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); }
.pager a { display: block; max-width: 48%; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 600; }
.pager a:hover { border-color: var(--ink); }
.pager span { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.pager .next { margin-left: auto; text-align: right; }

.faq dt { font-weight: 700; font-size: 1.06rem; margin-top: 1.6em; }
.faq dd { margin: 0.4em 0 0; color: var(--ink-2); }
.faq dd p:last-child { margin-bottom: 0; }

.notfound { padding: 96px 0; text-align: left; }
.notfound h1 { font-size: 2.4rem; }

/* Responsive */
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .try { grid-template-columns: minmax(0, 1fr); }
  .sev-scale { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 16px; }
  .docs-sidebar { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px; }
  .js .docs-sidebar:not(.is-open) { display: none; }
  .js .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    font: 600 15px/1.2 var(--font);
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    cursor: pointer;
  }
  .sidebar-toggle::after { content: "+"; font-size: 18px; line-height: 1; }
  .sidebar-toggle[aria-expanded="true"]::after { content: "\2212"; }
  .flow { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .flow > li + li::before { left: 50%; top: -26px; width: 2px; height: 18px; }
  .flow > li + li::after { left: calc(50% - 5px); top: -10px; border: 6px solid transparent; border-top: 8px solid var(--line-2); border-bottom: 0; border-left-width: 6px; }
  .arch { grid-template-columns: minmax(0, 1fr); }
  .arch-link { grid-auto-flow: column; justify-content: center; gap: 16px; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  h1 { font-size: 1.75rem; }
  .grid-3, .grid-2, .shots { grid-template-columns: minmax(0, 1fr); }
  .shots .shot-tall img { max-height: 560px; }
  .hero { padding: 40px 0 24px; }
  .section { padding: 44px 0; }
  .section h2 { font-size: 1.5rem; }
  .main-nav ul { gap: 0; }
  .main-nav a { padding: 6px 7px; font-size: 14.5px; }
  .header-inner { gap: 8px; }
  .main-nav .nav-optional { display: none; }
  .brand { font-size: 17px; }
  .sev-scale { grid-template-columns: minmax(0, 1fr); }
  .pager { flex-direction: column; }
  .pager a { max-width: none; }
  .btn-row .btn { flex: 1 1 auto; }
  th, td { padding: 9px 11px; }
  .table-wrap table { min-width: 520px; }
}

@media (max-width: 400px) {
  .header-inner { gap: 4px; }
  .brand { gap: 7px; font-size: 16px; }
  .main-nav a { padding: 6px 5px; font-size: 14px; }
  .theme-toggle { width: 32px; height: 32px; margin-left: 2px; }
}

@media (max-width: 370px) {
  .site-header .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
