/* ============================================================
   MyTCRPlus — INSTRUMENT-DARK DESIGN SYSTEM
   Surface: dark instrument panel. Live constellation field behind
   type, green-black radial wash, hairline plates, lime accent.
   One accent (#76B900). Canvas #070807. No white page body.
   Elevation = plate + 1px line, never a drop shadow.

   NOTE: this file loads AFTER tailwind.css and redefines the
   color utilities used by the templates (bg-white, bg-black,
   text-neutral, border-black, and related classes) to dark
   instrument values. Layout utilities (grid, flex, spacing)
   remain from Tailwind.
   ============================================================ */

:root {
  --accent: #76B900;
  --accent-hover: #8AD400;
  --accent-press: #5A8D00;
  --on-accent: #0A0A0A;

  --canvas: #070807;
  --canvas-mid: #0C0E0C;
  --plate: #111311;
  --recess: #0B0D0B;
  --plate-hover: #1C1F1C;

  --line: #262A26;
  --line-strong: #3A403A;
  --line-faint: #181B18;

  --ink: #F2F4F0;
  --ink-2: #C8CBC8;
  --mute: #8B908B;
  --mute-dim: #6A6E6A;
  --faint: #4C514C;

  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
}

* { -webkit-tap-highlight-color: transparent; }
*, ::before, ::after { border-color: var(--line); }

html { scroll-behavior: smooth; }

html, body {
  background: var(--canvas);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body { overflow-x: hidden; }

.mono { font-family: var(--mono); }

/* ---------- stacking: content above the live field ---------- */

body > header, body > nav, main#main, footer {
  position: relative;
  z-index: 1;
}

#id-net {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

.id-wash {
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 8% -10%, rgba(118,185,0,.20), transparent 52%),
    radial-gradient(ellipse 50% 42% at 82% 6%, rgba(118,185,0,.07), transparent 50%),
    linear-gradient(180deg, rgba(7,8,7,.10) 0%, rgba(7,8,7,.84) 46%, #070807 72%);
}

/* ================================================================
   LEGACY COLOR-UTILITY REMAP (templates still use these classes)
   ================================================================ */

.bg-white         { background-color: var(--plate); }
.bg-black         { background-color: var(--canvas); }
.bg-neutral-100   { background-color: var(--plate); }

.text-white       { color: var(--ink); }
.text-black       { color: var(--ink); }
.text-neutral-300 { color: var(--ink-2); }
.text-neutral-400 { color: var(--mute); }
.text-neutral-500 { color: var(--mute); }
.text-neutral-600 { color: var(--mute); }
.text-neutral-700 { color: var(--ink-2); }
.text-emerald-400 { color: #4ADE80; }

.border-black       { border-color: var(--line); }
.border-neutral-700 { border-color: var(--line-strong); }

.hover\:bg-black:hover      { background-color: var(--plate-hover); }
.hover\:text-white:hover    { color: var(--ink); }
.hover\:text-\[\#FF5518\]:hover         { color: var(--accent); }
.group:hover .group-hover\:text-\[\#FF5518\] { color: var(--accent); }

::placeholder { color: var(--mute); opacity: 1; }

/* ---------- core instrument plate primitives ---------- */

.b-brutal   { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--plate); }
.b-brutal-sm{ border: 1px solid var(--line); border-radius: var(--r-md); background: var(--plate); }
.b-brutal-b { border-bottom: 1px solid var(--line); }
.b-brutal-t { border-top: 1px solid var(--line); }

/* elevation = plate + 1px line. No drop shadow. */
.hard-shadow       { box-shadow: none; }
.hard-shadow-sm    { box-shadow: none; }
.hard-shadow-accent{ box-shadow: none; }

/* hero sparse grid, faint enough to sit behind the field */
.hero-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ---------- motion (drift + fast edge/fade; no lift, no shadow) ---------- */

.marquee-track { display: flex; width: max-content; animation: nb-marquee 36s linear infinite; }
@keyframes nb-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.sticker   { transform: rotate(-1.5deg); transition: transform .16s ease; }
.sticker:hover { transform: rotate(0deg); }
.sticker-r { transform: rotate(1.5deg); }
.sticker-r:hover { transform: rotate(0deg); }

.neo-btn {
  transition: background .15s ease, color .15s ease, border-color .15s ease, filter .15s ease;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.neo-btn:hover { filter: brightness(1.08); border-color: var(--line-strong); }
.neo-btn:active { filter: brightness(.96); }

/* buttons that are accent-filled appear as black-on-accent controls */
.neo-btn[style*="#76B900"], .neo-btn[style*="#8AD400"] {
  background: var(--accent) !important;
  color: var(--on-accent) !important;
  border-color: var(--accent) !important;
}

.feature-card { transition: border-color .16s ease, background .16s ease; }
.feature-card:hover { border-color: var(--line-strong); background: var(--plate-hover); }

.scanline { position: relative; }
.scanline::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 4px, rgba(118,185,0,.035) 4px, rgba(118,185,0,.035) 6px);
}

.terminal {
  font-family: var(--mono);
  background: var(--recess);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.pulse-dot { background: var(--accent); animation: nb-pulse 2.4s ease-out infinite; }
@keyframes nb-pulse {
  0% { box-shadow: 0 0 0 0 rgba(118,185,0,.5); }
  70% { box-shadow: 0 0 0 9px rgba(118,185,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(118,185,0,0); }
}

/* ---------- article content (scraped, untruncated) ---------- */

.content-brutal { font-size: 1.125rem; line-height: 1.75; color: var(--ink-2); }

.content-brutal > h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 650; letter-spacing: -0.02em; line-height: 1.1;
  color: var(--ink);
  margin: 3.5rem 0 1.25rem;
  padding-left: 1rem; border-left: 2px solid var(--accent);
}
.content-brutal > h3 {
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  font-weight: 650; letter-spacing: -0.015em; color: var(--ink);
  margin: 2.5rem 0 1rem;
  padding-left: .85rem; border-left: 2px solid var(--line-strong);
}
.content-brutal > h4, .content-brutal > h5, .content-brutal > h6 {
  font-size: 1.05rem; font-weight: 600; margin: 2rem 0 .75rem; color: var(--ink);
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em;
}
.content-brutal > p { margin: 0 0 1.4rem; }
.content-brutal a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.content-brutal a:hover { color: var(--accent-hover); }
.content-brutal strong { font-weight: 650; color: var(--ink); }
.content-brutal em { font-style: italic; }

.content-brutal ul, .content-brutal ol {
  margin: 0 0 1.75rem; padding: 1.15rem 1.15rem 1.15rem 2.25rem;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--plate);
}
.content-brutal ul { list-style: none; }
.content-brutal ul li { position: relative; margin-bottom: .6rem; padding-left: 1.4rem; }
.content-brutal ul li::before {
  content: ''; position: absolute; left: 0; top: .55em;
  width: .55em; height: .55em; background: var(--accent); border-radius: 2px;
}
.content-brutal ol { list-style: decimal; }
.content-brutal ol li { margin-bottom: .6rem; padding-left: .4rem; }
.content-brutal ol li::marker { font-family: var(--mono); font-weight: 600; color: var(--accent); }

.content-brutal blockquote {
  margin: 2rem 0; padding: 1.5rem 1.75rem;
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-md);
  background: var(--plate);
  font-size: 1.25rem; font-weight: 550; line-height: 1.5; color: var(--ink);
}

.content-brutal pre {
  margin: 2rem 0; padding: 1.5rem; overflow-x: auto;
  background: var(--recess); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: var(--r-md);
  font-family: var(--mono); font-size: .92rem;
}

.content-brutal img {
  display: block; max-width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  margin: 2.5rem auto;
}
.content-brutal figure { margin: 2.5rem 0; }
.content-brutal figcaption { font-family: var(--mono); font-size: .8rem; text-align: center; margin-top: .75rem; color: var(--mute); }

.table-brutal { width: 100%; border-collapse: collapse; margin: 2rem 0; font-size: .98rem; }
.table-brutal th, .table-brutal td { border: 1px solid var(--line); padding: .8rem 1rem; text-align: left; vertical-align: top; }
.table-brutal thead th, .table-brutal tr:first-child th {
  background: var(--plate); color: var(--ink);
  font-family: var(--mono); text-transform: uppercase; font-size: .76rem; letter-spacing: .08em;
}
.table-brutal tr:nth-child(even) td { background: rgba(255,255,255,0.016); }

/* ---------- nav — sticky translucent instrument bar ---------- */

nav[aria-label="Primary"] {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,11,10,.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav-mega { display: none; isolation: isolate; }
.nav-mega.open { display: block; }
@media (min-width: 1024px) {
  .nav-item { position: static !important; }
  .nav-item:hover .nav-mega { display: block; }
  .nav-mega {
    position: absolute;
    left: 0; right: 0; top: 100%;
    z-index: 60;
    max-width: 760px; min-width: 560px;
    margin: 0 auto;
    background: var(--canvas-mid);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: none;
  }
}

/* accent 2px underline on active nav link */
.nav-link, .links a { position: relative; }
.nav-link::after {
  content: ''; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0;
  background: var(--accent); transition: width .15s ease;
}
.nav-link:hover::after, .nav-link.on::after { width: 100%; }

/* compact nav search + landmark submit controls */
.nav-search {
  background: var(--recess);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  color: var(--mute);
}
.kbd {
  font-family: var(--mono); font-size: 11px; color: var(--mute-dim);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px;
}
.sq-submit {
  background: var(--accent); color: var(--on-accent);
  border: 0; border-radius: 8px;
  cursor: pointer; display: grid; place-items: center;
}
.sq-submit:hover { background: var(--accent-hover); }

/* top utility strip + accent hover links */
.top-strip {
  position: relative; z-index: 1;
  background: var(--canvas-mid);
  color: var(--mute);
  border-bottom: 1px solid var(--line);
}
.link-acc { transition: color .15s ease; }
.link-acc:hover { color: var(--accent); }

/* accent numeral / label rhythm used across stats plates */
.eyebrow { font-family: var(--mono); color: var(--mute); letter-spacing: .08em; }
.accent { color: var(--accent); }

/* ---------- misc ---------- */

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.toc-box {
  background: var(--plate); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.toc-box a { display: block; padding: .35rem 0; color: var(--ink-2); transition: color .12s ease, transform .12s ease; }
.toc-box a:hover { color: var(--accent); transform: translateX(4px); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: .75rem 1.25rem; border-radius: 0 0 var(--r-md) 0;
  font-family: var(--mono);
}
.skip-link:focus { left: 0; }

/* ================================================================
   SURFACE COMPONENTS — catalog / cards / rows / detail rails
   ================================================================ */

.chip {
  display: inline-flex; align-items: center; height: 21px; padding: 0 8px;
  border-radius: 6px; font-size: 11px; font-weight: 600; letter-spacing: .02em;
  white-space: nowrap; font-family: var(--mono);
}
.chip-live   { background: rgba(118,185,0,.15);  color: var(--accent); border: 1px solid rgba(118,185,0,.4); }
.chip-pack   { background: rgba(59,107,255,.14); color: #7d9cff;       border: 1px solid rgba(59,107,255,.4); }
.chip-fam    { background: rgba(26,163,163,.14); color: #37c4c4;       border: 1px solid rgba(26,163,163,.4); }
.chip-warn   { background: rgba(232,184,0,.14);  color: #e8b800;       border: 1px solid rgba(232,184,0,.4); }
.chip-danger { background: rgba(229,32,32,.14);  color: #ff6b6b;       border: 1px solid rgba(229,32,32,.4); }
.chip-outline{ background: transparent; color: var(--ink-2);           border: 1px solid var(--line-strong); }

.catalog { display: grid; grid-template-columns: 272px 1fr; gap: 40px; align-items: start; }
.rail { background: var(--plate); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; position: sticky; top: 96px; }
.rail-group { padding: 14px 0; border-bottom: 1px solid var(--line); }
.rail-group:first-child { padding-top: 0; }
.rail-group:last-child { border-bottom: 0; }
.rail-group .label, .filters .label {
  display: block; margin-bottom: 10px; font-family: var(--mono); font-size: 11px;
  font-weight: 600; color: var(--mute); letter-spacing: .08em; text-transform: uppercase;
}
.facet { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.facet:hover { color: var(--ink); }
.facet input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.facet .meta { margin-left: auto; font-size: 12px; color: var(--mute); }

.toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.refine { display: flex; flex: 1; max-width: 360px; height: 36px; background: var(--recess); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.refine:focus-within { border-color: var(--accent); }
.refine input { flex: 1; background: transparent; border: none; outline: none; color: var(--ink); padding: 0 14px; font-size: 13px; }
.refine .sq { width: 40px; background: var(--accent); border: none; color: var(--on-accent); display: flex; align-items: center; justify-content: center; }

.grid-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--plate); border: 1px solid var(--line); border-radius: 12px; padding: 18px;
  display: flex; flex-direction: column; gap: 10px; transition: border-color .14s ease; }
.card:hover { border-color: var(--line-strong); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pub { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--mute); }
.card-title { font-size: 17px; font-weight: 650; line-height: 1.3; color: var(--ink); }
.card-title a { color: inherit; }
.card-title a:hover { color: var(--accent); }
.card-desc { font-size: 14px; color: var(--ink-2); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.card-foot .meta { margin-left: auto; font-size: 12px; color: var(--mute); }

/* stacked rows: error codes, industries, reports, credits */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 16px; background: var(--plate); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 18px; transition: border-color .14s ease, background .14s ease; }
.row:hover { border-color: var(--line-strong); background: var(--plate-hover); }
.row .code { font-family: var(--mono); color: var(--accent); min-width: 64px; font-weight: 600; font-size: 14px; }
.row-name { font-size: 14px; font-weight: 650; color: var(--ink); }
.row-name a { color: inherit; }
.row-name a:hover { color: var(--accent); }
.row-sub { font-size: 12px; color: var(--mute); }
.row .meta, .row .chip { margin-left: auto; flex-shrink: 0; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }

/* credit (pricing) rows */
.credit-row { display: flex; align-items: center; gap: 16px; background: var(--plate); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.credit-row + .credit-row { margin-top: 8px; }
.credit-name { font-size: 14px; font-weight: 650; color: var(--ink); }
.credit-price { margin-left: auto; font-family: var(--mono); font-size: 14px; color: var(--ink); }

/* detail rail: metadata kv + warn */
.kv { display: grid; grid-template-columns: 110px 1fr; row-gap: 8px; font-size: 13px; }
.kv dt { color: var(--mute); }
.kv dd { color: var(--ink); }
.warn-well { background: rgba(232,184,0,.08); border: 1px solid rgba(232,184,0,.35); border-radius: 10px;
  padding: 12px 16px; font-size: 13px; color: var(--ink-2); display: flex; gap: 10px; align-items: flex-start; max-width: 720px; }

/* code hero for error detail pages */
.code-hero { font-family: var(--mono); color: var(--accent); }

@media (max-width: 1024px) {
  .catalog { grid-template-columns: 1fr; }
  .rail { position: static; }
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .grid-cards, .cols-2 { grid-template-columns: 1fr; }
}

/* reduced motion: freeze the field drift (marks remain), kill marquee */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track, .pulse-dot { animation: none !important; }
}

@media print {
  nav, footer, .no-print, #id-net, .id-wash { display: none !important; }
  .hard-shadow, .hard-shadow-sm { box-shadow: none !important; }
  html, body { background: #fff; color: #000; }
}