:root {
  color-scheme: light;
  --bg: #f5f7f7;
  --surface: #ffffff;
  --surface-soft: #eef5f2;
  --ink: #14201d;
  --muted: #5d6b67;
  --line: #d8e2de;
  --dark: #0d1514;
  --dark-soft: #15231f;
  --teal: #117a72;
  --cyan: #31b8b2;
  --rose: #cf4e68;
  --amber: #c98624;
  --green: #2c9a62;
  --shadow: 0 18px 44px rgba(20, 32, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.6;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

canvas {
  display: block;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
.eyebrow,
.brand,
button {
  letter-spacing: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 22px;
  font-size: clamp(34px, 4.8vw, 58px);
  line-height: 1.04;
}

h2 {
  margin-bottom: 12px;
  font-size: 42px;
  line-height: 1.12;
}

h3 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.25;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(216, 226, 222, 0.82);
  background: rgba(245, 247, 247, 0.91);
  backdrop-filter: blur(14px);
}

.brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  position: relative;
  width: 30px;
  height: 30px;
  border: 2px solid var(--teal);
  border-radius: 50%;
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.brand-mark::before {
  inset: 8px;
  border: 2px solid var(--rose);
}

.brand-mark::after {
  width: 8px;
  height: 8px;
  right: -4px;
  top: 9px;
  background: var(--amber);
}

.builder-note {
  color: var(--muted);
  font-size: 14px;
  font-weight: 680;
  text-align: right;
}

.builder-note a {
  color: var(--teal);
  font-weight: 820;
}

.builder-note a:hover,
.builder-note a:focus-visible {
  text-decoration: underline;
  outline: none;
}

.hero-section {
  position: relative;
  min-height: calc(100svh - 112px);
  overflow: hidden;
  background: var(--dark);
  color: #f7fbf9;
}

#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(13, 21, 20, 0.94), rgba(13, 21, 20, 0.62) 50%, rgba(13, 21, 20, 0.2)),
    linear-gradient(0deg, rgba(13, 21, 20, 0.38), rgba(13, 21, 20, 0.08));
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: 1fr auto;
  max-width: 1180px;
  min-height: calc(100svh - 112px);
  margin: 0 auto;
  padding: 72px 24px 34px;
}

.hero-copy {
  align-self: center;
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.hero-section .eyebrow {
  color: #7ee2d8;
}

.hero-text {
  max-width: 690px;
  color: rgba(247, 251, 249, 0.82);
  font-size: 18px;
}

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

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-link {
  background: #f2fbf8;
  color: var(--dark);
}

.secondary-link {
  border: 1px solid rgba(247, 251, 249, 0.32);
  color: #f7fbf9;
}

.primary-link:hover,
.secondary-link:hover,
.primary-link:focus-visible,
.secondary-link:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.content-band {
  padding: 78px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.content-band:nth-of-type(odd) {
  background: #f9fbfa;
}

.method-band {
  background: #f3f7f5;
}

.demo-band {
  background: #edf5f3;
}

.section-heading {
  max-width: 900px;
  margin: 0 auto 30px;
}

.section-heading.compact {
  margin-bottom: 24px;
}

.section-heading p:not(.eyebrow) {
  max-width: 780px;
  color: var(--muted);
  font-size: 17px;
}

.use-case-grid,
.method-grid {
  display: grid;
  max-width: 1180px;
  margin: 0 auto;
  gap: 14px;
}

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

.use-case,
.method-step {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(20, 32, 29, 0.06);
}

.use-case,
.method-step {
  padding: 20px;
}

.use-case-icon,
.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 30px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: #e4f4ef;
  color: var(--teal);
  font-size: 13px;
  font-weight: 850;
}

.use-case:nth-child(2) .use-case-icon,
.method-step:nth-child(2) .step-index {
  background: #f8e9ed;
  color: var(--rose);
}

.use-case:nth-child(3) .use-case-icon,
.method-step:nth-child(3) .step-index {
  background: #f6eddc;
  color: var(--amber);
}

.use-case:nth-child(4) .use-case-icon,
.method-step:nth-child(4) .step-index {
  background: #e8eef8;
  color: #3867a5;
}

.use-case p,
.method-step p {
  margin-bottom: 0;
  color: var(--muted);
}

.example-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1fr);
  gap: 18px;
  max-width: 1180px;
  margin: 18px auto 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.example-copy p:not(.eyebrow) {
  color: var(--muted);
}

.example-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.example-map div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.example-map dt {
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.example-map dd {
  margin: 4px 0 0;
  color: var(--muted);
}

.algorithm-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
  max-width: 1180px;
  margin: 24px auto 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.qaoa-figure {
  display: grid;
  grid-template-columns: minmax(240px, 0.36fr) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(20, 32, 29, 0.07);
}

.qaoa-figure figcaption {
  display: grid;
  gap: 8px;
  margin: 0;
}

.qaoa-figure figcaption strong {
  font-size: 21px;
  line-height: 1.25;
}

.qaoa-figure figcaption span:last-child {
  color: var(--muted);
  font-size: 14px;
}

.qaoa-figure a {
  color: var(--teal);
  font-weight: 780;
}

.qaoa-image-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.qaoa-image-card img {
  display: block;
  width: 100%;
  height: auto;
}

.algorithm-copy p:not(.eyebrow) {
  color: var(--muted);
}

pre {
  min-width: 0;
  margin: 0;
  overflow: auto;
  border-radius: 8px;
  background: #101817;
  color: #e9f5f1;
  font-size: 13px;
  line-height: 1.65;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

pre code {
  display: block;
  padding: 18px;
}

.algo-line {
  display: inline-block;
  min-width: 100%;
  padding: 0 6px;
  border-radius: 6px;
  color: inherit;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

.algo-line.is-active {
  background: rgba(49, 184, 178, 0.24);
  color: #ffffff;
}

.demo-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
}

.demo-stage,
.demo-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.demo-stage {
  overflow: hidden;
}

#rqaoaCanvas {
  width: 100%;
}

#rqaoaCanvas {
  aspect-ratio: 1120 / 680;
  background: #f8fbfa;
}

.stage-controls {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(150px, 0.42fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--dark);
  color: #ffffff;
}

.pause-icon {
  position: relative;
  display: block;
  width: 16px;
  height: 18px;
}

.pause-icon::before,
.pause-icon::after {
  position: absolute;
  top: 0;
  width: 5px;
  height: 18px;
  border-radius: 2px;
  background: currentColor;
  content: "";
}

.pause-icon::before {
  left: 1px;
}

.pause-icon::after {
  right: 1px;
}

.icon-button.is-paused .pause-icon {
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid currentColor;
}

.icon-button.is-paused .pause-icon::before,
.icon-button.is-paused .pause-icon::after {
  display: none;
}

.range-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.demo-panel {
  padding: 16px;
}

.mode-control {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 1180px;
  margin: 8px auto 12px;
}

.mode-button {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fbfa;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.mode-button:hover {
  transform: translateY(-1px);
  border-color: rgba(20, 32, 29, 0.25);
}

.mode-button[data-mode="cycle"].is-active {
  border-color: rgba(17, 122, 114, 0.55);
  background: #e4f4ef;
  color: #117a72;
  box-shadow: 0 4px 14px rgba(17, 122, 114, 0.18);
}

.mode-button[data-mode="regular"].is-active {
  border-color: rgba(56, 103, 165, 0.55);
  background: #e6edf6;
  color: #3867a5;
  box-shadow: 0 4px 14px rgba(56, 103, 165, 0.18);
}

.mode-button[data-mode="hard"].is-active {
  border-color: rgba(207, 78, 104, 0.55);
  background: #fae6ec;
  color: #cf4e68;
  box-shadow: 0 4px 14px rgba(207, 78, 104, 0.18);
}

.scenario-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 4px auto 14px;
  max-width: 720px;
  text-align: center;
}

.scenario-arrow {
  display: block;
  width: 18px;
  height: 18px;
  border-right: 3px solid var(--muted);
  border-bottom: 3px solid var(--muted);
  transform: rotate(45deg);
  opacity: 0.7;
}

.scenario-arrow-caption {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.scenario-result {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  max-width: 1180px;
  margin: 0 auto;
}

.result-graph-wrap,
.result-narrative {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.result-graph-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.result-eyebrow {
  align-self: flex-start;
}

.result-graph {
  width: 100%;
  max-width: 540px;
  aspect-ratio: 800 / 560;
  background: #f8fbfa;
  border-radius: 8px;
}

.result-legend {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 540px;
  margin-top: 6px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.legend-line {
  flex-shrink: 0;
  display: inline-block;
  width: 36px;
  height: 0;
}

.legend-cut {
  border-top: 3px solid var(--cut-color, #117a72);
  border-radius: 1.5px;
}

.legend-same {
  border-top: 1.5px solid #b6c2bd;
}

.legend-dash {
  border-top: 1.5px dashed #b6c2bd;
}

.result-narrative h3 {
  margin: 6px 0 10px;
  font-size: 22px;
  line-height: 1.25;
}

.result-narrative p {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

.result-narrative p:last-child {
  margin-bottom: 0;
}

.takeaway-eyebrow {
  margin-top: 6px;
}

.phase-card {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.phase-card p:not(.eyebrow) {
  color: var(--muted);
}

.decision-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 0;
}

.decision-metrics div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #f3f7f5;
}

.decision-metrics dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.decision-metrics dd {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 850;
}

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

.phase-list li {
  padding: 12px 12px 12px 14px;
  border-left: 3px solid var(--line);
  border-radius: 0 8px 8px 0;
  background: #f9fbfa;
}

.phase-list li.is-active {
  border-left-color: var(--teal);
  background: #e7f5f1;
}

.phase-list span {
  display: block;
  margin-bottom: 3px;
  font-weight: 850;
}

.phase-list p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.outcome-card {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff9ed;
}

.outcome-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  h1 {
    font-size: 42px;
  }

  h2 {
    font-size: 34px;
  }

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

  .algorithm-panel,
  .example-panel,
  .qaoa-figure,
  .demo-shell,
  .scenario-result {
    grid-template-columns: 1fr;
  }

  .demo-panel {
    box-shadow: 0 10px 28px rgba(20, 32, 29, 0.08);
  }
}

@media (max-width: 680px) {
  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 28px;
  }

  h3 {
    font-size: 18px;
  }

  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
  }

  .builder-note {
    text-align: left;
  }

  .hero-inner {
    padding: 48px 18px 24px;
  }

  .hero-text,
  .section-heading p:not(.eyebrow) {
    font-size: 16px;
  }

  .use-case-grid,
  .method-grid,
  .example-map {
    grid-template-columns: 1fr;
  }

  .content-band {
    padding: 56px 18px;
  }

  .algorithm-panel {
    padding: 16px;
  }

  pre {
    font-size: 12px;
  }

  .stage-controls {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .speed-control {
    grid-column: 1 / -1;
  }

  .decision-metrics {
    grid-template-columns: 1fr;
  }
}

.references-card {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4faf9;
  color: #2c3a40;
  line-height: 1.65;
}

.references-card p {
  margin: 0 0 12px;
  font-size: 14px;
}

.references-card p:last-child {
  margin-bottom: 0;
}

.references-card b {
  color: #155e6a;
  font-weight: 600;
}

.references-card a {
  color: #2f5f6f;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  word-break: break-word;
}

.references-card .references-disclaimer {
  font-size: 12.5px;
  color: #5a6e74;
  font-style: italic;
  border-top: 1px solid #c9dadd;
  padding-top: 10px;
  margin-top: 14px;
}
