/* =========================================================
   includes/substrate.css
   VioLev fork of the SecureLynx Intelligence Archive theme.

   The archive lives on VioLev now (a large nod to SecureLynx, not borrowed
   chrome). VioLev's colors.css already carries --cyan verbatim plus matching
   --text-*, --bg-panel-strong, --transition-*, and --radius-*; only the four
   tokens below are missing, so they are the entire SecureLynx dependency. The
   panel shade it inherits is VioLev's faintly-violet one, so the archive picks
   up a subtle VioLev undertone beneath the SecureLynx cyan. Below the tokens:
   a self-contained hero (replaces SecureLynx services.css) and the lightbox
   service button, then the dossier wall + lightbox + loupe forked verbatim
   from SecureLynx dossiers.css.
   ========================================================= */

:root {
  --red:    #FF202D;
  --green:  #39FF14;
  --yellow: #FFEA00;
  --black:  #05070D;
}

/* ---- hero (self-contained; no SecureLynx services.css needed) ---- */
.service-hero.archive-hero { padding-bottom: clamp(28px, 4vw, 48px); }
.archive-hero .service-kicker {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--cyan);
}
.archive-hero .service-title {
  font-family: var(--display); font-weight: 600; margin-top: 6px;
  font-size: clamp(2.6rem, 7vw, 5.2rem); line-height: 0.98;
  letter-spacing: -0.03em; text-transform: uppercase; color: var(--text-primary);
}
.text-cyan { color: var(--cyan); }

.service-section.archive-section { padding-bottom: clamp(60px, 8vw, 110px); }

/* ---- lightbox service button (replaces SecureLynx .btn .btn-secondary) ---- */
.dlb-service {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 18px; font-family: var(--body); font-size: 0.82rem;
  font-weight: 700; letter-spacing: 0.04em; color: var(--cyan);
  background: rgba(0, 230, 255, 0.08); border: 1px solid rgba(0, 230, 255, 0.45);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), border-color var(--transition-fast),
              background var(--transition-fast), box-shadow var(--transition-fast);
}
.dlb-service:hover, .dlb-service:focus-visible {
  color: var(--black); background: var(--cyan); border-color: var(--cyan);
  box-shadow: var(--glow-cyan-soft); outline: none;
}

/* =========================================================
   Below: SecureLynx dossiers.css, forked verbatim.
   ========================================================= */

/* =========================================================
   substrate/dossiers/dossiers.css
   SecureLynx Intelligence Archive - the dossier wall + lightbox viewer.

   Sits on top of the corporate stack (colors/base/navigation/components +
   services.css as $cssMain). Cyan-first, classified-archive treatment to match
   the art. The card art is a light thumbnail; the full sheet loads only in the
   lightbox. Cards are real <a> links to the full image, so the gallery works
   with JavaScript off - the lightbox is pure enhancement.
   ========================================================= */

/* fixed header clearance - same scale as signal.css */
.archive-main { padding-top: 118px; }

.archive-hero { border-bottom: 1px solid rgba(0, 230, 255, 0.12); }
.archive-hero .service-kicker { margin-bottom: 14px; }
.archive-deck {
  max-width: 760px; margin-top: 22px;
  color: var(--text-secondary); font-size: clamp(1.02rem, 1.5vw, 1.24rem); line-height: 1.7;
}
.archive-legend {
  display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 28px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted);
}
.archive-legend span { display: inline-flex; align-items: center; gap: 8px; }
.archive-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.lg-guardian { background: var(--cyan); }
.lg-threat   { background: var(--red); }
.lg-clown    { background: var(--green); }

.archive-section { padding-top: clamp(40px, 5vw, 64px); }

/* ---- the wall ---- */
.archive-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 1.8vw, 24px);
}

/* ---- a dossier card (real link; tier sets its accent) ---- */
.dossier-card {
  --tier: var(--cyan); --tier-rgb: 0, 230, 255;
  position: relative; display: flex; flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--radius-md);
  background: var(--bg-panel-strong); overflow: hidden; isolation: isolate;
  transition: transform var(--transition-medium), border-color var(--transition-medium), box-shadow var(--transition-medium);
}
.tier-guardian { --tier: var(--cyan);   --tier-rgb: 0, 230, 255; }
.tier-omega    { --tier: var(--red);    --tier-rgb: 255, 32, 45; }
.tier-critical { --tier: var(--red);    --tier-rgb: 255, 32, 45; }
.tier-high     { --tier: var(--yellow); --tier-rgb: 255, 234, 0; }
.tier-medium   { --tier: #FFB020;       --tier-rgb: 255, 176, 32; }
.tier-clown    { --tier: var(--green);  --tier-rgb: 57, 255, 20; }

.dossier-card::before {   /* the clearance stripe */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; z-index: 3;
  background: var(--tier); box-shadow: 0 0 14px rgba(var(--tier-rgb), 0.6);
}
.dossier-card:hover, .dossier-card:focus-visible {
  transform: translateY(-4px); border-color: rgba(var(--tier-rgb), 0.5);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.4), 0 0 30px rgba(var(--tier-rgb), 0.22);
  outline: none;
}

.dossier-thumb { position: relative; aspect-ratio: 480 / 289; overflow: hidden; background: var(--black); }
.dossier-thumb img {
  width: 100%; height: 100%; object-fit: cover; object-position: left center;
  opacity: 0.92; transition: transform var(--transition-slow), opacity var(--transition-medium);
}
.dossier-card:hover .dossier-thumb img, .dossier-card:focus-visible .dossier-thumb img {
  transform: scale(1.04); opacity: 1;
}
.dossier-thumb::after {   /* bottom scrim so meta reads over any art */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 40%, rgba(5, 7, 13, 0.55) 72%, rgba(5, 7, 13, 0.92) 100%);
}

.dossier-meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.dossier-badge {
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--tier); background: rgba(var(--tier-rgb), 0.12);
  border: 1px solid rgba(var(--tier-rgb), 0.42); border-radius: var(--radius-sm); padding: 4px 9px;
}
.dossier-name {
  font-size: clamp(1.15rem, 1.7vw, 1.5rem); font-weight: 800; letter-spacing: -0.03em;
  text-transform: uppercase; color: var(--text-primary); line-height: 1;
}
.dossier-open {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-primary); background: rgba(5, 7, 13, 0.66); backdrop-filter: blur(6px);
  border: 1px solid rgba(var(--tier-rgb), 0.4); border-radius: var(--radius-sm); padding: 5px 9px;
  opacity: 0; transform: translateY(-4px); transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.dossier-card:hover .dossier-open, .dossier-card:focus-visible .dossier-open { opacity: 1; transform: translateY(0); }

@media (max-width: 1100px) { .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1280px) { .archive-main { padding-top: 146px; } }
@media (max-width: 680px)  { .archive-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px)  { .archive-main { padding-top: 164px; } }

/* =========================================================
   LIGHTBOX - JS enhancement. Hidden by default; .is-open shows it.
   With JS off it never appears and the card link opens the full image.
   ========================================================= */
.dossier-lightbox {
  position: fixed; inset: 0; z-index: 1000; display: none;
  align-items: center; justify-content: center; padding: clamp(14px, 3vw, 40px);
}
.dossier-lightbox.is-open { display: flex; }
body.dossier-lock { overflow: hidden; }

.dlb-backdrop {
  position: absolute; inset: 0; background: rgba(2, 4, 9, 0.86);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.dlb-panel {
  --tier: var(--cyan); --tier-rgb: 0, 230, 255;
  position: relative; z-index: 1; display: flex; flex-direction: column;
  width: min(1180px, 100%); max-height: 92vh;
  background: var(--bg-panel-strong); border: 1px solid rgba(var(--tier-rgb), 0.4);
  border-radius: var(--radius-lg); box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6), 0 0 40px rgba(var(--tier-rgb), 0.16);
  overflow: hidden; animation: dlbIn var(--transition-medium) ease;
}
@keyframes dlbIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }
.dlb-panel::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; z-index: 4;
  background: var(--tier); box-shadow: 0 0 16px rgba(var(--tier-rgb), 0.7);
}

.dlb-close {
  position: absolute; top: 12px; right: 14px; z-index: 5;
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.5rem; line-height: 1; color: var(--text-primary);
  background: rgba(5, 7, 13, 0.7); border: 1px solid rgba(var(--tier-rgb), 0.4); border-radius: var(--radius-sm);
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
.dlb-close:hover { color: var(--tier); border-color: rgba(var(--tier-rgb), 0.7); background: rgba(var(--tier-rgb), 0.08); }

.dlb-stage {
  flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--black); padding: clamp(8px, 1.4vw, 18px);
}
.dlb-img { max-width: 100%; max-height: 78vh; width: auto; height: auto; object-fit: contain; border-radius: var(--radius-sm); display: block; -webkit-user-drag: none; user-select: none; }
.dlb-stage.is-magnifying .dlb-img { cursor: crosshair; touch-action: none; }

/* magnifier toggle - top-left of the stage, mirrors the close button */
.dlb-mag-toggle {
  position: absolute; top: 12px; left: 14px; z-index: 5;
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-primary); background: rgba(5, 7, 13, 0.7);
  border: 1px solid rgba(var(--tier-rgb), 0.4); border-radius: var(--radius-sm);
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}
.dlb-mag-toggle:hover { color: var(--tier); border-color: rgba(var(--tier-rgb), 0.7); background: rgba(var(--tier-rgb), 0.08); }
.dlb-mag-toggle[aria-pressed="true"] {
  color: var(--tier); border-color: var(--tier);
  background: rgba(var(--tier-rgb), 0.14); box-shadow: 0 0 14px rgba(var(--tier-rgb), 0.4);
}

/* the lens - lives at the lightbox layer so it can spill OUTSIDE the box to read corners */
.dlb-loupe {
  --tier: var(--cyan); --tier-rgb: 0, 230, 255;
  position: fixed; z-index: 1100; width: 340px; height: 240px;
  border: 2px solid var(--tier); border-radius: var(--radius-md);
  background-repeat: no-repeat; background-color: var(--black);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 22px rgba(var(--tier-rgb), 0.32);
  pointer-events: none; opacity: 0; transition: opacity 120ms ease; overflow: hidden;
}
.dlb-loupe.is-on { opacity: 1; }

/* hint - fades once the lens is engaged */
.dlb-zoomhint {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 4;
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-secondary); background: rgba(5, 7, 13, 0.72);
  border: 1px solid rgba(0, 230, 255, 0.22); border-radius: var(--radius-sm);
  padding: 6px 12px; backdrop-filter: blur(6px); pointer-events: none;
  opacity: 0.82; transition: opacity var(--transition-fast);
}
.dlb-stage.is-magnifying .dlb-zoomhint { opacity: 0; }

@media (prefers-reduced-motion: reduce) { .dlb-loupe { transition: none; } }

.dlb-footer {
  flex: 0 0 auto; display: flex; align-items: center; gap: 16px 20px; flex-wrap: wrap;
  padding: 16px clamp(16px, 2vw, 26px); border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 7, 13, 0.7);
}
.dlb-bridge { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; flex: 1 1 320px; }
.dlb-badge {
  flex: 0 0 auto; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--tier); background: rgba(var(--tier-rgb), 0.12);
  border: 1px solid rgba(var(--tier-rgb), 0.42); border-radius: var(--radius-sm); padding: 5px 10px;
}
.dlb-line { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.5; }
.dlb-service { flex: 0 0 auto; min-height: 44px; }

.dlb-nav { flex: 0 0 auto; display: flex; gap: 8px; margin-left: auto; }
.dlb-nav button {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.4rem; line-height: 1; color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(0, 230, 255, 0.22); border-radius: var(--radius-sm);
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
.dlb-nav button:hover { color: var(--cyan); border-color: rgba(0, 230, 255, 0.5); background: rgba(0, 230, 255, 0.06); }

@media (max-width: 720px) {
  .dlb-footer { gap: 12px; }
  .dlb-bridge { flex-basis: 100%; }
  .dlb-service { width: 100%; }
  .dlb-nav { margin-left: 0; width: 100%; justify-content: space-between; }
  .dlb-nav button { flex: 1 1 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dossier-card, .dossier-thumb img, .dossier-open { transition: none; }
  .dlb-panel { animation: none; }
  .dossier-card:hover .dossier-thumb img { transform: none; }
}
