/* Parapet — shared design tokens & primitives */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --accent: #0b5fff;
  --accent-hover: #0a50d8;
  --accent-soft: rgba(11, 95, 255, 0.1);
  --violet: #5b4bff;
  --teal: #00b8a3;
  --grad: linear-gradient(95deg, #0b5fff 0%, #5b4bff 48%, #00b8a3 100%);

  --crit: #e5484d;
  --high: #f2711c;
  --med: #e8a10c;
  --low: #8391a7;
  --ok: #1f9d61;

  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --hair: rgba(0, 0, 0, 0.08);
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --card: #ffffff;
  --radius: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(11, 95, 255, .45); outline-offset: 2px; border-radius: 8px; }
.ico { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-size: 16px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap;
  transition: background .2s var(--ease), color .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s;
  text-decoration: none !important; background: none;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-dark { background: var(--ink); color: var(--on-ink, #fff); }
.btn-dark:hover { background: var(--ink-2); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 17px; }
.link-arrow { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; color: var(--accent); }
.link-arrow::after { content: "›"; font-size: 1.25em; line-height: 1; transform: translateY(-1px); transition: transform .2s var(--ease); }
.link-arrow:hover { text-decoration: underline; }
.link-arrow:hover::after { transform: translate(2px, -1px); }

/* Severity */
.sev { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; }
.sev-critical { background: var(--crit); }
.sev-high { background: var(--high); }
.sev-medium { background: var(--med); }
.sev-low { background: var(--low); }
.sev-ok { background: var(--ok); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* iOS-style switch */
.switch { position: relative; display: inline-flex; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--switch-off, #d9dae0); border-radius: 999px; transition: background .25s var(--ease); }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s var(--ease); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid rgba(11, 95, 255, .45); outline-offset: 2px; }

/* Checkbox */
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; line-height: 1.4; }
.check input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; border-radius: 6px; border: 1.5px solid var(--ctl-border, #b9bcc4); background: var(--surface, #fff); flex: none; display: grid; place-items: center; transition: all .18s var(--ease); cursor: pointer; }
.check input::after { content: ""; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .18s var(--ease); }
.check input:checked { background: var(--ok); border-color: var(--ok); }
.check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check input:checked ~ span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }

/* Grade ring */
.ring { position: relative; display: grid; place-items: center; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-track { stroke: var(--ring-track, rgba(0,0,0,.08)); }
.ring .ring-val { transition: stroke-dashoffset .9s var(--ease), stroke .5s; }
.ring .ring-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1; }
.ring .ring-grade { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; }
.ring .ring-sub { font-size: 10px; color: var(--muted); font-weight: 500; margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
