/* ================================================================
   FORGE — Defense Manufacturing Network
   Redesign: cinematic dark, editorial typography, institutional weight
   ================================================================ */

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

:root {
  /* Core palette */
  --black: #000000;
  --off-black: #0a0a0a;
  --surface: #111111;
  --surface-2: #161616;
  --surface-3: #1c1c1c;
  --hairline: rgba(255,255,255,0.08);
  --hairline-bright: rgba(255,255,255,0.16);
  --hairline-dim: rgba(255,255,255,0.04);

  /* Text.
     --text-3 was #6a6a6a (~3.6:1 on #0a0a0a) which failed WCAG AA for
     normal-weight body text. Bumped to #8a8a8a (~5.6:1) per audit fix
     a11y-003. Still distinctly subdued from --text-2 for the visual
     hierarchy. --text-4 stays as decorative-only (UI separators, never
     text). */
  --text: #f5f5f5;
  --text-2: #a0a0a0;
  --text-3: #8a8a8a;
  --text-4: #3a3a3a;

  /* Brand */
  --accent: #8bba3c;
  --accent-bright: #a8de4d;
  --accent-dim: rgba(139,186,60,0.10);
  --accent-edge: rgba(139,186,60,0.32);

  /* Status */
  --status-uncl: #8bba3c;
  --status-conf: #4d9de0;
  --status-secr: #e0a52a;
  --status-ts: #e05252;
  --urgent: #e05252;
  --priority: #e0a52a;

  /* Type */
  --sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body { background: var(--black); color: var(--text); }

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
  /* Subtle film grain */
  background:
    radial-gradient(ellipse at top, rgba(139,186,60,0.025), transparent 60%),
    var(--black);
}

/* Grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

::selection { background: var(--accent); color: var(--black); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--off-black); }
::-webkit-scrollbar-thumb { background: var(--surface-3); }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
/* Native dropdown popup options — browsers render these with OS defaults
   unless explicitly styled, which on dark Windows themes shows white-on-white. */
option { background-color: var(--off-black); color: var(--text); }
option:checked, option:hover { background-color: var(--surface-3); color: var(--text); }
option:disabled { color: var(--text-3); }

/* ================================================================
   TYPE SYSTEM
   ================================================================ */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-2);
}
.eyebrow--accent { color: var(--accent); }

.h-display {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(56px, 7.6vw, 116px);
  line-height: 0.92;
  letter-spacing: -0.045em;
}
.h-display em {
  font-style: normal;
  color: var(--accent);
}
.h-1 {
  font-weight: 800;
  font-size: clamp(40px, 4.4vw, 72px);
  line-height: 0.96;
  letter-spacing: -0.038em;
}
.h-2 {
  font-weight: 700;
  font-size: clamp(28px, 2.6vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.028em;
}
.h-3 {
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.018em;
}
.lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-2);
  font-weight: 400;
  max-width: 60ch;
  text-wrap: pretty;
}
.body { font-size: 15px; line-height: 1.6; color: var(--text-2); text-wrap: pretty; }
.mono { font-family: var(--mono); }
.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
}

/* ================================================================
   LAYOUT
   ================================================================ */
.wide { width: 100%; max-width: 1640px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px); }
.narrow { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px); }

.section { padding: clamp(64px, 8vw, 140px) 0; position: relative; }
.section--tight { padding: clamp(40px, 5vw, 72px) 0; }
.section--dark { background: var(--black); }
.section--off { background: var(--off-black); }
.section--surface { background: var(--surface); }

.hr {
  width: 100%;
  height: 1px;
  background: var(--hairline);
  border: 0;
}
.hr-labeled {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  padding: 28px 0;
}
.hr-labeled::before, .hr-labeled::after {
  content: "";
  height: 1px;
  background: var(--hairline);
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.18s ease;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.btn--primary {
  background: var(--accent);
  color: var(--black);
}
.btn--primary:hover { background: var(--accent-bright); transform: translateY(-1px); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--hairline-bright);
}
.btn--ghost:hover { border-color: var(--text); background: rgba(255,255,255,0.04); }

.btn--minimal {
  background: transparent;
  color: var(--text-2);
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline-bright);
  border-radius: 0;
}
.btn--minimal:hover { color: var(--accent); border-color: var(--accent); }

.btn--sm { padding: 10px 16px; font-size: 11px; }
.btn--lg { padding: 18px 30px; font-size: 14px; }
.btn--block { width: 100%; }

/* CHUNK 9 — promoted btn--danger from latent (used by admin/vetting,
   admin/agency-vetting, admin/errors, agency/order-detail) to defined. */
.btn--danger {
  background: transparent;
  color: #e05252;
  border-color: rgba(224,82,82,0.35);
}
.btn--danger:hover { background: rgba(224,82,82,0.08); border-color: #e05252; }

/* ================================================================
   NAV
   ================================================================ */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 48px);
  height: 72px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.topnav--scrolled {
  background: rgba(0,0,0,0.92);
  border-bottom-color: var(--hairline);
}
.topnav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.topnav__mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--black);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.04em;
  border-radius: 2px;
}
/* When the brand mark is an <img> (logo image) instead of the FG text block,
   drop the green background and just render the image. */
.topnav__mark--img {
  background: transparent;
  border-radius: 0;
  object-fit: contain;
  display: block;
}
.topnav__word {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.14em;
  padding-right: 0.14em;
}
.topnav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.topnav__link {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s ease;
  letter-spacing: 0.02em;
}
.topnav__link:hover { color: var(--text); }
.topnav__link--active { color: var(--text); }
.topnav__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ── Hamburger nav ── */
.nav-toggle {
  position: absolute;
  width: 0; height: 0;
  opacity: 0;
  pointer-events: none;
}
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 6px 2px;
  background: none;
  border: none;
  flex-shrink: 0;
  margin-left: 8px;
}
.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}

/* ================================================================
   CHIPS / BADGES
   ================================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 2px;
  border: 1px solid;
  white-space: nowrap;
  line-height: 1.4;
}
.chip--uncl { color: var(--status-uncl); border-color: rgba(139,186,60,0.4); background: rgba(139,186,60,0.08); }
.chip--conf { color: var(--status-conf); border-color: rgba(77,157,224,0.4); background: rgba(77,157,224,0.08); }
.chip--secr { color: var(--status-secr); border-color: rgba(224,165,42,0.4); background: rgba(224,165,42,0.08); }
.chip--ts   { color: var(--status-ts);   border-color: rgba(224,82,82,0.4);  background: rgba(224,82,82,0.08); }
.chip--neutral { color: var(--text-2); border-color: var(--hairline-bright); background: var(--off-black); }
.chip--urgent { color: var(--urgent); border-color: rgba(224,82,82,0.5); background: rgba(224,82,82,0.10); }
.chip--priority { color: var(--priority); border-color: rgba(224,165,42,0.5); background: rgba(224,165,42,0.10); }
.chip--accent { color: var(--accent); border-color: var(--accent-edge); background: var(--accent-dim); }

/* Status dot */
.dot {
  width: 7px; height: 7px;
  display: inline-block;
}
.dot--accent { background: var(--accent); }
.dot--urgent { background: var(--urgent); }
.dot--priority { background: var(--priority); }
.dot--neutral { background: var(--text-3); }
.dot--pulse {
  animation: pulse 2s infinite;
  box-shadow: 0 0 0 0 currentColor;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(139,186,60,0.6); }
  70% { box-shadow: 0 0 0 8px rgba(139,186,60,0); }
  100% { box-shadow: 0 0 0 0 rgba(139,186,60,0); }
}

/* ================================================================
   FORM
   ================================================================ */
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.field__input,
.field__select,
.field__textarea {
  background: var(--off-black);
  border: 1px solid var(--hairline);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  padding: 14px 16px;
  border-radius: 2px;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}
.field__input:focus,
.field__select:focus,
.field__textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}
.field__textarea { resize: vertical; min-height: 100px; }

/* ================================================================
   TABLE
   ================================================================ */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
.tbl td {
  padding: 18px 16px;
  border-bottom: 1px solid var(--hairline-dim);
  color: var(--text);
  vertical-align: middle;
}
.tbl tbody tr {
  transition: background 0.12s;
  cursor: pointer;
}
.tbl tbody tr:hover {
  background: rgba(255,255,255,0.02);
}
.tbl td.num { font-family: var(--mono); }

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
  background: var(--black);
  border-top: 1px solid var(--hairline);
  padding: 80px 0 36px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, 1fr);
  gap: 48px;
  margin-bottom: 64px;
}
.footer__col h5 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  padding-right: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: 18px;
}
.footer__col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer__col a {
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.15s;
  cursor: pointer;
}
.footer__col a:hover { color: var(--text); }
.footer__legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  border-top: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.06em;
}

@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .topnav__links { display: none; }
  .nav-hamburger { display: flex; }
  .topnav__meta  { display: none; }

  /* Backdrop dim behind the open drawer — purely CSS, no JS.
     We render the backdrop as a ::before on the .topnav itself, only visible
     when the checkbox is checked. */
  #nav-toggle:checked ~ #mainNav::before {
    content: '';
    position: fixed;
    top: 64px; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 98;
  }

  #nav-toggle:checked ~ #mainNav .topnav__links {
    display: flex;
    position: fixed;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--black);
    border-bottom: 1px solid var(--hairline-bright);
    padding: 10px 0 22px;
    z-index: 99;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  #nav-toggle:checked ~ #mainNav .topnav__links li { width: 100%; }
  #nav-toggle:checked ~ #mainNav .topnav__link {
    display: block;
    padding: 16px 28px;
    font-size: 15px;
    font-family: var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--hairline-dim);
    transition: background 0.15s, color 0.15s;
  }
  #nav-toggle:checked ~ #mainNav .topnav__link:hover,
  #nav-toggle:checked ~ #mainNav .topnav__link--active {
    background: rgba(139,186,60,0.08);
    color: var(--accent);
  }
  #nav-toggle:checked ~ #mainNav .topnav__links li:last-child .topnav__link { border-bottom: none; }
  #nav-toggle:checked ~ #mainNav .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  #nav-toggle:checked ~ #mainNav .nav-hamburger span:nth-child(2) { opacity: 0; }
  #nav-toggle:checked ~ #mainNav .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Lock body scroll while drawer is open */
  body:has(#nav-toggle:checked) { overflow: hidden; }
}

@media (max-width: 640px) {
  .footer__legal { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 480px) {
  .footer__grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ================================================================
   UTIL
   ================================================================ */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.gap-12 { gap: 48px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.text-center { text-align: center; }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-accent { color: var(--accent); }

.fade-in {
  animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
