/* =========================================================================
   FDT design tokens — canonical source.

   This file is the single source of truth for the --fdt-* token layer,
   consumed by every FDT web property as a Hugo Module (sites) or via
   go:embed (Go apps). Values are documented at
   design.fd1x.com. WebAwesome's wa-prefixed bridge
   mappings are deliberately NOT here — their scoping differs per site
   (see research-library's .wa-dark scoping) and they stay site-local.
   ========================================================================= */

:root,
.wa-dark {
  /* Navy surfaces (canvas → raised) */
  --fdt-navy-900: #0A1220;
  --fdt-navy-800: #0F1A2E;
  --fdt-navy-700: #16243D;
  --fdt-navy-600: #1E3050;

  /* Fog (text + light UI) */
  --fdt-fog-100: #E8EEF7;
  --fdt-fog-200: #C5D1E2;

  /* Steel (metadata + muted UI) */
  --fdt-steel-300: #8A9BB4;
  --fdt-steel-400: #5A6D8A;

  /* Electric (single accent) */
  --fdt-electric-300: #7BA9FF;
  --fdt-electric-400: #4A8DFF;
  --fdt-electric-500: #1D6EF5;
  --fdt-electric-600: #1456C7;

  /* Semantic */
  --fdt-hostile:     #E0322C;
  --fdt-hostile-400: #EE5050;
  --fdt-neutral:     #2FA85A;
  --fdt-caution:     #F2B535;

  /* Divider / border */
  --fdt-divider: #1F3352;

  /* Glow scale (xs/sm/md/lg/xl) */
  --fdt-glow-xs: 0 0   8px  2px rgb(29 110 245 / 20%);
  --fdt-glow-sm: 0 0  16px  2px rgb(29 110 245 / 30%);
  --fdt-glow-md: 0 0  32px  4px rgb(29 110 245 / 35%);
  --fdt-glow-lg: 0 0  64px  8px rgb(29 110 245 / 40%);
  --fdt-glow-xl: 0 0 128px 16px rgb(123 169 255 / 35%);

  /* Typography */
  --fdt-font-body:     'Inter', -apple-system, blinkmacsystemfont, 'Segoe UI', system-ui, sans-serif;
  --fdt-font-display:  'Inter Display', 'Inter', -apple-system, sans-serif;
  --fdt-font-wordmark: 'Barlow Condensed', 'Oswald', 'Arial Narrow', sans-serif;
  --fdt-font-mono:     'JetBrains Mono', ui-monospace, 'SF Mono', menlo, consolas, monospace;

  /* Spacing (4px base) */
  --fdt-space-1: 4px;
  --fdt-space-2: 8px;
  --fdt-space-3: 12px;
  --fdt-space-4: 16px;
  --fdt-space-5: 24px;
  --fdt-space-6: 32px;
  --fdt-space-7: 48px;
  --fdt-space-8: 64px;
  --fdt-space-9: 96px;

  /* Radii */
  --fdt-radius-sm: 2px;
  --fdt-radius-md: 4px;
  --fdt-radius-lg: 8px;

  /* Motion — tempo (design system § Motion).
     UI state change: 150–250ms · panel entrance/exit: 400–600ms · ambient signal: 1–2s. */
  --fdt-motion-fast:    150ms;   /* hover, focus ring, tab switch */
  --fdt-motion-base:    200ms;   /* signature "Acquire" — selection, commit */
  --fdt-motion-slow:    350ms;   /* signature "Panel slide" — drawer/sheet */
  --fdt-motion-panel:   500ms;   /* panel entrance/exit, modal in */
  --fdt-motion-ambient: 1200ms;  /* live pulse */
  --fdt-motion-sweep:   2000ms;  /* radar sweep, ambient signals */

  /* Motion — easing. UI motion uses fast-out gentle-settle; tactical is linear. */
  --fdt-ease-ui:     cubic-bezier(0.2, 0.8, 0.2, 1);
  --fdt-ease-linear: linear;
}
:root {
  --max-width: 72rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--fdt-navy-900);
  color: var(--fdt-fog-100);
  font-family: var(--fdt-font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--fdt-electric-400); text-decoration: none; }
a:hover, a:focus { color: var(--fdt-electric-300); text-decoration: underline; }

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: var(--fdt-navy-700);
  padding: 0.5rem 1rem;
  border-radius: var(--fdt-radius-md);
  z-index: 100;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
}

/* header */
.site-header {
  background: var(--fdt-navy-800);
  border-bottom: 1px solid var(--fdt-divider);
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.site-brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  color: var(--fdt-fog-100);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.site-brand:hover, .site-brand:focus { color: var(--fdt-fog-100); text-decoration: none; }

.site-brand-mark {
  font-family: var(--fdt-font-mono);
  font-size: 0.85rem;
  background: var(--fdt-electric-400);
  color: var(--fdt-navy-900);
  padding: 0.15rem 0.45rem;
  border-radius: var(--fdt-radius-md);
  letter-spacing: 0.1em;
}

.site-brand-name {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}
.site-nav a { color: var(--fdt-steel-300); }
.site-nav a:hover, .site-nav a:focus { color: var(--fdt-fog-100); }

/* search */
.site-search {
  position: relative;
  flex: 1 1 16rem;
  max-width: 24rem;
}

.site-search-input {
  width: 100%;
  background: var(--fdt-navy-700);
  border: 1px solid var(--fdt-divider);
  border-radius: var(--fdt-radius-md);
  color: var(--fdt-fog-100);
  font-family: var(--fdt-font-body);
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  outline: none;
}
.site-search-input::placeholder { color: var(--fdt-steel-300); }
.site-search-input:focus { border-color: var(--fdt-electric-400); }

.site-search-results {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  background: var(--fdt-navy-800);
  border: 1px solid var(--fdt-divider);
  border-radius: var(--fdt-radius-md);
  box-shadow: 0 8px 24px rgb(0 0 0 / 35%);
  max-height: 24rem;
  overflow-y: auto;
  z-index: 50;
}
.site-search-results[hidden] { display: none; }

.search-results-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.search-results-list li { border-bottom: 1px solid var(--fdt-divider); }
.search-results-list li:last-child { border-bottom: none; }

.search-results-list a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.75rem;
  color: var(--fdt-fog-100);
  text-decoration: none;
}

.search-results-list a:hover, .search-results-list a:focus {
  background: var(--fdt-navy-700);
  color: var(--fdt-fog-100);
  text-decoration: none;
  outline: none;
}

.search-result-kind {
  font-family: var(--fdt-font-mono);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--fdt-steel-300);
}
.search-result-title { font-size: 0.95rem; }

.search-empty, .search-error {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--fdt-steel-300);
}
.search-empty strong { color: var(--fdt-fog-100); }

/* page */
.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* hero */
.hero { margin-bottom: 3rem; }

.hero-eyebrow {
  font-family: var(--fdt-font-mono);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--fdt-steel-300);
  margin: 0 0 0.5rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.hero-lede {
  font-size: 1.15rem;
  color: var(--fdt-steel-300);
  max-width: 48rem;
  margin: 0;
}

/* section grid */
.sections-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.75rem;
}

.sections-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--fdt-navy-700);
  border: 1px solid var(--fdt-divider);
  border-radius: var(--fdt-radius-md);
  padding: 1rem 1.25rem;
  color: var(--fdt-fog-100);
}

.sections-list a:hover, .sections-list a:focus {
  border-color: var(--fdt-electric-400);
  color: var(--fdt-fog-100);
  text-decoration: none;
}
.section-card-title { font-weight: 500; }

.section-card-count {
  margin-left: auto;
  margin-right: 0.75rem;
  font-family: var(--fdt-font-mono);
  font-size: 0.8rem;
  color: var(--fdt-steel-300);
}

.section-card-arrow { color: var(--fdt-electric-400); font-size: 1.1rem; }

/* record list (section landing) */
.section-header { margin-bottom: 2rem; }
.section-header h1 { margin: 0; font-size: 2.4rem; letter-spacing: -0.01em; }

.record-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 0.6rem;
}

.record-list a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--fdt-navy-700);
  border: 1px solid var(--fdt-divider);
  border-radius: var(--fdt-radius-md);
  padding: 0.85rem 1rem;
  color: var(--fdt-fog-100);
}

.record-list a:hover, .record-list a:focus {
  border-color: var(--fdt-electric-400);
  text-decoration: none;
}
.record-list-title { font-weight: 500; }
.record-list-summary { color: var(--fdt-steel-300); font-size: 0.875rem; }

.sections-grid + .sections-grid { margin-top: 2.5rem; }


.sections-group-title {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fdt-steel-300);
  font-weight: 600;
  margin: 0 0 1rem;
}
.section-empty { color: var(--fdt-steel-300); }

/* record (single) */
.record-header { margin-bottom: 2rem; }

.record-kind {
  font-family: var(--fdt-font-mono);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--fdt-steel-300);
  margin: 0 0 0.5rem;
}
.record-header h1 { margin: 0; font-size: 2.2rem; letter-spacing: -0.01em; }

.record-section { margin-top: 2rem; }

.record-section h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fdt-steel-300);
  font-weight: 600;
  border-bottom: 1px solid var(--fdt-divider);
  padding-bottom: 0.25rem;
  margin: 0 0 1rem;
}

/* facts grid (dl) */
.record-facts {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.5rem;
}

.record-facts dt {
  font-family: var(--fdt-font-mono);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--fdt-steel-300);
  margin: 0;
  align-self: baseline;
}

.record-facts dd {
  margin: 0;
}
/* references */
.record-references {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.record-references li::before {
  content: "→ ";
  color: var(--fdt-steel-300);
}

/* body */
.record-body { line-height: 1.7; }
.record-body h2 { margin-top: 2rem; }
.record-body code { font-family: var(--fdt-font-mono); font-size: 0.9em; background: var(--fdt-navy-700); padding: 0.1rem 0.3rem; border-radius: var(--fdt-radius-md); }

/* footer */
.site-footer {
  background: var(--fdt-navy-800);
  border-top: 1px solid var(--fdt-divider);
  margin-top: 4rem;
}

.site-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  font-size: 0.85rem;
  color: var(--fdt-steel-300);
}

.site-footer-brand {
  font-weight: 600;
  color: var(--fdt-fog-100);
  margin: 0 0 0.5rem;
}

.site-footer-links {
  margin: 0 0 1.5rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.site-footer-disclaimer {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  line-height: 1.5;
}

.site-footer-copyright {
  margin: 0;
  font-size: 0.75rem;
}

@media (max-width: 640px) {
  .site-header-inner { flex-direction: column; align-items: flex-start; }
  .page { padding: 2rem 1rem 3rem; }
}
