/* ===========================================================================
   EACL Public Witness — shared surface styling
   Extends the eacl.io design system (Cormorant Garamond / Inter / gold #d4b574)
   with the components the witness surfaces need: gates, event cards, verdicts,
   the status indicator.

   DESIGN CONSTRAINT (brief §3 R2): governance states and presentation states
   must remain visually and semantically distinct. Governance states are
   rendered in a boxed, monospaced, uppercase treatment. Presentation states
   are rendered in lowercase italic serif and are never boxed. A reader must
   never mistake our label for EACL's verdict.

   DESIGN CONSTRAINT (brief §3 R4): there is no "success green" applied to an
   unresolved gate. Unresolved is the default and it looks unresolved.
   =========================================================================== */

:root {
  --bg: #0a0a0a;
  --panel: #141414;
  --panel-2: #101010;
  --line: rgba(212, 181, 116, 0.18);
  --line-strong: rgba(212, 181, 116, 0.35);
  --gold: #d4b574;
  --gold-bright: #e8c98a;
  --ink: #ffffff;
  --cream: #f0ebe0;
  --muted: #c9c2b3;
  --dim: #8a8576;
  --mono: 'JetBrains Mono', ui-monospace, 'Consolas', monospace;

  /* Governance outcome colours — used ONLY for EACL's own verdicts. */
  --allow: #3ecf8e;
  --hold: #f5b74e;
  --deny: #ff6b6b;
  /* Verification verdicts — deliberately a different family from governance. */
  --verified: #7fb3d5;
  --indeterminate: #b8a06a;
  --refuted: #d98a8a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg) !important; color-scheme: dark; }
body {
  background: var(--bg) !important;
  color: var(--ink) !important;
  font-family: 'Cormorant Garamond', Georgia, serif;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-top: 36px;            /* clears the fixed public status strip */
}
@media (max-width: 860px) { body { padding-top: 62px; } }
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(ellipse at top, rgba(212, 181, 116, 0.04), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(212, 181, 116, 0.02), transparent 50%);
  pointer-events: none; z-index: 0;
}
.container { position: relative; z-index: 1; max-width: 1000px; margin: 0 auto; padding: 0 32px; }
.container.wide { max-width: 1180px; }

/* ── Chrome ─────────────────────────────────────────────────────────────── */
.parent-tag {
  position: fixed; top: 50px; left: 32px; z-index: 50;
  font-family: 'Inter', sans-serif; font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--dim); text-decoration: none; transition: color 0.2s;
}
.parent-tag:hover { color: var(--gold); }
.parent-tag .arrow { color: var(--gold); }
@media (max-width: 860px) { .parent-tag { top: 72px; left: 18px; font-size: 10px; } }

/* ── Public status indicator (cross-cutting) ────────────────────────────── */
.status-strip {
  position: fixed; top: 0; left: 0; right: 0; z-index: 45;
  background: rgba(10, 10, 10, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 9px 32px 9px 250px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-family: 'Inter', sans-serif; font-size: 11px; letter-spacing: 0.14em;
}
@media (max-width: 860px) { .status-strip { padding: 34px 18px 9px; justify-content: center; } }
.status-strip .dot {
  width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px;
  background: var(--dim); box-shadow: 0 0 0 3px rgba(138, 133, 118, 0.14);
}
.status-strip .dot.pending { background: var(--hold); box-shadow: 0 0 0 3px rgba(245, 183, 78, 0.14); }
.status-strip .dot.live { background: var(--allow); box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.16); }
.status-strip .dot.halted { background: var(--deny); box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.16); }
.status-strip .label { color: var(--dim); text-transform: uppercase; }
.status-strip .value { color: var(--cream); text-transform: uppercase; font-weight: 500; }
.status-strip .sep { color: rgba(212, 181, 116, 0.3); }
.status-strip a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(212, 181, 116, 0.35); }

/* ── Page head ──────────────────────────────────────────────────────────── */
header.page-head { padding: 110px 32px 60px; text-align: center; border-bottom: 1px solid var(--line); }
header.page-head .eyebrow {
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500;
  letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); margin-bottom: 24px;
}
header.page-head h1 {
  font-size: clamp(38px, 6vw, 66px); font-weight: 500; letter-spacing: 0.03em;
  color: var(--ink) !important; margin-bottom: 24px; line-height: 1.12;
}
header.page-head .subtitle {
  font-size: 20px; color: var(--muted) !important; max-width: 680px;
  margin: 0 auto; line-height: 1.6; font-style: italic;
}

section.doc { padding: 72px 32px; border-bottom: 1px solid var(--line); }
section.doc:last-of-type { border-bottom: none; }
section.doc h2 {
  font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold); margin-bottom: 28px;
}
section.doc h3 {
  font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--cream);
  margin: 32px 0 14px;
}
section.doc p { font-size: 18px; line-height: 1.7; color: var(--cream) !important; margin-bottom: 18px; }
section.doc p.lead { font-size: 22px; color: var(--ink) !important; }
section.doc p.note { font-size: 16px; color: var(--muted) !important; }
section.doc a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(212, 181, 116, 0.4); }
section.doc a:hover { color: var(--gold-bright); }
section.doc ul { color: var(--cream); padding-left: 22px; margin-bottom: 18px; }
section.doc li { font-size: 17px; line-height: 1.65; margin-bottom: 8px; }

.mono { font-family: var(--mono); font-size: 13px; word-break: break-all; }

/* ── Fail-closed banner ─────────────────────────────────────────────────── */
.failclosed {
  border: 1px solid rgba(245, 183, 78, 0.4); border-left: 3px solid var(--hold);
  background: linear-gradient(90deg, rgba(245, 183, 78, 0.07), transparent);
  padding: 16px 20px; margin: 22px 0; font-size: 15.5px; color: var(--cream);
  font-family: 'Inter', sans-serif; line-height: 1.6;
}
.failclosed .tag {
  display: block; font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--hold); font-weight: 600; margin-bottom: 7px;
}

/* ── Governance state chip — boxed, mono, uppercase. EACL's vocabulary. ─── */
.gov {
  display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.12em; padding: 3px 9px; border: 1px solid currentColor;
  border-radius: 2px; text-transform: uppercase;
}
.gov.allow { color: var(--allow); }
.gov.hold { color: var(--hold); }
.gov.deny { color: var(--deny); }
.gov.ready, .gov.completed { color: var(--allow); }
.gov.delayed { color: var(--hold); }
.gov.halted, .gov.aborted { color: var(--deny); }
.gov.unresolved { color: var(--dim); border-style: dashed; }

/* ── Presentation state — lowercase italic serif, never boxed. Ours. ────── */
.pres {
  font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic;
  font-size: 15px; color: var(--dim); letter-spacing: 0.01em;
}

/* ── Gate component ─────────────────────────────────────────────────────── */
.gate {
  border: 1px solid var(--line); background: var(--panel); margin-bottom: 10px;
  transition: border-color 0.2s;
}
.gate.unresolved { border-style: dashed; border-color: rgba(212, 181, 116, 0.14); background: var(--panel-2); }
.gate:hover { border-color: var(--line-strong); }
.gate-head {
  display: grid; grid-template-columns: 54px 1fr auto; gap: 16px; align-items: center;
  padding: 16px 20px; cursor: pointer; user-select: none;
}
@media (max-width: 640px) {
  .gate-head { grid-template-columns: 40px 1fr; gap: 10px; }
  .gate-head .gate-state { grid-column: 2; justify-self: start; margin-top: 6px; }
}
.gate-seq {
  font-family: var(--mono); font-size: 12px; color: var(--dim);
  border: 1px solid var(--line); padding: 6px 0; text-align: center; letter-spacing: 0.06em;
}
.gate.unresolved .gate-seq { border-style: dashed; }
.gate-name {
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 500;
  letter-spacing: 0.04em; color: var(--cream);
}
.gate-sub { font-family: 'Inter', sans-serif; font-size: 11.5px; color: var(--dim); margin-top: 3px; letter-spacing: 0.02em; }
.gate-state { display: flex; align-items: center; gap: 10px; }
.gate-toggle { color: var(--dim); font-size: 12px; font-family: var(--mono); }
.gate-body { display: none; padding: 0 20px 20px; border-top: 1px solid var(--line); }
.gate.open .gate-body { display: block; }
.gate-body dl { display: grid; grid-template-columns: 190px 1fr; gap: 10px 20px; margin-top: 18px; font-family: 'Inter', sans-serif; font-size: 13px; }
@media (max-width: 640px) { .gate-body dl { grid-template-columns: 1fr; gap: 4px 0; } }
.gate-body dt { color: var(--dim); letter-spacing: 0.1em; text-transform: uppercase; font-size: 10.5px; padding-top: 2px; }
.gate-body dd { color: var(--cream); word-break: break-word; }
.gate-body dd.mono { font-family: var(--mono); font-size: 12px; }
.gate-body .absent { color: var(--dim); font-style: italic; }

/* ── Verdict block (verification) ───────────────────────────────────────── */
.verdict {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; margin: 20px 0;
  border: 1px solid var(--line); background: var(--panel);
  font-family: 'Inter', sans-serif; font-size: 15px; line-height: 1.6;
}
.verdict .vmark { font-family: var(--mono); font-size: 15px; flex: 0 0 auto; margin-top: 1px; }
.verdict.verified { border-color: rgba(127, 179, 213, 0.45); color: var(--verified); }
.verdict.indeterminate { border-color: rgba(184, 160, 106, 0.45); color: var(--indeterminate); }
.verdict.refuted { border-color: rgba(217, 138, 138, 0.45); color: var(--refuted); }
.verdict.idle { border-style: dashed; color: var(--dim); }
.verdict strong { display: block; letter-spacing: 0.14em; text-transform: uppercase; font-size: 12px; margin-bottom: 5px; }
.verdict .vtext { color: var(--cream); font-size: 14.5px; }

.vstep { display: grid; grid-template-columns: 22px 150px 1fr; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: start; }
.vstep:last-child { border-bottom: none; }
@media (max-width: 640px) { .vstep { grid-template-columns: 22px 1fr; } .vstep .vsname { grid-column: 2; } .vstep .vsdetail { grid-column: 1 / -1; } }
.vstep .vsmark { font-family: var(--mono); font-size: 13px; }
.vstep .vsname { font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 600; letter-spacing: 0.05em; color: var(--cream); }
.vstep .vsdetail { font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.vstep .vsremedy { display: block; margin-top: 7px; font-family: 'Inter', sans-serif; font-size: 12px; color: var(--dim); font-style: italic; }
.m-verified { color: var(--verified); }
.m-indeterminate { color: var(--indeterminate); }
.m-refuted { color: var(--refuted); }
.m-declared { color: var(--dim); }

/* ── Panels, inputs, buttons ────────────────────────────────────────────── */
.panel { background: var(--panel); border: 1px solid var(--line); padding: 26px; margin: 20px 0; }
.panel .plabel { font-family: 'Inter', sans-serif; font-size: 10px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.panel .pvalue { font-family: var(--mono); font-size: 12.5px; color: var(--cream); word-break: break-all; margin-bottom: 18px; }
.panel .pvalue:last-child { margin-bottom: 0; }

textarea, input[type=text] {
  width: 100%; background: var(--panel-2); color: var(--cream);
  border: 1px solid var(--line); padding: 12px 14px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
}
textarea { min-height: 150px; resize: vertical; }
textarea:focus, input[type=text]:focus { outline: none; border-color: var(--line-strong); }

.btn {
  display: inline-block; padding: 13px 28px; font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  background: transparent; color: var(--gold); border: 1px solid var(--gold);
  text-decoration: none; cursor: pointer; transition: all 0.25s ease;
}
.btn:hover { background: var(--gold); color: var(--bg); }
.btn.solid { background: var(--gold); color: var(--bg); }
.btn.solid:hover { background: var(--gold-bright); }
.btn.ghost { color: var(--muted); border-color: var(--line); }
.btn.ghost:hover { background: transparent; border-color: var(--gold); color: var(--gold); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; align-items: center; }

pre.raw {
  font-family: var(--mono); font-size: 11.5px; background: var(--panel-2);
  border: 1px solid var(--line); padding: 18px; overflow-x: auto;
  color: var(--cream); line-height: 1.6; max-height: 460px; overflow-y: auto;
}

details.rec { border: 1px solid var(--line); background: var(--panel); margin: 16px 0; }
details.rec summary {
  cursor: pointer; padding: 13px 18px; font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); list-style: none;
}
details.rec summary::-webkit-details-marker { display: none; }
details.rec summary::before { content: "▸ "; color: var(--dim); }
details.rec[open] summary::before { content: "▾ "; }
details.rec .rbody { padding: 0 18px 18px; }

footer {
  border-top: 1px solid var(--line); padding: 54px 32px 40px; text-align: center;
  position: relative; z-index: 1;
}
.footer-text { font-family: 'Inter', sans-serif; font-size: 12px; letter-spacing: 0.06em; color: var(--dim); line-height: 2; }
.footer-text a { color: var(--muted); text-decoration: none; border-bottom: 1px solid rgba(212, 181, 116, 0.22); }

.witness-nav {
  display: flex; gap: 26px; justify-content: center; flex-wrap: wrap;
  padding: 26px 32px; border-bottom: 1px solid var(--line);
  font-family: 'Inter', sans-serif; font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase;
}
.witness-nav a { color: var(--dim); text-decoration: none; padding-bottom: 4px; border-bottom: 1px solid transparent; }
.witness-nav a:hover { color: var(--gold); }
.witness-nav a.here { color: var(--gold); border-bottom-color: var(--gold); }

/* ── Founder statement of intent (genesis.html) ──────────────────────────
   The statement is set in the serif face to read as a document rather than
   as interface copy. It is deliberately NOT styled as a governance state:
   it is prose, and prose must never look like a verdict on this surface. */
section.doc .panel.statement { border-left: 3px solid var(--line-strong); padding: 32px 36px; }
section.doc .panel.statement p {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 21px; line-height: 1.62; color: var(--cream) !important; margin-bottom: 20px;
}
section.doc .panel.statement p:last-child { margin-bottom: 0; }
section.doc .panel.statement .affirm-block {
  margin: 30px 0 26px; padding-left: 22px; border-left: 2px solid var(--line-strong);
}
section.doc .panel.statement p.affirm {
  font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold) !important; margin-bottom: 10px;
}
section.doc .panel.statement p.affirm:last-child { margin-bottom: 0; }
section.doc .panel.statement p.attrib {
  font-family: 'Inter', sans-serif; font-size: 13px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--dim) !important;
  margin: 32px 0 0; padding-top: 20px; border-top: 1px solid var(--line);
}
@media (max-width: 600px) {
  section.doc .panel.statement { padding: 24px 22px; }
  section.doc .panel.statement p { font-size: 19px; }
}
section.doc .panel.statement p.stitle {
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold) !important;
  margin-bottom: 26px; padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
