/* ============================================================
   NULLGRAVE — ARCHIVE
   Loaded only by the Archive template. Uses the tokens defined
   in style.css (:root), so both files must be active.
   Depth model: Business = ordered grid. Archive = the grid
   fractures the deeper you go (surface -> mid -> deep).
   ============================================================ */

/* ---- DEPTH TEXTURES (Business = ordered, Archive = fractures) ----
   .ng-tex--grid lives in style.css now (it's the Business-side texture,
   business pages don't load this file). Archive keeps the three
   fracturing textures below. ---- */
.ng-tex--circuit {
  background-color: #0A0A0B;
  background-image:
    linear-gradient(90deg, rgba(174,44,17,.35) 1px, transparent 1px),
    linear-gradient(rgba(174,44,17,.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(174,44,17,.55) 2px, transparent 2px);
  background-size: 34px 34px, 34px 34px, 68px 136px;
  background-position: 0 0, 0 0, 17px 40px;
}
.ng-tex--scan {
  background-color: #0A0A0B;
  background-image:
    repeating-linear-gradient(0deg, rgba(174,44,17,.25) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(90deg, rgba(174,44,17,.12) 0 2px, transparent 2px 18px),
    linear-gradient(180deg, rgba(174,44,17,0) 60%, rgba(174,44,17,.18) 100%);
  background-size: 100% 5px, 100% 18px, 100% 100%;
}
.ng-tex--glitch {
  /* v2: red-tinted base, thicker + sparser stripes. Reads as "red has
     taken over" without fine hatching that vibrates behind text. */
  background-color: #1A0806;
  background-image:
    repeating-linear-gradient(115deg, rgba(174,44,17,.42) 0 4px, transparent 4px 28px),
    repeating-linear-gradient(-65deg, rgba(174,44,17,.18) 0 2px, transparent 2px 40px),
    linear-gradient(200deg, rgba(174,44,17,.35), transparent 55%),
    linear-gradient(20deg, rgba(174,44,17,.4), transparent 45%);
}



/* ---- Hero gets the surface texture behind the base grid ---- */
.ng-hero--archive .ng-hero__grid-bg {
  opacity: .55;
  background-color: #0A0A0B;
}

/* ---- Depth bands ---- */
.ng-depth {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 96px 40px;
  border-top: 1px solid var(--ng-border);
}
.ng-depth--surface { background: #0A0A0B; }
.ng-depth--mid     { background: #080809; border-top-color: var(--ng-red-deep); }
.ng-depth--deep    { background: #050506; border-top-color: var(--ng-red); }

.ng-depth__tex {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 65%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 65%, transparent 100%);
}
.ng-depth--surface .ng-depth__tex { opacity: .55; }
.ng-depth--mid     .ng-depth__tex { opacity: .8; }
.ng-depth--deep    .ng-depth__tex { opacity: 1; }

.ng-depth__inner { max-width: 1180px; margin: 0 auto; }
.ng-depth__head  { max-width: 640px; margin-bottom: 48px; }

/* Gauge: how many of the three levels are "lit" */
.ng-depth__level {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--ng-font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--ng-muted);
  margin-bottom: 14px;
}
.ng-depth__gauge { display: inline-flex; gap: 4px; }
.ng-depth__gauge i {
  display: block;
  width: 22px;
  height: 6px;
  background: var(--ng-gray);
}
.ng-depth--surface .ng-depth__gauge i:nth-child(1),
.ng-depth--mid     .ng-depth__gauge i:nth-child(-n+2),
.ng-depth--deep    .ng-depth__gauge i { background: var(--ng-red); }

.ng-depth__title {
  font-family: var(--ng-font-display);
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
  letter-spacing: .02em;
  color: var(--ng-bone);
  margin-bottom: 14px;
}
.ng-depth__blurb { font-size: 16px; font-weight: 300; line-height: 1.7; color: var(--ng-muted); }

/* ---- Entries ---- */
.ng-depth__entries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2px;
  background: var(--ng-border);
  border: 1px solid var(--ng-border);
}
.ng-entry {
  background: rgba(7, 17, 29, .92);
  padding: 28px 26px;
  border-left: 3px solid var(--ng-amber-dim);
}
.ng-depth--mid  .ng-entry { border-left-color: var(--ng-red-deep); }
.ng-depth--deep .ng-entry { border-left-color: var(--ng-red); }

.ng-entry__meta {
  font-family: var(--ng-font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ng-muted);
  margin-bottom: 10px;
}
.ng-entry__title {
  font-family: var(--ng-font-display);
  font-size: 26px;
  letter-spacing: .03em;
  color: var(--ng-bone);
  margin-bottom: 8px;
}
.ng-entry__body { font-size: 15px; font-weight: 300; line-height: 1.6; color: var(--ng-muted); }
.ng-entry__link {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--ng-font-mono);
  font-size: 12px;
  letter-spacing: .05em;
  color: var(--ng-amber);
  text-decoration: none;
}
.ng-entry__link:hover { color: var(--ng-bone); }
.ng-entry--empty { border-left-style: dashed; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .ng-depth { padding: 64px 20px; }
  .ng-depth__head { margin-bottom: 32px; }
  .ng-depth__entries { grid-template-columns: 1fr; }
}
@media (min-width: 1440px) {
  .ng-depth { padding: 120px 40px; }
  .ng-depth__blurb { font-size: 18px; }
}

/* ============================================================
   CHARACTER DOSSIER — single-character pages
   One template, reused per character. Swap the tier modifier
   (--surface / --mid / --deep) to match the tier a character is
   filed under on the Archive hub, and it inherits that tier's
   accent color + texture automatically.
   ============================================================ */

.ng-dossier {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 96px 40px 80px;
}
.ng-dossier--surface { background: #0A0A0B; }
.ng-dossier--mid     { background: #080809; }
.ng-dossier--deep    { background: #050506; }

.ng-dossier__tex {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
}
.ng-dossier--surface .ng-dossier__tex { opacity: .5; }
.ng-dossier--mid     .ng-dossier__tex { opacity: .75; }
.ng-dossier--deep    .ng-dossier__tex { opacity: 1; }

.ng-dossier__inner { max-width: 900px; margin: 0 auto; }

.ng-dossier__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ng-font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--ng-muted);
  text-decoration: none;
  margin-bottom: 40px;
}
.ng-dossier__back:hover { color: var(--ng-bone); }

.ng-dossier__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--ng-font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--ng-muted);
  margin-bottom: 18px;
}
.ng-dossier__eyebrow .ng-depth__gauge i { background: var(--ng-gray); }
.ng-dossier--surface .ng-dossier__eyebrow .ng-depth__gauge i:nth-child(1),
.ng-dossier--mid     .ng-dossier__eyebrow .ng-depth__gauge i:nth-child(-n+2),
.ng-dossier--deep    .ng-dossier__eyebrow .ng-depth__gauge i { background: var(--ng-red); }

.ng-dossier__name-jp {
  display: block;
  font-family: var(--ng-font-mono);
  font-size: 13px;
  letter-spacing: .18em;
  color: var(--ng-muted);
  margin-bottom: 10px;
}
.ng-dossier__name-en {
  font-family: var(--ng-font-display);
  font-size: clamp(44px, 6vw, 78px);
  line-height: .96;
  letter-spacing: .02em;
  color: var(--ng-bone);
  margin-bottom: 16px;
}
.ng-dossier--surface .ng-dossier__name-en { text-shadow: 0 0 26px rgba(219,153,65,.18); }
.ng-dossier--mid     .ng-dossier__name-en { text-shadow: 0 0 26px rgba(174,44,17,.22); }
.ng-dossier--deep    .ng-dossier__name-en { text-shadow: 0 0 34px rgba(174,44,17,.4); }

.ng-dossier__tagline {
  font-size: 17px;
  font-weight: 300;
  color: var(--ng-muted);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 40px;
}

/* Classification field grid */
.ng-dossier__fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--ng-border);
  border: 1px solid var(--ng-border);
  margin-bottom: 48px;
}
.ng-dossier__field { background: rgba(7,17,29,.6); padding: 18px 20px; }
.ng-dossier--surface .ng-dossier__field { border-bottom: 2px solid var(--ng-amber-dim); }
.ng-dossier--mid     .ng-dossier__field { border-bottom: 2px solid var(--ng-red-deep); }
.ng-dossier--deep    .ng-dossier__field { border-bottom: 2px solid var(--ng-red); }
.ng-dossier__field-key {
  font-family: var(--ng-font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--ng-muted);
  margin-bottom: 6px;
}
.ng-dossier__field-val {
  font-family: var(--ng-font-mono);
  font-size: 13px;
  letter-spacing: .03em;
  color: var(--ng-bone);
}

.ng-dossier__body {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.85;
  color: var(--ng-bone);
  opacity: .88;
  max-width: 680px;
  margin-bottom: 36px;
}
.ng-dossier__body + .ng-dossier__body { margin-top: -20px; }

.ng-dossier__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ng-dossier__tag {
  font-family: var(--ng-font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--ng-muted);
  border: 1px solid var(--ng-border);
  padding: 6px 12px;
}

@media (max-width: 768px) {
  .ng-dossier { padding: 64px 20px 56px; }
  .ng-dossier__fields { grid-template-columns: 1fr; }
}
@media (min-width: 1440px) {
  .ng-dossier { padding: 130px 40px 100px; }
  .ng-dossier__tagline, .ng-dossier__body { font-size: 18px; }
}

/* ============================================================
   FILE 00 / FILE 001 — anomalous numbering
   Archive Zero (00) and Null (001) both break the normal
   three-digit sequence on purpose. This styling marks a file
   number as irregular without saying why.
   ============================================================ */
.ng-dossier__eyebrow--anomaly .ng-dossier__filenum {
  display: inline-block;
  color: var(--ng-red);
  text-shadow: 1px 0 0 var(--ng-amber), -1px 0 0 rgba(174,44,17,.6);
  letter-spacing: .12em;
}

/* ============================================================
   VOID TEXTURE — File 001 / Null
   Deliberately the sparsest texture in the set. Most of the
   circuit grid is simply missing — broken/incomplete rather
   than dense, to read as "reserved, not filled" rather than
   "corrupted like Deep tier."
   ============================================================ */
.ng-tex--void {
  background-color: #0A0A0B;
  background-image:
    linear-gradient(90deg, rgba(219,153,65,.10) 1px, transparent 1px),
    linear-gradient(rgba(219,153,65,.06) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px;
  background-position: 0 0, 40px 60px;
}

/* ============================================================
   HIDDEN TEXT — the NULL / GRAVE split
   Text colored to match its own background: invisible at rest,
   revealed only by the browser's native text-selection highlight.
   Real content in the markup (copy/paste, view-source, screen
   readers all see it) — nothing is faked or decorative-only.
   Pick the modifier matching the section's background color.
   ============================================================ */
.ng-hidden {
  user-select: text;
  cursor: text;
}
.ng-hidden::selection { color: var(--ng-bone); background: var(--ng-red); }
.ng-hidden--void    { color: #0A0A0B; }   /* matches .ng-tex--void / .ng-dossier--surface bg */
.ng-hidden--surface { color: #0A0A0B; }
.ng-hidden--mid     { color: #080809; }
.ng-hidden--deep     { color: #0A0506; }   /* matches .ng-dossier--deep panel/field bg */

/* A dossier field whose value is deliberately blank-looking —
   the real value ("NULL", "GRAVE", etc.) is present but hidden
   via .ng-hidden. Mirrors how null fields render blank in real
   databases/spreadsheets rather than showing the word "null". */
.ng-dossier__field-val--blank {
  min-height: 1em;
}

/* ============================================================
   RECORD BLOCK — cold, procedural, system-dump styling.
   Used instead of .ng-dossier__fields where the content should
   read like an actual raw record rather than a narrative
   classification summary (currently: Null / File 001 only).
   Deliberately boring — no color accents, no tier tinting.
   ============================================================ */
.ng-dossier__record {
  font-family: var(--ng-font-mono);
  font-size: 13px;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--ng-border);
  padding: 22px 26px;
  margin-bottom: 44px;
}
.ng-dossier__record-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 7px 0;
  border-bottom: 1px dotted var(--ng-border);
}
.ng-dossier__record-row:last-child { border-bottom: none; }
.ng-dossier__record-key {
  color: var(--ng-muted);
  letter-spacing: .05em;
  white-space: nowrap;
}
.ng-dossier__record-val {
  color: var(--ng-bone);
  text-align: right;
  letter-spacing: .02em;
}

/* ============================================================
   INTRUSION — the closing JP line on Null's page. Deliberately
   unlabeled, no tagline styling, set apart by whitespace and a
   single faint rule, so it reads as something inserted into an
   otherwise sterile record rather than a character catchphrase.
   ============================================================ */
.ng-dossier__intrusion {
  margin-top: 88px;
  padding-top: 32px;
  border-top: 1px solid var(--ng-border);
  max-width: 460px;
}
.ng-dossier__intrusion-jp {
  display: block;
  font-family: var(--ng-font-mono);
  font-size: 15px;
  letter-spacing: .08em;
  color: var(--ng-bone);
  opacity: .75;
  margin-bottom: 10px;
}
.ng-dossier__intrusion-en {
  font-size: 13px;
  font-weight: 300;
  color: var(--ng-muted);
}

/* ============================================================
   V2 PASS — READABILITY + GRID FIX
   1. Empty grid tracks no longer show the container background
      (the "blank slate block" bug). Gaps now come from per-item
      borders on a transparent container.
   2. Small text is larger and uses a lighter, warmer gray instead
      of the blue-slate --ng-muted.
   3. Deep tier: red environment, but all reading content sits on
      a solid "containment panel" with a hazard-stripe edge.
   ============================================================ */

:root {
  --ng-arc-label: #C4C1B6;   /* small labels / meta (warm gray, ~9:1 on navy) */
  --ng-arc-soft:  #D3D2CA;   /* secondary body copy */
  --ng-deep-panel: #0A0506;  /* solid reading surface for Deep tier */
}

/* ---- 1. Grid bug fix ---- */
.ng-depth__entries {
  background: transparent;
  border: 0;
  gap: 14px;
}
.ng-entry { border: 1px solid var(--ng-border); border-left-width: 3px; }
.ng-depth--surface .ng-entry { border-left-color: var(--ng-amber-dim); }
.ng-depth--mid  .ng-entry    { border-left-color: var(--ng-red-deep); }
.ng-depth--deep .ng-entry    { border-left-color: var(--ng-red); }
.ng-entry--empty { border-left-style: dashed; }

.ng-dossier__fields {
  background: transparent;
  border: 0;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.ng-dossier__field { border: 1px solid var(--ng-border); }

/* ---- 2. Small text: bigger + lighter (all tiers) ---- */
.ng-depth__level,
.ng-dossier__eyebrow   { font-size: 13.5px; color: var(--ng-arc-label); }
.ng-depth__blurb       { font-size: 17px; color: var(--ng-arc-soft); }
.ng-entry__meta        { font-size: 12.5px; color: var(--ng-arc-label); letter-spacing: .07em; }
.ng-entry__body        { font-size: 16px; color: var(--ng-arc-soft); }
.ng-entry__link        { font-size: 13.5px; }
.ng-dossier__back      { font-size: 13px; color: var(--ng-arc-label); }
.ng-dossier__name-jp   { font-size: 14px; color: var(--ng-arc-label); }
.ng-dossier__tagline   { font-size: 18px; color: var(--ng-arc-soft); }
.ng-dossier__field-key { font-size: 12px; color: var(--ng-arc-label); letter-spacing: .09em; }
.ng-dossier__field-val { font-size: 15px; }
.ng-dossier__body      { font-size: 17px; opacity: .92; }
.ng-dossier__tag       { font-size: 12.5px; color: var(--ng-arc-label); }
.ng-dossier__record    { font-size: 14.5px; }
.ng-dossier__record-key { color: var(--ng-arc-label); }
.ng-dossier__intrusion-en { font-size: 15px; color: var(--ng-arc-soft); }

@media (min-width: 1440px) {
  .ng-depth__blurb { font-size: 19px; }
  .ng-dossier__tagline, .ng-dossier__body { font-size: 19px; }
}

/* ---- 3. DEEP: containment panel ---- */
.ng-depth--deep .ng-depth__inner,
.ng-dossier--deep .ng-dossier__inner {
  position: relative;
  background: var(--ng-deep-panel);
  border: 1px solid var(--ng-red);
  box-shadow: 0 0 60px rgba(174,44,17,.25);
  padding: 56px 48px 48px;
}
.ng-dossier--deep .ng-dossier__inner { max-width: 940px; }

/* Hazard-stripe top edge */
.ng-depth--deep .ng-depth__inner::before,
.ng-dossier--deep .ng-dossier__inner::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 10px;
  background: repeating-linear-gradient(-45deg, var(--ng-red) 0 12px, var(--ng-deep-panel) 12px 24px);
}

/* Deep cards/fields share the panel color so hidden text (GRAVE) truly matches */
.ng-depth--deep .ng-entry,
.ng-dossier--deep .ng-dossier__field { background: var(--ng-deep-panel); }
.ng-dossier--deep .ng-dossier__field { border-color: rgba(174,44,17,.45); border-bottom: 2px solid var(--ng-red); }
.ng-depth--deep .ng-entry { border-color: rgba(174,44,17,.45); border-left-color: var(--ng-red); }
.ng-dossier--deep .ng-dossier__tag { border-color: rgba(174,44,17,.55); }

/* Title glitch: static chromatic split, one slow slice pulse */
.ng-dossier--deep .ng-dossier__name-en {
  text-shadow: -2px 0 rgba(174,44,17,.85), 2px 0 rgba(219,153,65,.45);
  animation: ng-glitch-title 7s steps(1) infinite;
}
@keyframes ng-glitch-title {
  0%, 92%, 100% { transform: none; text-shadow: -2px 0 rgba(174,44,17,.85), 2px 0 rgba(219,153,65,.45); }
  93% { transform: translateX(-4px); text-shadow: -6px 0 rgba(174,44,17,.9), 6px 0 rgba(219,153,65,.5); }
  95% { transform: translateX(3px); }
  97% { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ng-dossier--deep .ng-dossier__name-en { animation: none; }
}

@media (max-width: 768px) {
  .ng-depth--deep .ng-depth__inner,
  .ng-dossier--deep .ng-dossier__inner { padding: 44px 22px 32px; }
  .ng-dossier__fields { grid-template-columns: 1fr; }
}


/* ============================================================
   PORTRAIT MODULE (dossier infobox) + ARCHIVE SERIES (merch)
   Portrait floats right beside the body copy on desktop, stacks
   above it on mobile. The caption is a canon device (keep it a
   fragment). The link under it goes to that file's merch card.
   To use real art: replace the .ng-dossier__portrait-ph div with
   <img src="..." alt="...">  (4:5 crop works best).
   ============================================================ */
.ng-dossier__portrait { float: right; width: 280px; margin: 0 0 24px 36px; }
.ng-dossier__portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #07111D;
  border: 1px solid var(--ng-border);
}
.ng-dossier--surface .ng-dossier__portrait-frame { border-bottom: 2px solid var(--ng-amber-dim); }
.ng-dossier--mid     .ng-dossier__portrait-frame { border-bottom: 2px solid var(--ng-red-deep); }
.ng-dossier--deep    .ng-dossier__portrait-frame { background: var(--ng-deep-panel); border-color: rgba(174,44,17,.55); border-bottom: 2px solid var(--ng-red); }
.ng-dossier__portrait-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ng-dossier__portrait-ph {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--ng-font-mono);
  font-size: 12.5px; letter-spacing: .12em;
  color: var(--ng-arc-label);
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(196,193,182,.14) 50%, transparent calc(50% + .5px)),
    linear-gradient(transparent calc(50% - .5px), rgba(196,193,182,.14) 50%, transparent calc(50% + .5px));
}
.ng-dossier__portrait-caption {
  padding-top: 10px;
  font-family: var(--ng-font-mono);
  font-size: 12.5px; line-height: 1.6; letter-spacing: .04em;
  color: var(--ng-arc-label);
}
.ng-dossier__portrait-link {
  display: inline-block; margin-top: 8px;
  font-family: var(--ng-font-mono);
  font-size: 13.5px; letter-spacing: .05em;
  color: var(--ng-amber); text-decoration: none;
}
.ng-dossier__portrait-link:hover { color: var(--ng-bone); }
.ng-dossier__tags { clear: both; }

@media (max-width: 768px) {
  .ng-dossier__portrait { float: none; width: 100%; max-width: 340px; margin: 0 0 32px; }
}

/* ---- Archive Series section on the merch page ---- */
.ng-merch-series {
  background: #0A0A0B;
  border-top: 1px solid var(--ng-red-deep);
}
.ng-merch-card__filelink {
  display: inline-block; margin: 2px 0 14px;
  font-family: var(--ng-font-mono);
  font-size: 13px; letter-spacing: .05em;
  color: var(--ng-amber); text-decoration: none;
}
.ng-merch-card__filelink:hover { color: var(--ng-bone); }