/* ==========================================================================
   Evan Fischell Consulting — document brand system
   Canonical palette source: EvanFischellConsulting/brand/BRAND-ASSETS.html
   ========================================================================== */

:root {
  /* --- EFC brand primitives ------------------------------------------- */
  --efc-ink-900:   #0B1926;
  --efc-ink-800:   #0F2233;
  --efc-slate-700: #24404F;
  --efc-slate-600: #34505F;
  --efc-slate-500: #5A7180;
  --efc-slate-400: #7C93A3;
  --efc-mist-300:  #9FB0BC;
  --efc-mist-200:  #C4D0D8;
  --efc-mist-100:  #DCE4E9;
  --efc-paper-100: #EDF1F4;
  --efc-paper-50:  #F4F7F9;
  --efc-paper-0:   #FFFFFF;

  --efc-amber-50:  #FBEEDC;
  --efc-amber-100: #F6E3CB;
  --efc-amber-400: #F0A85E;
  --efc-amber-500: #E8912A;
  --efc-amber-600: #C1731A;
  --efc-amber-700: #A65F12;

  --efc-ok-600:    #3F6B54;
  --efc-ok-bg-50:  #E4EDE7;
  --efc-warn-600:  #8A6D1E;
  --efc-warn-bg-50:#F3EBD3;
  --efc-err-600:   #B0553F;
  --efc-err-bg-50: #F5E4DE;

  --efc-font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system,
                   BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --efc-font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", SFMono-Regular, Consolas, monospace;

  /* --- semantic roles -------------------------------------------------- */
  --paper:       var(--efc-paper-50);
  --panel:       var(--efc-paper-0);
  --ink:         var(--efc-ink-800);
  --ink-soft:    var(--efc-slate-600);
  --muted:       var(--efc-slate-500);
  --line:        var(--efc-mist-100);
  --line-strong: var(--efc-mist-200);
  --accent:      var(--efc-amber-600);
  --accent-soft: var(--efc-amber-100);
  --accent-tint: var(--efc-amber-50);

  --measure: 46rem;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--efc-font-sans);
  font-size: 16.5px;
  line-height: 1.68;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
}

/* --- masthead --------------------------------------------------------- */
.efc-masthead {
  background: var(--efc-ink-900);
  color: var(--efc-paper-50);
  border-bottom: 3px solid var(--efc-amber-500);
}
.efc-masthead-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.efc-masthead img { height: 26px; width: auto; display: block; }
.efc-masthead-meta {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--efc-mist-300);
  text-align: right;
  line-height: 1.9;
}
.efc-masthead-meta b { color: var(--efc-amber-400); font-weight: 600; }

/* --- document shell --------------------------------------------------- */
.efc-doc {
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}
.efc-sheet {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(11, 25, 38, 0.04), 0 12px 32px rgba(11, 25, 38, 0.05);
  padding: 3.5rem clamp(1.25rem, 4vw, 4rem) 3.5rem;
}

/* --- typography ------------------------------------------------------- */
.efc-sheet > * { max-width: var(--measure); }
.efc-sheet > h1,
.efc-sheet > table,
.efc-sheet > .mermaid,
.efc-sheet > hr,
.efc-sheet > .efc-callout { max-width: none; }

h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.16;
  letter-spacing: -0.021em;
  font-weight: 600;
  margin: 0 0 0.4rem;
  color: var(--efc-ink-900);
}
h2 {
  font-size: 1.5rem;
  line-height: 1.28;
  letter-spacing: -0.014em;
  font-weight: 600;
  margin: 3.25rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--efc-ink-900);
}
h1 + h2 {
  border-top: 0;
  padding-top: 0;
  margin-top: 0.25rem;
  font-size: 1.28rem;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: -0.005em;
}
h3 {
  font-size: 1.16rem;
  font-weight: 600;
  margin: 2.5rem 0 0.75rem;
  color: var(--efc-ink-900);
}
h3::before {
  content: "";
  display: block;
  width: 30px;
  height: 3px;
  background: var(--efc-amber-500);
  border-radius: 2px;
  margin-bottom: 0.85rem;
}
h4 {
  font-size: 0.79rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 2rem 0 0.6rem;
}

p { margin: 0 0 1.05rem; }
strong { font-weight: 600; color: var(--efc-ink-900); }
em { color: var(--ink-soft); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--efc-amber-700); }

ul, ol { margin: 0 0 1.15rem; padding-left: 1.35rem; }
li { margin-bottom: 0.45rem; }
li::marker { color: var(--efc-slate-400); }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.75rem 0;
}

code {
  font-family: var(--efc-font-mono);
  font-size: 0.87em;
  background: var(--efc-paper-100);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.09em 0.36em;
}
pre {
  background: var(--efc-ink-900);
  color: var(--efc-paper-50);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.86rem;
}
pre code { background: none; border: 0; padding: 0; color: inherit; }

/* --- tables ----------------------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 1.9rem;
  font-size: 0.935rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
thead th {
  background: var(--efc-paper-100);
  color: var(--efc-ink-900);
  font-weight: 600;
  font-size: 0.79rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  text-align: left;
  padding: 0.7rem 0.95rem;
  border-bottom: 2px solid var(--line-strong);
}
tbody td {
  padding: 0.72rem 0.95rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: rgba(244, 247, 249, 0.6); }
/* Markdown gives a header row to every pipe table. Two-column key/value blocks
   are written with an empty header — drop it rather than render a grey bar. */
thead:not(:has(th:not(:empty))) { display: none; }
tbody td:first-child { color: var(--efc-ink-900); }
table strong { color: var(--efc-ink-900); }

/* --- blockquote / callout -------------------------------------------- */
blockquote {
  margin: 1.6rem 0;
  padding: 1.15rem 1.4rem;
  background: var(--accent-tint);
  border-left: 3px solid var(--efc-amber-500);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--efc-slate-700);
}
blockquote > :last-child { margin-bottom: 0; }
blockquote strong { color: var(--efc-amber-700); }

/* --- mermaid ---------------------------------------------------------- */
.mermaid {
  margin: 2rem 0;
  padding: 1.75rem 1rem;
  background: var(--efc-paper-50);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  overflow-x: auto;
}
.mermaid svg { max-width: 100%; height: auto; }

/* --- document metadata block ------------------------------------------ */
.efc-docmeta { max-width: none; margin: 1.75rem 0 0; }
.efc-docmeta table {
  border: 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  font-size: 0.9rem;
  margin: 0;
}
.efc-docmeta tbody tr { background: transparent !important; }
.efc-docmeta tbody td {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.efc-docmeta tbody tr:last-child td { border-bottom: 0; }
.efc-docmeta tbody td:first-child {
  width: 12.5rem;
  padding-right: 1.5rem;
  color: var(--muted);
  white-space: nowrap;
}
.efc-docmeta tbody td:first-child strong {
  font-weight: 500;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- signature block -------------------------------------------------- */
.efc-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem 3.5rem;
  margin: 2.25rem 0 2.5rem;
  max-width: none;
}
.efc-sig p {
  margin: 0 0 0.15rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.efc-sig p:first-child {
  font-size: 0.79rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--efc-ink-900);
  margin-bottom: 1.6rem;
}
.efc-sig p:first-child strong { font-weight: 600; }
.efc-sig-rule {
  display: block;
  height: 0;
  border-bottom: 1px solid var(--efc-slate-400);
  margin-top: 2.1rem;
  margin-bottom: 0.35rem;
}
.efc-sig p:nth-of-type(2) .efc-sig-rule { margin-top: 0.25rem; }

/* --- terms strip ------------------------------------------------------ */
.efc-terms-strip { max-width: none; }
.efc-terms-strip table {
  background: var(--accent-tint);
  border-color: var(--accent-soft);
}
.efc-terms-strip tbody tr { background: transparent !important; }
.efc-terms-strip tbody td { border-bottom-color: var(--accent-soft); }
.efc-terms-strip tbody td:first-child { width: 32%; color: var(--efc-amber-700); }

/* --- footer note ------------------------------------------------------ */
.efc-footer-note {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
}
.efc-footer-note strong { color: var(--ink-soft); }

.efc-colophon {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.75rem 2rem 3rem;
  font-size: 0.75rem;
  letter-spacing: 0.045em;
  color: var(--efc-slate-400);
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* --- print ------------------------------------------------------------ */
.efc-downloads { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.efc-downloads a { padding: .55rem .85rem; border: 1px solid var(--efc-slate-400); border-radius: 4px; font-size: .85rem; }
@media print {
  .efc-downloads { display: none; }
  body { background: #fff; font-size: 10.5pt; line-height: 1.5; }
  .efc-masthead { background: #fff; color: var(--efc-ink-900); border-bottom: 2px solid var(--efc-amber-600); }
  .efc-masthead-meta { color: var(--efc-slate-600); }
  .efc-masthead img { content: url("/brand/logos/efc-wordmark-light.svg"); }
  .efc-doc { padding: 0; max-width: none; }
  .efc-sheet { border: 0; box-shadow: none; padding: 0.75rem 0 0; border-radius: 0; }
  .efc-sheet > * { max-width: none; }
  h2 { page-break-after: avoid; break-after: avoid; }
  h3, h4 { page-break-after: avoid; break-after: avoid; }
  table, blockquote, .mermaid { page-break-inside: avoid; break-inside: avoid; }
  .efc-colophon { display: none; }
  a { color: var(--efc-ink-900); text-decoration: none; }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .efc-doc { padding: 1.5rem 0.85rem 3rem; }
  .efc-sheet { padding: 1.75rem 1.15rem; }
  .efc-masthead-inner { padding: 1.1rem 1rem; }
  .efc-masthead-meta { text-align: left; }
  table { font-size: 0.86rem; display: block; overflow-x: auto; }
}
