/* Segmenter — strategy briefing */
:root {
  --paper: #f4f1ea;
  --paper-2: #ebe6dc;
  --card: #fbfaf6;
  --ink: #1a1814;
  --ink-2: #3d3933;
  --muted: #6a645b;
  --rule: #d4cec2;
  --rule-strong: #1a1814;
  --navy: #1c3554;
  --navy-2: #2a4a6e;
  --gold: #8c6d32;
  --crimson: #8b2e2e;
  --quad: #ece9e1;
  --quad-alt: #e4e0d6;
  --serif: "Newsreader", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Source Sans 3", "Source Sans Pro", "Segoe UI", system-ui, sans-serif;
  --max: 1120px;
  --gutter: 28px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); }
.wrap { width: min(var(--max), calc(100% - 2 * var(--gutter))); margin: 0 auto; }

/* Header */
.mast {
  padding: 36px 0 22px;
  border-bottom: 1px solid var(--rule);
}
.mast-kicker {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin: 0 0 10px;
}
.mast h1 {
  font-family: var(--serif);
  font-size: clamp(42px, 5.4vw, 64px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin: 0;
  color: var(--ink);
}
.mast-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  align-items: baseline;
  margin-top: 14px;
  color: var(--ink-2);
}
.mast-sub .pair {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}
.mast-meta {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* Search */
.search-panel {
  background: var(--card);
  border: 1px solid var(--rule);
  margin: 28px 0 8px;
  padding: 18px 18px 16px;
}
.search-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}
.field label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  height: 46px;
  border: 1px solid #c9c2b4;
  background: #fff;
  font-family: var(--serif);
  font-size: 18px;
  padding: 0 12px;
  color: var(--ink);
  outline: none;
}
.field input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(28,53,84,0.12); }
button.run {
  height: 46px;
  padding: 0 22px;
  background: var(--navy);
  color: #f7f4ee;
  border: 0;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
}
button.run:hover { background: var(--navy-2); }
button.run:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--navy);
}
button.run:focus-visible { outline: 3px solid #8c6d32; outline-offset: 2px; }
.search-hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* Sections */
.briefing { padding-bottom: 64px; }
.sec {
  padding: 42px 0 8px;
  border-top: 1px solid var(--rule);
  margin-top: 8px;
}
.sec-head {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  margin-bottom: 18px;
  align-items: baseline;
}
.sec-num {
  font-family: var(--serif);
  color: var(--gold);
  font-size: 20px;
  font-weight: 500;
}
.sec h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.02em;
}
.lede {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 78ch;
}
.lede p { margin: 0 0 0.9em; }
.lede p:last-child { margin-bottom: 0; }
.note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 14px;
  max-width: 80ch;
}

/* Cards / tables */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 16px 16px 14px;
  min-height: 100%;
}
.card h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
}
.card p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.card .meta {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 6px;
}
.kv {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.kv th, .kv td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
}
.kv th {
  width: 22%;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
}
.kv td { color: var(--ink-2); }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: 0; }

/* Pyramid */
.pyramid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 8px 0 18px;
}
.tier {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 16px 20px 14px;
}
.tier h3 {
  font-family: var(--serif);
  font-size: 20px;
  margin: 0 0 6px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.tier .badge {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 3px 8px;
  color: #fff;
}
.tier p { margin: 0 0 6px; color: var(--ink-2); font-size: 14.5px; }
.tier p:last-child { margin-bottom: 0; }
.tier .strat { font-weight: 600; color: var(--ink); }
.platinum { width: 62%; border-top: 4px solid #b7b7b2; }
.platinum .badge { background: #6e6e6a; }
.gold { width: 74%; border-top: 4px solid #c4a35a; }
.gold .badge { background: #8c6d32; }
.iron { width: 86%; border-top: 4px solid #8d939c; }
.iron .badge { background: #5c636c; }
.lead { width: 100%; border-top: 4px solid #5a4e43; }
.lead .badge { background: #3e352e; }
.cite {
  font-size: 13.5px;
  color: var(--muted);
  font-style: italic;
  margin-top: 16px;
  max-width: 85ch;
}

/* Plots */
.plot-wrap {
  background: #fff;
  border: 1px solid var(--rule);
  padding: 18px 18px 12px;
}
.plot-title {
  font-family: var(--serif);
  font-size: 20px;
  margin: 0 0 4px;
  font-weight: 600;
}
.plot-cap {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
  max-width: 90ch;
}
.plot {
  position: relative;
  width: 100%;
  height: 560px;
  background: #faf9f6;
  border: 1px solid #1a1814;
  overflow: hidden;
}
.plot.mq { height: 640px; }
.plot.landscape { border-color: #cfc8bb; }
.mq-fill {
  position: absolute;
  width: 50%;
  height: 50%;
}
.mq-fill.tl { left: 0; top: 0; background: #ecebe6; }
.mq-fill.tr { right: 0; top: 0; background: #e7ebe8; }
.mq-fill.bl { left: 0; bottom: 0; background: #eeeae3; }
.mq-fill.br { right: 0; bottom: 0; background: #ebe8e1; }
.crosshair-x, .crosshair-y {
  position: absolute;
  background: #1a1814;
  z-index: 1;
  pointer-events: none;
}
.crosshair-x { left: 0; right: 0; top: 50%; height: 1px; opacity: 0.55; }
.crosshair-y { top: 0; bottom: 0; left: 50%; width: 1px; opacity: 0.55; }
.axis-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.axis-label {
  position: absolute;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
  z-index: 2;
}
.axis-label.x {
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(250,249,246,0.86);
  padding: 2px 8px;
}
.axis-label.y {
  top: 50%;
  left: 10px;
  writing-mode: vertical-rl;
  transform: rotate(180deg) translateY(50%);
  white-space: nowrap;
  background: rgba(250,249,246,0.86);
  padding: 8px 2px;
}
.q-label {
  position: absolute;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  color: #5a554c;
  letter-spacing: 0.04em;
  z-index: 2;
  pointer-events: none;
}
.q-label.leaders { top: 14px; right: 16px; }
.q-label.challengers { top: 14px; left: 16px; }
.q-label.visionaries { bottom: 36px; right: 16px; }
.q-label.niche { bottom: 36px; left: 16px; }

.mark {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
}
.logo-tile {
  background: #fff;
  border: 1px solid #cfc8bb;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(26,24,20,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.logo-tile img {
  object-fit: contain;
  width: 100%;
  height: 100%;
  padding: 6px;
}
.mark .name {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
  background: rgba(251,250,246,0.92);
  padding: 1px 5px;
}
.landscape .logo-tile { width: 78px; height: 42px; }
.mq .logo-tile { width: 86px; height: 48px; border-radius: 10px; }

.foot-note {
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 0;
}

.rationale {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 14px;
}
.rationale th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ink);
}
.rationale td {
  padding: 10px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  color: var(--ink-2);
}
.rationale td.brand {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.rationale td.quad { white-space: nowrap; font-weight: 600; color: var(--navy); }

/* Status / working */
.status-panel {
  padding: 72px 0 96px;
  text-align: center;
  border-top: 1px solid var(--rule);
  margin-top: 24px;
}
.status-panel h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
  margin: 0 0 8px;
}
.status-panel p {
  color: var(--muted);
  margin: 0 auto;
  max-width: 52ch;
}
.status-panel.is-error h2 { color: var(--crimson); }
.letter-tile {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  background: #f3efe6;
}

footer.site {
  border-top: 1px solid var(--ink);
  padding: 28px 0 48px;
  font-size: 13.5px;
  color: var(--ink-2);
}
footer.site h2 {
  font-family: var(--serif);
  font-size: 18px;
  margin: 0 0 10px;
  font-weight: 600;
}
footer.site ul { margin: 0; padding-left: 18px; }
footer.site li { margin-bottom: 4px; }
.hidden { display: none; }

@media (max-width: 900px) {
  .search-form { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .platinum, .gold, .iron, .lead { width: 100%; }
  .plot, .plot.mq { height: 480px; }
  .landscape .logo-tile { width: 64px; height: 36px; }
  .mq .logo-tile { width: 70px; height: 40px; }
  .sec-head { grid-template-columns: 40px 1fr; }
}
@media print {
  body { background: #fff; }
  .search-panel, button.run { display: none; }
  .plot, .plot.mq { break-inside: avoid; }
}
