:root {
  color-scheme: light;
  --paper: #f4f0e8;
  --card: #faf7f0;
  --ink: #101e2a;
  --muted: #53616a;
  --line: #d9d4ca;
  --orange: #ed582d;
  --orange-dark: #ac3819;
  --navy-light: #182a39;
  --circuit: #617789;
  --good: #34573e;
  --bad: #9a321a;
  --sans: "Instrument Sans", "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.52 var(--sans); }
body :focus-visible { outline: 2px solid var(--orange-dark); outline-offset: 3px; }
:where(h1, h2, h3, p, pre, ul, dl) { margin: 0; }
button, select { font: inherit; }
a { color: inherit; }
button { cursor: pointer; }
button:disabled, select:disabled { cursor: default; opacity: .58; }
.shell { width: min(1320px, calc(100% - 96px)); margin-inline: auto; }
.screen { padding-top: 52px; padding-bottom: 64px; }
.skip-link { position: fixed; z-index: 8; top: 12px; left: 12px; padding: 10px; background: var(--ink); color: var(--card); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.topbar { border-bottom: 1px solid var(--line); }
.header-layout { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 74px; gap: 24px; }
.brand { display: inline-flex; align-items: center; justify-self: start; gap: 9px; text-decoration: none; font-weight: 790; font-size: 24px; letter-spacing: -.065em; }
.brand-mark { display: inline-grid; align-items: end; justify-items: center; flex: none; position: relative; width: 29px; height: 24px; }
.brand-mark i { position: absolute; border: 3px solid var(--ink); border-bottom: 0; width: 29px; height: 23px; }
.brand-mark i:nth-child(2) { width: 21px; height: 18px; }
.brand-mark i:nth-child(3) { width: 13px; height: 12px; border-color: var(--orange); }
.nav { display: flex; gap: 31px; align-self: stretch; }
.nav a { position: relative; display: grid; place-items: center; font-size: 14px; font-weight: 610; color: var(--muted); white-space: nowrap; text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--orange); content: ""; }
.workspace-link { justify-self: end; font-weight: 710; color: var(--ink); white-space: nowrap; text-decoration: none; }
.workspace-link:hover, .text-link:hover, .bare-button:hover { color: var(--orange-dark); }
.workspace-link span, .text-link span { margin-left: 4px; }

.hero { min-height: 470px; display: grid; grid-template-columns: .98fr 1.02fr; align-items: center; gap: clamp(38px, 7vw, 108px); }
.hero-copy { padding: 17px 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 23px; color: var(--muted); font-size: 12px; font-weight: 690; }
.chip-dot { display: inline-block; width: 7px; height: 7px; background: var(--orange); }
.hero h1 { font-size: clamp(55px, 7vw, 104px); line-height: .94; font-weight: 790; letter-spacing: -.081em; }
.hero h1 em { color: var(--orange-dark); font-style: normal; }
.hero-lede { max-width: 475px; margin-top: 26px; color: var(--muted); font-size: clamp(16px, 1.5vw, 20px); line-height: 1.48; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 33px; }
.button { min-height: 45px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 9px 13px; border: 1px solid transparent; border-radius: 5px; font-weight: 730; font-size: 14px; text-align: center; text-decoration: none; }
.button-primary { color: #101a22; background: var(--orange); border-color: var(--orange); }
.button-primary:hover:not(:disabled) { background: #fc6b43; border-color: #fc6b43; }
.button-outline { color: var(--ink); background: transparent; border-color: #bcb8b0; }
.button-outline:hover:not(:disabled) { background: #e9e3d9; border-color: #a7a095; }

.hero-console { position: relative; overflow: hidden; background: var(--ink); color: #f5efe3; border: 1px solid #1c2c37; border-radius: 9px; box-shadow: 0 20px 45px #3424141a; }
.console-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 16px 20px; background: var(--navy-light); border-bottom: 1px solid #405465; font: 11px/1.25 var(--mono); letter-spacing: .055em; color: #d3dee5; }
.console-indicator { display: inline-block; width: 6px; height: 6px; margin-right: 4px; background: #fe6e45; vertical-align: 1px; }
.console-sample { color: #ff977a; }
.console-body { padding: 28px max(18px, 5%); background-image: linear-gradient(90deg, #7992a318 1px, transparent 1px), linear-gradient(#7992a318 1px, transparent 1px); background-size: 18px 18px; }
.console-prompt { padding: 14px; border: 1px solid var(--circuit); background: var(--navy-light); border-radius: 5px; text-align: center; }
.console-label { color: #aebfca; font: 10px/1.4 var(--mono); letter-spacing: .055em; }
.console-prompt p { margin-top: 5px; line-height: 1.45; }
.console-stem { height: 18px; width: 50%; margin: 0 auto; border-bottom: 1px solid #b95a40; position: relative; }
.console-stem::before { position: absolute; top: 0; left: 50%; bottom: 0; border-left: 1px solid #b95a40; content: ""; }
.console-branches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding-top: 18px; }
.console-answer { border: 1px solid var(--circuit); background: var(--navy-light); border-radius: 5px; position: relative; padding: 13px; }
.console-answer::before { position: absolute; bottom: 100%; left: 50%; height: 19px; border-left: 1px solid #b95a40; content: ""; }
.console-answer .console-label span { display: inline-block; width: 5px; height: 5px; margin-right: 4px; background: #fc693f; vertical-align: 1px; }
.console-answer code { display: block; margin-top: 9px; color: #f7efe4; font: clamp(9px, 1.1vw, 13px)/1.45 var(--mono); overflow-wrap: anywhere; }
.console-footer { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px 20px; margin-top: 19px; color: #aebfca; font: 10px/1.4 var(--mono); letter-spacing: .04em; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 45px; }
.feature { border-top: 1px solid #bbb5aa; padding: 17px 12px 0 0; }
.feature h2 { margin-top: 12px; font-size: 19px; line-height: 1.24; letter-spacing: -.035em; }
.feature p { max-width: 320px; margin-top: 6px; color: var(--muted); }
.feature-icon { height: 23px; width: 28px; position: relative; display: inline-grid; align-items: center; }
.feature-icon i { position: absolute; display: block; border: 2px solid var(--ink); border-radius: 2px; content: ""; }
.compare-icon i { height: 13px; width: 12px; left: 0; }
.compare-icon i + i { left: 15px; border-color: var(--orange-dark); }
.wallet-icon i { height: 14px; width: 22px; left: 1px; }
.wallet-icon i + i { height: 6px; width: 9px; left: 18px; border-color: var(--orange-dark); background: var(--paper); }
.key-icon i { width: 11px; height: 11px; border-radius: 50%; left: 2px; }
.key-icon i + i { width: 14px; height: 5px; border-color: var(--orange-dark); left: 12px; }

.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 26px; }
.page-heading .chip { margin-bottom: 12px; }
.page-heading h1 { font-size: clamp(37px, 5vw, 67px); line-height: 1; font-weight: 780; letter-spacing: -.073em; }
.page-heading p:not(.chip) { max-width: 660px; margin-top: 12px; color: var(--muted); }
.balance-chip { display: grid; grid-template-columns: auto auto; align-items: center; gap: 2px 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); white-space: nowrap; }
.balance-chip span, .balance-chip a { color: var(--muted); font-size: 12px; }
.balance-chip strong { justify-self: end; font: 690 14px/1.4 var(--mono); }
.balance-chip a { grid-column: 1 / -1; }
.compare-layout { display: grid; grid-template-columns: minmax(330px, .83fr) minmax(0, 1.47fr); align-items: start; gap: 16px; }
.compare-setup { display: grid; gap: 12px; }
.tool-panel, .results-panel { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.tool-panel { padding: 16px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 11px; }
.panel-heading h2, .results-header h2 { font-size: 17px; line-height: 1.19; font-weight: 760; letter-spacing: -.03em; }
.muted, .bare-button, .text-link { color: var(--muted); font-size: 12px; }
.bare-button { appearance: none; background: transparent; border: 0; padding: 4px; font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.text-link { font-weight: 690; text-underline-offset: 2px; }
.scenario-options { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.scenario-options button { display: block; border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; color: var(--muted); background: none; font-size: 12px; font-weight: 650; text-align: start; }
.scenario-options button:hover { background: #eee7dc; color: var(--ink); }
.scenario-options button[aria-pressed="true"] { border-color: #d9a58e; background: #f7e8de; color: #842b16; }
.prompt-preview { padding: 10px 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--ink); font: 11px/1.52 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 169px; overflow: auto; }
.scenario-criteria, .run-cost { margin-top: 7px; color: var(--muted); font-size: 12px; }
.scenario-criteria h3 { font-size: 12px; color: var(--ink); }
#compare-form { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.mode-field { margin-bottom: 10px; }
.model-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.model-fields span, .mode-field label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 710; }
.model-fields select, .mode-field select { display: block; width: 100%; height: 36px; padding: 4px 6px; border: 1px solid #c8c1b7; border-radius: 4px; color: var(--ink); background: var(--paper); font-size: 12px; }
.run-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 11px; }
.run-actions .button { min-height: 36px; font-size: 12px; padding: 6px 8px; }
.balance-help { margin-top: 6px; }
.form-error { margin-top: 10px; background: #fae7df; border: 1px solid #e2ad99; padding: 7px; border-radius: 4px; color: var(--bad); font-size: 12px; overflow-wrap: anywhere; }
.results-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.results-header p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.run-status { flex: none; border-radius: 4px; border: 1px solid var(--line); padding: 3px 6px; color: var(--muted); font: 10px/1.45 var(--mono); }
.run-status[data-state="busy"] { color: var(--orange-dark); border-color: #d9a58e; }
.run-status[data-state="complete"] { color: var(--good); border-color: #aebca9; }
.run-status[data-state="failed"] { color: var(--bad); border-color: #e2ad99; }
.results-empty { min-height: 325px; display: grid; align-content: center; justify-items: center; gap: 13px; padding: 20px; text-align: center; color: var(--muted); font-size: 14px; }
.empty-icon { display: inline-grid; grid-template-columns: 23px 23px; gap: 5px; height: 29px; }
.empty-icon span { border: 1px solid #beb7ab; border-radius: 4px; position: relative; }
.empty-icon span::after { position: absolute; top: 7px; left: 5px; right: 5px; height: 1px; background: #beb7ab; box-shadow: 0 5px #beb7ab; content: ""; }
.results-content { padding: 12px; }
.comparison-update { margin-bottom: 8px; padding: 7px; border: 1px solid #d9a58e; background: #f7e8de; border-radius: 4px; color: #842b16; font-size: 12px; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.result-card { padding: 10px; min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; }
.result-card h3 { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.result-head { display: flex; align-items: start; justify-content: space-between; gap: 7px; }
.result-score { white-space: nowrap; font: 12px/1.4 var(--mono); }
.result-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 8px 0; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result-metrics dt { color: var(--muted); font-size: 11px; }
.result-metrics dd { margin: 1px 0 0; font: 12px/1.4 var(--mono); }
.result-body { display: grid; gap: 7px; }
.validation { display: grid; gap: 3px; color: var(--muted); font-size: 12px; }
.validation strong { color: var(--good); }
.validation[data-pass="false"] strong { color: var(--bad); }
.trace, .answer { overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--card); }
.trace summary, .answer summary { padding: 6px 7px; font-weight: 720; cursor: pointer; font-size: 12px; }
.trace-name { margin: 5px 7px 0; color: var(--orange-dark); font: 700 11px/1.4 var(--mono); overflow-wrap: anywhere; }
.trace-content, .answer-content { margin: 4px 7px 7px; overflow: auto; max-height: 230px; white-space: pre-wrap; overflow-wrap: anywhere; font: 10px/1.55 var(--mono); }
.answer-content { font-size: 11px; }
.history-panel { margin-top: 16px; }
.history-list { padding: 0; list-style: none; }
.history-list li + li { border-top: 1px solid var(--line); }
.history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px 14px; width: 100%; align-items: center; padding: 8px 1px; text-align: left; border: 0; background: transparent; color: var(--ink); font-size: 12px; }
.history-row:hover { color: var(--orange-dark); }
.history-row span { color: var(--muted); }

.wallet-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wallet-overview { padding: 20px; }
.wallet-overview h3 { font-size: 15px; }
.wallet-overview p { margin: 4px 0 12px; color: var(--muted); }
.wallet-option + .wallet-option { border-top: 1px solid var(--line); padding-top: 9px; }
.wallet-code { background: var(--ink); color: var(--paper); padding: 10px; border-radius: 5px; margin-bottom: 10px; white-space: pre-wrap; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; min-height: 60px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--orange-dark); }

@media (max-width: 1050px) {
  .shell { width: calc(100% - 56px); }
  .hero { min-height: 405px; }
  .compare-layout { grid-template-columns: minmax(290px, .9fr) minmax(0, 1.4fr); }
}

@media (max-width: 760px) {
  .shell { width: calc(100% - 34px); }
  .screen { padding-top: 33px; padding-bottom: 42px; }
  .header-layout { min-height: 60px; gap: 15px; }
  .brand { font-size: 21px; gap: 6px; }
  .brand-mark { transform: scale(.88); transform-origin: left center; width: 26px; }
  .nav { gap: 16px; }
  .nav a, .workspace-link { font-size: 12px; }
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 21px; }
  .hero-copy { padding: 0; }
  .hero .chip { margin-bottom: 16px; }
  .hero-lede { margin-top: 12px; }
  .actions { margin-top: 19px; }
  .console-body { padding: 18px; }
  .console-answer code { font-size: 11px; }
  .feature-grid { margin-top: 32px; }
  .compare-layout { grid-template-columns: minmax(0, 1fr); }
  .results-empty { min-height: 205px; }
}

@media (max-width: 490px) {
  .header-layout { grid-template-columns: 1fr auto; grid-template-rows: auto auto; padding-top: 10px; gap: 5px; }
  .workspace-link { grid-column: 2; grid-row: 1; }
  .nav { grid-column: 1 / -1; justify-content: center; gap: 23px; }
  .nav a { min-height: 32px; }
  .feature-grid { grid-template-columns: 1fr; gap: 12px; }
  .feature { display: grid; grid-template-columns: auto 1fr; gap: 2px 9px; padding: 10px 0 0; }
  .feature h2 { margin: 1px 0 0; }
  .feature p { grid-column: 2; margin: 0; }
  .page-heading { align-items: start; flex-direction: column; gap: 11px; }
  .result-grid, .wallet-layout { grid-template-columns: minmax(0, 1fr); }
  .history-row { grid-template-columns: minmax(0, 1fr) auto; }
  .history-row span:last-child { grid-column: 1 / -1; }
}
