/* Enigma Studios family layer — shared by every family site.
   One file: fire ramp, light/dark neutrals, per-site themes ([data-site]), and the family components.
   Each site copies this file as-is and sets <html data-site="…">. Every site opens dark; light is the visitor's choice. */

/* ---------- 1. Fire: the family constant ---------- */
:root {
  --ember-50: #fdf2e4;
  --ember-100: #f9dfbd;
  --ember-200: #f3c189;
  --ember-300: #f2a65a;
  --ember-400: #ea8a32;
  --ember-500: #e07b24;
  --ember-600: #c25f17;
  --ember-700: #9a4512;
  --ember-800: #6e300e;
  --ember-900: #3d1a08;
  --flame: #d9441c;
  --brass: #d9a441;
  --coal: #14100c;
  --ash: #f1e9dc;

  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --font-display: var(--font-body);
  --display-weight: 600;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 72px; --space-9: 112px;
  --radius: 2px;
  --measure: 62ch;
  --page: 1200px;
  --gutter: clamp(16px, 4vw, 48px);

  /* Light / dark neutrals. Sites override these raw values; section 2 maps them. */
  --l-bg: #f6f0e4;   --d-bg: #15110d;
  --l-bg-2: #fbf7ef; --d-bg-2: #1d1813;
  --l-bg-3: #ece4d4; --d-bg-3: #100c09;
  --l-ink: #1c1712;  --d-ink: #f1e9dc;
  --l-ink-2: #4a4036; --d-ink-2: #cbbfae;
  --l-ink-3: #6e6255; --d-ink-3: #9d907e;
  --l-rule: #d9cdb8; --d-rule: #2e261e;
  --l-rule-2: #b9a88d; --d-rule-2: #4a3e31;
  --l-fire-ink: #9a4512; --d-fire-ink: #f2a65a;
  /* Site accent: a fill colour and a text-safe colour per mode. */
  --accent: var(--brass);
  --l-accent-ink: #7a5a14; --d-accent-ink: #e6be6a;
}

/* ---------- 2. Mode mapping ----------
   Dark is the default on every site. Light applies only when the visitor chooses it
   (data-theme="light" on <html>). [data-mode] scopes a mode to any element. */
:root, [data-mode="dark"] {
  color-scheme: dark;
  --bg: var(--d-bg); --bg-2: var(--d-bg-2); --bg-3: var(--d-bg-3);
  --ink: var(--d-ink); --ink-2: var(--d-ink-2); --ink-3: var(--d-ink-3);
  --rule: var(--d-rule); --rule-2: var(--d-rule-2);
  --fire-ink: var(--d-fire-ink); --accent-ink: var(--d-accent-ink);
}
:root[data-theme="light"], [data-mode="light"] {
  color-scheme: light;
  --bg: var(--l-bg); --bg-2: var(--l-bg-2); --bg-3: var(--l-bg-3);
  --ink: var(--l-ink); --ink-2: var(--l-ink-2); --ink-3: var(--l-ink-3);
  --rule: var(--l-rule); --rule-2: var(--l-rule-2);
  --fire-ink: var(--l-fire-ink); --accent-ink: var(--l-accent-ink);
}

/* ---------- 3. Sites ---------- */
/* Sites differ by accent and, for Vaelthorn and TaskTruth, by their purple grounds. One typeface throughout. */
[data-site="enigma"] { }

[data-site="tog"] {
  --accent: #4f6d8f; --l-accent-ink: #3c5674; --d-accent-ink: #9db7d6;
}

[data-site="vaelthorn"] {
  --accent: #8a6fb8; --l-accent-ink: #5b3f8a; --d-accent-ink: #cbb8e6;
  --l-bg: #f4eff8;   --d-bg: #140c1e;
  --l-bg-2: #fbf8fd; --d-bg-2: #1c1229;
  --l-bg-3: #e8dff0; --d-bg-3: #0e0816;
  --l-ink: #1d1428;  --d-ink: #efe6f7;
  --l-ink-2: #4a3d5c; --d-ink-2: #c9bcdb;
  --l-ink-3: #6b5d80; --d-ink-3: #9a8bb0;
  --l-rule: #dccfe8; --d-rule: #2a1d3a;
  --l-rule-2: #b9a6cf; --d-rule-2: #44325c;
}

[data-site="tasktruth"] {
  --accent: #6c5ce7; --l-accent-ink: #4b3cc4; --d-accent-ink: #b3a8ff;
  --l-bg: #f2f0fb;   --d-bg: #100d22;
  --l-bg-2: #faf9fe; --d-bg-2: #18142f;
  --l-bg-3: #e4e0f5; --d-bg-3: #0b0918;
  --l-ink: #17132e;  --d-ink: #ebe8fa;
  --l-ink-2: #423c66; --d-ink-2: #c3bde6;
  --l-ink-3: #625b8a; --d-ink-3: #9089b8;
  --l-rule: #d6d1ee; --d-rule: #241f45;
  --l-rule-2: #b2abd9; --d-rule-2: #3b3466;
}

[data-site="osmiumstack"] {
  --accent: #8523da; --l-accent-ink: #6c18b4; --d-accent-ink: #c498ff;
}

[data-site="gracehub"] {
  --accent: #3d62a0; --l-accent-ink: #2f4e84; --d-accent-ink: #88a3cf;
}

[data-site="justinedwards"] {
  --accent: #3a332c; --l-accent-ink: #1c1712; --d-accent-ink: #f1e9dc;
}

[data-site="gc0d3"] {
  --accent: #2f8f4e; --l-accent-ink: #23703c; --d-accent-ink: #7fd49a;
}

[data-site="enigmaschool"] {
  --accent: #1f7a72; --l-accent-ink: #17605a; --d-accent-ink: #7cc9bf;
}

[data-site="deadmenstilltalk"] {
  --accent: #7a1f2b; --l-accent-ink: #6b1a24; --d-accent-ink: #d98a95;
}

/* ---------- 4. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.6 var(--font-body);
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: var(--ember-500); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--fire-ink); }
:focus-visible { outline: 2px solid var(--ember-500); outline-offset: 3px; }
::selection { background: var(--ember-200); color: var(--coal); }
h1, h2, h3 {
  font-family: var(--font-display); font-weight: var(--display-weight, 500);
  text-transform: var(--display-case, none);
  line-height: 1.04; letter-spacing: -0.025em; margin: 0; text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }
.es-wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.es-mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em; }
.es-skip { position: absolute; left: -9999px; }
.es-skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--bg); padding: 8px 12px; }

/* ---------- 5. Family components ---------- */

/* The family bar: the same on every site, in both modes. Coal strip, then the heat strip. */
.es-familybar { background: var(--coal); color: #cfc4b3; font: 400 12.5px/1 var(--font-mono); letter-spacing: 0.04em; }
.es-familybar .es-wrap { display: flex; align-items: center; gap: var(--space-4); min-height: 34px; }
.es-familybar a { color: #cfc4b3; text-decoration: none; }
.es-familybar a:hover { color: var(--ember-300); }
.es-familybar .es-family-mark { display: inline-flex; align-items: center; gap: 8px; color: var(--ash); }
.es-familybar .es-family-mark::before { content: ""; width: 8px; height: 8px; background: var(--ember-500); }
.es-familybar nav { margin-left: auto; display: flex; gap: var(--space-4); }
.es-heat { display: grid; grid-template-columns: 5fr 3fr 2fr; height: 4px; }
.es-heat > i:nth-child(1) { background: var(--flame); }
.es-heat > i:nth-child(2) { background: var(--ember-500); }
.es-heat > i:nth-child(3) { background: var(--brass); }

/* Masthead: wordmark left, nav and the mode toggle right, ruled underneath. */
.es-masthead { border-bottom: 1px solid var(--rule); }
.es-masthead .es-wrap { display: flex; align-items: center; gap: var(--space-5); min-height: 72px; }
.es-wordmark { font-family: var(--font-display); font-weight: var(--display-weight, 500); text-transform: var(--display-case, none); font-size: 22px; text-decoration: none; color: var(--ink); }
.es-nav { margin-left: auto; display: flex; gap: var(--space-5); font-size: 15px; }
.es-nav a { text-decoration: none; color: var(--ink-2); }
.es-nav a[aria-current] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ember-500); }
.es-mode {
  appearance: none; border: 1px solid var(--rule-2); background: transparent; color: var(--ink-2);
  font: 400 12px/1 var(--font-mono); letter-spacing: 0.04em; padding: 8px 10px; border-radius: var(--radius); cursor: pointer;
}
.es-mode:hover { border-color: var(--ember-500); color: var(--ink); }

/* Kicker: the mono label above headings. A short ember dash leads it. */
.es-kicker { display: inline-flex; align-items: center; gap: 10px; font: 500 12.5px/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fire-ink); }
.es-kicker::before { content: ""; width: 18px; height: 2px; background: currentColor; }

/* Hero: left-aligned, never centered. */
.es-hero { padding: var(--space-9) 0 var(--space-8); }
.es-hero h1 { font-size: clamp(40px, 7vw, 84px); max-width: 16ch; margin-top: var(--space-4); }
.es-hero .es-lede { font-size: clamp(18px, 2vw, 21px); color: var(--ink-2); max-width: 46ch; margin-top: var(--space-5); }
.es-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }

/* Buttons: square, solid fire, the arrow is part of the label. */
.es-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 20px;
  border: 1.5px solid var(--ember-500); border-radius: var(--radius);
  background: var(--ember-500); color: var(--coal);
  font: 500 15px/1 var(--font-body); text-decoration: none; cursor: pointer;
}
.es-btn:hover { background: var(--ember-400); border-color: var(--ember-400); color: var(--coal); }
.es-btn--line { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.es-btn--line:hover { background: transparent; border-color: var(--ember-500); color: var(--ink); }

/* Sections: a numbered head on a rule. */
.es-section { padding: var(--space-8) 0; border-top: 1px solid var(--rule); }
.es-section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-6); align-items: start; margin-bottom: var(--space-7); }
.es-section-head .es-num { font: 500 13px/1.4 var(--font-mono); color: var(--ink-3); letter-spacing: 0.06em; }
.es-section-head h2 { font-size: clamp(28px, 4vw, 44px); }
.es-section-head p { color: var(--ink-2); margin-top: var(--space-3); max-width: var(--measure); }

/* Ledger: ruled rows, the family's list form. */
.es-ledger { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.es-ledger li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2.4fr) auto; gap: var(--space-5); padding: var(--space-5) 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.es-ledger .es-name { font-family: var(--font-display); font-weight: var(--display-weight, 500); font-size: 22px; }
.es-ledger .es-what { color: var(--ink-2); }
.es-ledger .es-tag { font: 500 12px/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink); }

/* Panels: ruled boxes in a hairline grid. No shadows, no rounding beyond 2px. */
.es-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.es-panel { background: var(--bg-2); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }
.es-panel h3 { font-size: 24px; }
.es-panel p { color: var(--ink-2); font-size: 16px; }
.es-panel .es-mono { color: var(--ink-3); margin-top: auto; padding-top: var(--space-3); }

/* Footer: contact block, the family index, the fine print. Same structure on every site. */
.es-footer { background: var(--bg-3); border-top: 1px solid var(--rule); padding: var(--space-8) 0 var(--space-6); font-size: 15px; }
.es-footer-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--space-7); }
.es-footer h4 { margin: 0 0 var(--space-3); font: 500 12px/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.es-footer address { font-style: normal; line-height: 1.7; color: var(--ink-2); }
.es-footer address a { color: var(--ink); }
/* Footer with link columns between the contact block and the family index; --cols is set by sitegen. */
.es-footer-grid--wide { grid-template-columns: minmax(0, 1.25fr) repeat(var(--cols, 2), minmax(0, 0.65fr)) minmax(0, 1.7fr); gap: var(--space-6); }
.es-footer-grid--wide .es-family-index { column-gap: var(--space-4); }
.es-tagline { color: var(--ink-2); margin: var(--space-4) 0; max-width: 34ch; }
.es-fine a { color: var(--ink-3); text-decoration: none; }
.es-fine a:hover { color: var(--fire-ink); }
.es-family-index { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: var(--space-5); }
.es-family-index li { break-inside: avoid; padding: 3px 0; }
.es-family-index a { text-decoration: none; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; }
.es-family-index img { width: 18px; height: 18px; }
.es-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.es-brand img { width: 34px; height: 34px; }
/* Each mark ships a dark-ground and a light-ground file; show the one that matches the mode. */
.es-on-light { display: none !important; }
:root[data-theme="light"] .es-on-light, [data-mode="light"] .es-on-light { display: block !important; }
:root[data-theme="light"] .es-on-dark, [data-mode="light"] .es-on-dark { display: none !important; }
.es-brand span { font: 600 19px/1 var(--font-body); letter-spacing: -0.02em; }
.es-masthead .es-btn { min-height: 40px; padding: 0 16px; font-size: 14px; }
.es-family-index a:hover { color: var(--fire-ink); }
.es-family-index [aria-current] { color: var(--ink); font-weight: 500; }
.es-social { list-style: none; margin: var(--space-5) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.es-social a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px;
  border: 1px solid var(--rule-2); border-radius: var(--radius);
  font: 500 12.5px/1 var(--font-mono); letter-spacing: 0.04em; color: var(--ink-2); text-decoration: none;
}
.es-social a:hover { border-color: var(--ember-500); color: var(--ink); }
.es-fine { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; margin-top: var(--space-7); padding-top: var(--space-4); border-top: 1px solid var(--rule); color: var(--ink-3); font: 400 12.5px/1.5 var(--font-mono); }

@media (max-width: 760px) {
  .es-familybar nav { display: none; }
  .es-masthead .es-wrap { flex-wrap: wrap; row-gap: 0; padding-top: 14px; }
  .es-nav { order: 3; width: 100%; margin: 0; gap: var(--space-5); overflow-x: auto; padding: 14px 0; }
  .es-mode { margin-left: auto; }
  .es-masthead .es-btn { display: none; }
  .es-section-head, .es-footer-grid { grid-template-columns: 1fr; gap: var(--space-5); }
  .es-ledger li { grid-template-columns: 1fr; gap: var(--space-2); }
  .es-hero { padding: var(--space-8) 0 var(--space-7); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
