/* ============================================================
   Ekushield — Design Tokens
   Subject: adversarial ML robustness testing / security tooling
   Palette: cold "signal room" charcoal, teal signal, coral alert
   ============================================================ */

:root {
  --bg: #0b0e14;
  --surface: #131822;
  --surface-2: #1b2130;
  --surface-3: #202840;
  --border: #262e40;
  --text: #e6e9ef;
  --text-muted: #8b95a7;
  --text-faint: #545e73;

  --signal: #4fd1c5;      /* brand / primary action */
  --signal-dim: #2a5f5a;
  --alert: #f2545b;       /* high severity */
  --warn: #f5a623;        /* medium severity */
  --safe: #6fcf97;        /* low severity / robust */

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.06;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--text);
}

h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1.08; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.15; }
h3 { font-size: 1.25rem; }

p { color: var(--text-muted); margin: 0 0 1em; }

.mono { font-family: var(--font-mono); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--signal);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(79,209,197,0.15);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--signal); color: #05201d; }
.btn-primary:hover { background: #6be0d5; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--signal); color: var(--signal); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,14,20,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--container);
  margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-weight: 600; font-size: 1.05rem;
  color: var(--text);
}
.brand-mark {
  width: 30px; height: 30px;
  border: 1px solid var(--signal);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--signal);
  font-size: 1rem;
}
.nav-links {
  display: flex; align-items: center; gap: 28px;
  list-style: none; margin: 0; padding: 0;
}
.nav-links a {
  font-size: 0.92rem; color: var(--text-muted);
  transition: color 0.15s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--signal); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; }

@media (max-width: 900px) {
  .nav-links { position: fixed; top: 66px; left: 0; right: 0; bottom: 0;
    background: var(--bg); flex-direction: column; align-items: flex-start;
    padding: 28px 24px; gap: 20px; transform: translateX(100%);
    transition: transform 0.25s ease; overflow-y: auto;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle { display: block; }
  .nav-actions .btn-ghost { display: none; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 28px;
  margin-top: 90px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
.footer-grid h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-grid a { color: var(--text-muted); font-size: 0.9rem; }
.footer-grid a:hover { color: var(--signal); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; border-top: 1px solid var(--border);
  color: var(--text-faint); font-size: 0.82rem; flex-wrap: wrap; gap: 12px;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Sections ---------- */
section { padding: 88px 0; position: relative; z-index: 1; }
.section-tight { padding: 56px 0; }

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 40px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero p.lead { font-size: 1.12rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 26px; margin-top: 40px; }
.hero-meta div { font-family: var(--font-mono); }
.hero-meta strong { display: block; font-size: 1.3rem; color: var(--text); }
.hero-meta span { font-size: 0.76rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; }

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

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}
.card h3 { margin-bottom: 10px; }
.card .tag {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--signal); text-transform: uppercase; letter-spacing: 0.08em;
  display: inline-block; margin-bottom: 14px;
}

/* ---------- Risk register list (real severity catalogue, not decoration) ---------- */
.risk-register { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.risk-row {
  display: grid;
  grid-template-columns: 90px 1.3fr 2fr 110px;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.risk-row:last-child { border-bottom: none; }
.risk-row:nth-child(odd) { background: var(--surface); }
.risk-id { font-family: var(--font-mono); color: var(--text-faint); font-size: 0.85rem; }
.risk-name { font-weight: 600; }
.risk-desc { color: var(--text-muted); font-size: 0.9rem; }
.severity { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 10px; border-radius: 20px; text-align: center; }
.severity.high { color: var(--alert); background: rgba(242,84,91,0.12); border: 1px solid rgba(242,84,91,0.35); }
.severity.medium { color: var(--warn); background: rgba(245,166,35,0.12); border: 1px solid rgba(245,166,35,0.35); }
.severity.low { color: var(--safe); background: rgba(111,207,151,0.12); border: 1px solid rgba(111,207,151,0.35); }

@media (max-width: 720px) {
  .risk-row { grid-template-columns: 1fr; text-align: left; }
}

/* ---------- Perturbation demo (hero signature element) ---------- */
.demo-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.demo-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint);
  margin-bottom: 14px;
}
.demo-canvas-wrap { position: relative; }
canvas { width: 100%; display: block; border-radius: var(--radius-sm); background: #0e1420; }
.demo-readout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px;
}
.readout-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.readout-box .label { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.07em; }
.readout-box .value { font-family: var(--font-mono); font-size: 1.15rem; margin-top: 4px; }
.value.ok { color: var(--safe); }
.value.bad { color: var(--alert); }

.slider-row { margin-top: 18px; }
.slider-row label { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); margin-bottom: 8px; }
input[type="range"] {
  width: 100%; -webkit-appearance: none; height: 4px; background: var(--border); border-radius: 4px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--signal); cursor: pointer; border: 3px solid #05201d;
}

/* ---------- Forms ---------- */
.form-shell {
  max-width: 440px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px;
}
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.86rem; color: var(--text-muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); padding: 11px 13px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.95rem;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--signal);
}
.field textarea { resize: vertical; min-height: 110px; }
.form-note { font-size: 0.82rem; color: var(--text-faint); margin-top: 16px; text-align: center; }
.form-msg { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.88rem; margin-bottom: 16px; display: none; }
.form-msg.show { display: block; }
.form-msg.success { background: rgba(111,207,151,0.1); border: 1px solid rgba(111,207,151,0.35); color: var(--safe); }
.form-msg.error { background: rgba(242,84,91,0.1); border: 1px solid rgba(242,84,91,0.35); color: var(--alert); }

/* ---------- Pricing ---------- */
.price-card { display: flex; flex-direction: column; }
.price-card .amount { font-family: var(--font-mono); font-size: 2.2rem; margin: 14px 0; color: var(--text); }
.price-card .amount span { font-size: 0.9rem; color: var(--text-faint); font-weight: 400; }
.price-card ul { list-style: none; padding: 0; margin: 18px 0; flex: 1; }
.price-card li { padding: 8px 0; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.9rem; }
.price-card.featured { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal); }

/* ---------- Dashboard ---------- */
.dash-shell { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 66px); }
.dash-side { border-right: 1px solid var(--border); padding: 28px 18px; }
.dash-side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 0.9rem; margin-bottom: 4px; }
.dash-side a:hover, .dash-side a.active { background: var(--surface); color: var(--signal); }
.dash-main { padding: 32px; }
.stat-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin-bottom: 30px; }
@media (max-width: 980px) { .dash-shell { grid-template-columns: 1fr; } .dash-side { display: none; } .stat-row { grid-template-columns: repeat(2,1fr); } }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.stat-card .label { color: var(--text-faint); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-mono); }
.stat-card .num { font-family: var(--font-mono); font-size: 1.6rem; margin-top: 6px; }

.upload-zone {
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 34px; text-align: center; color: var(--text-muted);
  cursor: pointer; transition: border-color 0.15s ease;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--signal); color: var(--signal); }

table.report-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.report-table th, table.report-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.report-table th { color: var(--text-faint); font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ---------- Policy pages ---------- */
.prose { max-width: 76ch; }
.prose h2 { margin-top: 2em; }
.prose ul { color: var(--text-muted); }
.prose li { margin-bottom: 0.5em; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-lg { margin-top: 48px; }
.muted { color: var(--text-faint); font-size: 0.85rem; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint);
  border: 1px solid var(--border); padding: 4px 10px; border-radius: 20px;
}
