:root {
  color-scheme: light;
  --paper: #f5f7f6;
  --white: #ffffff;
  --ink: #17252b;
  --muted: #5d6c70;
  --line: #ccd7d5;
  --cyan: #087f9c;
  --emerald: #087f5b;
  --coral: #d85845;
  --gold: #b77a10;
  --dark: #102126;
  --radius: 6px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 82px; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #62c3d8; outline-offset: 3px; }

.site-header {
  height: 72px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(170px, 1fr);
  align-items: center;
  gap: 28px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; font-size: 20px; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: white; background: var(--ink); border-radius: 3px; }
nav { display: flex; gap: 28px; font-size: 14px; font-weight: 650; }
nav a:hover { color: var(--cyan); }
.api-indicator { justify-self: end; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.api-indicator span { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.api-indicator.is-live span { background: var(--emerald); }

.hero { height: clamp(580px, 78svh, 820px); position: relative; overflow: hidden; background: #edf1ef; border-bottom: 1px solid var(--line); }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center center; }
.hero-copy { position: relative; z-index: 2; padding: clamp(48px, 8vh, 90px) clamp(20px, 6vw, 96px); max-width: 680px; }
.hero-copy > * { text-shadow: 0 1px 0 white, 0 0 14px white, 0 0 28px white; }
.eyebrow { margin: 0 0 12px; color: var(--cyan); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; }
h1, h2, h3, p { letter-spacing: 0; }
h1 { margin: 0; font-size: clamp(66px, 10vw, 144px); line-height: 0.9; letter-spacing: 0; }
.hero-statement { margin: 28px 0 10px; font-size: clamp(24px, 3.2vw, 44px); font-weight: 760; line-height: 1.05; }
.hero-detail { max-width: 540px; margin: 0; color: #35484d; font-size: clamp(16px, 1.5vw, 20px); line-height: 1.6; }
.hero-actions { display: flex; gap: 12px; margin-top: 30px; }
.hero-actions > * { text-shadow: none; }
.primary-action, .secondary-action { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 20px; border: 1px solid var(--ink); font-weight: 750; border-radius: 3px; }
.primary-action { color: white; background: var(--ink); }
.secondary-action { background: rgba(255, 255, 255, 0.9); }
.primary-action:hover { background: var(--cyan); border-color: var(--cyan); }
.pipeline-ribbon { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(16, 33, 38, 0.94); color: white; }
.pipeline-ribbon span { padding: 18px clamp(10px, 3vw, 44px); border-right: 1px solid #3f555b; font-size: 13px; font-weight: 700; }
.pipeline-ribbon span:nth-child(2) { color: #74d1e1; }
.pipeline-ribbon span:nth-child(3) { color: #72d4b1; }
.pipeline-ribbon span:nth-child(4) { color: #f29384; }

section:not(.hero) { scroll-margin-top: 82px; }
.lab-band, .architecture-band, .interface-band, .principles-band { padding: clamp(68px, 9vw, 128px) clamp(20px, 6vw, 96px); }
.section-heading { max-width: 1380px; margin: 0 auto 44px; display: grid; grid-template-columns: 1fr minmax(280px, 520px); gap: 48px; align-items: end; }
.section-heading h2, .principles-band h2 { margin: 0; max-width: 820px; font-size: clamp(36px, 5vw, 70px); line-height: 1; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }

.lab-band { background: var(--white); }
.lab-layout { max-width: 1380px; margin: 0 auto; display: grid; grid-template-columns: minmax(320px, 0.78fr) minmax(520px, 1.22fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lab-controls { padding: clamp(24px, 3vw, 42px); background: #f7f9f8; border-right: 1px solid var(--line); }
.lab-output { min-width: 0; padding: clamp(24px, 3vw, 42px); }
.lab-controls label:not(.file-zone):not(.check-row) { display: block; margin: 20px 0 8px; font-size: 13px; font-weight: 750; }
.file-zone { min-height: 112px; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 22px; border: 1px dashed #7a9297; border-radius: 4px; background: white; cursor: pointer; }
.file-zone:hover { border-color: var(--cyan); }
.file-zone span { color: var(--muted); font-size: 13px; }
.file-zone input { margin-top: 8px; max-width: 100%; }
.control-row { margin: 14px 0; display: flex; gap: 10px; }
.command, .quiet-command, .run-command, .download-command { min-height: 42px; border-radius: 3px; font-weight: 720; cursor: pointer; }
.command, .quiet-command { padding: 0 14px; border: 1px solid var(--line); background: white; }
.quiet-command { color: var(--muted); }
textarea { width: 100%; min-height: 210px; resize: vertical; padding: 14px; border: 1px solid var(--line); border-radius: 3px; background: #fff; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.55; }
.policy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.policy-grid label span { display: block; margin-bottom: 8px; }
select { width: 100%; min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 3px; background: white; }
.check-row { margin: 20px 0; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 650; }
.check-row input { width: 18px; height: 18px; accent-color: var(--emerald); }
.run-command, .download-command { width: 100%; padding: 0 18px; border: 1px solid var(--ink); color: white; background: var(--ink); }
.run-command:hover, .download-command:hover:not(:disabled) { background: var(--cyan); border-color: var(--cyan); }
.download-command:disabled { opacity: 0.45; cursor: not-allowed; }
.lab-error { min-height: 22px; margin: 12px 0 0; color: #a33d30; font-size: 13px; }
.output-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.output-header h3 { margin: 0; font-size: 26px; }
.stage-badge { padding: 7px 10px; background: #e7efed; color: var(--emerald); border-radius: 2px; font-size: 11px; font-weight: 850; }
.metric-grid { margin: 34px 0; display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric-grid div { min-width: 0; padding: 18px 10px; border-right: 1px solid var(--line); }
.metric-grid div:last-child { border-right: 0; }
.metric-grid span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 750; }
.metric-grid strong { display: block; margin-top: 8px; font-size: clamp(18px, 2vw, 28px); overflow-wrap: anywhere; }
.lineage-strip { min-height: 42px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; overflow-x: auto; }
.lineage-strip span { flex: 0 0 auto; padding: 7px 9px; border: 1px solid var(--line); border-radius: 2px; }
.lineage-strip i { flex: 0 0 28px; height: 1px; background: var(--cyan); }
.table-shell { margin: 16px 0 24px; max-width: 100%; overflow: auto; border: 1px solid var(--line); }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
th, td { max-width: 240px; padding: 11px 12px; border-right: 1px solid #dce4e2; border-bottom: 1px solid #dce4e2; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
th { position: sticky; top: 0; background: #edf3f1; color: #294047; }

.architecture-band { background: #e8efed; }
.agent-grid { max-width: 1380px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: #aebebb; border: 1px solid #aebebb; }
.agent-grid article { min-height: 340px; padding: 34px; background: #f8faf9; }
.agent-grid article > span { color: var(--coral); font-weight: 850; }
.agent-grid h3 { margin: 55px 0 16px; font-size: 25px; }
.agent-grid p { color: var(--muted); line-height: 1.65; }
.agent-grid ul { padding-left: 18px; line-height: 1.9; }
.agent-grid article:nth-child(2) > span { color: var(--cyan); }
.agent-grid article:nth-child(3) > span { color: var(--emerald); }
.agent-grid article:nth-child(4) > span { color: var(--gold); }

.interface-band { background: var(--dark); color: white; }
.interface-band .eyebrow { color: #74d1e1; }
.interface-band .section-heading > p { color: #b8c7ca; }
.interface-layout { max-width: 1380px; margin: 0 auto; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 22px; }
pre { margin: 0; min-width: 0; padding: 30px; overflow: auto; border: 1px solid #40545a; border-radius: 4px; background: #09171b; color: #dbe6e8; font: 13px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace; }
.catalog-panel { padding: 30px; border: 1px solid #40545a; border-radius: 4px; background: #172d32; }
.catalog-panel h3 { margin: 0 0 22px; font-size: 20px; }
.catalog-panel pre { max-height: 300px; padding: 0; border: 0; background: transparent; }

.principles-band { background: #f6efe9; }
.principles-band > * { max-width: 1380px; margin-left: auto; margin-right: auto; }
.principle-list { margin-top: 56px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid #cbbeb3; }
.principle-list p { margin: 0; padding: 24px 28px 24px 0; color: #5e554f; line-height: 1.6; }
.principle-list strong { display: block; margin-bottom: 8px; color: var(--ink); }

footer { min-height: 170px; padding: 42px clamp(20px, 6vw, 96px); display: flex; justify-content: space-between; gap: 30px; background: #0d1b1f; color: white; }
footer > div { display: flex; gap: 22px; align-items: flex-start; }
footer strong { font-size: 24px; }
footer span, footer a { color: #a9bbbf; font-size: 13px; }
footer a:hover { color: white; }

@media (max-width: 1050px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-header nav { display: none; }
  .lab-layout, .interface-layout { grid-template-columns: 1fr; }
  .lab-controls { border-right: 0; border-bottom: 1px solid var(--line); }
  .agent-grid { grid-template-columns: 1fr 1fr; }
  .principle-list { grid-template-columns: 1fr 1fr; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .metric-grid div:nth-child(3) { border-right: 0; }
}

@media (max-width: 680px) {
  .site-header { height: 62px; padding: 0 16px; }
  .api-indicator { font-size: 0; }
  .hero { height: 720px; }
  .hero > img { object-position: 62% center; opacity: 0.78; }
  .hero-copy { padding: 44px 18px; }
  h1 { font-size: 68px; }
  .hero-detail { max-width: 88%; }
  .hero-actions { flex-direction: column; width: min(270px, 100%); }
  .pipeline-ribbon { grid-template-columns: 1fr 1fr; }
  .pipeline-ribbon span { padding: 12px 16px; }
  .section-heading { grid-template-columns: 1fr; gap: 20px; }
  .lab-band, .architecture-band, .interface-band, .principles-band { padding: 68px 16px; }
  .lab-layout { grid-template-columns: minmax(0, 1fr); }
  .lab-controls, .lab-output { padding: 20px; }
  .policy-grid { grid-template-columns: 1fr; gap: 0; }
  .agent-grid, .principle-list { grid-template-columns: 1fr; }
  .agent-grid article { min-height: 280px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid div:nth-child(2n) { border-right: 0; }
  .metric-grid div:nth-child(3) { border-right: 1px solid var(--line); }
  footer, footer > div { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
