/* =============================================================
   TIRESIUS — Core tokens
   Acoustic Intelligence for Situational Awareness
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* -----------------------------------------------------------
     COLOR — Base surfaces (dark-first, cool-neutral)
     ----------------------------------------------------------- */
  --bg-void:      #07080A;   /* deepest — page background */
  --bg-base:      #0A0B0C;   /* default surface */
  --bg-raised:    #121417;   /* cards, panels */
  --bg-sunken:    #050607;   /* inset wells, code blocks */
  --bg-overlay:   rgba(10, 11, 12, 0.78);

  /* Borders / rules */
  --line-hair:    #1C1F23;   /* 1px internal dividers */
  --line-edge:    #2A2E34;   /* visible borders */
  --line-bright:  #3D434B;   /* hovered / focused borders */

  /* Foreground / type */
  --fg-primary:   #E8E9EB;   /* main text */
  --fg-secondary: #9FA4AB;   /* secondary labels, metadata */
  --fg-tertiary:  #5E646C;   /* muted, disabled */
  --fg-quaternary:#3D434B;   /* inactive marks */
  --fg-inverse:   #0A0B0C;   /* on-accent text */

  /* -----------------------------------------------------------
     SIGNAL — the single hot accent.
     Reserved for: detections, alerts, primary CTAs, live indicators.
     Never decorative. Never more than ~5% of any screen.
     ----------------------------------------------------------- */
  --signal:        #FF6B1A;
  --signal-hot:    #FF854A;   /* hover */
  --signal-dim:    #C24A0C;   /* pressed */
  --signal-ghost:  rgba(255, 107, 26, 0.12);  /* selection wash */
  --signal-trace:  rgba(255, 107, 26, 0.40);  /* trails / waveform */

  /* -----------------------------------------------------------
     STATUS — operational states
     ----------------------------------------------------------- */
  --status-nominal:  #5FB37A;  /* green — all clear */
  --status-watch:    #D4B24C;  /* amber — elevated */
  --status-alert:    #FF6B1A;  /* = signal */
  --status-critical: #E03131;  /* red — actionable threat */
  --status-offline:  #5E646C;  /* gray — no signal */

  /* -----------------------------------------------------------
     TYPOGRAPHY
     ----------------------------------------------------------- */
  --font-sans: 'Inter Tight', 'Söhne', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Berkeley Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Scale — tight, industrial. */
  --t-display: 72px;   /* hero display */
  --t-h1:      48px;
  --t-h2:      34px;
  --t-h3:      24px;
  --t-h4:      18px;
  --t-body:    15px;
  --t-small:   13px;
  --t-micro:   11px;   /* telemetry labels */

  --lh-tight:   1.05;
  --lh-snug:    1.22;
  --lh-normal:  1.5;

  --ls-tight:   -0.02em;
  --ls-normal:  0;
  --ls-label:   0.08em;   /* eyebrow labels */
  --ls-mono:    0.02em;

  /* -----------------------------------------------------------
     SPACING — 4px base, engineered not arbitrary
     ----------------------------------------------------------- */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  24px;
  --s-6:  32px;
  --s-7:  48px;
  --s-8:  64px;
  --s-9:  96px;
  --s-10: 128px;

  /* -----------------------------------------------------------
     RADIUS — sharp. Defense instruments aren't squishy.
     ----------------------------------------------------------- */
  --r-0: 0px;
  --r-1: 2px;      /* default chip / input */
  --r-2: 4px;      /* cards */
  --r-pill: 999px; /* for live-status dots only */

  /* -----------------------------------------------------------
     ELEVATION — crisp edges, not blurred shadows
     ----------------------------------------------------------- */
  --e-1: 0 0 0 1px var(--line-edge);
  --e-2: 0 0 0 1px var(--line-edge), 0 1px 0 0 rgba(0,0,0,0.4);
  --e-3: 0 0 0 1px var(--line-edge), 0 8px 24px -8px rgba(0,0,0,0.6);
  --e-focus: 0 0 0 1px var(--signal), 0 0 0 3px var(--signal-ghost);

  /* Grid / reticle */
  --grid-line: rgba(255,255,255,0.035);
  --grid-line-strong: rgba(255,255,255,0.08);

  /* Motion */
  --ease-signal: cubic-bezier(0.22, 0.61, 0.36, 1);   /* decisive */
  --ease-linear: linear;                               /* data readouts */
  --dur-instant: 80ms;
  --dur-fast:    140ms;
  --dur-med:     240ms;
  --dur-slow:    420ms;
}

/* =============================================================
   SEMANTIC ELEMENT STYLES
   ============================================================= */
html, body {
  background: var(--bg-void);
  color: var(--fg-primary);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  margin: 0;
}

.t-display {
  font-family: var(--font-sans);
  font-size: var(--t-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}
h1, .t-h1 {
  font-family: var(--font-sans);
  font-size: var(--t-h1);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  margin: 0;
}
h2, .t-h2 {
  font-family: var(--font-sans);
  font-size: var(--t-h2);
  font-weight: 500;
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  margin: 0;
}
h3, .t-h3 {
  font-family: var(--font-sans);
  font-size: var(--t-h3);
  font-weight: 500;
  line-height: var(--lh-snug);
  margin: 0;
}
h4, .t-h4 {
  font-family: var(--font-sans);
  font-size: var(--t-h4);
  font-weight: 500;
  line-height: var(--lh-snug);
  margin: 0;
}
p, .t-body {
  font-size: var(--t-body);
  line-height: var(--lh-normal);
  color: var(--fg-primary);
}
small, .t-small {
  font-size: var(--t-small);
  color: var(--fg-secondary);
}

/* The operator's voice: uppercase monospace labels, tick-tight. */
.t-label,
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  color: var(--fg-secondary);
}

/* Numeric telemetry — always mono, tabular */
.t-data, code, kbd, pre, samp {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--t-small);
  letter-spacing: var(--ls-mono);
}

/* Live indicator — the pulse */
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--signal);
  box-shadow: 0 0 0 0 var(--signal-trace);
  animation: t-pulse 1.6s var(--ease-linear) infinite;
}
@keyframes t-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,107,26,0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(255,107,26,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,107,26,0); }
}

/* Reticle grid background — usable on any dark surface */
.bg-grid {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Selection */
::selection {
  background: var(--signal-ghost);
  color: var(--fg-primary);
}
