:root {
  --bg: #0f131a;
  --panel: #161c25;
  --card: #1c2430;
  --border: #273142;
  --text: #e6eefc;
  --muted: #9fb1c9;
  --accent: #4da3ff;
  --accent-strong: #6ec1ff;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --card: #f1f4f8;
  --border: #d9e2ec;
  --text: #0f1722;
  --muted: #4a5568;
  --accent: #2b6cb0;
  --accent-strong: #3182ce;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--accent-strong);
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(15, 19, 26, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.logo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 12px rgba(77, 163, 255, 0.6);
}

.nav-links {
  display: flex;
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.active {
  background: var(--panel);
  color: var(--accent);
  border: 1px solid var(--border);
}

.toggle {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.toggle:hover,
.toggle:focus-visible {
  border-color: var(--accent);
}

.view-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.section-header {
  display: flex;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 8px;
}

h1, h2, h3, h4 {
  color: var(--text);
  margin: 8px 0;
}

.lead {
  color: var(--muted);
  max-width: 760px;
}

.hero { 
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.missionproject-status {
  margin: 24px 0 12px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.status-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.muted {
  color: var(--muted);
}

.toolchain {
  margin: 32px 0;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.strip-title {
  margin: 0 0 6px;
}

.toolchain-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.step-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry-modes {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 12px;
}

.entry-diagram {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.entry-node {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--card);
  font-weight: 700;
}

.entry-sub {
  display: block;
  font-weight: 400;
  color: var(--muted);
  margin-top: 6px;
}

.missionproject-callout {
  margin: 20px 0 8px;
  padding: 18px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.code-snippet {
  background: #0c121c;
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 12px;
  overflow: auto;
}

.hero-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.stack-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.stack-list li {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.demo-request {
  margin: 26px 0 32px;
  padding: 28px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.demo-request-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.demo-note {
  margin-top: 6px;
}

.demo-request-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demo-request-btn {
  min-width: 220px;
  text-align: center;
}

.demo-request-email {
  margin: 0;
  color: var(--muted);
}

.demo-request-email a {
  color: var(--accent);
  font-weight: 700;
}

@media (min-width: 640px) {
  .demo-request-actions {
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }

  .demo-request-email {
    margin: 0;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--panel);
  text-decoration: none;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0c111a;
  border: none;
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
}

.btn.subtle {
  background: var(--card);
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(77, 163, 255, 0.2);
}

.card-grid,
.tool-grid,
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card,
.tool-card,
.embed-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card:hover,
.tool-card:hover,
.embed-card:hover {
  border-color: var(--accent);
}

.tool-card.highlight {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(77, 163, 255, 0.25);
}

.tool-card .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
}

.status {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  align-self: flex-start;
}

.status.live { color: #2dd4bf; border-color: #2dd4bf33; }
.status.prototype { color: #fbbf24; border-color: #fbbf2433; }
.status.planned { color: #f87171; border-color: #f8717133; }

.workflow-dashboard {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 960px) {
  .workflow-dashboard {
    grid-template-columns: 1fr;
  }
}

.module-sidebar {
  display: grid;
  gap: 10px;
}

.module-nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease;
}

.module-nav-item:hover,
.module-nav-item:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.module-nav-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(77, 163, 255, 0.2);
}

.module-nav-text {
  display: grid;
  gap: 4px;
}

.status-pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
}

.status-pill.not-started { color: var(--muted); }
.status-pill.in-progress { color: #fbbf24; border-color: #fbbf2433; }
.status-pill.complete { color: #2dd4bf; border-color: #2dd4bf33; }

.module-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.module-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.status-control {
  display: grid;
  gap: 6px;
}

.status-control select {
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

.module-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.module-panel .embed-container {
  padding-top: 65%;
  min-height: 320px;
  border-radius: 12px;
}

.project-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.project-card,
.feasibility-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.project-form .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.project-form input,
.project-form select {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

.project-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.project-alert {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(77, 163, 255, 0.12);
  color: var(--text);
  font-weight: 600;
}

.project-alert.success { border-color: #2dd4bf; background: rgba(45, 212, 191, 0.12); }
.project-alert.alert { border-color: #f87171; background: rgba(248, 113, 113, 0.12); }

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.feasibility-header {
  display: grid;
  gap: 6px;
}

.feasibility-items {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.feasibility-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--card);
  border-left: 4px solid var(--border);
}

.feasibility-item.good { border-left-color: #2dd4bf; }
.feasibility-item.warning { border-left-color: #fbbf24; }
.feasibility-item.alert { border-left-color: #f87171; }

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.workflow-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}

.workflow-card button,
.workflow-card a {
  justify-self: flex-start;
}

.loop-diagram {
  position: relative;
  width: 280px;
  height: 280px;
  display: grid;
  place-items: center;
}

.loop-node {
  position: absolute;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  text-align: center;
  width: 110px;
}

.loop-node:nth-child(1) { top: 10px; left: 50%; transform: translateX(-50%); }
.loop-node:nth-child(2) { left: 10px; top: 90px; }
.loop-node:nth-child(3) { right: 10px; top: 90px; }
.loop-node:nth-child(4) { left: 30px; bottom: 40px; }
.loop-node:nth-child(5) { right: 30px; bottom: 40px; }

.loop-lines {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--border);
  stroke-width: 2;
}

.mission-layout,
.docs-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.bullet-list {
  padding-left: 18px;
  color: var(--muted);
}

.sample-flow ol {
  margin: 8px 0 12px 18px;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.embed-container {
  position: relative;
  width: 100%;
  padding-top: 60%;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
}

.embed-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.demo-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}

.demo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-card h3,
.workflow-card h3,
.demo-card h3,
.embed-card h3,
.card h3 {
  margin-bottom: 0;
}

.small {
  color: var(--muted);
  font-size: 14px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px;
  background: var(--panel);
  text-align: center;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 8px;
}

@media (max-width: 760px) {
  .nav-links {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .loop-diagram {
    width: 220px;
    height: 220px;
  }
}
