/* WebSentinel — brand tokens
 * Drop-in stylesheet. Import once at the root of any WebSentinel surface.
 *   @import "websentinel-brand/assets/brand-tokens.css";
 *
 * Reference these custom properties — never hex literals — in component code.
 * Spec: see ../style-guide.md.
 */

@import "./fonts/fonts.css";
@import "./print.css";

:root {
  /* ── Color · core ─────────────────────────────────────────── */
  --ws-red:        #D7263D;
  --ws-red-deep:   #9E0E22;
  --ws-red-wash:   #FBEDEF;

  --ws-ink:        #141416;
  --ws-ink-2:      #1F1F22;
  --ws-ink-3:      #2A2A2E;

  --ws-paper:      #F4F1EC;
  --ws-paper-2:    #EAE5DC;

  --ws-rule:       rgba(20, 20, 22, 0.14);
  --ws-rule-dark:  rgba(244, 241, 236, 0.10);
  --ws-mute:       rgba(20, 20, 22, 0.55);
  --ws-mute-dark:  rgba(244, 241, 236, 0.55);

  /* ── Color · severity ─────────────────────────────────────── */
  --ws-sev-crit:   #D7263D;
  --ws-sev-high:   #E8743C;
  --ws-sev-med:    #C8A23A;
  --ws-sev-low:    #5B7C6E;
  --ws-sev-info:   #5A6B7A;
  --ws-sev-pass:   #3E7A5C;

  /* ── Type ─────────────────────────────────────────────────── */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --text-xs:   12px;  --lh-xs:  16px;
  --text-sm:   14px;  --lh-sm:  20px;
  --text-base: 16px;  --lh-base: 26px;
  --text-lg:   18px;  --lh-lg:  28px;
  --text-xl:   22px;  --lh-xl:  30px;
  --text-2xl:  28px;  --lh-2xl: 34px;
  --text-3xl:  36px;  --lh-3xl: 42px;
  --text-4xl:  48px;  --lh-4xl: 54px;
  --text-5xl:  64px;  --lh-5xl: 68px;
  --text-6xl:  88px;  --lh-6xl: 92px;

  --tracking-tight:  -0.025em;
  --tracking-snug:   -0.015em;
  --tracking-normal: 0;
  --tracking-wide:    0.04em;
  --tracking-mono:    0.18em;  /* uppercase mono eyebrows */

  /* ── Layout ───────────────────────────────────────────────── */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-14: 56px;
  --space-20: 80px;
  --space-30: 120px;
  --space-40: 160px;

  --content-max: 1200px;
  --content-pad-desk: 80px;
  --content-pad-mob:  24px;

  /* ── Radius ───────────────────────────────────────────────── */
  --radius-xs:  2px;
  --radius-sm:  4px;
  --radius-md:  6px;
  --radius-lg: 10px;
  --radius-pill: 9999px;

  /* ── Elevation (use sparingly) ────────────────────────────── */
  --shadow-sm: 0 1px 0 rgba(20,20,22,.06), 0 4px 10px rgba(20,20,22,.04);
  --shadow-md: 0 1px 0 rgba(20,20,22,.08), 0 12px 24px rgba(20,20,22,.08);

  /* ── Motion ───────────────────────────────────────────────── */
  --ease-std: cubic-bezier(0.2, 0.7, 0.3, 1);
  --dur-instant: 120ms;
  --dur-default: 180ms;
  --dur-deliberate: 240ms;

  /* ── Focus ────────────────────────────────────────────────── */
  --focus-ring: 0 0 0 2px var(--ws-paper), 0 0 0 4px var(--ws-red);
}

/* ── Base reset / typography defaults ───────────────────────── */
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--ws-paper);
  color: var(--ws-ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: var(--tracking-snug);
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--text-5xl); line-height: var(--lh-5xl); letter-spacing: var(--tracking-tight); }
h2 { font-size: var(--text-4xl); line-height: var(--lh-4xl); letter-spacing: var(--tracking-tight); }
h3 { font-size: var(--text-3xl); line-height: var(--lh-3xl); }
h4 { font-size: var(--text-2xl); line-height: var(--lh-2xl); }
h5 { font-size: var(--text-xl);  line-height: var(--lh-xl); }
h6 { font-size: var(--text-lg);  line-height: var(--lh-lg); }

p { text-wrap: pretty; max-width: 64ch; }

code, kbd, samp, pre, .mono {
  font-family: var(--font-mono);
}

a {
  color: var(--ws-ink);
  text-decoration: underline;
  text-decoration-color: var(--ws-red);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: color var(--dur-default) var(--ease-std);
}
a:hover { color: var(--ws-red-deep); }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

hr { border: none; border-top: 1px solid var(--ws-rule); margin: var(--space-8) 0; }

/* ── Eyebrow / mono caption ─────────────────────────────────── */
.ws-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--ws-mute);
}

/* ── Severity badges ────────────────────────────────────────── */
.rs-sev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid currentColor;
  text-transform: uppercase;
}
.rs-sev--crit { color: var(--ws-sev-crit); }
.rs-sev--high { color: var(--ws-sev-high); }
.rs-sev--med  { color: var(--ws-sev-med);  }
.rs-sev--low  { color: var(--ws-sev-low);  }
.rs-sev--info { color: var(--ws-sev-info); }
.rs-sev--pass { color: var(--ws-sev-pass); }

/* ── Buttons ────────────────────────────────────────────────── */
.ws-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur-default) var(--ease-std),
              color var(--dur-default) var(--ease-std),
              border-color var(--dur-default) var(--ease-std);
  text-decoration: none;
}
.ws-btn--primary {
  background: var(--ws-red);
  color: var(--ws-paper);
}
.ws-btn--primary,
.ws-btn--primary:hover,
.ws-btn--primary:focus,
.ws-btn--primary:visited { color: var(--ws-paper); }
.ws-btn--primary:hover { background: var(--ws-red-deep); }
.ws-btn--secondary {
  background: transparent;
  color: var(--ws-ink);
  border-color: var(--ws-ink);
}
.ws-btn--secondary:hover { background: var(--ws-ink); color: var(--ws-paper); }
.ws-btn--ghost {
  background: transparent;
  color: var(--ws-ink);
}
.ws-btn--ghost:hover { background: var(--ws-paper-2); }

/* ── Cards ──────────────────────────────────────────────────── */
.ws-card {
  background: var(--ws-paper);
  border: 1px solid var(--ws-rule);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}
.ws-card--dark {
  background: var(--ws-ink-2);
  border-color: var(--ws-rule-dark);
  color: var(--ws-paper);
}

/* ── Forms ──────────────────────────────────────────────────── */
.ws-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: var(--ws-paper);
  border: 1px solid var(--ws-rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--ws-ink);
  transition: border-color var(--dur-default) var(--ease-std);
}
.ws-input:focus { border-color: var(--ws-ink); outline: none; box-shadow: var(--focus-ring); }
.rs-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ws-ink);
  margin-bottom: 6px;
}
.rs-help {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ws-mute);
  margin-top: 6px;
}

/* ── Scan-line animation ────────────────────────────────────── */
@keyframes rs-scan {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}
.ws-scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--ws-red);
  opacity: 0.85;
  animation: rs-scan 1.6s cubic-bezier(.4,.1,.4,1) infinite;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .ws-scan-line { display: none; }
}

/* ── Dark surface helper ────────────────────────────────────── */
.ws-dark {
  background: var(--ws-ink);
  color: var(--ws-paper);
}
.ws-dark .ws-eyebrow { color: var(--ws-mute-dark); }
.ws-dark hr { border-top-color: var(--ws-rule-dark); }
.ws-dark a { color: var(--ws-paper); }
.ws-dark .ws-input {
  background: var(--ws-ink-2);
  border-color: var(--ws-rule-dark);
  color: var(--ws-paper);
}
