/* ============================================================
   C-IT — Design tokens
   Direction: Tech & technique — field operations console
   ============================================================ */

:root {
  /* ——— Brand ——— */
  --navy-950: #060c18;
  --navy-900: #0a1628;
  --navy-800: #0f2038;
  --navy-700: #15314f;
  --navy-600: #1c4470;
  --navy-500: #245a92;
  --navy-400: #4d82b8;
  --navy-300: #87aed4;
  --navy-200: #c0d6ea;
  --navy-100: #e3edf6;
  --navy-50:  #f3f7fb;

  /* Primary — keep heritage blue, deepened */
  --blue:      #0d4a7a;
  --blue-600:  #0a3a62;
  --blue-700:  #082c4b;

  /* Accent — electric cyan (replaces orange for tech feel) */
  --cyan-500: #00b8d4;
  --cyan-600: #0095ad;
  --cyan-400: #2dd4ff;
  --cyan-50:  #e6f9fc;

  /* Status (operations) */
  --ok:       #16a34a;
  --ok-50:    #ecfdf3;
  --warn:     #d97706;
  --warn-50:  #fef6e4;
  --crit:     #dc2626;
  --crit-50:  #fef0ef;
  --info:     #0284c7;
  --info-50:  #e8f4fb;

  /* Ink scale */
  --ink:      #07101e;
  --ink-2:    #1f2d40;
  --ink-3:    #4a5b73;
  --ink-4:    #7a8aa0;
  --ink-5:    #a6b3c4;

  /* Surfaces */
  --bg:        #f6f7f9;
  --bg-grid:   #eef0f4;
  --surface:   #ffffff;
  --surface-2: #fafbfc;
  --line:      #e2e6ed;
  --line-2:    #d4dae3;
  --line-strong: #c0c8d4;

  /* Dark surfaces */
  --dark:      var(--navy-950);
  --dark-2:    var(--navy-900);
  --dark-line: rgba(255,255,255,.08);
  --dark-line-2: rgba(255,255,255,.14);

  /* ——— Typography ——— */
  --f-sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --f-display: "Geist", "Inter", -apple-system, system-ui, sans-serif;

  /* Type scale */
  --t-mono-xs:  11px;
  --t-mono-sm:  12px;
  --t-xs:       12px;
  --t-sm:       13px;
  --t-base:     15px;
  --t-md:       16px;
  --t-lg:       18px;
  --t-xl:       21px;
  --t-2xl:      28px;
  --t-3xl:      40px;
  --t-4xl:      56px;
  --t-display:  76px;

  /* Spacing — 4px base */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 56px;
  --sp-10: 72px;
  --sp-11: 96px;
  --sp-12: 128px;

  /* Radii — tight, technical */
  --r-xs: 2px;
  --r:    4px;
  --r-md: 6px;
  --r-lg: 10px;
  --r-xl: 14px;
  --r-2xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(8,16,30,.05), 0 0 0 1px rgba(8,16,30,.04);
  --shadow:    0 4px 12px -2px rgba(8,16,30,.08), 0 0 0 1px rgba(8,16,30,.06);
  --shadow-lg: 0 24px 48px -12px rgba(8,16,30,.18), 0 0 0 1px rgba(8,16,30,.06);

  --container: 1280px;
  --gutter: 28px;
}

/* ——— Reset ——— */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--f-sans);
  font-size: var(--t-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ——— Layout ——— */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container-narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section { padding: var(--sp-12) 0; }
.section-sm { padding: var(--sp-10) 0; }
.section-tight { padding: var(--sp-8) 0; }

/* Background grid (signature) */
.grid-bg {
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
}
.grid-bg-fade {
  position: relative;
}
.grid-bg-fade::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(8,16,30,.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(8,16,30,.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 30%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 30%, black 30%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}
.grid-bg-fade > * { position: relative; z-index: 1; }

/* ——— Typography classes ——— */
.h-display {
  font-family: var(--f-display);
  font-size: clamp(48px, 6.5vw, var(--t-display));
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.h1 {
  font-size: clamp(32px, 4vw, var(--t-3xl));
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
}
.h2 {
  font-size: var(--t-2xl);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}
.h3 {
  font-size: var(--t-lg);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 0;
}
.lead {
  font-size: var(--t-lg);
  line-height: 1.55;
  color: var(--ink-3);
  max-width: 64ch;
  margin: 0;
}
.body { font-size: var(--t-base); line-height: 1.6; color: var(--ink-2); margin: 0; }
.small { font-size: var(--t-sm); color: var(--ink-3); margin: 0; }

.mono {
  font-family: var(--f-mono);
  font-feature-settings: "ss02";
}
.label-mono {
  font-family: var(--f-mono);
  font-size: var(--t-mono-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--t-mono-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan-600);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--sp-4);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--cyan-500);
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r);
  font-weight: 500;
  font-size: var(--t-sm);
  border: 1px solid transparent;
  background: transparent;
  transition: all .15s ease;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--f-sans);
}
.btn-lg { padding: 13px 22px; font-size: var(--t-base); }
.btn-sm { padding: 7px 12px; font-size: var(--t-sm); }
.btn-block { width: 100%; justify-content: center; }

.btn-primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--navy-800); transform: translateY(-1px); }

.btn-cyan {
  background: var(--cyan-500);
  color: var(--navy-950);
  border-color: var(--cyan-500);
  font-weight: 600;
}
.btn-cyan:hover { background: var(--cyan-400); }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-2);
}
.btn-ghost:hover { border-color: var(--ink); background: var(--surface); }

.btn-ghost-dark {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.2);
}
.btn-ghost-dark:hover { border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.05); }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 500;
  font-size: var(--t-sm);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 2px;
  transition: border-color .15s, color .15s;
}
.btn-link:hover { border-color: var(--cyan-500); color: var(--cyan-600); }

/* ——— Badges ——— */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: var(--t-mono-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--r-xs);
  border: 1px solid;
}
.badge-ok    { background: var(--ok-50);   color: var(--ok);   border-color: rgba(22,163,74,.18); }
.badge-warn  { background: var(--warn-50); color: var(--warn); border-color: rgba(217,119,6,.18); }
.badge-crit  { background: var(--crit-50); color: var(--crit); border-color: rgba(220,38,38,.18); }
.badge-info  { background: var(--info-50); color: var(--info); border-color: rgba(2,132,199,.18); }
.badge-cyan  { background: var(--cyan-50); color: var(--cyan-600); border-color: rgba(0,184,212,.22); }
.badge-neutral { background: var(--bg); color: var(--ink-3); border-color: var(--line); }

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px rgba(255,255,255,.6);
}
.badge-ok .dot,
.badge-warn .dot { animation: pulse 2s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* ——— Forms ——— */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-4); }
.field label {
  font-family: var(--f-mono);
  font-size: var(--t-mono-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.field .req { color: var(--crit); }
.input, .textarea, .select {
  font-family: var(--f-sans);
  font-size: var(--t-base);
  padding: 11px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(0,184,212,.2);
}
.textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
@media (max-width: 720px) { .row-2 { grid-template-columns: 1fr; } }

/* ——— Cards ——— */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

/* ——— Utility ——— */
.divider { height: 1px; background: var(--line); border: none; }
.tick-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  padding: 6px 0;
  font-size: var(--t-sm);
  color: var(--ink-2);
}
.tick-row::before {
  content: "";
  width: 18px;
  height: 18px;
  background: var(--cyan-500);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/16px no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/16px no-repeat;
  margin-top: 1px;
}

/* ——— Section header ——— */
.section-head {
  margin-bottom: var(--sp-9);
  max-width: 720px;
}
.section-head .h1 { margin-bottom: var(--sp-4); }

/* ——— Animations ——— */
.fade-up {
  animation: fadeUp .7s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
