/* ==========================================================================
   RaiseTheNorth — "Dawn" design system (single source of truth)
   Warm paper ground, one maple accent, coded stage/sector palette.
   Every page links this file; shared chrome (header/footer/ticker) is markup
   in api/site-chrome.js and styled here. Change the look here → it updates
   everywhere.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Dawn palette */
  --bg: #fdf9f7;              /* warm paper body */
  --dawn-1: #fbe3dd;         /* soft rose/peach, top of the header→body blend */
  --dawn-2: #fdeee9;
  --surface: #ffffff;
  --paper-2: #f6efe8;
  --ink: #1c1712;
  --ink-2: #6b6157;
  --ink-3: #9a9186;
  --line: #efe5db;
  --line-2: #e4d9cc;
  --live: #dc2626;           /* maple accent */
  --live-ink: #c02218;

  /* coded stage/sector palette (set inline on chips via var(--c-*)) */
  --c-amber: #d9922b; --c-teal: #1a9e91; --c-cobalt: #2f6ad6;
  --c-plum: #8352bd; --c-brick: #c1492f; --c-moss: #5f8a37;

  --shadow: 0 1px 2px rgba(50,35,28,.05), 0 20px 44px -26px rgba(50,35,28,.22);
  --shadow-lg: 0 2px 6px rgba(50,35,28,.06), 0 34px 60px -30px rgba(50,35,28,.30);
  --ease: cubic-bezier(.2,.9,.25,1);

  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --exp: 'Archivo Expanded', 'Archivo', system-ui, sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --transition: 140ms var(--ease);

  /* ---- Legacy aliases: keep old var names working, remapped to Dawn, so
     pages not yet ported adopt the warm palette instead of breaking. ---- */
  --black: #1c1712;
  --white: #ffffff;
  --gray-900: #2a231c;
  --gray-700: #4a4038;
  --gray-600: var(--ink-2);
  --gray-500: #847a6e;
  --gray-400: var(--ink-3);
  --gray-300: #d8ccbe;
  --gray-200: var(--line-2);
  --gray-100: var(--line);
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink-2);
  line-height: 1.5;
  min-height: 100vh;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }

/* ---------- Utilities ---------- */
.hidden { display: none !important; }
/* Visually hidden but in the a11y tree (the maple-leaf "o" in the wordmark). */
.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 28px; }

/* ---------- Selection / scrollbar / focus ---------- */
::selection { background: var(--live); color: #fff; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #e2d6c9; border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #d3c3b1; }
:focus-visible { outline: 2px solid var(--live); outline-offset: 3px; border-radius: 3px; }
input:focus-visible, select:focus-visible, button:focus-visible, textarea:focus-visible { outline: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-weight: 700; font-size: .9rem;
  letter-spacing: -.01em; border: 1px solid transparent; border-radius: 10px;
  padding: .7rem 1.1rem; cursor: pointer; transition: transform .12s var(--ease), background .15s, border-color .15s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-live { background: var(--live); color: #fff; }
.btn-live:hover { background: var(--live-ink); color: #fff; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #000; color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: #cdbfae; }
.btn svg { transition: transform .2s var(--ease); }
.btn-live:hover svg, .btn-ink:hover svg { transform: translateX(3px); }

/* ---------- Coded chips (color comes inline, e.g. style="background:var(--c-teal)") ---------- */
.chip { font-size: .64rem; font-weight: 600; padding: .15rem .45rem; border-radius: 5px; color: #fff; letter-spacing: .01em; white-space: nowrap; }
.chip-sm { font-size: .6rem; padding: .12rem .4rem; border-radius: 4px; }

/* ==========================================================================
   Shared chrome (markup lives in api/site-chrome.js)
   ========================================================================== */

/* ---------- Header (.rail) ---------- */
.rail { position: relative; z-index: 2; }
.rail-in { max-width: 1240px; margin: 0 auto; padding: 16px 28px; display: flex; align-items: center; gap: 22px; }
.rail .mark { display: inline-flex; align-items: center; gap: .1em; font-family: var(--exp); font-weight: 800; font-size: 1.02rem; letter-spacing: -.02em; color: var(--ink); }
.rail .mark .n { color: var(--ink-3); font-weight: 600; }
.rail .maple { height: .86em; width: .76em; vertical-align: -.05em; fill: var(--live); flex: none; }
.rail nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.rail nav a { font-size: .82rem; color: var(--ink-2); padding: .4rem .7rem; border-radius: 8px; transition: .15s; }
.rail nav a:hover { color: var(--ink); background: rgba(80,60,50,.06); }
.rail nav a.active:not(.live-btn) { color: var(--ink); font-weight: 700; }
.rail .live-btn { background: var(--live); color: #fff; font-weight: 700; padding: .5rem .9rem; }
.rail .live-btn:hover { background: var(--live-ink); color: #fff; }
@media (max-width: 900px) { .rail nav a:not(.live-btn) { display: none; } }

/* ---------- Deal ticker (.tape) ---------- */
.tape { overflow: hidden; background: var(--ink); border-bottom: 1px solid rgba(0,0,0,.28); }
.tape-in { display: inline-flex; gap: 0; white-space: nowrap; animation: tape 60s linear infinite; will-change: transform; }
.tape:hover .tape-in { animation-play-state: paused; }
.tick { display: inline-flex; align-items: baseline; gap: .55rem; white-space: nowrap; padding: .55rem 1.4rem; font-family: var(--mono); font-size: .72rem; color: rgba(244,235,228,.5); border-right: 1px solid rgba(255,255,255,.08); }
.tick .dot { width: 6px; height: 6px; border-radius: 50%; background: #ff5a4d; align-self: center; position: static; transform: translateY(-1px); box-shadow: 0 0 0 3px rgba(255,90,77,.24); }
.tick b { color: #f7efe8; font-weight: 600; font-family: var(--sans); letter-spacing: -.01em; }
.tick .amt { color: #ff6a5e; font-weight: 600; }
@keyframes tape { to { transform: translateX(-50%); } }

/* ---------- Footer (.foot) ---------- */
.foot { border-top: 1px solid var(--line-2); padding: 34px 0 60px; color: var(--ink-3); font-size: .8rem; }
.foot-in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: baseline; }
.foot a:hover { color: var(--ink); }
.foot .foot-brand { font-family: var(--exp); font-weight: 800; color: var(--ink); }
.foot .foot-brand .n { color: var(--ink-3); font-weight: 600; }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.foot .src { font-family: var(--mono); font-size: .68rem; max-width: 52ch; line-height: 1.5; }

/* ---------- Dawn blend + topographic hero texture ---------- */
.top-band { position: relative; background: linear-gradient(180deg, var(--dawn-1) 0%, var(--dawn-2) 24%, var(--bg) 92%); }
.top-band > * { position: relative; z-index: 1; }
.top-band::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-repeat: no-repeat; background-position: center top; background-size: cover; opacity: .85;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='600'%3E%3Cdefs%3E%3ClinearGradient id='fade' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0%25' stop-color='%23f8f8f6' stop-opacity='0'/%3E%3Cstop offset='60%25' stop-color='%23f8f8f6' stop-opacity='0'/%3E%3Cstop offset='100%25' stop-color='%23f8f8f6' stop-opacity='.9'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cellipse cx='420' cy='310' rx='340' ry='260' fill='none' stroke='%23b8b8b0' stroke-width='.7' opacity='.35'/%3E%3Cellipse cx='420' cy='310' rx='290' ry='218' fill='none' stroke='%23b8b8b0' stroke-width='.7' opacity='.35'/%3E%3Cellipse cx='420' cy='310' rx='240' ry='178' fill='none' stroke='%23b8b8b0' stroke-width='.7' opacity='.35'/%3E%3Cellipse cx='420' cy='310' rx='192' ry='140' fill='none' stroke='%23b8b8b0' stroke-width='.7' opacity='.35'/%3E%3Cellipse cx='420' cy='310' rx='146' ry='104' fill='none' stroke='%23b8b8b0' stroke-width='.7' opacity='.35'/%3E%3Cellipse cx='420' cy='310' rx='102' ry='70' fill='none' stroke='%23b8b8b0' stroke-width='.7' opacity='.35'/%3E%3Cellipse cx='420' cy='310' rx='60' ry='40' fill='none' stroke='%23b8b8b0' stroke-width='.7' opacity='.35'/%3E%3Cellipse cx='160' cy='80' rx='220' ry='160' fill='none' stroke='%23b8b8b0' stroke-width='.65' opacity='.28'/%3E%3Cellipse cx='160' cy='80' rx='176' ry='124' fill='none' stroke='%23b8b8b0' stroke-width='.65' opacity='.28'/%3E%3Cellipse cx='160' cy='80' rx='134' ry='90' fill='none' stroke='%23b8b8b0' stroke-width='.65' opacity='.28'/%3E%3Cellipse cx='160' cy='80' rx='94' ry='60' fill='none' stroke='%23b8b8b0' stroke-width='.65' opacity='.28'/%3E%3Cellipse cx='700' cy='500' rx='200' ry='150' fill='none' stroke='%23b8b8b0' stroke-width='.65' opacity='.22'/%3E%3Cellipse cx='700' cy='500' rx='155' ry='114' fill='none' stroke='%23b8b8b0' stroke-width='.65' opacity='.22'/%3E%3Cellipse cx='700' cy='500' rx='112' ry='80' fill='none' stroke='%23b8b8b0' stroke-width='.65' opacity='.22'/%3E%3Cline x1='0' y1='0' x2='800' y2='0' stroke='%23b8b8b0' stroke-width='.4' opacity='.2'/%3E%3Cline x1='0' y1='100' x2='800' y2='100' stroke='%23b8b8b0' stroke-width='.4' opacity='.2'/%3E%3Cline x1='0' y1='200' x2='800' y2='200' stroke='%23b8b8b0' stroke-width='.4' opacity='.2'/%3E%3Cline x1='0' y1='300' x2='800' y2='300' stroke='%23b8b8b0' stroke-width='.4' opacity='.2'/%3E%3Cline x1='0' y1='400' x2='800' y2='400' stroke='%23b8b8b0' stroke-width='.4' opacity='.2'/%3E%3Cline x1='0' y1='500' x2='800' y2='500' stroke='%23b8b8b0' stroke-width='.4' opacity='.2'/%3E%3Cline x1='200' y1='0' x2='200' y2='600' stroke='%23b8b8b0' stroke-width='.4' opacity='.18'/%3E%3Cline x1='400' y1='0' x2='400' y2='600' stroke='%23b8b8b0' stroke-width='.4' opacity='.18'/%3E%3Cline x1='600' y1='0' x2='600' y2='600' stroke='%23b8b8b0' stroke-width='.4' opacity='.18'/%3E%3Crect x='0' y='0' width='800' height='600' fill='url(%23fade)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Home page: hero, deal carousel, board/roster
   ========================================================================== */

/* ---------- Hero ---------- */
.hero { padding: 44px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 52px; align-items: center; }
.claim { font-family: var(--exp); font-weight: 800; letter-spacing: -.035em; line-height: .98; font-size: clamp(2.6rem,5vw,4.15rem); color: var(--ink); margin: 0 0 22px; }
.claim .u { color: var(--live); }
.lede { font-size: 1.06rem; line-height: 1.5; color: var(--ink-2); max-width: 46ch; margin: 0 0 26px; font-weight: 400; }
.lede b { color: var(--ink); font-weight: 600; }
.ai-tag { display: inline-flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--live); margin-bottom: 10px; }
.ai-tag svg { flex: none; }
.ai-tag .beta { font-family: var(--mono); font-weight: 600; font-size: .62rem; letter-spacing: .04em; text-transform: none; color: var(--ink-3); background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 99px; padding: .06rem .42rem; }
.matchbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.matchbar input { flex: 1; min-width: 220px; font-family: var(--sans); font-size: .95rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: .85rem 1rem; letter-spacing: -.01em; }
.matchbar input::placeholder { color: var(--ink-3); }
.matchbar input:focus { outline: none; border-color: #d8b7ae; box-shadow: 0 0 0 4px rgba(220,38,38,.08); }
.match-alt { margin: 10px 0 0; font-size: .82rem; color: var(--ink-3); }
.match-alt a { color: var(--ink-2); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.match-alt a:hover { color: var(--live); }
.deal-btn { display: inline-flex; align-items: center; gap: .5rem; background: var(--live); color: #fff; font-weight: 700; font-size: .95rem; border: none; border-radius: 10px; padding: .85rem 1.25rem; cursor: pointer; letter-spacing: -.01em; transition: transform .12s var(--ease), background .15s; font-family: var(--sans); }
.deal-btn:hover { background: var(--live-ink); }
.deal-btn:active { transform: translateY(1px); }
.deal-btn svg { transition: transform .2s var(--ease); }
.deal-btn:hover svg { transform: translateX(3px); }
.hero-sub { margin-top: 16px; font-family: var(--sans); font-size: .8rem; color: var(--ink-3); display: flex; gap: 1.3rem; flex-wrap: wrap; }
.hero-sub s { text-decoration: none; color: var(--ink); }

/* ---------- Dealt-card carousel ---------- */
.deal-col { display: flex; flex-direction: column; gap: 14px; }
.deck-cap { display: flex; justify-content: space-between; align-items: baseline; padding: 0 6px; font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); font-weight: 700; }
.deck-cap .spark { color: var(--live); margin-right: .25em; vertical-align: -.12em; }
.deck-cap .deck-pos { font-family: var(--mono); letter-spacing: .05em; color: var(--ink-2); text-transform: none; }
.deck-dots { display: flex; gap: 6px; justify-content: center; }
.ddot { width: 7px; height: 7px; border-radius: 99px; border: none; background: var(--line-2); cursor: pointer; padding: 0; transition: width .2s, background .2s; }
.ddot:hover { background: var(--ink-3); }
.ddot.on { background: var(--live); width: 22px; }
.deal-stage { position: relative; min-height: 430px; display: flex; align-items: center; justify-content: center; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.ghost { position: absolute; width: 300px; height: 392px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); opacity: .7; border: 1px solid var(--line); }
.ghost.g1 { transform: rotate(-8deg) translate(-46px,14px); }
.ghost.g2 { transform: rotate(6deg) translate(52px,8px); opacity: .5; }
.card { position: relative; width: 330px; background: var(--surface); color: var(--ink); border-radius: 12px; border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); overflow: hidden; z-index: 2; animation: deal .8s var(--ease) both; }
@keyframes deal { from { opacity: 0; transform: translateY(28px) rotate(-3deg) scale(.96); } to { opacity: 1; transform: none; } }
.card-top { padding: 16px 18px 12px; display: flex; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); }
.crest { width: 44px; height: 44px; border-radius: 9px; flex: none; display: flex; align-items: center; justify-content: center; font-family: var(--exp); font-weight: 800; font-size: 1.15rem; color: #fff; background: var(--c-teal); }
.card-id { font-family: var(--mono); font-size: .66rem; color: var(--ink-3); letter-spacing: .02em; margin-bottom: 3px; }
.card-name { font-family: var(--exp); font-weight: 700; font-size: 1.18rem; letter-spacing: -.02em; line-height: 1.05; }
.card-hq { font-size: .78rem; color: var(--ink-2); margin-top: 2px; }
.fit { margin-left: auto; text-align: right; flex: none; }
.fit .num { font-family: var(--exp); font-weight: 800; font-size: 1.5rem; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.fit .lab { font-size: .58rem; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-3); margin-top: 3px; }
.card-body { padding: 13px 18px; }
.why { font-size: .83rem; line-height: 1.5; color: var(--ink); margin: 0 0 13px; }
.why mark { background: linear-gradient(transparent 62%,#f6d38b 62%); color: inherit; padding: 0 1px; }
.statline { display: flex; flex-direction: column; gap: 0; }
.stat { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: .78rem; }
.stat .k { color: var(--ink-2); }
.stat .v { font-family: var(--mono); font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.card-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; background: var(--paper-2); }
.card-foot .live { display: inline-flex; align-items: center; gap: .4rem; font-size: .68rem; font-weight: 700; color: var(--live); text-transform: uppercase; letter-spacing: .1em; }
.ember { width: 8px; height: 8px; border-radius: 50%; background: var(--live); position: relative; }
.ember::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--live); animation: ember 2s ease-out infinite; }
@keyframes ember { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(3); opacity: 0; } }
.card-foot .go { margin-left: auto; font-size: .76rem; font-weight: 700; color: var(--ink); display: inline-flex; align-items: center; gap: .35rem; }

/* ---------- Board / roster ---------- */
.board { padding: 26px 0 90px; }
.board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.board-title { font-family: var(--exp); font-weight: 700; font-size: 1.5rem; letter-spacing: -.02em; color: var(--ink); margin: 0; }
.board-title s { text-decoration: none; color: var(--ink-3); font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .72rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.filters { display: flex; flex-direction: column; gap: 8px; padding: 16px 0; }
.filter-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.filter-row .search-input { flex: 0 1 340px; }
/* Row 2 stays on one line: category pills flatten into the row (display:contents)
   so the JS "More" dropdown can collapse just enough of them to keep the sector
   select + Clear on the same line. */
.filter-row-sub #category-pills { display: contents; }
.filters > .result-count { align-self: flex-end; }
.filt { font-family: var(--sans); font-size: .78rem; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: .4rem .75rem; cursor: pointer; transition: .15s; letter-spacing: -.01em; }
.filt:hover { color: var(--ink); border-color: #cdbfae; }
.filt.on { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }
.roster { display: grid; grid-template-columns: 1fr; gap: 0; margin-top: 6px; }
.row { display: grid; grid-template-columns: 34px 1.5fr 1.1fr 0.9fr 128px; gap: 16px; align-items: center; padding: 13px 12px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; transition: background .14s; }
.row:hover { background: #f8efe8; }
.r-crest { width: 34px; height: 34px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-family: var(--exp); font-weight: 700; font-size: .86rem; color: #fff; }
.r-name { font-weight: 600; font-size: .95rem; color: var(--ink); letter-spacing: -.01em; }
.r-name .id { font-family: var(--mono); font-size: .66rem; color: var(--ink-3); font-weight: 400; margin-top: 2px; display: block; }
.r-thesis { font-size: .82rem; color: var(--ink-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.r-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.r-chip { font-size: .6rem; font-weight: 600; padding: .12rem .4rem; border-radius: 4px; color: #fff; white-space: nowrap; }
.r-meta { text-align: right; font-family: var(--mono); font-size: .74rem; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.r-meta s { display: block; text-decoration: none; font-size: .62rem; margin-top: 2px; }
.r-live { color: var(--live); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; display: inline-flex; align-items: center; gap: .3rem; }
.r-dorm { color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.r-link { position: absolute; inset: 0; z-index: 1; }
.row > * { position: relative; z-index: 2; }
.row .r-link { z-index: 1; }

/* full-directory box at the end of the board */
.dir-cta { margin-top: 26px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 20px 24px; box-shadow: var(--shadow); transition: transform .15s var(--ease), box-shadow .15s; }
.dir-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.dir-cta .t { font-family: var(--exp); font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.dir-cta .s { font-size: .86rem; color: var(--ink-2); margin-top: 2px; }
.dir-cta .go { margin-left: auto; display: inline-flex; align-items: center; gap: .4rem; background: var(--ink); color: #fff; font-weight: 700; font-size: .86rem; padding: .62rem 1.05rem; border-radius: 9px; white-space: nowrap; }

/* board filter toolbar (shared by the home board + the standalone directory) */
#filter-toolbar { align-items: center; }
.search-input { flex: 1 1 240px; min-width: 200px; font-family: var(--sans); font-size: .88rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: .5rem .8rem; letter-spacing: -.01em; }
.search-input::placeholder { color: var(--ink-3); }
.search-input:focus { outline: none; border-color: #d8b7ae; box-shadow: 0 0 0 3px rgba(220,38,38,.07); }
.pill-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.sector-select { appearance: none; -webkit-appearance: none; padding-right: 1.4rem; }
/* Overflow "More" dropdown for pill groups that outgrow one line. */
.more-wrap { position: relative; display: inline-flex; }
.more-btn.filt { display: inline-flex; align-items: center; }
.more-btn.filt::after { content: '\25BE'; display: inline-block; margin-left: .35rem; font-size: .8em; line-height: 1; transition: transform .15s; }
.more-wrap.open .more-btn.filt::after { transform: rotate(180deg); }
.more-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; display: flex; flex-direction: column; gap: 4px; min-width: 210px; max-height: 60vh; overflow-y: auto; padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 12px 32px rgba(40,30,20,.16); }
.more-menu[hidden] { display: none; }
.more-menu .filt { width: 100%; text-align: left; border-color: transparent; }
.more-menu .filt:hover { border-color: var(--line-2); }
.result-count { margin-left: auto; font-family: var(--mono); font-size: .74rem; color: var(--ink-3); white-space: nowrap; }
.active-tags-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 0 0 12px; }
.filter-label { font-size: .68rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.empty-state { padding: 60px 12px; text-align: center; color: var(--ink-2); }
.empty-state h3 { font-family: var(--exp); color: var(--ink); margin-bottom: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .deal-stage { min-height: 400px; }
  .row { grid-template-columns: 30px 1.4fr auto; gap: 12px; }
  .r-thesis, .r-chips { display: none; }
  .dir-cta .go { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tape-in, .card, .ember::after { animation: none; }
}

/* ==========================================================================
   Fund detail + fund-group pages (Dawn). Styles the class names the inline
   render scripts in fund.html / fund-group.html already emit, so the pages
   adopt the Scouting·Dawn look without changing their data/render logic.
   ========================================================================== */

/* warm dawn wash at the top of a document page (fund + group) */
.fund-page { background-image: linear-gradient(180deg, var(--dawn-1) 0, var(--dawn-2) 150px, var(--bg) 430px); background-repeat: no-repeat; }

/* ---- shell: sticky sidebar + report ---- */
.layout-row { max-width: 1240px; margin: 0 auto; padding: 22px 28px 70px; display: grid; grid-template-columns: 290px 1fr; gap: 26px; align-items: start; }
.main-area, .main-content { min-width: 0; }

/* ---- sidebar ---- */
.sidebar { position: sticky; top: 22px; display: flex; flex-direction: column; gap: 16px; }
.sb-section { background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 15px 16px; }
.sb-label { font-family: var(--exp); font-weight: 700; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin-bottom: 10px; }
.sb-stat-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .82rem; }
.sb-stat-row:first-of-type { border-top: none; }
.sb-stat-key { color: var(--ink-2); }
.sb-stat-val { font-family: var(--mono); font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.sb-badges { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.sb-stage-row { align-items: flex-start; }
.sb-stage-row .sb-stat-key { padding-top: 3px; }
#sb-actions { background: none; border: none; box-shadow: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sb-btn { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .72rem 1rem; border-radius: 10px; font-family: var(--sans); font-weight: 600; font-size: .84rem; cursor: pointer; transition: transform .12s var(--ease), background .15s, border-color .15s; letter-spacing: -.01em; }
.sb-btn:active { transform: translateY(1px); }
.sb-btn-outline { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); }
.sb-btn-outline:hover { border-color: #cdbfae; background: var(--paper-2); }
.sb-btn-primary { background: var(--live); color: #fff; border: 1px solid var(--live); }
.sb-btn-primary:hover { background: var(--live-ink); }
.completeness-label { display: flex; justify-content: space-between; font-size: .72rem; color: var(--ink-2); margin-bottom: 7px; }
.completeness-pct { color: var(--ink); font-family: var(--mono); font-weight: 600; }
.completeness-bar-bg { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.completeness-bar-fill { height: 100%; background: var(--c-teal); }
.sb-report-link { font-size: .78rem; color: var(--ink-2); text-align: center; text-decoration: underline; text-decoration-color: var(--line-2); }
.sb-report-link:hover { color: var(--ink); }

/* ---- the report card ---- */
#fund-content { background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.fund-hero { padding: 26px 30px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 16px; position: relative; }
.fund-hero-logo { width: 52px; height: 52px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; font-family: var(--exp); font-weight: 800; font-size: 1.3rem; color: #fff; background: var(--hero-color, var(--c-teal)); }
.fund-hero-name { font-family: var(--exp); font-weight: 800; font-size: 2rem; letter-spacing: -.03em; line-height: 1; margin: 0; color: var(--ink); }
.fund-hero-hq { font-size: .85rem; color: var(--ink-2); margin-top: 6px; }
.fund-hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.fund-hero-aum { font-family: var(--mono); font-weight: 600; color: var(--ink); font-size: .82rem; }
.fund-hero-source { font-size: .72rem; color: var(--ink-3); }
.section { padding: 24px 30px; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: none; }
.section-title { display: flex; align-items: center; gap: .5rem; font-family: var(--exp); font-weight: 700; font-size: 1.02rem; letter-spacing: -.02em; color: var(--ink); margin-bottom: 15px; }
.section-icon { color: var(--live); display: inline-flex; }

/* thesis */
.thesis-body, .thesis-section-body { font-size: .95rem; line-height: 1.68; color: var(--ink); margin: 0 0 .8rem; }
.thesis-section { margin-bottom: 1rem; }
.thesis-section-header { font-family: var(--exp); font-weight: 700; font-size: .9rem; color: var(--ink); margin-bottom: .4rem; }
.thesis-list { margin: .4rem 0 .8rem 1.1rem; color: var(--ink); font-size: .95rem; line-height: 1.6; }
.thesis-list li { margin-bottom: .3rem; }

/* focus areas */
.focus-group { margin-bottom: 16px; }
.focus-group:last-child { margin-bottom: 0; }
.focus-group-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; margin-bottom: 8px; }
.badge-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* coded stage badges (used across fund, group, similar, sidebar) */
.badge { font-size: .7rem; font-weight: 600; padding: .28rem .6rem; border-radius: 6px; color: #fff; letter-spacing: -.01em; white-space: nowrap; background: var(--ink-3); }
.badge-pre-seed, .badge-seed, .badge-early { background: var(--c-amber); }
.badge-series-a { background: var(--c-teal); }
.badge-series-b { background: var(--c-cobalt); }
.badge-growth { background: var(--c-moss); }
.badge-pe-debt { background: var(--c-plum); }
.badge-multi-stage { background: var(--c-brick); }
.badge-other { background: var(--ink-3); }

/* sector tags (neutral outlined chips) */
.tag { display: inline-block; font-size: .76rem; padding: .3rem .6rem; border-radius: 7px; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface); transition: .14s; }
.tag-link:hover { border-color: var(--ink-3); color: var(--ink); }

/* investment signals */
.signals-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; }
.signal-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .86rem; }
.signal-label { color: var(--ink-2); }
.signal-value { font-family: var(--mono); font-weight: 500; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }

/* shared fund-logo tiles — markup comes from js/fund-logo.js.
   `has-logo` whitens the tile while a real logo is showing; the img onerror drops
   the class so the tile falls back to the original coloured initials. */
.has-logo { background: #fff !important; border: 1px solid var(--line-2); overflow: hidden; }
.has-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; box-sizing: border-box; display: block; }
.crest-init { font-style: normal; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

/* portfolio */
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 9px; }
.portfolio-card { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 6px; border: 1px solid var(--line-2); border-radius: 9px; transition: .14s; text-align: center; }
.portfolio-card:hover { border-color: var(--ink-3); background: var(--paper-2); }
.portfolio-logo-wrap { width: 38px; height: 38px; border-radius: 8px; background: #fff; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.portfolio-logo { width: 30px; height: 30px; object-fit: contain; }
.portfolio-initial { width: 38px; height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--exp); font-weight: 700; font-size: 1rem; }
.portfolio-name { font-size: .66rem; color: var(--ink-2); line-height: 1.25; }
.show-all-btn { margin-top: 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; padding: .6rem 1rem; font-family: var(--sans); font-weight: 600; font-size: .8rem; color: var(--ink); cursor: pointer; transition: .14s; }
.show-all-btn:hover { border-color: var(--ink-3); background: var(--paper-2); }

/* team */
.team-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.team-member { display: flex; align-items: center; gap: 11px; }
.team-avatar { width: 38px; height: 38px; border-radius: 9px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--exp); font-weight: 700; font-size: .85rem; }
.team-name { font-weight: 700; font-size: .86rem; color: var(--ink); }
.team-title { font-size: .72rem; color: var(--ink-2); }

.unique-body { font-size: .95rem; line-height: 1.6; color: var(--ink); max-width: 68ch; }

/* aum + sources */
.aum-display { font-family: var(--exp); font-weight: 800; font-size: 1.6rem; color: var(--ink); letter-spacing: -.02em; }
.aum-sub { font-size: .78rem; color: var(--ink-3); margin: 2px 0 16px; }
.sources-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; margin-bottom: 6px; }
.source-item { display: flex; align-items: baseline; gap: .5rem; font-size: .8rem; padding: 6px 0; border-top: 1px solid var(--line); }
.source-item:first-of-type { border-top: none; }
.source-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink); align-self: center; flex: none; }
.source-link { text-decoration: underline; text-decoration-color: var(--line-2); color: var(--ink); }
.source-link:hover { text-decoration-color: var(--ink); }
.source-date { font-family: var(--mono); font-size: .66rem; color: var(--ink-3); margin-left: auto; }

/* match CTA strip + report-error (inside the report card) */
.match-cta-strip { padding: 20px 30px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: linear-gradient(180deg, var(--paper-2), var(--surface)); border-top: 1px solid var(--line); }
.match-cta-text strong { display: block; font-family: var(--exp); font-weight: 700; color: var(--ink); font-size: 1rem; }
.match-cta-text span { font-size: .85rem; color: var(--ink-2); }
.match-cta-btn { background: var(--live); color: #fff; font-weight: 700; font-size: .86rem; padding: .62rem 1.05rem; border-radius: 9px; white-space: nowrap; }
.match-cta-btn:hover { background: var(--live-ink); }
.report-section { padding: 20px 30px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.report-text h3 { font-family: var(--exp); font-weight: 700; font-size: .95rem; color: var(--ink); margin: 0 0 3px; }
.report-text p { font-size: .84rem; color: var(--ink-2); margin: 0; }
.report-btn { background: var(--ink); color: #fff; font-weight: 700; font-size: .82rem; padding: .6rem 1rem; border-radius: 9px; white-space: nowrap; }
.report-btn:hover { background: #000; }

/* similar funds (rows inside the report card) */
.similar-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.similar-card { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); transition: transform .14s; }
.similar-card:first-of-type { border-top: none; }
.similar-card:hover { transform: translateX(6px); }
.similar-logo { width: 30px; height: 30px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--exp); font-weight: 700; font-size: .76rem; flex: none; }
.similar-name { font-weight: 600; font-size: .88rem; color: var(--ink); }
.similar-hq { font-size: .72rem; color: var(--ink-2); }
.similar-badges { display: flex; gap: 4px; margin-top: 3px; }
.similar-arrow { margin-left: auto; color: var(--ink-3); font-size: 1rem; }

/* loading / not-found / error states */
.state-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 80px 20px; text-align: center; }
.loading-spinner { width: 32px; height: 32px; border: 3px solid var(--line-2); border-top-color: var(--live); border-radius: 50%; animation: fspin .8s linear infinite; }
@keyframes fspin { to { transform: rotate(360deg); } }
.state-title { font-family: var(--exp); font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.state-sub { font-size: .88rem; color: var(--ink-2); }
.state-back-link { color: var(--live); font-weight: 600; font-size: .88rem; }

/* suggest-an-edit modal */
.edit-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.edit-modal[hidden] { display: none; }
.edit-modal-backdrop { position: absolute; inset: 0; background: rgba(28,23,18,.5); backdrop-filter: blur(3px); }
.edit-modal-card { position: relative; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 28px; max-width: 400px; width: 100%; }
.edit-modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; font-size: 1.5rem; line-height: 1; color: var(--ink-3); cursor: pointer; }
.edit-modal-card h1 { font-family: var(--exp); font-weight: 800; font-size: 1.3rem; color: var(--ink); margin: 0 0 8px; }
.auth-sub { font-size: .86rem; color: var(--ink-2); margin-bottom: 16px; line-height: 1.5; }
.edit-modal-card label { display: block; font-size: .82rem; color: var(--ink-2); margin-bottom: 14px; }
.edit-modal-card input { width: 100%; margin-top: 5px; padding: .7rem .85rem; border: 1px solid var(--line-2); border-radius: 9px; font-family: var(--sans); font-size: .9rem; color: var(--ink); background: var(--surface); }
.edit-modal-card input:focus { outline: none; border-color: #d8b7ae; box-shadow: 0 0 0 4px rgba(220,38,38,.08); }
.auth-note { font-size: .74rem; color: var(--ink-3); margin-top: 10px; }
body.modal-open { overflow: hidden; }

/* ---- fund-group: card grid ---- */
.page-body { max-width: 1180px; margin: 0 auto; padding: 30px 28px 70px; }
.group-intro { margin-bottom: 22px; }
.group-count { font-family: var(--exp); font-weight: 800; font-size: 1.6rem; letter-spacing: -.02em; color: var(--ink); }
.group-desc { font-size: 1rem; color: var(--ink-2); max-width: 70ch; margin: 8px 0 0; line-height: 1.55; }
.fund-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.fund-card { position: relative; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: transform .15s var(--ease), box-shadow .15s; }
.fund-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.fund-card .card-link { position: absolute; inset: 0; z-index: 1; }
.fund-card > *:not(.card-link) { position: relative; z-index: 2; pointer-events: none; }
.fund-card .card-top { display: flex; align-items: center; gap: 12px; }
.fund-card .card-logo { width: 40px; height: 40px; border-radius: 9px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--exp); font-weight: 700; font-size: .95rem; }
.fund-card .card-name { font-family: var(--exp); font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; color: var(--ink); }
.fund-card .card-hq { font-size: .78rem; color: var(--ink-2); margin-top: 1px; }
.fund-card .card-stages { display: flex; gap: 6px; flex-wrap: wrap; }
.fund-card .card-thesis { font-size: .84rem; color: var(--ink-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fund-card .card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.fund-card .card-aum { font-family: var(--mono); font-size: .78rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.fund-card .card-arrow { color: var(--ink-3); }

@media (max-width: 860px) {
  .layout-row { grid-template-columns: 1fr; gap: 18px; }
  .sidebar { position: static; }
  .fund-hero { padding: 20px; }
  .fund-hero-name { font-size: 1.6rem; }
  .section, .match-cta-strip, .report-section { padding: 20px; }
  .signals-grid, .team-list { grid-template-columns: 1fr; }
  .fund-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .loading-spinner { animation: none; } }

/* ==========================================================================
   Static + legal pages (Dawn) — privacy, terms, sources article typography
   ========================================================================== */
.legal { max-width: 1240px; margin: 0 auto; padding: 44px 28px 80px; }
.legal > * { max-width: 760px; } /* readable prose column, left-aligned to the header gutter */
.legal .legal-kicker { font-family: var(--mono); font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--live); }
.legal h1 { font-family: var(--exp); font-weight: 800; letter-spacing: -.03em; font-size: clamp(1.9rem, 4vw, 2.6rem); color: var(--ink); line-height: 1.05; margin: .4rem 0 .3rem; }
.legal .updated { color: var(--ink-3); font-size: .85rem; margin-bottom: 2rem; }
.legal h2 { font-family: var(--exp); font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; color: var(--ink); margin: 2rem 0 .5rem; }
.legal p, .legal li { color: var(--ink-2); font-size: 1rem; line-height: 1.65; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal em { color: var(--ink-2); }
.legal ul { padding-left: 1.2rem; }
.legal li { margin: .3rem 0; }
.legal a { color: var(--live); font-weight: 500; }
.legal a:hover { text-decoration: underline; }
.legal .note { background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 1rem 1.2rem; font-size: .92rem; color: var(--ink-2); margin: 1.5rem 0; }
.legal .callout { background: var(--dawn-2); border: 1px solid #f3c9c0; border-radius: 12px; padding: 1rem 1.2rem; font-size: .95rem; color: #7f2a20; margin: 1.4rem 0; }
.legal .callout strong { color: #611f17; }
.legal table { width: 100%; border-collapse: collapse; margin: .8rem 0; font-size: .92rem; }
.legal th, .legal td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal th { color: var(--ink-3); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.legal td { color: var(--ink-2); }
