/* StaFeb — shared styles.
   Paper and ink, one accent. The accent is reserved for "the next thing to do". */

:root {
  --paper: #F1F0ED;
  --panel: #FAFAF8;
  --ink: #191917;
  --ink-2: #4A4A45;
  --ink-3: #7A7A73;
  --rule: #D9D7D1;
  --rule-strong: #B9B6AE;
  --accent: #C25A1C;
  --accent-ink: #FFFFFF;
  --accent-soft: #F6E4D8;
  --good: #1F8A6D;
  --good-soft: #DDEFE8;
  --bad: #B23A3A;
  --bad-soft: #F5DEDE;
  --info: #1B6FA8;
  --info-soft: #DCE9F3;

  /* Headings: Century Gothic where installed (Windows with Office, macOS). It is a licensed
     Monotype face with no free webfont, so Didact Gothic, a free look-alike, covers phones.
     Didact has no bold, and font-synthesis on headings stops the browser faking one. */
  --serif: "Century Gothic", CenturyGothic, "Didact Gothic", AppleGothic, "Roboto", sans-serif;
  --sans: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 6px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151513;
    --panel: #1D1D1A;
    --ink: #ECEBE6;
    --ink-2: #BDBCB5;
    --ink-3: #8C8B84;
    --rule: #2F2F2B;
    --rule-strong: #45453F;
    --accent: #CE7029;
    --accent-ink: #151513;
    --accent-soft: #3A2616;
    --good: #2E9878;
    --good-soft: #15302A;
    --bad: #D06060;
    --bad-soft: #3A1C1C;
    --info: #3E93C8;
    --info-soft: #16293A;
  }
}
:root[data-theme="dark"] {
  --paper: #151513;
  --panel: #1D1D1A;
  --ink: #ECEBE6;
  --ink-2: #BDBCB5;
  --ink-3: #8C8B84;
  --rule: #2F2F2B;
  --rule-strong: #45453F;
  --accent: #CE7029;
  --accent-ink: #151513;
  --accent-soft: #3A2616;
  --good: #2E9878;
  --good-soft: #15302A;
  --bad: #D06060;
  --bad-soft: #3A1C1C;
  --info: #3E93C8;
  --info-soft: #16293A;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; font-synthesis: none; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .4em; }
h1 { font-size: clamp(34px, 5.6vw, 60px); letter-spacing: -.02em; }
h2 { font-size: clamp(24px, 3.4vw, 34px); }
h3 { font-size: 19px; font-weight: 500; letter-spacing: 0; }
p { margin: 0 0 1em; }
.mono, .label { font-family: var(--mono); }
.label { font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px var(--gutter); border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; background: var(--paper); z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 5px; background: var(--ink); color: var(--paper);
  display: grid; place-items: center; font: 600 12px var(--mono);
}
.brand-name { font-family: var(--serif); font-synthesis: none; font-size: 18px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.badge {
  font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--rule-strong); border-radius: 99px; padding: 2px 8px; color: var(--ink-2);
}
.nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink-2); font-size: 14px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* ---------- Buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  font: 500 14px var(--sans); padding: 8px 14px; border-radius: var(--radius);
  border: 1px solid var(--rule-strong); background: var(--panel); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); padding: 6px 8px; }
.btn.ghost:hover { color: var(--ink); background: var(--panel); }
.btn.small { font-size: 12px; padding: 4px 9px; }
.btn.danger { color: var(--bad); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

input, select, textarea {
  font: 14px var(--sans); color: var(--ink); background: var(--panel);
  border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 8px 10px; width: 100%;
}
textarea { min-height: 72px; resize: vertical; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 180px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Landing ---------- */
.hero { padding: 72px 0 48px; border-bottom: 1px solid var(--rule); }
.hero p.lede { font-size: 19px; max-width: 640px; color: var(--ink-2); }
.loop {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 28px 0;
  font: 12px var(--mono); color: var(--ink-2);
}
.loop span { border: 1px solid var(--rule-strong); border-radius: 99px; padding: 4px 10px; background: var(--panel); }
.loop i { font-style: normal; color: var(--ink-3); }
.section { padding: 56px 0; border-bottom: 1px solid var(--rule); }
.grid { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cell { background: var(--panel); padding: 22px; }
.cell h3 { margin-bottom: 6px; }
.cell p { color: var(--ink-2); margin: 0; font-size: 14px; }
.founders { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.founder { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel); padding: 22px; }
.founder h3 { font-synthesis: none; font-size: 21px; font-weight: 700; margin-bottom: 2px; }
.footer { padding: 32px 0 48px; color: var(--ink-3); font-size: 13px; }
.footer a { color: var(--ink-2); }
table.plain { width: 100%; border-collapse: collapse; font-size: 14px; }
table.plain th, table.plain td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.plain th { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 57px); }
.side { border-right: 1px solid var(--rule); padding: 18px 12px; position: sticky; top: 57px; height: calc(100vh - 57px); overflow-y: auto; }
.side .startup-name { font-family: var(--serif); font-synthesis: none; font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; padding: 0 8px; margin-bottom: 4px; word-break: break-word; }
.side .stage { padding: 0 8px; margin-bottom: 18px; }
.side nav a {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 5px; text-decoration: none; color: var(--ink-2); font-size: 14px;
}
.side nav a:hover { background: var(--panel); color: var(--ink); }
.side nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.side nav a .count { font: 11px var(--mono); opacity: .7; }
.side .group { margin: 16px 8px 6px; }
.main { padding: 28px clamp(16px, 3vw, 40px) 80px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h2 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); max-width: 640px; }

.card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }
.card.form { border-style: dashed; }
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card-title { font-weight: 500; font-size: 15px; margin: 0 0 4px; }
.card-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.list-empty { border: 1px dashed var(--rule-strong); border-radius: var(--radius); padding: 22px; color: var(--ink-3); text-align: center; font-size: 14px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font: 500 11px var(--mono); letter-spacing: .03em; padding: 2px 8px; border-radius: 99px;
  border: 1px solid var(--rule-strong); color: var(--ink-2); background: transparent; white-space: nowrap;
}
.chip.good { color: var(--good); border-color: var(--good); background: var(--good-soft); }
.chip.bad { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.chip.info { color: var(--info); border-color: var(--info); background: var(--info-soft); }
.chip.accent { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.chip.link { cursor: pointer; text-decoration: none; }

/* Next best action */
.nba {
  border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius);
  padding: 18px 20px; display: flex; gap: 16px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 24px;
}
.nba .label { color: var(--accent); }
.nba h3 { font-synthesis: none; margin: 4px 0 4px; font-size: 21px; font-weight: 700; }
.nba p { margin: 0; color: var(--ink-2); font-size: 14px; }

/* Outcome timeline */
.timeline { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin-bottom: 28px; }
.tl-step { border-top: 3px solid var(--rule-strong); padding-top: 8px; min-width: 0; }
.tl-step.done { border-color: var(--good); }
.tl-step.current { border-color: var(--accent); }
.tl-step .tl-name { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.tl-step .tl-desc { font-size: 12px; color: var(--ink-3); line-height: 1.35; margin-top: 2px; }

.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; margin-bottom: 28px; }
.stat { background: var(--panel); padding: 14px 16px; text-decoration: none; }
.stat:hover { background: var(--paper); }
.stat .n { font-family: var(--serif); font-synthesis: none; font-size: 28px; font-weight: 500; line-height: 1; letter-spacing: -.02em; }
.stat .l { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-top: 4px; }

/* Trace (context graph) */
.trace { border-left: 2px solid var(--rule-strong); margin-left: 6px; padding-left: 16px; }
.trace-node { position: relative; margin: 8px 0; }
.trace-node::before { content: ""; position: absolute; left: -22px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--rule-strong); }
.trace-node.good::before { border-color: var(--good); background: var(--good); }
.trace-node.bad::before { border-color: var(--bad); background: var(--bad); }
.trace-node.accent::before { border-color: var(--accent); }
.trace-kind { font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-right: 6px; }

/* Board */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.col { background: transparent; border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px; min-width: 0; }
.col > .label { display: block; margin: 2px 4px 10px; }
.col .card { margin-bottom: 8px; padding: 12px; }

/* Dashboard */
.startups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.startup-card { text-decoration: none; display: block; }
.startup-card:hover { border-color: var(--ink-3); }
.startup-card h3 { margin-bottom: 4px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius);
  font-size: 14px; z-index: 50; max-width: calc(100vw - 32px);
}
.notice { border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 12px 14px; font-size: 13px; color: var(--ink-2); background: var(--panel); margin-bottom: 20px; }

details.more > summary { cursor: pointer; font-size: 13px; color: var(--ink-2); list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+ "; font-family: var(--mono); }
details.more[open] > summary::before { content: "− "; }

pre.doc { white-space: pre-wrap; font: 13px/1.6 var(--mono); background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; max-height: 60vh; overflow: auto; }

.side-toggle { display: none; }

/* Feedback — pilot users talk to the founders from anywhere in the app. */
.fb-btn { position: fixed; right: 16px; bottom: 16px; z-index: 40; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.fb-box { position: fixed; right: 16px; bottom: 60px; z-index: 41; width: min(380px, calc(100vw - 32px)); box-shadow: 0 8px 30px rgba(0,0,0,.25); margin: 0; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--rule); padding: 12px var(--gutter); }
  .side nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
  .side nav a { flex: 0 0 auto; }
  .side .group { display: none; }
  .timeline { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 14px; }
  .board { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav .hide-sm { display: none; }
  .brand-name { font-size: 16px; }
  .topbar .nav { gap: 10px; }
  .topbar .btn.primary { padding: 7px 10px; font-size: 13px; }
}
