/* ═══════════════════════════════════════════════════════════════════
   NORM Design System v1.0
   Independent claims–evidence infrastructure
   ═══════════════════════════════════════════════════════════════════ */

/* ── Foundation Colors ──────────────────────────────────────────── */
:root {
  --n-obsidian:     #080B10;
  --n-navy:         #142D54;
  --n-paper:        #F3F4F0;
  --n-white:        #FFFFFF;
  --n-ink:          #101820;
  --n-ink-2:        #59636E;
  --n-rule:         rgba(255,255,255,0.08);
  --n-rule-strong:  rgba(255,255,255,0.16);
  --n-indigo:       #5B6FF2;
  --n-indigo-dim:   rgba(91,111,242,0.12);

  /* Status — ONLY for status, never decoration */
  --s-green:        #1e9459;
  --s-green-bg:     rgba(30,148,89,0.08);
  --s-green-bdr:    rgba(30,148,89,0.2);
  --s-amber:        #c07718;
  --s-amber-bg:     rgba(192,119,24,0.08);
  --s-amber-bdr:    rgba(192,119,24,0.2);
  --s-red:          #c44038;
  --s-red-bg:       rgba(196,64,56,0.08);
  --s-red-bdr:      rgba(196,64,56,0.2);
  --s-gray:         #59636E;
  --s-gray-bg:      rgba(89,99,110,0.08);

  /* Text hierarchy */
  --t-primary:      #f2f2f2;
  --t-secondary:    #8b93b0;
  --t-tertiary:     #5d6580;
  --t-muted:        #3d4560;

  /* Surfaces */
  --sf-base:        #080B10;
  --sf-raised:      #0e1118;
  --sf-elevated:    #141822;
  --sf-overlay:     #1a1f2e;

  /* Typography */
  --f-sans:         'Geist', 'Inter', system-ui, -apple-system, sans-serif;
  --f-serif:        'Newsreader', 'Georgia', serif;
  --f-mono:         'Geist Mono', 'IBM Plex Mono', 'SF Mono', monospace;

  /* Spacing (8px base) */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  24px;
  --sp-6:  32px;
  --sp-7:  48px;
  --sp-8:  64px;
  --sp-9:  96px;
  --sp-10: 128px;
  --sp-11: 160px;

  /* Grid */
  --grid-max:       1360px;
  --grid-gutter:    48px;
  --grid-cols:      12;

  /* Motion */
  --ease-out:       cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out:    cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:       180ms;
  --dur-med:        360ms;
  --dur-slow:       600ms;

  /* Radii */
  --r-none:  0px;
  --r-sm:    2px;
  --r-md:    4px;

  /* Utility bar + nav heights */
  --h-util:  32px;
  --h-nav:   72px;
  --h-strip: 36px;
  --h-total: calc(var(--h-util) + var(--h-nav) + var(--h-strip));
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--sf-base);
  color: var(--t-primary);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font: inherit; }

/* ── Typography Scale ───────────────────────────────────────────── */
.t-hero       { font-family: var(--f-sans); font-size: clamp(52px, 6vw, 84px); font-weight: 500; line-height: 1.04; letter-spacing: -0.03em; }
.t-section    { font-family: var(--f-sans); font-size: clamp(36px, 4vw, 56px); font-weight: 500; line-height: 1.1; letter-spacing: -0.025em; }
.t-subsection { font-family: var(--f-sans); font-size: clamp(24px, 2.5vw, 36px); font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; }
.t-heading    { font-family: var(--f-sans); font-size: clamp(18px, 1.4vw, 22px); font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; }
.t-body       { font-family: var(--f-sans); font-size: clamp(16px, 1.1vw, 18px); font-weight: 400; line-height: 1.7; }
.t-body-sm    { font-family: var(--f-sans); font-size: clamp(14px, 0.95vw, 15px); font-weight: 400; line-height: 1.7; }
.t-ui         { font-family: var(--f-sans); font-size: clamp(13px, 0.9vw, 15px); font-weight: 500; line-height: 1.4; }
.t-meta       { font-family: var(--f-mono); font-size: clamp(10px, 0.75vw, 12px); font-weight: 400; line-height: 1.5; letter-spacing: 0.04em; }
.t-meta-caps  { font-family: var(--f-mono); font-size: clamp(9px, 0.7vw, 11px); font-weight: 500; line-height: 1.4; letter-spacing: 0.12em; text-transform: uppercase; }
.t-record-id  { font-family: var(--f-mono); font-size: 11px; font-weight: 400; letter-spacing: 0.06em; color: var(--t-tertiary); }
.t-editorial  { font-family: var(--f-serif); font-size: clamp(16px, 1.1vw, 19px); font-weight: 400; line-height: 1.85; font-style: italic; }

/* ── Layout ─────────────────────────────────────────────────────── */
.n-container {
  max-width: var(--grid-max);
  margin: 0 auto;
  padding-left: var(--grid-gutter);
  padding-right: var(--grid-gutter);
}

.n-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  gap: var(--grid-gutter);
}

.n-section {
  padding-top: var(--sp-11);
  padding-bottom: var(--sp-11);
}

/* ── Dividers ───────────────────────────────────────────────────── */
.n-rule       { border: none; border-top: 1px solid var(--n-rule); }
.n-rule-strong { border: none; border-top: 1px solid var(--n-rule-strong); }

/* ── Buttons ────────────────────────────────────────────────────── */
.n-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: var(--r-md);
  border: 1px solid var(--n-rule-strong);
  background: transparent;
  color: var(--t-secondary);
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.n-btn:hover {
  color: var(--t-primary);
  border-color: var(--t-tertiary);
}

.n-btn-primary {
  background: var(--n-indigo);
  border-color: var(--n-indigo);
  color: var(--n-white);
}
.n-btn-primary:hover {
  background: #4d5ee0;
  border-color: #4d5ee0;
  color: var(--n-white);
}

.n-btn-lg {
  font-size: 15px;
  padding: 14px 32px;
}

.n-btn-sm {
  font-size: 12px;
  padding: 6px 14px;
}

/* ── Status Indicators ──────────────────────────────────────────── */
.n-signal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: var(--r-sm);
}
.n-signal-green  { color: var(--s-green); background: var(--s-green-bg); border: 1px solid var(--s-green-bdr); }
.n-signal-amber  { color: var(--s-amber); background: var(--s-amber-bg); border: 1px solid var(--s-amber-bdr); }
.n-signal-red    { color: var(--s-red);   background: var(--s-red-bg);   border: 1px solid var(--s-red-bdr); }
.n-signal-gray   { color: var(--s-gray);  background: var(--s-gray-bg);  border: 1px solid rgba(89,99,110,0.2); }

/* Signal dot */
.n-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.n-dot-green { background: var(--s-green); }
.n-dot-amber, .n-dot-yellow { background: var(--s-amber); }
.n-dot-red   { background: var(--s-red); }
.n-dot-gray  { background: var(--s-gray); }

/* ── Record Components ──────────────────────────────────────────── */
.n-record {
  background: var(--sf-raised);
  border: 1px solid var(--n-rule);
  border-radius: var(--r-md);
}

.n-record-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--n-rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.n-record-row {
  padding: 12px 20px;
  border-bottom: 1px solid var(--n-rule);
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.n-record-row:last-child { border-bottom: none; }

.n-record-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t-tertiary);
  flex-shrink: 0;
  min-width: 120px;
}

.n-record-value {
  font-size: 14px;
  color: var(--t-primary);
  flex: 1;
}

.n-record-value-secondary {
  font-size: 13px;
  color: var(--t-secondary);
  flex: 1;
  line-height: 1.65;
}

/* ── Tables ─────────────────────────────────────────────────────── */
.n-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.n-table thead th {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t-tertiary);
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--n-rule-strong);
  white-space: nowrap;
  font-weight: 500;
}
.n-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--n-rule);
  color: var(--t-secondary);
  vertical-align: middle;
}
.n-table tbody tr:hover {
  background: var(--sf-raised);
}
.n-table tbody td:first-child {
  color: var(--t-primary);
  font-weight: 500;
}

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes n-fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes n-fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes n-countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.n-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.n-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.n-stagger > * { transition-delay: calc(var(--i, 0) * 80ms); }

/* ── Reduced Motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .n-reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ── Responsive ─────────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --grid-gutter: 32px;
    --sp-11: 96px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --grid-gutter: 20px;
    --sp-11: 72px;
    --h-util: 0px; /* Hide utility bar on mobile */
  }

  .n-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }
}

/* Small mobile */
@media (max-width: 390px) {
  :root {
    --grid-gutter: 18px;
  }
}
