:root {
  color-scheme: dark;
  --bg: #050505;
  --ink: #f6f2e9;
  --muted: rgba(246, 242, 233, 0.62);
  --soft: rgba(246, 242, 233, 0.1);
  --line: rgba(246, 242, 233, 0.14);
  --line-strong: rgba(212, 197, 162, 0.35);
  --surface: #0b0b0a;
  --surface-2: #11100e;
  --primary: #d4c5a2;
  --teal: #82d9ce;
  --green: #9be7b0;
  --amber: #e0bd75;
  --red: #e98472;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(130deg, #050505 0%, #070706 44%, #0e0d0b 100%);
  background-size: 64px 64px, 64px 64px, auto;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

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

button,
input {
  font: inherit;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-style: italic;
  color: var(--ink);
}

.navlinks {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.navlinks a:hover,
.footer a:hover {
  color: var(--primary);
}

main {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 48px;
  align-items: end;
  min-height: 74vh;
  padding: 110px 0 72px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.eyebrow.small {
  margin-bottom: 10px;
  font-size: 10px;
  letter-spacing: 0.22em;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  max-width: 920px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 6.8vw, 88px);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 4vw, 58px);
  font-weight: 500;
  line-height: 1;
}

h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.lead {
  max-width: 740px;
  margin: 28px 0 0;
  color: rgba(246, 242, 233, 0.82);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(21px, 2.35vw, 29px);
  line-height: 1.28;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 38px;
}

.button,
.run-button,
.command-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  padding: 13px 18px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.button:hover,
.run-button:hover,
.command-row button:hover {
  border-color: rgba(246, 242, 233, 0.55);
  color: var(--ink);
}

.button.primary {
  background: var(--primary);
  color: #090807;
}

.button.primary:hover {
  background: var(--ink);
  color: #050505;
}

.hero-panel,
.workspace,
.left-rail,
.right-rail,
.workbench,
.memo-card,
.detail-card,
.executive-card,
.runway-card {
  border: 1px solid var(--line);
  background: rgba(8, 8, 7, 0.84);
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.36);
}

.hero-panel {
  padding: 28px;
}

.panel-topline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brief-objective {
  display: grid;
  gap: 14px;
  padding: 48px 0 38px;
}

.brief-objective strong {
  color: var(--primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 4vw, 58px);
  font-weight: 400;
  line-height: 0.95;
}

.brief-objective span {
  max-width: 420px;
  color: rgba(246, 242, 233, 0.72);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.brief-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.brief-grid span {
  background: var(--surface);
  color: var(--primary);
  padding: 16px 10px;
  text-align: center;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.briefing-guide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 24px;
  border: 1px solid var(--line);
  background: var(--line);
}

.briefing-guide div {
  background:
    linear-gradient(145deg, rgba(212, 197, 162, 0.07), transparent 48%),
    rgba(8, 8, 7, 0.84);
  padding: 22px;
}

.briefing-guide span {
  display: block;
  margin-bottom: 18px;
  color: var(--primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1;
}

.briefing-guide strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.briefing-guide p {
  margin: 12px 0 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  min-height: 780px;
  margin-bottom: 72px;
}

.left-rail,
.right-rail {
  border: 0;
  box-shadow: none;
}

.left-rail {
  border-right: 1px solid var(--line);
}

.right-rail {
  border-left: 1px solid var(--line);
}

.rail-section {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.rail-label {
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.scenario-list {
  display: grid;
  gap: 8px;
}

.scenario-button {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  cursor: pointer;
  padding: 13px;
  text-align: left;
}

.scenario-button strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.scenario-button span {
  display: block;
  margin-top: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
}

.scenario-button.active {
  border-color: var(--line-strong);
  background: rgba(212, 197, 162, 0.08);
}

.progress-shell {
  height: 3px;
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.progress-shell span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--primary);
  transition: width 500ms ease;
}

.run-status,
.signal-list p,
.memo-card p,
.detail-card p {
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
}

.run-status {
  margin: 12px 0 0;
  font-size: 13px;
}

.signal-list {
  display: grid;
  gap: 10px;
}

.signal {
  border-left: 1px solid var(--line-strong);
  padding-left: 12px;
}

.signal strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.signal span {
  color: var(--muted);
  font-size: 12px;
}

.workbench {
  min-width: 0;
  border: 0;
  box-shadow: none;
  background: rgba(10, 10, 9, 0.68);
}

.workbench-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 28px;
  border-bottom: 1px solid var(--line);
}

.header-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 1fr));
  gap: 1px;
  min-width: 290px;
  background: var(--line);
  border: 1px solid var(--line);
}

.stat {
  background: var(--surface);
  padding: 13px;
}

.stat strong {
  display: block;
  color: var(--primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 400;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.command-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
}

.command-input {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(246, 242, 233, 0.76);
  padding: 14px 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 15px 18px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.tab.active {
  background: rgba(212, 197, 162, 0.08);
  color: var(--primary);
}

.panel {
  display: none;
  padding: 28px;
}

.panel.active {
  display: block;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.executive-card,
.runway-card {
  box-shadow: none;
  padding: 22px;
}

#executiveSummary {
  margin: 28px 0;
  color: rgba(246, 242, 233, 0.84);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  line-height: 1.35;
}

.risk-list {
  display: grid;
  gap: 10px;
}

.risk-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  padding: 12px;
}

.risk-mark {
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 999px;
}

.sev-critical { color: var(--red); }
.sev-high { color: var(--amber); }
.sev-medium { color: var(--teal); }
.sev-low { color: var(--green); }
.bg-critical { background: var(--red); }
.bg-high { background: var(--amber); }
.bg-medium { background: var(--teal); }
.bg-low { background: var(--green); }

.decision-runway {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.runway-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(212, 197, 162, 0.1), transparent 55%),
    rgba(255, 255, 255, 0.025);
  color: var(--ink);
  cursor: pointer;
  padding: 14px;
  text-align: left;
}

.runway-step:hover,
.runway-step.active {
  border-color: var(--line-strong);
  background:
    linear-gradient(90deg, rgba(212, 197, 162, 0.16), rgba(130, 217, 206, 0.06)),
    rgba(255, 255, 255, 0.035);
}

.runway-index {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(212, 197, 162, 0.32);
  color: var(--primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.runway-copy strong,
.runway-copy span {
  display: block;
}

.runway-copy strong {
  font-size: 13px;
  letter-spacing: 0.08em;
}

.runway-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
}

.runway-copy .runway-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.runway-meta span {
  border: 1px solid var(--line);
  padding: 5px 7px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 18px;
  border: 1px solid var(--line);
  background: var(--line);
}

.metric-tile {
  background: var(--surface);
  padding: 20px;
}

.metric-tile strong {
  color: var(--primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  font-weight: 400;
}

.metric-tile span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-head h3 {
  max-width: 720px;
  font-size: 30px;
  line-height: 1.12;
}

.count-pill {
  align-self: start;
  border: 1px solid var(--line);
  color: var(--primary);
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 15px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--primary);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

td {
  color: rgba(246, 242, 233, 0.78);
  font-size: 13px;
}

tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.active {
  background: rgba(212, 197, 162, 0.06);
}

.program-name {
  display: block;
  color: var(--ink);
  font-weight: 760;
}

.program-note {
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
}

.system-map {
  position: relative;
  min-height: 520px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    rgba(255,255,255,.018);
  background-size: 48px 48px;
  overflow: hidden;
}

.edge-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.edge-layer line {
  stroke: rgba(212, 197, 162, 0.26);
  stroke-width: 0.22;
}

.map-node {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 100px;
  border: 1px solid var(--line);
  background: rgba(8, 8, 7, 0.92);
  color: var(--ink);
  cursor: pointer;
  padding: 10px;
  text-align: left;
}

.map-node.active {
  border-color: var(--primary);
  background: rgba(212, 197, 162, 0.1);
}

.map-node strong {
  display: block;
  font-size: 12px;
}

.map-node span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.program-detail {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 18px;
}

.program-detail h4 {
  margin: 0 0 10px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 500;
}

.program-detail p {
  margin: 0 0 16px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border: 1px solid var(--line);
  color: var(--primary);
  padding: 6px 8px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.roadmap {
  display: grid;
  gap: 12px;
}

.phase {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 160px;
  gap: 20px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.02);
  padding: 18px;
}

.phase-number {
  color: var(--primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  line-height: 1;
}

.phase h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 19px;
}

.phase p {
  margin: 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
}

.phase-meta {
  display: grid;
  align-content: start;
  gap: 8px;
}

.phase-meta span {
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.evidence-item {
  background: var(--surface);
  padding: 22px;
}

.evidence-item strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
}

.evidence-item p {
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
}

.right-rail {
  display: grid;
  align-content: start;
}

.memo-card,
.detail-card {
  border: 0;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  padding: 22px;
}

.memo-card h3,
.detail-card h3 {
  margin-top: 24px;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.08;
}

.memo-actions,
.rules {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.memo-action,
.rule {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
  padding: 10px;
  color: rgba(246, 242, 233, 0.76);
  font-size: 12px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 46px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer a {
  color: var(--primary);
}

@media (max-width: 1180px) {
  .hero,
  .workspace,
  .overview-grid,
  .map-layout {
    grid-template-columns: 1fr;
  }

  .workspace {
    min-height: 0;
  }

  .left-rail,
  .right-rail {
    border: 0;
  }

  .left-rail {
    border-bottom: 1px solid var(--line);
  }

  .right-rail {
    border-top: 1px solid var(--line);
    grid-template-columns: 1fr 1fr;
  }

  .header-stats,
  .metric-grid,
  .evidence-grid,
  .briefing-guide {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .topbar,
  main,
  .footer {
    width: calc(100% - 32px);
  }

  .topbar,
  .workbench-header,
  .section-head,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    min-height: auto;
    padding: 72px 0 44px;
  }

  h1 {
    font-size: clamp(43px, 13vw, 58px);
    letter-spacing: 0;
    overflow-wrap: anywhere;
  }

  .lead {
    font-size: clamp(20px, 6.6vw, 28px);
    overflow-wrap: break-word;
  }

  .hero-panel,
  .workbench,
  .left-rail,
  .right-rail {
    max-width: 100%;
    overflow: hidden;
  }

  .brief-objective strong {
    font-size: clamp(38px, 12vw, 50px);
  }

  .brief-objective span {
    font-size: 18px;
    overflow-wrap: break-word;
  }

  .brief-grid,
  .briefing-guide,
  .header-stats,
  .metric-grid,
  .evidence-grid,
  .right-rail,
  .phase,
  .command-row {
    grid-template-columns: 1fr;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab {
    border-bottom: 1px solid var(--line);
    padding: 14px 12px;
  }

  .tab:last-child {
    grid-column: 1 / -1;
  }

  .panel,
  .workbench-header,
  .rail-section,
  .memo-card,
  .detail-card {
    padding: 18px;
  }

  .system-map {
    min-height: 460px;
  }

  .map-node {
    min-width: 86px;
    padding: 8px;
  }
}
