/* =============================================================================
   6TH WAVE VENTURES — BUILD COCKPIT · STYLES
   Ported from the TSX design spec (dark, two-tone teal/gold).
   Fonts: Fraunces (display) · DM Sans (body) · JetBrains Mono (labels)
   ============================================================================ */

:root {
  --bg:       #0a0d15;
  --bg2:      #0c1019;
  --panel:    #10141f;
  --panel2:   #141a28;
  --line:     #1e2638;
  --line2:    #2a3550;
  --text:     #e8edf6;
  --dim:      #8a97b0;
  --faint:    #5c6883;
  --teal:     #2dd4bf;
  --gold:     #e0b94d;
  --rose:     #fb7185;
  --violet:   #c084fc;
  --emerald:  #34d399;
  --blue:     #60a5fa;
  --amber:    #f59e0b;

  --mono:    'JetBrains Mono', ui-monospace, monospace;
  --display: 'Fraunces', Georgia, serif;
  --body:    'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  letter-spacing: -0.01em;
  min-height: 100vh;
}

body {
  display: flex;
}

button { font-family: inherit; color: inherit; cursor: pointer; background: none; border: none; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ────────────────────────────────────────────────────────── SIDEBAR */
#sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--line);
  padding: 26px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; margin-bottom: 4px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--teal), #0e7a6e);
  display: grid; place-items: center;
  box-shadow: 0 4px 18px rgba(45, 212, 191, 0.35);
}
.brand-mark span { font-family: var(--display); font-weight: 700; font-size: 20px; color: #04201c; }
.brand-name { font-family: var(--display); font-size: 17px; font-weight: 600; line-height: 1; }
.brand-tag  { font-family: var(--mono); font-size: 9px; letter-spacing: 0.22em; color: var(--gold); margin-top: 4px; }

.sep { height: 1px; background: var(--line); margin: 16px 6px 14px; }

.label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 12px; padding: 0 6px;
}

#view-nav { display: flex; flex-direction: column; gap: 4px; }

.nav-btn {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 9px;
  font-family: var(--body); font-size: 13.5px; font-weight: 500;
  color: var(--dim);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.nav-btn:hover { background: rgba(255,255,255,0.025); }
.nav-btn.active {
  background: var(--panel2);
  border-color: var(--line2);
  color: var(--text);
  font-weight: 600;
}
.nav-btn .ico { width: 16px; height: 16px; color: var(--gold); flex-shrink: 0; }
.nav-btn.active .ico { color: var(--teal); }

.filter-group { padding: 0 6px; margin-bottom: 10px; }
.filter-label {
  display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 6px;
}
.filter-select {
  width: 100%; padding: 8px 10px; border-radius: 7px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line2);
  font-family: var(--body); font-size: 12.5px;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><polyline points='2,4 5,7 8,4' fill='none' stroke='%238a97b0' stroke-width='1.4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 26px;
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--teal); }

.footer-stat {
  margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 9.5px; color: var(--faint); line-height: 1.7;
}

/* ────────────────────────────────────────────────────────── MAIN */
#main {
  flex: 1; min-width: 0;
  padding: 30px 38px 64px;
  max-width: 1280px;
}

#view-root { animation: rise 0.4s ease both; }

#footer {
  margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; color: var(--faint);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ────────────────────────────────────────────────────────── PRIMITIVES */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.panel.accent::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--accent, var(--teal)), transparent);
}

h1.display {
  font-family: var(--display); font-size: 38px; font-weight: 600;
  line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 12px;
}
h1.display .accent { color: var(--teal); }

.lede {
  color: var(--dim); font-size: 15.5px; max-width: 720px; line-height: 1.6; margin-bottom: 28px;
}

.label-light { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 14px; }

/* ────────────────────────────────────────────────────────── PORTFOLIO VIEW */
.headline-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 30px;
}
.headline-grid .panel { padding: 18px; }
.headline-grid .ico { width: 18px; height: 18px; }
.headline-grid .num { font-family: var(--display); font-size: 34px; font-weight: 600; margin-top: 10px; line-height: 1; }
.headline-grid .cap { color: var(--dim); font-size: 12.5px; margin-top: 6px; }

.pillar-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 13px; margin-bottom: 34px;
}
.pillar-card .head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.pillar-card .badge {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; flex-shrink: 0;
}
.pillar-card .badge .ico { width: 16px; height: 16px; }
.pillar-card .name { font-weight: 600; font-size: 13.5px; line-height: 1.15; }
.pillar-card .blurb { color: var(--dim); font-size: 12.3px; line-height: 1.55; }

/* COVERAGE MATRIX */
.matrix-panel { padding: 0; margin-bottom: 34px; overflow-x: auto; }
.matrix { min-width: 760px; }
.matrix-row {
  display: grid; grid-template-columns: 210px repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
}
.matrix-row.head .cell-col-head {
  padding: 14px 16px; font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: 0.1em;
}
.matrix-row.head .cell-col {
  padding: 14px 8px; text-align: center; border-left: 1px solid var(--line);
}
.matrix-row.head .cell-col .ico { width: 15px; height: 15px; }
.matrix-row.head .cell-col .short {
  font-size: 9.5px; color: var(--dim); margin-top: 5px; line-height: 1.2; font-family: var(--mono);
}
.matrix-row.data { cursor: pointer; transition: background 0.12s; }
.matrix-row.data:hover { background: rgba(255,255,255,0.018); }
.matrix-row.data:last-child { border-bottom: none; }
.matrix-row.data .row-head {
  padding: 13px 16px; display: flex; align-items: center; gap: 9px;
}
.matrix-row.data .row-head .ico { width: 15px; height: 15px; flex-shrink: 0; }
.matrix-row.data .row-head .name { font-size: 12.8px; font-weight: 500; }
.matrix-row.data .row-head .chev { width: 13px; height: 13px; color: var(--faint); margin-left: auto; }
.matrix-row.data .heat {
  border-left: 1px solid var(--line);
  display: grid; place-items: center; padding: 6px;
}
.matrix-row.data .heat-cell {
  width: 100%; height: 34px; border-radius: 6px;
  display: grid; place-items: center;
  border: 1px solid transparent;
}
.matrix-row.data .heat-cell.flagship .dot {
  width: 6px; height: 6px; border-radius: 9px;
}
.matrix-legend {
  padding: 11px 16px; display: flex; gap: 18px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 9.5px; color: var(--faint);
  border-top: 1px solid var(--line);
}
.matrix-legend .ml-spacer { margin-left: auto; color: var(--dim); }
.legend-chip { display: inline-flex; align-items: center; gap: 6px; }
.legend-chip .sw {
  width: 16px; height: 12px; border-radius: 3px;
  display: grid; place-items: center;
}
.legend-chip .sw .dot { width: 4px; height: 4px; border-radius: 9px; background: var(--teal); }

/* ENGAGEMENTS */
.engagement-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(252px, 1fr));
  gap: 13px; margin-bottom: 34px;
}
.engagement-card { padding: 16px; }
.engagement-card .ico { width: 17px; height: 17px; color: var(--teal); }
.engagement-card .n { font-weight: 600; font-size: 13.5px; margin: 9px 0 6px; }
.engagement-card .d { color: var(--dim); font-size: 12.2px; line-height: 1.5; }

/* DELIVERY PHASES */
.phase-strip { display: flex; gap: 0; flex-wrap: wrap; align-items: stretch; }
.phase-card { flex: 1 1 180px; padding: 16px; border-radius: 12px; --accent: var(--gold); }
.phase-card .num  { font-family: var(--mono); font-size: 10px; color: var(--gold); }
.phase-card .name { font-family: var(--display); font-size: 19px; font-weight: 600; margin: 6px 0 7px; }
.phase-card .desc { color: var(--dim); font-size: 12px; line-height: 1.5; }
.phase-arrow { display: grid; place-items: center; padding: 0 4px; }
.phase-arrow .ico { width: 16px; height: 16px; color: var(--faint); }

/* ────────────────────────────────────────────────────────── MIND-MAP VIEW */
.mindmap-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  overflow: auto;
  position: relative;
}
.mindmap-svg { display: block; width: 100%; height: auto; min-height: 720px; }
.mm-edge { stroke: var(--line2); stroke-width: 1.1; fill: none; opacity: 0.75; }
.mm-edge.req { stroke: var(--teal); stroke-width: 1.4; opacity: 0.55; stroke-dasharray: 3 3; }
.mm-node-pillar rect, .mm-node-accel rect {
  fill: var(--panel2); stroke: var(--line2); stroke-width: 1; cursor: pointer;
  transition: fill 0.12s, stroke 0.12s;
}
.mm-node-pillar rect { stroke-width: 1.5; }
.mm-node-accel rect:hover { fill: #18203a; stroke: var(--teal); }
.mm-node-pillar text { font-family: var(--display); font-size: 13px; font-weight: 600; fill: var(--text); }
.mm-node-accel text { font-family: var(--body); font-size: 11px; fill: var(--text); }
.mm-status-dot { stroke: rgba(0,0,0,0.4); stroke-width: 0.5; }

.mindmap-legend {
  display: flex; gap: 18px; padding: 14px 18px 4px;
  font-family: var(--mono); font-size: 10px; color: var(--faint); flex-wrap: wrap;
}
.mindmap-legend .item { display: inline-flex; align-items: center; gap: 6px; }
.mindmap-legend .dot { width: 8px; height: 8px; border-radius: 50%; }
.mindmap-legend .dash {
  width: 22px; height: 0; border-top: 1.4px dashed var(--teal); opacity: 0.7;
}

/* ────────────────────────────────────────────────────────── SCHEDULE VIEW */
.schedule-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  overflow-x: auto;
}
.schedule-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  min-width: 760px;
}
.sch-head, .sch-row {
  display: grid;
  grid-template-columns: 220px repeat(var(--weeks, 18), minmax(28px, 1fr));
}
.sch-head { background: var(--panel2); }
.sch-row { background: var(--panel); }
.sch-row:hover { background: var(--panel2); }
.sch-cell {
  padding: 8px 10px;
  background: var(--panel);
  font-size: 12px;
  display: flex; align-items: center; gap: 8px;
}
.sch-head .sch-cell { background: var(--panel2); }
.sch-cell.week-head {
  font-family: var(--mono); font-size: 9.5px; color: var(--faint);
  letter-spacing: 0.06em; justify-content: center; padding: 8px 4px;
}
.sch-cell.name-head { color: var(--dim); font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; }
.sch-cell.name {
  cursor: pointer; font-weight: 500; gap: 9px;
}
.sch-cell.name:hover { color: var(--teal); }
.sch-cell.name .id-pill {
  font-family: var(--mono); font-size: 9px; color: var(--faint);
  background: var(--bg2); border: 1px solid var(--line2);
  padding: 2px 6px; border-radius: 4px;
  flex-shrink: 0;
}
.sch-track {
  grid-column-start: var(--start);
  grid-column-end: span var(--span);
  background: var(--track-color, var(--teal));
  opacity: 0.62;
  height: 18px;
  margin: auto 4px;
  border-radius: 4px;
  cursor: pointer;
  display: flex; align-items: center; padding: 0 6px;
  font-family: var(--mono); font-size: 9px; color: rgba(0,0,0,0.55);
  font-weight: 600; letter-spacing: 0.04em;
  position: relative;
}
.sch-track:hover { opacity: 0.85; }

/* ────────────────────────────────────────────────────────── ASSETS VIEW */
.assets-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.assets-table th, .assets-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12.8px;
  vertical-align: middle;
}
.assets-table th {
  background: var(--panel2);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--faint); text-transform: uppercase; font-weight: 500;
  position: sticky; top: 0;
}
.assets-table tbody tr { cursor: pointer; transition: background 0.1s; }
.assets-table tbody tr:hover { background: var(--panel2); }
.assets-table tbody tr:last-child td { border-bottom: none; }
.assets-table .id-cell { font-family: var(--mono); color: var(--faint); width: 44px; }
.assets-table .name-cell { font-weight: 500; }
.assets-table .pillar-cell, .assets-table .verticals-cell {
  font-family: var(--mono); font-size: 10.5px; color: var(--dim); letter-spacing: 0.06em;
}
.assets-table .week-cell { font-family: var(--mono); font-size: 11px; color: var(--dim); width: 90px; }
.assets-table .deps-cell { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 20px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--status-bg);
  color: var(--status-fg);
  border: 1px solid var(--status-bg);
}
.status-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--status-fg);
}

/* ────────────────────────────────────────────────────────── PITCH VIEW */
.pitch-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
}
.pitch-card {
  padding: 18px; cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  transition: border-color 0.15s, transform 0.15s;
  position: relative; overflow: hidden;
}
.pitch-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--accent, var(--teal)), transparent);
}
.pitch-card:hover { border-color: var(--line2); transform: translateY(-1px); }
.pitch-card .id { font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: 0.14em; }
.pitch-card .name { font-family: var(--display); font-size: 17px; font-weight: 600; margin: 6px 0 10px; line-height: 1.2; }
.pitch-card .line { color: var(--text); font-size: 13.5px; line-height: 1.55; margin-bottom: 12px; }
.pitch-card .meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10px; color: var(--dim); letter-spacing: 0.04em;
}

/* ────────────────────────────────────────────────────────── DRAWER */
#drawer {
  position: fixed; inset: 0; pointer-events: none; z-index: 50;
}
#drawer[aria-hidden="false"] { pointer-events: auto; }
.drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(4, 8, 16, 0.65);
  opacity: 0;
  transition: opacity 0.25s;
}
#drawer[aria-hidden="false"] .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: 0; height: 100vh;
  width: min(560px, 92vw);
  background: var(--bg2);
  border-left: 1px solid var(--line2);
  padding: 26px 30px 40px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
}
#drawer[aria-hidden="false"] .drawer-panel { transform: translateX(0); }
.drawer-close {
  position: absolute; top: 14px; right: 18px;
  font-size: 26px; line-height: 1; color: var(--dim);
  padding: 4px 10px; border-radius: 7px;
}
.drawer-close:hover { background: var(--panel); color: var(--text); }

.drawer-body .id-row {
  font-family: var(--mono); font-size: 10.5px; color: var(--faint); letter-spacing: 0.14em;
  margin-bottom: 8px;
}
.drawer-body h2 {
  font-family: var(--display); font-size: 26px; font-weight: 600;
  line-height: 1.15; letter-spacing: -0.01em; margin-bottom: 14px;
}
.drawer-body .blurb { color: var(--dim); font-size: 14px; line-height: 1.6; margin-bottom: 22px; }

.drawer-section { margin-bottom: 22px; }
.drawer-section h3 {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 10px; font-weight: 500;
}

.kv-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px;
}
.kv { display: flex; flex-direction: column; gap: 3px; }
.kv-label { font-family: var(--mono); font-size: 9.5px; color: var(--faint); letter-spacing: 0.1em; text-transform: uppercase; }
.kv-value { font-size: 13px; color: var(--text); }

.pitch-quote {
  font-family: var(--display); font-size: 16px; font-style: italic;
  color: var(--text); line-height: 1.5;
  padding: 14px 18px; border-left: 3px solid var(--teal);
  background: var(--panel); border-radius: 0 8px 8px 0;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 5px 10px; border-radius: 7px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 11.5px; color: var(--text);
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono);
  cursor: pointer; transition: border-color 0.1s;
}
.chip:hover { border-color: var(--teal); }
.chip .swatch { width: 6px; height: 6px; border-radius: 50%; }

.notes-block {
  background: var(--panel); border: 1px solid var(--line);
  padding: 12px 14px; border-radius: 8px;
  font-size: 12.8px; line-height: 1.55; color: var(--dim);
}
.notes-block code { font-family: var(--mono); font-size: 11.5px; color: var(--text); background: var(--bg); padding: 1px 5px; border-radius: 4px; }

.link-row {
  display: flex; gap: 10px; flex-wrap: wrap; font-family: var(--mono); font-size: 11.5px;
}
.link-row a {
  color: var(--teal); text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
}
.link-row a:hover { border-color: var(--teal); }
.link-row .empty { color: var(--faint); font-style: italic; }

/* ────────────────────────────────────────────────────────── BACK BUTTON / MISC */
.back-btn {
  font-family: var(--mono); font-size: 10.5px; color: var(--faint);
  letter-spacing: 0.1em; margin-bottom: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 6px; border: 1px solid transparent;
}
.back-btn:hover { background: var(--panel); border-color: var(--line); color: var(--text); }

/* ────────────────────────────────────────────────────────── RESPONSIVE 375px */
@media (max-width: 900px) {
  body { flex-direction: column; }
  #sidebar {
    width: 100%; height: auto; position: relative;
    border-right: none; border-bottom: 1px solid var(--line);
    padding: 18px 16px;
  }
  #view-nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .nav-btn { flex: 1 1 calc(50% - 6px); padding: 9px 10px; font-size: 12.5px; }
  .filter-group { padding: 0; flex: 1 1 calc(50% - 6px); }
  .sidebar-filters { display: flex; flex-wrap: wrap; gap: 10px; }
  .footer-stat { display: none; }
  .label { padding: 0; }
  .sep { margin: 12px 0; }
  .brand { padding: 0; margin-bottom: 0; }

  #main { padding: 22px 16px 48px; max-width: 100%; }
  h1.display { font-size: 26px; }
  .lede { font-size: 13.5px; }
  .headline-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .headline-grid .num { font-size: 26px; }
  .pillar-grid { grid-template-columns: 1fr; gap: 10px; }
  .matrix-panel { overflow-x: auto; }
  .engagement-grid { grid-template-columns: 1fr; }
  .phase-strip { flex-direction: column; }
  .phase-arrow { transform: rotate(90deg); padding: 4px 0; }

  .drawer-panel { width: 100vw; padding: 22px 18px 36px; }
  .kv-grid { grid-template-columns: 1fr; gap: 6px; }
  .pitch-grid { grid-template-columns: 1fr; }
  #footer { font-size: 9.5px; }
}
