/* ──────────────────────────────────────────────────────────────────────────
   GLACIS document-grade components — June 2026
   Derived from the overt.is editorial system (paper / ink / one mark),
   mapped onto the commercial brand faces. Receipts, evidence, checklists,
   and publication facts render as PAPER ARTIFACTS set into the dark chrome:
   related to overt.is, bolder in contrast, plainer in voice.

   Type mapping (overt.is → glacis.io):
     Tiempos Headline/Text → var(--display) Söhne 500 / var(--body) Domaine 400
     Colfax kicker         → var(--display) Söhne 500, caps + letterspacing
     JetBrains Mono        → var(--mono) Geist Mono 400  (JetBrains is BANNED here)

   All classes are prefixed dg- and safe to drop into any page.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  /* Paper — shared family with overt.is */
  --dg-paper:   #F6F1E5;
  --dg-paper-2: #EFE8D6;
  --dg-paper-3: #E9E0C9;
  /* Ink */
  --dg-ink:        #1C1820;
  --dg-ink-soft:   #2A2530;
  --dg-ink-mute:   rgba(28,24,32,0.62);
  --dg-ink-dim:    rgba(28,24,32,0.45);
  --dg-ink-faint:  rgba(28,24,32,0.30);
  /* The single mark — deep sienna, kin to the site brass */
  --dg-mark:      #8E6D3E;
  --dg-mark-lift: #B8935E;
  --dg-mark-deep: #6E5430;
  --dg-mark-wash: rgba(142,109,62,0.07);
  --dg-mark-line: rgba(142,109,62,0.28);
  /* Rules on paper */
  --dg-rule:        rgba(28,24,32,0.12);
  --dg-rule-strong: rgba(28,24,32,0.22);
  --dg-rule-faint:  rgba(28,24,32,0.06);
  /* Verdict colors — earth tones that sit naturally on paper */
  --dg-pass: #5F7050;
  --dg-fail: #B05A3E;
}

/* ── Paper sheet: a physical artifact set on the dark surface ───────────── */
.dg-paper {
  background: linear-gradient(180deg, var(--dg-paper) 0%, var(--dg-paper-2) 100%);
  color: var(--dg-ink);
  border-radius: 2px;
  position: relative;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.55) inset,
    0 0 0 1px rgba(28,24,32,0.18),
    0 24px 60px rgba(10,8,14,0.55),
    0 4px 14px rgba(10,8,14,0.35);
}
body.theme-light .dg-paper {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.8) inset,
    0 0 0 1px rgba(28,24,32,0.16),
    0 18px 44px rgba(54,42,27,0.16);
}
/* Top edge: the document's binding rule */
.dg-paper::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--dg-ink);
  border-radius: 2px 2px 0 0;
}

/* ── Kicker: journal eyebrow ────────────────────────────────────────────── */
.dg-kicker {
  font-family: var(--display, sans-serif);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dg-ink-mute);
}
.dg-kicker .dg-mark-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--dg-mark);
  margin-right: 9px;
  vertical-align: 1px;
}

/* ── Hairlines ──────────────────────────────────────────────────────────── */
.dg-hairline        { height: 1px; width: 100%; background: var(--dg-rule); border: 0; }
.dg-hairline-strong { height: 1px; width: 100%; background: var(--dg-rule-strong); border: 0; }
.dg-hairline-warm   { height: 1px; width: 100%; background: var(--dg-mark-line); border: 0; }

/* ── Meta card: publication facts (dt/dd rows under a 2px ink rule) ─────── */
.dg-meta-card { border-top: 2px solid var(--dg-ink); }
.dg-meta-card .dg-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  padding: 9px 0;
  border-bottom: 1px solid var(--dg-rule-faint);
}
.dg-meta-card dt {
  font-family: var(--display, sans-serif);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dg-ink-dim);
  flex-shrink: 0;
}
.dg-meta-card dd {
  font-family: var(--mono, monospace);
  font-size: 12.5px;
  color: var(--dg-ink);
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
.dg-meta-card dd.dg-mark, .dg-meta-card dd a { color: var(--dg-mark); }
.dg-meta-card dd a { text-decoration: none; border-bottom: 1px solid transparent; }
.dg-meta-card dd a:hover { border-color: var(--dg-mark-line); }

/* ── Artifact links: bordered rows with kind labels (PDF · JSON · MD) ───── */
.dg-artifacts { display: flex; flex-wrap: wrap; border: 1px solid var(--dg-rule); }
.dg-artifact {
  flex: 1 1 180px;
  padding: 16px 18px;
  border-left: 1px solid var(--dg-rule);
  position: relative;
  text-decoration: none;
  transition: background 180ms ease;
}
.dg-artifact:first-child { border-left: 0; }
.dg-artifact::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--dg-mark);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 240ms ease;
}
.dg-artifact:hover { background: var(--dg-mark-wash); }
.dg-artifact:hover::after { transform: scaleX(1); }
.dg-artifact .dg-a-kind {
  font-family: var(--mono, monospace);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dg-mark);
  display: block;
  margin-bottom: 6px;
}
.dg-artifact .dg-a-name {
  font-family: var(--display, sans-serif);
  font-weight: 500;
  font-size: 14.5px;
  color: var(--dg-ink);
  display: block;
}
.dg-artifact .dg-a-desc {
  font-family: var(--body, Georgia, serif);
  font-style: italic;
  font-size: 12.5px;
  color: var(--dg-ink-mute);
  display: block;
  margin-top: 3px;
}

/* ── Abstract block: small-caps lead + serif body ───────────────────────── */
.dg-abstract {
  border-left: 2px solid var(--dg-mark);
  padding: 4px 0 4px 18px;
  font-family: var(--body, Georgia, serif);
  font-size: 16px;
  line-height: 1.65;
  color: var(--dg-ink-soft);
}
.dg-abstract .dg-lead {
  font-family: var(--display, sans-serif);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dg-mark);
  display: block;
  margin-bottom: 8px;
}

/* ── Stamp: the inked verdict ───────────────────────────────────────────── */
.dg-stamp {
  display: inline-block;
  font-family: var(--display, sans-serif);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--dg-pass);
  border: 2px solid currentColor;
  border-radius: 2px;
  padding: 7px 14px 6px;
  transform: rotate(-2deg);
  opacity: 0.92;
}
.dg-stamp.dg-stamp-fail { color: var(--dg-fail); }

/* ── Running head: journal identifier strip for document pages ──────────── */
.dg-running-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--dg-rule);
  font-family: var(--mono, monospace);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--dg-ink-mute);
}
.dg-running-head .dg-sep { color: var(--dg-ink-faint); }

/* ── Ink button: solid, certain, certificate-grade ──────────────────────── */
.dg-btn-ink {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display, sans-serif);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 13px 26px;
  background: var(--dg-ink);
  color: var(--dg-paper) !important;
  border: 1px solid var(--dg-ink);
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: background 200ms ease, box-shadow 200ms ease;
}
.dg-btn-ink:hover, .dg-btn-ink:focus-visible {
  background: var(--dg-ink-soft);
  box-shadow: 0 6px 18px rgba(28,24,32,0.28);
  outline: none;
}
.dg-btn-ink[disabled] { opacity: 0.55; cursor: default; box-shadow: none; }

/* Ghost link on paper */
.dg-link {
  font-family: var(--display, sans-serif);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dg-mark);
  text-decoration: none;
  border-bottom: 1px solid var(--dg-mark-line);
  padding-bottom: 2px;
}
.dg-link:hover { color: var(--dg-mark-deep); border-color: currentColor; }

/* ──────────────────────────────────────────────────────────────────────────
   Cascade guard — paper on aubergine chrome (added 11 Jun 2026).
   glacis-aubergine.css paints body.aubergine p / li / dd / td / blockquote
   in bone serif (and theme-light repeats the repaint with !important), and
   every <a> in cyan. Inside a .dg-paper artifact those rules invert
   contrast: bone on cream. Re-assert ink and the mark at strictly higher
   specificity, with !important where the chrome already uses it.
   ────────────────────────────────────────────────────────────────────────── */
html body.aubergine .dg-paper :is(p, li, dd, td, blockquote) {
  color: var(--dg-ink) !important;
}
html body.aubergine .dg-paper a:not(.dg-btn-ink) {
  color: var(--dg-mark) !important;
}
html body.aubergine .dg-paper a:not(.dg-btn-ink):hover {
  color: var(--dg-mark-deep) !important;
  border-bottom-color: var(--dg-mark-line) !important;
}
/* The ink button keeps paper-colored text under every chrome */
html body.aubergine .dg-paper .dg-btn-ink,
html body.aubergine .dg-paper .dg-btn-ink:hover {
  color: var(--dg-paper) !important;
}
/* Component voices the broad ink guard above would flatten */
html body.aubergine .dg-paper .dg-kicker {
  color: var(--dg-ink-mute) !important;
  font-family: var(--display, sans-serif);
}
html body.aubergine .dg-paper .dg-abstract { color: var(--dg-ink-soft) !important; }
html body.aubergine .dg-paper .dg-a-desc { color: var(--dg-ink-mute) !important; }
html body.aubergine .dg-paper .dg-running-head { color: var(--dg-ink-mute) !important; }
html body.aubergine .dg-paper .dg-meta-card dd { font-family: var(--mono, monospace); }
html body.aubergine .dg-paper .dg-meta-card dd.dg-mark,
html body.aubergine .dg-paper .dg-meta-card dd a,
html body.aubergine .dg-paper .dg-link,
html body.aubergine .dg-paper .dg-a-kind { color: var(--dg-mark) !important; }
html body.aubergine .dg-paper .dg-stamp { color: var(--dg-pass) !important; }
html body.aubergine .dg-paper .dg-stamp.dg-stamp-fail { color: var(--dg-fail) !important; }
