:root {
  color-scheme: light;
  --bg: #f6faf8;
  --panel: #ffffff;
  --panel-2: #eef7f3;
  --ink: #18252f;
  --muted: #5f6f7c;
  --line: #d6e3df;
  --blue: #2368a2;
  --pink: #b83a7d;
  --green: #237a57;
  --amber: #c58b19;
  --red: #bc342f;
  --teal: #17847d;
  --shadow: 0 20px 55px rgba(28, 56, 45, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(222, 241, 235, 0.75), rgba(246, 250, 248, 0.96) 34rem),
    radial-gradient(circle at 88% 4%, rgba(35, 104, 162, 0.1), transparent 25rem),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
}

button,
select,
textarea,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid rgba(35, 122, 87, 0.14);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #ffffff;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.8rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}

nav a {
  text-decoration: none;
}

.hero,
.prototype-grid,
.section-band {
  padding: clamp(1.1rem, 4vw, 3rem);
}

.page-hero {
  padding: clamp(1.5rem, 5vw, 4rem) clamp(1.1rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem);
}

.page-hero h1 {
  max-width: 14ch;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(22rem, 0.72fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  min-height: calc(100vh - 4.5rem);
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.8rem, 7vw, 6.5rem);
  line-height: 0.94;
  letter-spacing: 0;
}

h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

.lead {
  max-width: 58rem;
  margin: 1.4rem 0 0;
  color: #3e4d58;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.65;
}

.hero-actions,
.hero-proof,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-actions {
  margin-top: 1.8rem;
}

.button,
button {
  min-height: 2.85rem;
  border: 0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
}

.primary,
button {
  background: var(--blue);
  color: #ffffff;
}

.secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--green);
}

.hero-proof {
  margin-top: 1.3rem;
}

.hero-proof span,
.pill,
.risk-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.48rem 0.75rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  white-space: nowrap;
}

.ops-card,
.panel,
.challenge-grid article,
.architecture-grid article,
.submit-grid article,
.submission-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.ops-card,
.panel {
  padding: 1rem;
}

.ops-head,
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ops-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.ops-metrics div,
.extract-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem;
  background: #f9fcfb;
}

.ops-metrics span,
.extract-grid span,
.warning span,
.transfer-line span,
.score-bars span {
  color: var(--muted);
  font-size: 0.78rem;
}

.ops-metrics strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.7rem;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin: 0.35rem 0;
  color: var(--green);
  font-size: clamp(2rem, 4vw, 3rem);
}

.metric-card.danger strong {
  color: var(--red);
}

.metric-card.warn strong {
  color: var(--amber);
}

.metric-card p,
.panel p {
  color: var(--muted);
  line-height: 1.55;
}

.mini-map {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(35, 122, 87, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(35, 122, 87, 0.08) 1px, transparent 1px),
    #f8fcfa;
  background-size: 34px 34px;
}

.mini-map svg {
  display: block;
  width: 100%;
  min-height: 220px;
}

.large-map svg {
  min-height: 360px;
}

.mini-route {
  fill: none;
  stroke: #b9cbc5;
  stroke-width: 6;
  stroke-linecap: round;
}

.mini-route.active {
  stroke: var(--blue);
  stroke-dasharray: 10 10;
  animation: route 1.2s linear infinite;
}

@keyframes route {
  to {
    stroke-dashoffset: -20;
  }
}

.mini-node circle {
  stroke: #ffffff;
  stroke-width: 4;
}

.mini-node.stable circle { fill: var(--green); }
.mini-node.donor circle { fill: var(--blue); }
.mini-node.critical circle { fill: var(--red); }
.mini-node.watch circle { fill: var(--amber); }

.ops-note {
  color: #354651;
  line-height: 1.5;
}

.section-title {
  max-width: 68rem;
  margin-bottom: 1rem;
}

.section-title h2 {
  font-size: clamp(1.8rem, 4vw, 3.3rem);
  line-height: 1.05;
}

.challenge-grid,
.architecture-grid,
.submit-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}

.challenge-grid article,
.architecture-grid article,
.submit-grid article {
  padding: 1rem;
  box-shadow: none;
}

.challenge-grid span,
.submit-grid span {
  display: block;
  margin-bottom: 1rem;
  color: var(--blue);
  font-size: 1.8rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.challenge-grid p,
.architecture-grid p,
.submit-grid p,
.copilot-panel p,
.transfer-card p {
  color: var(--muted);
  line-height: 1.55;
}

.prototype-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(280px, 0.85fr) minmax(280px, 0.8fr);
  gap: 1rem;
}

.compact-grid {
  grid-template-columns: minmax(320px, 1.25fr) minmax(280px, 0.85fr);
}

.voice-panel {
  grid-row: span 2;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
  color: var(--ink);
}

select {
  min-height: 2.6rem;
  margin-bottom: 0.8rem;
  padding: 0 0.75rem;
}

textarea {
  min-height: 150px;
  resize: vertical;
  padding: 0.9rem;
  line-height: 1.55;
}

.button-row {
  margin-top: 0.8rem;
}

.extract-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.extract-grid strong {
  display: block;
  margin-top: 0.25rem;
}

.warning-list {
  display: grid;
  gap: 0.75rem;
}

.ai-trace {
  display: grid;
  gap: 0.7rem;
}

.ai-trace p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem;
  background: #f9fcfb;
}

.warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-radius: 8px;
  padding: 0.85rem;
  background: #fbfefd;
}

.critical-border {
  border: 1px solid rgba(188, 52, 47, 0.28);
  background: #fff7f5;
}

.watch-border {
  border: 1px solid rgba(197, 139, 25, 0.3);
  background: #fffaf0;
}

.warning b,
.risk-pill {
  color: var(--red);
}

.transfer-card {
  border: 1px solid rgba(35, 104, 162, 0.28);
  border-radius: 8px;
  padding: 0.9rem;
  background: #f2f8fc;
}

.transfer-line {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 0.6rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.score {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 999px;
  color: #ffffff;
  background: conic-gradient(var(--amber) 0 61%, #e2ebe7 61% 100%);
}

.score-bars {
  display: grid;
  gap: 0.85rem;
}

.score-bars label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.8rem;
  color: var(--ink);
}

progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 0.65rem;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: #e2ebe7;
}

progress::-webkit-progress-bar {
  background: #e2ebe7;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--green), var(--amber));
}

.copilot-panel {
  grid-column: span 2;
}

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

.enterprise-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.research-grid .panel b {
  display: block;
  margin-top: 0.75rem;
  color: var(--green);
}

.source-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.source-list span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  background: #f9fcfb;
  color: var(--muted);
  line-height: 1.45;
}

.role-table,
.audit-log,
.sla-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.role-table div,
.audit-log div,
.sla-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  background: #f9fcfb;
}

.role-table b,
.audit-log b,
.sla-grid strong {
  display: block;
  color: var(--green);
}

.role-table span,
.audit-log small,
.sla-grid span {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  line-height: 1.45;
}

.audit-log span {
  display: inline-block;
  margin-bottom: 0.3rem;
  color: var(--blue);
  font-weight: 900;
}

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

.forecast-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.35fr) repeat(2, minmax(220px, 0.7fr));
  gap: 1rem;
}

.forecast-main {
  grid-row: span 2;
}

.bar-chart {
  display: flex;
  align-items: end;
  gap: 0.45rem;
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: linear-gradient(180deg, #fbfefd, #eef7f3);
}

.bar-chart span {
  flex: 1;
  height: var(--h);
  min-height: 18px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--blue), var(--green));
}

.code-block {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: #0f2933;
  color: #e9fff5;
  line-height: 1.6;
}

.plain-list {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.7;
}

.architecture-grid b {
  color: var(--green);
}

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

.submit-grid a {
  color: var(--blue);
  font-weight: 800;
}

.webform-section {
  padding-top: 1rem;
}

.submission-form {
  display: grid;
  gap: 1rem;
}

fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 1rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

legend {
  padding: 0 0.45rem;
  color: var(--blue);
  font-weight: 900;
}

.form-grid,
.architecture-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-grid label,
.architecture-form-grid label,
.submission-form > fieldset > label {
  display: grid;
  gap: 0.45rem;
  color: var(--ink);
}

.form-grid label:nth-child(3),
.form-grid label:nth-child(4),
.submission-form > fieldset > label {
  grid-column: 1 / -1;
}

input,
.submission-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
  color: var(--ink);
  padding: 0.85rem;
  line-height: 1.5;
}

input[readonly],
textarea[readonly] {
  cursor: default;
}

.flow-grid,
.deck-grid,
.check-grid {
  display: grid;
  gap: 0.75rem;
}

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

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

.flow-grid article,
.deck-grid article,
.check-grid label {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  background: #f9fcfb;
}

.flow-grid b,
.deck-grid b {
  color: var(--green);
}

.flow-grid p,
.deck-grid p {
  color: var(--muted);
  line-height: 1.5;
}

.deck-grid span {
  display: block;
  margin-bottom: 0.65rem;
  color: var(--blue);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 1.35rem;
}

.check-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0.85rem;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
}

.check-grid input {
  width: auto;
  accent-color: var(--green);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  border: 1px solid rgba(35, 122, 87, 0.25);
  border-radius: 8px;
  padding: 1rem;
  background: #eef8f3;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.toolbar label {
  min-width: min(26rem, 100%);
  color: var(--ink);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
}

.status-chip {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.32rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 900;
}

.status-critical {
  background: #fff0ed;
  color: var(--red);
}

.status-watch {
  background: #fff7df;
  color: #8a5d00;
}

.status-stable {
  background: #eaf8f0;
  color: var(--green);
}

.order-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.order-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.integration-list {
  display: grid;
  gap: 0.75rem;
}

.integration-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  background: #f9fcfb;
}

.integration-row b,
.integration-row span,
.integration-row small {
  display: block;
}

.integration-row span,
.integration-row small {
  margin-top: 0.25rem;
  color: var(--muted);
  line-height: 1.45;
}

output {
  color: var(--green);
  font-weight: 800;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

footer a {
  color: var(--blue);
}

.ready {
  background: #eaf8f0;
}

.tour-start {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 70;
  min-height: 3rem;
  padding-inline: 1.25rem;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(35, 104, 162, 0.28);
}

.tour-overlay {
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  z-index: 80;
  display: none;
  pointer-events: none;
}

.tour-overlay.open {
  display: block;
}

.tour-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1.15rem;
  align-items: center;
  width: min(1100px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(35, 104, 162, 0.25);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 70px rgba(24, 37, 47, 0.22);
  pointer-events: auto;
}

.tour-copy h2 {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.tour-copy p:last-child {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.tour-side {
  min-width: 9rem;
}

.tour-progress {
  color: var(--green);
  font-weight: 900;
  white-space: nowrap;
}

.tour-dots {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.tour-dots span {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #cbd9d4;
}

.tour-dots .active {
  width: 1.35rem;
  background: var(--blue);
}

.tour-hint {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.tour-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.tour-actions button {
  min-height: 2.75rem;
  white-space: nowrap;
}

.tour-actions .tour-primary {
  min-width: 9.25rem;
  box-shadow: 0 12px 24px rgba(35, 104, 162, 0.24);
}

.tour-actions .tour-primary:focus-visible,
.tour-start:focus-visible {
  outline: 3px solid rgba(35, 104, 162, 0.35);
  outline-offset: 3px;
}

.tour-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.tour-target {
  position: relative;
  outline: 4px solid rgba(35, 104, 162, 0.28);
  outline-offset: 6px;
  box-shadow: 0 0 0 10px rgba(35, 104, 162, 0.08);
}

@media (max-width: 1050px) {
  .hero,
  .prototype-grid,
  .challenge-grid,
  .architecture-grid,
  .submit-grid,
  .ops-grid,
  .forecast-layout,
  .enterprise-grid,
  .research-grid,
  .flow-grid,
  .deck-grid,
  .check-grid,
  .order-board {
    grid-template-columns: 1fr 1fr;
  }

  .voice-panel,
  .copilot-panel {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .hero,
  .prototype-grid,
  .challenge-grid,
  .architecture-grid,
  .submit-grid,
  .ops-grid,
  .forecast-layout,
  .enterprise-grid,
  .research-grid,
  .form-grid,
  .architecture-form-grid,
  .flow-grid,
  .deck-grid,
  .check-grid,
  .order-board {
    grid-template-columns: 1fr;
  }

  .voice-panel,
  .copilot-panel {
    grid-column: span 1;
  }

  .ops-metrics,
  .extract-grid {
    grid-template-columns: 1fr;
  }

  .transfer-line {
    grid-template-columns: 1fr;
  }

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

  .source-list {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
  }

  .tour-overlay {
    inset: auto 0.6rem 0.6rem 0.6rem;
  }

  .tour-panel {
    grid-template-columns: 1fr;
    padding: 0.9rem;
  }

  .tour-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .tour-actions .tour-primary {
    grid-column: 1 / -1;
    min-width: 0;
    order: -1;
  }

  .tour-side {
    min-width: 0;
  }

  .tour-hint {
    white-space: normal;
  }
}
