/* Venture Portal
   Ground: cool drafting grey, so the signal colours mean something when they appear.
   Display: Archivo, using its width axis. Wide for headings, normal for reading.
   Data: IBM Plex Mono, because days, counts and money should line up. */

:root {
  --ground: #E4E7E2;
  --surface: #FBFBF9;
  --surface-2: #F1F3EF;
  --ink: #15181A;
  --ink-2: #3D444A;
  --muted: #6C7278;
  --rule: #CDD3CB;
  --rule-strong: #A9B1A8;
  --navy: #1F2E45;
  --go: #2C6B4C;
  --hold: #A76A15;
  --stop: #9E2E25;
  --go-bg: #DCE8DF;
  --hold-bg: #F2E6D0;
  --stop-bg: #F0DAD7;
  --shadow: 0 1px 0 rgba(21,24,26,.06), 0 1px 3px rgba(21,24,26,.05);
  --r: 3px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  font-variation-settings: 'wdth' 100;
}

a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }

.mono, time, .num {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ chrome */

.topbar {
  background: var(--navy);
  color: #E9ECEF;
  border-bottom: 1px solid var(--navy);
}
.topbar-in {
  max-width: 1120px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.wordmark {
  font-variation-settings: 'wdth' 118, 'wght' 700;
  letter-spacing: .14em; text-transform: uppercase; font-size: 13px;
  color: #fff; text-decoration: none;
}
.wordmark span { color: #8FA4C0; }
.topnav { display: flex; gap: 16px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.topnav a { color: #C3CCD8; text-decoration: none; font-size: 13px; letter-spacing: .04em; }
.topnav a:hover, .topnav a.on { color: #fff; }
.topnav form { margin: 0; }
.linkbtn {
  background: none; border: 0; color: #C3CCD8; font: inherit; font-size: 13px;
  cursor: pointer; padding: 0; letter-spacing: .04em;
}
.linkbtn:hover { color: #fff; }

main { max-width: 1120px; margin: 0 auto; padding: 28px 20px 80px; }

.flash {
  background: var(--navy); color: #fff; padding: 10px 14px; border-radius: var(--r);
  margin-bottom: 20px; font-size: 14px;
}

/* --------------------------------------------------------------- typography */

h1 {
  font-size: 27px; margin: 0 0 4px;
  font-variation-settings: 'wdth' 112, 'wght' 650;
  letter-spacing: -.01em; line-height: 1.15;
}
h2 {
  font-size: 15px; margin: 0 0 12px; text-transform: uppercase;
  letter-spacing: .13em; font-variation-settings: 'wdth' 108, 'wght' 600;
  color: var(--ink-2);
}
h3 { font-size: 16px; margin: 0 0 6px; font-variation-settings: 'wdth' 104, 'wght' 600; }

.eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: .18em;
  color: var(--muted); font-variation-settings: 'wdth' 106, 'wght' 600;
  margin: 0 0 6px;
}
.lede { color: var(--ink-2); max-width: 62ch; margin: 0 0 24px; }
.page-head { margin-bottom: 26px; }
.small { font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------------- cards */

.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px;
}
.grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid.two { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------- signature: the ladder */
/* Ten rungs. Filled rungs are closed stages, the wide rung is where you are,
   and the notched rungs are the four decision gates. */

.ladder { display: flex; gap: 3px; align-items: flex-end; margin: 14px 0 4px; }
.rung {
  flex: 1; height: 26px; background: var(--surface-2);
  border: 1px solid var(--rule); border-radius: 1px; position: relative;
  display: flex; align-items: flex-end; justify-content: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--muted);
  padding-bottom: 2px; text-decoration: none;
}
.rung.done { background: var(--navy); border-color: var(--navy); color: #93A5BC; }
.rung.here { height: 38px; background: var(--surface); border: 1.5px solid var(--ink); color: var(--ink); }
.rung.gate::before {
  content: ''; position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--rule-strong);
}
.rung.here.gate::before { border-top-color: var(--ink); }
.ladder-key { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

/* --------------------------------------------- signature: the two clocks */

.clocks { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.clock {
  flex: 1 1 190px; border: 1px solid var(--rule); border-radius: var(--r);
  padding: 10px 12px; background: var(--surface-2);
}
.clock-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .15em;
  color: var(--muted); display: flex; justify-content: space-between; align-items: baseline;
}
.clock-value {
  font-family: 'IBM Plex Mono', monospace; font-size: 20px; line-height: 1.2; margin-top: 2px;
}
.clock-bar { height: 4px; background: var(--rule); margin-top: 8px; border-radius: 2px; overflow: hidden; }
.clock-bar i { display: block; height: 100%; background: var(--ink-2); }
.clock.met { background: var(--go-bg); border-color: #A9C5B2; }
.clock.met .clock-bar i { background: var(--go); }
.clock.met .clock-value { color: var(--go); }
.clock.breached { background: var(--stop-bg); border-color: #D6A9A3; }
.clock.breached .clock-bar i { background: var(--stop); width: 100% !important; }
.clock.breached .clock-value { color: var(--stop); }

/* ---------------------------------------------------------------- progress */

.bar { height: 6px; background: var(--surface-2); border: 1px solid var(--rule); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--navy); }

/* ------------------------------------------------------------------- tags */

.tag {
  display: inline-block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .11em;
  padding: 2px 7px; border-radius: 2px; border: 1px solid var(--rule-strong);
  color: var(--ink-2); background: var(--surface-2); white-space: nowrap;
  font-variation-settings: 'wdth' 100, 'wght' 600;
}
.tag.go { color: var(--go); border-color: #A9C5B2; background: var(--go-bg); }
.tag.hold { color: var(--hold); border-color: #DCC69B; background: var(--hold-bg); }
.tag.stop { color: var(--stop); border-color: #D6A9A3; background: var(--stop-bg); }
.tag.ai { color: var(--navy); border-color: #A8B5C7; background: #DEE5EE; }

/* ------------------------------------------------------------ venture card */

.venture { display: block; text-decoration: none; color: inherit; }
.venture:hover { border-color: var(--rule-strong); }
.venture-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.venture h3 { font-size: 19px; font-variation-settings: 'wdth' 110, 'wght' 650; }
.people { display: flex; gap: 5px; margin-top: 2px; }
.chip {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--surface-2); border: 1px solid var(--rule); border-radius: 10px;
  padding: 1px 8px; color: var(--ink-2);
}
.chip.lead { background: var(--navy); border-color: var(--navy); color: #fff; }
.stat-row { display: flex; gap: 22px; margin-top: 12px; flex-wrap: wrap; }
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.stat-value { font-family: 'IBM Plex Mono', monospace; font-size: 15px; }

/* ------------------------------------------------------------------ tasks */

.tasklist { list-style: none; margin: 0; padding: 0; }
.tasklist li { border-top: 1px solid var(--rule); }
.tasklist li:first-child { border-top: 0; }
.task-row {
  display: flex; gap: 12px; align-items: baseline; padding: 10px 2px;
  text-decoration: none; color: inherit;
}
.task-row:hover { background: var(--surface-2); }
.task-seq { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); min-width: 24px; }
.task-title { flex: 1; }
.task-row.done .task-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--rule-strong); }
.task-meta { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.stage-block { border-top: 1px solid var(--rule-strong); padding-top: 14px; margin-top: 26px; }
.stage-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.stage-num { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); }
.stage-name { font-variation-settings: 'wdth' 112, 'wght' 650; font-size: 17px; }
.stage-obj { color: var(--muted); font-size: 13px; }
.stage-count { margin-left: auto; font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ forms */

label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; font: inherit; font-size: 14px;
  border: 1px solid var(--rule-strong); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
}
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy); outline-offset: 1px; border-color: var(--navy); }
.field { margin-bottom: 16px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: none; letter-spacing: 0; }
.row { display: grid; gap: 14px; }
@media (min-width: 640px) { .row.three { grid-template-columns: 1fr 1fr 1fr; } .row.two { grid-template-columns: 1fr 1fr; } }

.btn {
  display: inline-block; background: var(--navy); color: #fff; border: 1px solid var(--navy);
  padding: 9px 18px; border-radius: var(--r); font: inherit; font-size: 14px;
  cursor: pointer; text-decoration: none; letter-spacing: .02em;
}
.btn:hover { background: #162336; color: #fff; }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.go { background: var(--go); border-color: var(--go); }
.btn.stop { background: var(--stop); border-color: var(--stop); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

fieldset { border: 1px solid var(--rule); border-radius: var(--r); padding: 12px 14px; margin: 0 0 16px; }
legend { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); padding: 0 6px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.check input { width: auto; }
.check label { margin: 0; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); }

/* ------------------------------------------------------------- task detail */

.why {
  border-left: 3px solid var(--navy); padding: 2px 0 2px 14px;
  color: var(--ink-2); margin: 0 0 20px; max-width: 66ch;
}
.action-block { margin-bottom: 18px; }
.action-block .eyebrow { margin-bottom: 3px; }
.gate-line {
  background: var(--surface-2); border: 1px dashed var(--rule-strong);
  border-radius: var(--r); padding: 10px 13px; font-size: 14px;
}
.ai-out {
  white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--rule);
  border-radius: var(--r); padding: 14px; font-size: 14px; line-height: 1.6; margin-top: 12px;
}
.ai-out:empty { display: none; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 0 10px 7px 0; font-weight: 600; }
td { padding: 9px 10px 9px 0; border-top: 1px solid var(--rule); vertical-align: top; }

.empty {
  border: 1px dashed var(--rule-strong); border-radius: var(--r);
  padding: 26px 20px; text-align: center; color: var(--muted); background: var(--surface-2);
}

/* ------------------------------------------------------------------- login */

.login-wrap { max-width: 380px; margin: 12vh auto; padding: 0 20px; }
.login-mark {
  font-variation-settings: 'wdth' 120, 'wght' 700; letter-spacing: .2em;
  text-transform: uppercase; font-size: 14px; margin-bottom: 8px;
}
.error { color: var(--stop); font-size: 14px; margin-bottom: 14px; }

@media (prefers-reduced-motion: no-preference) {
  .rung { transition: height .2s ease; }
}

/* collapsed stages */
details > summary.stage-head { cursor: pointer; list-style: none; }
details > summary.stage-head::-webkit-details-marker { display: none; }
details > summary.stage-head::before {
  content: '+'; font-family: 'IBM Plex Mono', monospace; color: var(--muted);
  margin-right: 2px; width: 12px; display: inline-block;
}
details[open] > summary.stage-head::before { content: '\2212'; }
details > summary.stage-head:hover .stage-name { color: var(--navy); }
textarea[readonly] { background: var(--surface-2); color: var(--ink-2); }

/* ------------------------------------------------------ deliverable forms */
.req {
  font-size: 10px; letter-spacing: .08em; color: var(--hold);
  border: 1px solid #DCC69B; background: var(--hold-bg);
  padding: 1px 6px; border-radius: 2px; margin-left: 6px; text-transform: none;
}
.checklist { border-radius: var(--r); padding: 12px 14px; margin-bottom: 18px; }
.checklist ul { margin: 4px 0 0; padding-left: 18px; font-size: 14px; }
.checklist li { margin-bottom: 2px; }
.checklist.not-ready { background: var(--stop-bg); border: 1px solid #D6A9A3; color: var(--stop); }
.checklist.ready { background: var(--go-bg); border: 1px solid #A9C5B2; color: var(--go); }
.source-link {
  background: var(--surface-2); border: 1px solid var(--rule);
  border-radius: var(--r); padding: 12px 14px; margin-bottom: 18px;
}
.repeat { border-left: 2px solid var(--rule-strong); padding-left: 12px; margin-bottom: 22px; }
.repeat-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.repeat-row input, .repeat-row select { flex: 1; }
.row-n { color: var(--muted); font-size: 11px; min-width: 16px; text-align: right; }
.row-x {
  background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1;
  cursor: pointer; padding: 0 4px;
}
.row-x:hover { color: var(--stop); }
.small-btn { padding: 5px 12px; font-size: 13px; }
.table-scroll { overflow-x: auto; margin-bottom: 8px; }
.entry-table { min-width: 100%; }
.entry-table th { padding: 0 6px 6px 0; white-space: nowrap; }
.entry-table td { padding: 3px 6px 3px 0; border: 0; vertical-align: top; }
.entry-table tr.repeat-row { display: table-row; }
.entry-table input, .entry-table select { min-width: 130px; padding: 6px 8px; font-size: 13px; }
.entry-table td.row-n { padding-top: 12px; }
.money-wrap { display: flex; align-items: center; gap: 8px; }
.money-wrap .cur { color: var(--muted); font-size: 13px; }
input[type=file] { font-size: 13px; padding: 6px 0; border: 0; }
