/* AWARE Agentic Website — styles.
   No external fonts, no third-party scripts, no build step. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f8f7;
  --fg: #16211e;
  --muted: #55635f;
  --border: #d8e0dd;
  --primary: #1f6f5c;
  --primary-dark: #17564a;
  --accent: #1f6f5c;
  --danger: #a33232;
  --warn: #8a6100;
  --ok: #1f6f5c;
  --shadow: 0 1px 2px rgba(16, 32, 28, 0.06), 0 8px 24px rgba(16, 32, 28, 0.06);
  --radius: 12px;
  --wrap: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

code, .mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
}

a { color: var(--primary-dark); }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--primary);
  color: #fff; padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 60px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; text-decoration: none; color: var(--fg);
}
.brand-dim { font-weight: 400; color: var(--muted); }
.site-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-nav a {
  text-decoration: none; color: var(--muted); font-size: 14px;
  padding: 4px 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--fg); border-bottom-color: var(--primary); }

/* ---------- hero ---------- */

.hero {
  background: linear-gradient(180deg, #eef5f2 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 56px 0 44px;
}
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px;
  font-weight: 700; color: var(--primary-dark); margin: 0 0 12px;
}
.hero h1 {
  margin: 0 0 16px; font-size: clamp(30px, 5vw, 46px);
  line-height: 1.12; letter-spacing: -0.02em; max-width: 18ch;
}
.lede { font-size: 18px; max-width: 68ch; margin: 0 0 16px; }
.hero-note {
  max-width: 68ch; margin: 0; color: var(--muted); font-size: 15px;
  border-left: 3px solid var(--primary); padding-left: 14px;
}

.stats {
  display: grid; gap: 12px; margin: 32px 0 0;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stat {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.stat dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.stat dd { margin: 4px 0 0; font-size: 26px; font-weight: 700; line-height: 1.1; }

/* ---------- blocks ---------- */

.block { padding: 48px 20px; }
.block > h2 {
  margin: 0 0 10px; font-size: 26px; letter-spacing: -0.01em;
}
.block > .muted { max-width: 76ch; margin: 0 0 22px; }
.muted { color: var(--muted); }

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.catalogue-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.catalogue-table th, .catalogue-table td {
  text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.catalogue-table thead th {
  background: var(--bg-soft); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted); font-weight: 700;
  position: sticky; top: 0;
}
.catalogue-table tbody tr:last-child td { border-bottom: none; }
.catalogue-table tbody tr:hover { background: #fafcfb; }

/* ---------- severity + coverage ---------- */

.sev {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.sev-critical { background: #fbe9e9; color: #8f2626; }
.sev-high { background: #fdf0e3; color: #8a4a06; }
.sev-medium { background: #fdf8e0; color: #6f5a06; }
.sev-low { background: #eaf3ee; color: #245f47; }

.cov-state {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
}
.cov-addressed { background: #e3f2ea; color: #14503a; }
.cov-partial { background: #fdf3dd; color: #7a5a06; }
.cov-not_addressed { background: #f1f3f2; color: #5c6a66; }
tr.cov-not_addressed td { opacity: 0.82; }

/* ---------- control cards ---------- */

.ctl-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; background: var(--bg); box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.ctl-title { margin: 0 0 4px; font-size: 16px; }
.ctl-id { margin: 0 0 8px; font-size: 12px; color: var(--primary-dark); }
.ctl-card p:last-child { margin: 0; font-size: 14px; }

/* ---------- policy engine panel ---------- */

.decider {
  display: grid; gap: 20px; grid-template-columns: minmax(280px, 380px) 1fr;
  align-items: start;
}
.decider-controls label {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--muted);
}
.decider-controls select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; font-size: 15px;
}
.btn {
  display: inline-block; margin-top: 12px; padding: 10px 16px; border-radius: 8px;
  border: 1px solid var(--primary); background: var(--bg); color: var(--primary-dark);
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
}
.btn:hover { background: #eef5f2; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-quiet { border-color: var(--border); color: var(--muted); }
.btn-quiet:hover { background: var(--bg-soft); }
.field-error { color: var(--danger); font-size: 13px; min-height: 1.2em; margin: 8px 0 0; }

.decider-output { min-height: 80px; }
.decision {
  border: 1px solid var(--border); border-left-width: 5px;
  border-radius: var(--radius); padding: 16px 18px; background: var(--bg-soft);
}
.decision-allow { border-left-color: var(--ok); }
.decision-deny { border-left-color: var(--danger); }
.decision-audit { border-left-color: var(--warn); }
.decision-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px;
}
.decision-badge {
  font-weight: 800; font-size: 12px; letter-spacing: 0.08em;
  padding: 3px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border);
}
.decision-allow .decision-badge { color: var(--ok); border-color: var(--ok); }
.decision-deny .decision-badge { color: var(--danger); border-color: var(--danger); }
.decision-audit .decision-badge { color: var(--warn); border-color: var(--warn); }
.decision-reason { margin: 0 0 8px; font-size: 15px; }
.decision p:last-child { margin: 0; font-size: 13px; }

.trail-controls { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.plain-list { color: var(--muted); }
.plain-list li { margin-bottom: 6px; }

/* ---------- assistant ---------- */

.assistant { padding: 48px 20px; border-top: 1px solid var(--border); background: var(--bg-soft); }
.assistant h2 { margin: 0 0 10px; font-size: 26px; }
.assistant > .wrap > p { max-width: 76ch; }
.assistant-note { color: var(--muted); font-size: 14px; }
#assistant-status { color: var(--muted); font-size: 14px; }

/* Assistant layout. The runtime reads these variables for its chat, settings
   and agent panels. White text sits on --ns-primary and --ns-accent, so both
   need at least 4.5:1 contrast with white. */
#agent-app {
  --ns-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ns-bg: #ffffff;
  --ns-fg: #16211e;
  --ns-primary: #1f6f5c;
  --ns-accent: #1f6f5c;
  --ns-border: #d8e0dd;
  --ns-panelbg: #ffffff;
  --ns-msgbg: #f2f6f4;
  --ns-muted: #55635f;
  margin-top: 20px;
}

.assistant-panels {
  display: grid; grid-template-columns: minmax(0, 1fr) 240px;
  gap: 16px; margin-top: 16px;
}
#agent-app.ns-composed-app [data-ns-slot="chat"] { height: 640px; }
#agent-app .ns-chat { background: var(--ns-bg); }

/* Site-wide form rules often stretch the runtime's own controls. Undo them. */
#agent-app input[type="checkbox"], #agent-app input[type="radio"] { width: auto; }
#agent-app .ns-header { flex-wrap: wrap; }
#agent-app .ns-settings-body label { margin: 4px 0; font-weight: 400; }
#agent-app .ns-w-label { font-family: inherit; }
#agent-app .ns-widget label { margin: 0; }
#agent-app .ns-w-radio label, #agent-app .ns-w-multi label, #agent-app .ns-w-toggle { font-weight: 400; }
#agent-app .ns-w-toggle { font-size: 13px; }
#agent-app button { margin: 0; }
#agent-app .ns-w-choice { color: var(--ns-fg); }
#agent-app .ns-devtoggle:not(.on):hover, #agent-app .ns-modal-close:hover { background: transparent; }
#agent-app .ns-w-choice:disabled:hover { background: #fafbfc; }
#agent-app .ns-consent { background: #fffbeb; }
#agent-app .ns-msgs:has(.ns-consent-actions) > .ns-turn-status { display: none; }
#agent-app .ns-msg { overflow-wrap: break-word; }
#agent-app .ns-consent-actions { flex-wrap: wrap; }
#agent-app .ns-consent-actions button { white-space: nowrap; }

/* site.js and the runtime add their confirmation dialogs to <body>, outside
   #agent-app. */
body > dialog h2 { margin: 0 0 12px; font: 700 1.25em system-ui, sans-serif; }
body > dialog button { margin-right: 8px; }
.assistant-review {
  max-width: 640px; width: 85%; max-height: 85vh; overflow: auto;
  border: 1px solid #888; border-radius: 12px; padding: 24px;
  font: 16px system-ui, sans-serif;
}
.assistant-review dl {
  display: grid; grid-template-columns: fit-content(40%) 1fr; gap: 4px 16px; margin: 12px 0;
}
.assistant-review dt { font-weight: 600; }
.assistant-review dd { margin: 0; overflow-wrap: anywhere; }
.assistant-review details { margin: 12px 0; }
.assistant-review pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-review .assistant-decline {
  background: transparent; color: inherit; border: 1px solid currentColor;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border); padding: 32px 20px; background: var(--bg);
}
.site-footer p { max-width: 76ch; margin: 0 0 8px; font-size: 14px; }
.site-footer p:last-child { margin-bottom: 0; }

@media (max-width: 860px) {
  .decider { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .assistant-panels { grid-template-columns: 1fr; }
  .assistant-review dl { grid-template-columns: 1fr; gap: 0; }
  .assistant-review dd { margin-bottom: 8px; }
  .site-nav { gap: 12px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1513;
    --bg-soft: #131e1b;
    --fg: #e8efec;
    --muted: #9baba5;
    --border: #26332f;
    --primary: #4cbf9f;
    --primary-dark: #6fd3b4;
    --accent: #4cbf9f;
    --danger: #e08585;
    --warn: #d9ab4a;
    --ok: #4cbf9f;
  }
  .catalogue-table tbody tr:hover { background: #16211e; }
  .btn { border-color: var(--primary); color: var(--primary-dark); }
  .btn:hover { background: #16211e; }
  .btn-primary { background: var(--primary); color: #06231c; }
  .btn-primary:hover { background: var(--primary-dark); }
  .sev-critical { background: #3a1c1c; color: #f0a9a9; }
  .sev-high { background: #3a2a14; color: #e8c08a; }
  .sev-medium { background: #35301048; color: #dcd08a; }
  .sev-low { background: #14312a; color: #86d6bb; }
  .cov-addressed { background: #14312a; color: #86d6bb; }
  .cov-partial { background: #35301448; color: #dcd08a; }
  .cov-not_addressed { background: #1a2320; color: #9baba5; }
  .decision { background: #131e1b; }
  .decision-badge { background: #0d1513; }
  #agent-app .ns-consent { background: #2a2410; }
}
