/* The Kramer Companies, parent brand tokens and components.
   BRAND_NAME: The Kramer Companies (rename by find-and-replace on that exact string; rebuild marks with build_marks.py).
   Extends the original advisory look: navy, gold, Lora headings, Poppins body.
   Light is the default theme. Dark follows the system unless data-theme="light" is set, or is forced with data-theme="dark". */
/* Fonts are loaded with a <link> in each page head. */

:root {
  color-scheme: light;

  /* Fixed brand colors (same in both themes) */
  --kc-navy: #07111f;
  --kc-navy-2: #0b1a2e;
  --kc-gold: #d9a54a;
  --kc-gold-2: #f0c46e;
  --kc-ivory: #f7f4ee;

  /* Semantic roles, light */
  --bg: #f7f4ee;
  --surface: #ffffff;
  --surface-2: #efeae0;
  --line: #ddd5c6;
  --fg: #0b1a2e;
  --muted: #4c5a6e;
  --dim: #6c7889;
  --gold: #c9963e;          /* fills, rules on marks, icons */
  --gold-text: #8a6318;     /* gold used as text on light surfaces */
  --on-gold: #07111f;
  --focus: #2a63a6;
  --pos: #1f7a4f;
  --neg: #b0302b;

  /* Vertical accents, light (one each, used sparingly: a mark, a chip, a top rule on a card) */
  --v-dev: #1d7a6c;         /* Development Consulting, teal */
  --v-acq: #2a63a6;         /* Acquisitions, cerulean */
  --v-brk: #8f3556;         /* Brokerage, claret */
  --v-sys: #6a4ca0;         /* Systems, violet */

  /* Brokerage distress ladder, light (carried over from the brokerage build) */
  --sig-watch: #4f6b5a;
  --sig-filed: #c98a1a;
  --sig-judgment: #b8461b;
  --sig-saleset: #a3271f;
  --sig-reo: #15171b;
  --sig-watch-text: #3e5647;
  --sig-filed-text: #8a5e0e;
  --sig-judgment-text: #8e3412;
  --sig-saleset-text: #8a1f18;
  --sig-reo-text: #15171b;
  --ladder-ink: #ffffff;   /* text on ladder stage fills */

  /* Active accent (set per vertical with data-vertical) */
  --accent: var(--gold);
  --accent-text: var(--gold-text);

  /* Type */
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --fs-xs: .75rem;                                     /* 12 */
  --fs-sm: .875rem;                                    /* 14 */
  --fs-base: 1rem;                                     /* 16 */
  --fs-md: 1.125rem;                                   /* 18 */
  --fs-lg: 1.375rem;                                   /* 22 */
  --fs-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);        /* 24 to 32 */
  --fs-2xl: clamp(1.875rem, 1.3rem + 2.4vw, 2.75rem);  /* 30 to 44 */
  --fs-3xl: clamp(2.5rem, 1.4rem + 4.4vw, 4.5rem);     /* 40 to 72 */
  --lh-tight: 1.06;
  --lh-snug: 1.25;
  --lh-body: 1.6;

  /* Space, radius, shadow */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
  --gutter: clamp(16px, 4vw, 48px);
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-pill: 999px;
  --shadow: 0 1px 2px rgba(11, 26, 46, .06), 0 6px 18px rgba(11, 26, 46, .06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #07111f;
    --surface: #0f2038;
    --surface-2: #132845;
    --line: #1f3a5e;
    --fg: #e9eff8;
    --muted: #9fb2cc;
    --dim: #7d91ad;
    --gold: #d9a54a;
    --gold-text: #f0c46e;
    --focus: #7eaee6;
    --pos: #4cc38a;
    --neg: #ef6b6b;
    --v-dev: #45c4ae;
    --v-acq: #7eaee6;
    --v-brk: #e08aa8;
    --v-sys: #b49ae6;
    --sig-watch: #7fa58f;
    --sig-filed: #e0a73a;
    --sig-judgment: #e0703f;
    --sig-saleset: #ef6b6b;
    --sig-reo: #c9d3e0;
    --sig-watch-text: #a3c4b0;
    --sig-filed-text: #f0c46e;
    --sig-judgment-text: #f0946a;
    --sig-saleset-text: #f59a9a;
    --sig-reo-text: #e9eff8;
    --ladder-ink: #07111f;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111f;
  --surface: #0f2038;
  --surface-2: #132845;
  --line: #1f3a5e;
  --fg: #e9eff8;
  --muted: #9fb2cc;
  --dim: #7d91ad;
  --gold: #d9a54a;
  --gold-text: #f0c46e;
  --focus: #7eaee6;
  --pos: #4cc38a;
  --neg: #ef6b6b;
  --v-dev: #45c4ae;
  --v-acq: #7eaee6;
  --v-brk: #e08aa8;
  --v-sys: #b49ae6;
  --sig-watch: #7fa58f;
  --sig-filed: #e0a73a;
  --sig-judgment: #e0703f;
  --sig-saleset: #ef6b6b;
  --sig-reo: #c9d3e0;
  --sig-watch-text: #a3c4b0;
  --sig-filed-text: #f0c46e;
  --sig-judgment-text: #f0946a;
  --sig-saleset-text: #f59a9a;
  --sig-reo-text: #e9eff8;
  --ladder-ink: #07111f;
  --shadow: none;
}

/* Vertical scoping: put data-vertical on a section, page or card */
[data-vertical="dev"] { --accent: var(--v-dev); --accent-text: var(--v-dev); }
[data-vertical="acq"] { --accent: var(--v-acq); --accent-text: var(--v-acq); }
[data-vertical="brk"] { --accent: var(--v-brk); --accent-text: var(--v-brk); }
[data-vertical="sys"] { --accent: var(--v-sys); --accent-text: var(--v-sys); }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--fs-base)/var(--lh-body) var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent-text); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Type scale */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; text-wrap: balance; margin: 0; color: var(--fg); }
h1 { font-size: var(--fs-3xl); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-2xl); line-height: 1.12; margin-bottom: var(--sp-4); }
h3 { font-size: var(--fs-lg); line-height: var(--lh-snug); margin-bottom: var(--sp-2); }
h4 { font-family: var(--sans); font-size: var(--fs-base); font-weight: 600; letter-spacing: 0; margin-bottom: var(--sp-1); }
h1 em, h2 em, h3 em { font-style: italic; color: var(--gold-text); }
p { margin: 0 0 var(--sp-4); }
.eyebrow { font: 600 var(--fs-sm)/1.3 var(--sans); letter-spacing: .04em; color: var(--accent-text); margin: 0 0 var(--sp-3); }
.lead { font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); color: var(--muted); max-width: 62ch; }
.small { font-size: var(--fs-sm); color: var(--muted); }
.fine { font-size: var(--fs-xs); color: var(--dim); max-width: 90ch; }
.num { font-family: var(--serif); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums lining-nums; line-height: 1; }

/* Layout helpers */
.wrap { max-width: 1200px; margin: 0 auto; padding-inline: max(16px, var(--gutter)); }
.grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card p { color: var(--muted); font-size: .9375rem; margin: 0; }
.card.accent { border-top: 3px solid var(--accent); }
.card .tag { display: inline-flex; align-items: center; gap: 8px; font: 600 var(--fs-xs)/1.3 var(--sans); letter-spacing: .03em; color: var(--accent-text); margin-bottom: var(--sp-3); }
.card .tag::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); flex: none; }

/* Stats */
.stat { min-width: 0; }
.stat .num { font-size: clamp(2rem, 1.5rem + 2vw, 2.875rem); color: var(--fg); white-space: nowrap; }
.stat .num small { font-size: .5em; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.stat .label { font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; margin-top: var(--sp-2); }
.stat.card { border-top: 3px solid var(--accent); }

/* Chips */
.chip {
  --c: var(--dim); --ct: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--r-pill);
  font: 600 var(--fs-xs)/1.5 var(--sans);
  letter-spacing: .02em;
  color: var(--ct);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 34%, transparent);
  white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.chip.gold { --c: var(--gold); --ct: var(--gold-text); }
.chip.dev  { --c: var(--v-dev); --ct: var(--v-dev); }
.chip.acq  { --c: var(--v-acq); --ct: var(--v-acq); }
.chip.brk  { --c: var(--v-brk); --ct: var(--v-brk); }
.chip.sys  { --c: var(--v-sys); --ct: var(--v-sys); }
/* Distress ladder stages */
.chip.watch    { --c: var(--sig-watch);    --ct: var(--sig-watch-text); }
.chip.filed    { --c: var(--sig-filed);    --ct: var(--sig-filed-text); }
.chip.judgment { --c: var(--sig-judgment); --ct: var(--sig-judgment-text); }
.chip.saleset  { --c: var(--sig-saleset);  --ct: var(--sig-saleset-text); }
.chip.reo      { --c: var(--sig-reo);      --ct: var(--sig-reo-text); }

/* Distress ladder bar */
.ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.ladder > div { padding: 10px 12px; border-radius: var(--r-sm); color: var(--ladder-ink); font: 600 var(--fs-sm)/1.25 var(--sans); min-width: 0; }
.ladder > div span { display: block; font-weight: 400; font-size: var(--fs-xs); opacity: .9; margin-top: 2px; }
.ladder .watch { background: var(--sig-watch); }
.ladder .filed { background: var(--sig-filed); color: #241703; }
.ladder .judgment { background: var(--sig-judgment); }
.ladder .saleset { background: var(--sig-saleset); }
.ladder .reo { background: var(--sig-reo); color: var(--bg); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 44px; padding: 10px 20px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font: 600 .9375rem/1.2 var(--sans);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  background: var(--kc-gold); color: var(--on-gold);
  transition: background-color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--kc-gold-2); }
.btn.secondary { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--gold); }
.btn.navy { background: var(--kc-navy-2); color: #e9eff8; }
:root[data-theme="dark"] .btn.navy { background: #e9eff8; color: var(--kc-navy); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.navy { background: #e9eff8; color: var(--kc-navy); } }
.btn.link { background: transparent; color: var(--accent-text); padding-inline: 4px; min-height: 0; }
.btn.sm { min-height: 34px; padding: 6px 14px; font-size: var(--fs-sm); }

/* Tables */
.tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table.tbl { border-collapse: collapse; width: 100%; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font: 600 var(--fs-xs)/1.3 var(--sans); letter-spacing: .02em; color: var(--muted); padding: 12px 16px; background: var(--surface-2); }
.tbl td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl .r, .tbl th.r { text-align: right; white-space: nowrap; }
.tbl tr.tot td { font-weight: 600; background: var(--surface-2); }
.tbl .neg { color: var(--neg); }
.tbl .pos { color: var(--pos); }
@media (max-width: 600px) {
  table.tbl { font-size: .8125rem; }
  .tbl th, .tbl td { padding: 9px 10px; }
}

/* Disclosure block (brokerage and samples) */
.disclose { font-size: var(--fs-xs); color: var(--dim); border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; max-width: 90ch; }
