/* ==========================================================================
   Security Tech — base styles and reference components
   Requires tokens.css and fonts.css. Keep this file small; it is a reference
   implementation of the spec, not a framework.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-feature-settings: "kern", "liga";
  text-rendering: optimizeLegibility;
}
::selection { background: var(--selection); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---- Type scale ---- */
h1, h2, h3, h4 { font-weight: 600; margin: 0 0 var(--space-4); }
h1 { font-size: var(--text-2xl); line-height: var(--leading-tight); letter-spacing: var(--tracking-display); }
h2 { font-size: var(--text-xl);  line-height: var(--leading-snug); }
h3 { font-size: var(--text-lg);  line-height: var(--leading-snug); }
h4 { font-size: var(--text-md);  line-height: var(--leading-snug); }
p  { margin: 0 0 var(--space-4); }
.lead { font-size: var(--text-md); color: var(--fg-muted); max-width: 60ch; }
.hero-title { font-size: var(--text-3xl); line-height: 1.05; letter-spacing: var(--tracking-display); max-width: 18ch; }
small, .small { font-size: var(--text-sm); }
a { color: var(--link); text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); }
code, pre, kbd, .mono { font-family: var(--font-mono); }
code { font-size: 0.92em; }
pre { font-size: var(--text-sm); line-height: var(--leading-mono); padding: var(--space-4); background: var(--bg-raised); border: 1px solid var(--border); overflow-x: auto; }

/* The mono eyebrow label: uppercase, tracked, muted. Used above titles and on captions. */
.label {
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: var(--tracking-label);
  text-transform: uppercase; color: var(--fg-muted);
}

/* The accent bar: a short rule above a title. The only decorative device. */
.bar { width: 48px; height: var(--bar); background: var(--accent); margin-bottom: var(--space-4); }

/* ---- Layout ---- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: var(--container-narrow); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--space-9); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter); }
@media (max-width: 640px) {
  .container, .container-narrow { padding-inline: var(--gutter-mobile); }
  .section { padding-block: var(--space-7); }
  h1 { font-size: var(--text-xl); } .hero-title { font-size: var(--text-2xl); }
}

/* ---- Wordmark in HTML (use the SVG files for the logo wherever possible) ---- */
.wordmark { display: inline-flex; align-items: baseline; font-weight: 600; letter-spacing: var(--tracking-wordmark); text-transform: uppercase; line-height: 1; color: var(--fg); white-space: nowrap; }
.wordmark .pt { display: inline-block; width: 0.28em; height: 0.28em; margin: 0 0.30em 0 0.22em; background: var(--accent); }
.wordmark .suffix { font-weight: 400; letter-spacing: 0.06em; color: var(--fg-muted); margin-left: 0.5em; }
.domain { display: inline-flex; align-items: baseline; font-family: var(--font-mono); color: var(--fg); white-space: nowrap; }
.domain .pt { display: inline-block; width: 0.32em; height: 0.32em; margin: 0 0.12em; background: var(--accent); }

/* ---- Site header ---- */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.site-header .inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); min-height: 64px; }
.site-header .logo { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.site-header .logo svg, .site-header .logo img { height: 28px; width: auto; display: block; }
.site-nav { display: flex; gap: var(--space-5); flex-wrap: wrap; }
@media (max-width: 720px) {
  .site-header .inner { flex-wrap: wrap; padding-block: var(--space-3); }
  .site-nav { order: 3; width: 100%; gap: var(--space-4); border-top: 1px solid var(--border); padding-top: var(--space-3); }
}
.site-nav a { color: var(--fg-muted); text-decoration: none; font-size: var(--text-sm); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--fg); }

/* ---- Buttons: square, one weight, two kinds ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-5);
  font: 600 var(--text-sm)/1 var(--font-sans); letter-spacing: 0.02em;
  border: 2px solid var(--fg); border-radius: var(--radius-ui); background: var(--fg); color: var(--bg);
  text-decoration: none; cursor: pointer; transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-secondary { background: transparent; color: var(--fg); }
.btn-secondary:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ---- Cards: a rule, not a shadow ---- */
.card { background: var(--bg-raised); border: 1px solid var(--border); padding: var(--space-5); }
.card .label { margin-bottom: var(--space-2); }

/* ---- Tables (findings, scope, pricing) ---- */
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th { text-align: left; font-family: var(--font-mono); font-weight: 500; font-size: var(--text-xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--fg-muted); padding: var(--space-2) var(--space-3); border-bottom: 2px solid var(--border-strong); }
td { padding: var(--space-3); border-bottom: 1px solid var(--border); vertical-align: top; }
.table-wrap { overflow-x: auto; }

/* ---- Severity badges: color + text, never color alone ---- */
.sev { display: inline-block; font: 500 var(--text-xs)/1 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; padding: 5px 8px; color: #fff; }
.sev-critical { background: var(--st-sev-critical); }
.sev-high     { background: var(--st-sev-high); }
.sev-medium   { background: var(--st-sev-medium); }
.sev-low      { background: var(--st-sev-low); }
.sev-info     { background: var(--st-sev-info); }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); padding-block: var(--space-7); font-size: var(--text-sm); color: var(--fg-muted); }
.site-footer .inner { display: flex; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap; align-items: flex-end; }

/* ---- Motion: respect the user ---- */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
