/* One Darker applies to the entire desktop-like walkthrough, never its landscape. */
.demo-frame.code-window {
  background: var(--od-background);
  border-color: #30363d;
  box-shadow:
    0 28px 65px -22px #11162278,
    0 4px 10px #11162225;
  color: var(--od-foreground);
}
.demo-frame .demo-topbar {
  background: var(--od-panel);
  border-color: var(--od-border);
}
.demo-frame .demo-project,
.demo-frame .demo-label {
  color: var(--od-muted);
}
.demo-frame .demo-project strong,
.demo-frame .demo-project svg {
  color: var(--od-foreground);
}
.demo-frame .live-dot {
  background: #89ca78;
}
.demo-frame .source-pane {
  display: flex;
  flex-direction: column;
  background: var(--od-background);
  border-color: var(--od-border);
}
.demo-frame .source-pane .code-lines {
  flex: 1;
}
.demo-frame .result-pane {
  background: #0f141c;
}
.demo-frame .result-content,
.demo-frame .ancestry-copy,
.demo-frame .budget-demo-copy {
  color: var(--od-foreground);
}
.demo-frame .verdict-line h2,
.demo-frame .ancestry-copy h3,
.demo-frame .budget-demo-copy h3 {
  color: #e6edf3;
}
.demo-frame .verdict-line p,
.demo-frame .demo-metrics dt,
.demo-frame .demo-metrics dd span,
.demo-frame .meter-caption {
  color: var(--od-muted);
}
.demo-frame .demo-metrics dd {
  color: var(--od-foreground);
}
.demo-frame .demo-metrics dd strong {
  color: #e6edf3;
}
.demo-frame .demo-metrics dd .small-check {
  color: #89ca78;
}
.demo-frame .verdict-icon,
.demo-frame .pass-badge {
  background: #173629;
  color: #89ca78;
}
.demo-frame.is-rejected .verdict-icon,
.demo-frame .reject-badge {
  background: #3b2028;
  color: #e06c75;
}
.demo-frame.is-rejected #demo-untraced {
  color: #e06c75;
}
.demo-frame .budget-meter {
  background: #263044;
}
.demo-frame .budget-meter > span {
  background: #918df6;
}
.demo-frame .budget-meter i {
  background: #657188;
}
.demo-frame .demo-bottom {
  background: var(--od-panel);
  border-color: var(--od-border);
}
.demo-frame .demo-bottom p {
  color: #a5aeb9;
}
.demo-frame .source-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 17px;
  padding: 20px 25px;
  border-top: 1px solid var(--od-border);
  background: #111821;
}
.demo-frame .source-action p {
  color: var(--od-foreground);
  line-height: 1.6;
}
.demo-frame .source-action p span {
  display: block;
  color: var(--od-muted);
}
.demo-frame .button-demo {
  min-height: 44px;
  background: #918df6;
  color: #17172b;
  padding: 11px 18px;
  box-shadow: 0 4px 14px #0003;
  gap: 13px;
}
.demo-frame .button-demo:hover {
  background: #aaa4fa;
  transform: translateY(-2px);
  box-shadow: 0 5px 16px #0004;
}
.demo-frame .panel-action {
  margin-top: 24px;
}
.demo-frame .eyebrow {
  color: #a6afbd;
}
.demo-frame .ancestry-map {
  background: #10161f;
  border-color: var(--od-border);
}
.demo-frame .graph-node {
  background: var(--od-panel);
  border-color: #3b4657;
  box-shadow: 0 3px 10px #0002;
}
.demo-frame .graph-node strong {
  color: var(--od-foreground);
}
.demo-frame .node-type,
.demo-frame .graph-node small {
  color: #9da9b9;
}
.demo-frame .contract-root {
  background: #162437;
  border-color: #36577e;
}
.demo-frame .contract-root strong {
  color: #9bc6f3;
}
.demo-frame .helper-node {
  background: #14261e;
  border-color: #325841;
}
.demo-frame .helper-node strong {
  color: #a2d49d;
}
.demo-frame .graph-connector,
.demo-frame .graph-connector:after {
  background: #526176;
}
.demo-frame .unrooted-node {
  background: #2d1b23;
  border-color: #a25e6c;
}
.demo-frame .unrooted-node .node-type,
.demo-frame .unrooted-node strong {
  color: #e6a0a8;
}
.demo-frame .ancestry-copy > p,
.demo-frame .budget-demo-copy > p,
.demo-frame .graph-fact p,
.demo-frame .ring-label {
  color: #9aa6b7;
}
.demo-frame .graph-fact > span {
  color: #89ca78;
}
.demo-frame .ancestry-copy > code {
  color: #9bc6f3;
  overflow-wrap: anywhere;
}
.demo-frame .budget-visual {
  background: #10161f;
  border-color: var(--od-border);
}
.demo-frame .ring-track {
  stroke: #293145;
}
.demo-frame .budget-ring strong {
  color: #e6edf3;
}
.demo-frame .budget-ring span,
.demo-frame .budget-demo-copy dt {
  color: #9aa6b7;
}
.demo-frame .budget-demo-copy dl > div {
  border-color: var(--od-border);
}
.demo-frame .budget-demo-copy dd {
  color: var(--od-foreground);
}
.demo-frame .budget-demo-copy .headroom-row dd {
  color: #89ca78;
}

/* Direct curve exploration: native keyboard/touch slider, pointer scrubbing, scroll fill. */
.curve-chart {
  cursor: ew-resize;
  touch-action: pan-y;
}
.surface-control {
  border-top: 1px solid #e6e5ee;
  padding-top: 21px;
  margin-top: 9px;
}
.surface-control label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #667085;
}
.surface-control output {
  font-weight: 500;
  color: #73638f;
  font-variant-numeric: tabular-nums;
}
.surface-control input[type="range"] {
  --range-progress: 0%;
  display: block;
  width: 100%;
  height: 44px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: ew-resize;
  margin: 9px 0 0;
  border-radius: 8px;
  touch-action: pan-y;
}
.surface-control input[type="range"]:focus-visible {
  outline: 3px solid #615bce;
  outline-offset: 3px;
}
.surface-control input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(
    to right,
    #ab9cdb 0 var(--range-progress),
    #ece8f5 var(--range-progress) 100%
  );
}
.surface-control input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(
    to right,
    #ab9cdb 0 var(--range-progress),
    #ece8f5 var(--range-progress) 100%
  );
}
.surface-control input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #918df6;
  border: 3px solid #fff;
  margin-top: -7.5px;
  box-shadow: 0 1px 6px #51437835;
}
.surface-control input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #918df6;
  border: 3px solid #fff;
  box-shadow: 0 1px 6px #51437835;
}
.surface-ticks {
  position: relative;
  height: 25px;
  color: #667085;
}
.surface-ticks span {
  position: absolute;
  top: 0;
  white-space: nowrap;
  transform: translateX(-50%);
}
.surface-ticks span:nth-child(1) {
  left: 0;
  transform: none;
}
.surface-ticks span:nth-child(2) {
  left: 14.2857%;
}
.surface-ticks span:nth-child(3) {
  left: 42.8571%;
}
.surface-ticks span:nth-child(4) {
  right: 0;
  transform: none;
}
.curve-hint {
  color: #667085;
  line-height: 1.7;
  text-align: center;
  margin-top: 14px;
}
.chart-labels text {
  fill: #667085;
}
.curve-insight strong {
  color: #4d5669;
}

/* Meaningful light-page captions keep sufficient contrast; decorative art stays pastel. */
.hero-description,
.section-heading > p:last-child,
.section-copy > p:not(.eyebrow),
.rules-grid p,
.loop-card > p,
.faq-list details > p,
.start-copy > p {
  color: #667085;
}
.eyebrow,
.stack-strip > p,
.stack-strip > div > span,
.local-strip,
.adoption-note,
.matrix-alone,
.matrix-note,
.matrix-corner,
.curve-note,
.chart-header div > span,
.chart-unit,
.curve-stat > span,
.curve-insight,
.contract-stats > div > span,
.footer-top > div > p,
.footer-links,
.footer-byline,
.loop-caption {
  color: #667085;
}
.local-strip > span:first-child,
.local-strip a,
.faq-heading .text-link,
.footer-byline a,
.adoption-note a {
  color: #566177;
}
.feature-matrix tbody th {
  color: #566177;
}
.demo-disclaimer,
.brand-line,
.stage-intro > span {
  color: #514166;
}
@media (max-width: 800px) {
  .demo-frame .source-action {
    padding: 20px 24px;
  }
  .demo-frame .source-pane .code-lines {
    flex: auto;
  }
}
@media (max-width: 600px) {
  .demo-frame .source-action {
    padding: 20px;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }
  .demo-frame .source-action .button-demo {
    width: 100%;
    align-self: stretch;
  }
  .demo-frame .panel-action .button-demo {
    width: 100%;
  }
  .demo-frame .unrooted-node {
    position: static;
    transform: none;
    margin-top: 20px;
    min-width: 220px;
  }
  .demo-frame .ancestry-map {
    padding-block: 26px;
  }
  .demo-frame .demo-label {
    max-width: 140px;
    text-align: right;
  }
  .surface-control {
    padding-top: 20px;
  }
  .surface-control label {
    flex-wrap: wrap;
  }
  .curve-hint {
    margin-top: 16px;
  }
}
.code-window {
  color-scheme: dark;
}
@media (max-width: 600px) {
  .demo-frame .ancestry-map:has(.unrooted-node:not([hidden])) {
    padding-bottom: 26px;
    min-height: 0;
  }
  .comparison-section .feature-matrix table {
    min-width: 600px;
  }
  .comparison-section .feature-matrix th:first-child {
    width: 180px;
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
  }
  .comparison-section .feature-matrix thead th:first-child {
    z-index: 2;
  }
}
.demo-frame .pane-heading code {
  color: var(--od-foreground);
}

/* Quiet arrows sit midway through the landscape beside the desktop. */
.walkthrough-shell {
  position: relative;
  width: 100%;
  max-width: 1190px;
  margin-inline: auto;
}
.walkthrough-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  transform: translateY(-50%);
  background: #ffffffb3;
  color: #514166;
  border: 1px solid #ffffffb8;
  border-radius: 50%;
  transition:
    background 0.18s,
    border-color 0.18s;
}
.walkthrough-previous {
  left: calc((100% - 100vw) / 4 - 22px);
}
.walkthrough-next {
  right: calc((100% - 100vw) / 4 - 22px);
}
.walkthrough-arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.walkthrough-arrow:hover {
  background: #ffffffe6;
  border-color: #fff;
}
.walkthrough-step {
  display: none;
}
.demo-disclaimer a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: #44315e;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #44315e60;
  text-underline-offset: 4px;
}
.demo-disclaimer a:hover {
  text-decoration-color: currentColor;
}

/* Two independent quantities: the policy earns allowance; retained material uses it. */
.curve-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0 0;
}
.curve-totals dt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: #667085;
}
.series-key {
  display: inline-block;
  width: 20px;
  border-top: 3px solid #7860b6;
  flex-shrink: 0;
}
.usage-key {
  border-color: #b8643e;
  border-top-style: dashed;
}
.curve-totals dd {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin: 7px 0 0;
}
.curve-totals strong {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -1.3px;
  font-variant-numeric: tabular-nums;
  color: #665093;
}
.curve-totals > div:last-child strong {
  color: #a85b38;
}
.curve-totals dd > span {
  font-size: 14px;
  color: #667085;
}
.chart-axis-title {
  margin-top: 22px;
  font-size: 12px;
  line-height: 1.6;
  color: #667085;
}
.curve-card .curve-chart {
  display: block;
  margin-top: 10px;
}
.chart-axis-x {
  margin-top: 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
}
.curve-result {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #eedbd2;
  border-radius: 10px;
  background: #fcf3ed;
}
.curve-result > span {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f6e0d3;
  color: #a85b38;
  font-size: 18px;
}
.curve-result .curve-insight {
  margin: 0;
  text-align: left;
  line-height: 1.6;
}
.curve-result .curve-insight strong {
  display: block;
  color: #955032;
  font-weight: 600;
  font-size: 16px;
}
.curve-result.is-within-budget {
  background: #f0f7f0;
  border-color: #d5e7d7;
}
.curve-result.is-within-budget > span {
  background: #dceedd;
  color: #46724c;
}
.curve-result.is-within-budget .curve-insight strong {
  color: #3f6b46;
}
.budget-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 20px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e6e5ee;
}
.budget-controls .surface-control {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.range-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.budget-controls .range-heading {
  gap: 2px 8px;
}
.budget-controls input[type="range"] {
  height: 44px;
  min-height: 44px;
  margin-top: 4px;
  background:
    linear-gradient(
      to right,
      #ab9cdb 0%,
      #ab9cdb var(--range-progress),
      #ece8f5 var(--range-progress),
      #ece8f5 100%
    )
    center / 100% 4px no-repeat;
}
.budget-controls input[type="range"]::-webkit-slider-runnable-track {
  background: transparent;
  height: 4px;
}
.budget-controls input[type="range"]::-moz-range-track {
  background: transparent;
  height: 4px;
}
.budget-controls input[type="range"]::-webkit-slider-thumb {
  margin-top: -8.5px;
}
.usage-control output {
  color: #a85b38;
}
.budget-controls .usage-control input[type="range"] {
  background-image: linear-gradient(
    to right,
    #c98664 0%,
    #c98664 var(--range-progress),
    #f1e5de var(--range-progress),
    #f1e5de 100%
  );
}
.usage-control input[type="range"]::-webkit-slider-thumb {
  background: #b8643e;
}
.usage-control input[type="range"]::-moz-range-thumb {
  background: #b8643e;
}
@media (min-width: 801px) {
  .demo-band {
    padding-inline: 64px;
  }
}
@media (max-width: 1100px) {
  .curve-totals strong {
    font-size: 28px;
  }
  .curve-totals {
    column-gap: 12px;
  }
}
@media (max-width: 800px) {
  .walkthrough-shell {
    padding-top: 58px;
  }
  .walkthrough-arrow {
    top: 0;
    transform: none;
  }
  .walkthrough-previous {
    left: 0;
  }
  .walkthrough-next {
    right: 0;
  }
  .walkthrough-step {
    display: block;
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    color: #44315e;
    font-size: 14px;
    line-height: 24px;
    white-space: nowrap;
  }
  .curve-totals strong {
    font-size: 32px;
  }
}
@media (max-width: 460px) {
  .curve-totals {
    gap: 12px;
  }
  .curve-totals dt {
    align-items: flex-start;
  }
  .series-key {
    margin-top: 9px;
    width: 15px;
  }
  .curve-totals strong {
    font-size: 28px;
  }
  .budget-controls {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .walkthrough-arrow {
    transition: none;
  }
}
