:root {
  color-scheme: light;
  --paper: #f4f1e9;
  --paper-2: #ebe7dc;
  --ink: #101319;
  --muted: #646762;
  --line: #c9c5b9;
  --blue: #2447ff;
  --blue-dark: #1731b9;
  --lime: #c7f36b;
  --red: #d83b2d;
  --white: #fffdf7;
  --radius: 16px;
  --shadow: 0 22px 60px rgba(16, 19, 25, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); min-width: 320px; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  min-height: 76px;
  padding: 14px clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 241, 233, 0.92);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.brand { display: inline-flex; gap: 11px; align-items: center; text-decoration: none; font-weight: 800; letter-spacing: -0.03em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--ink); color: var(--lime); border-radius: 9px 3px 9px 3px; font: 800 17px/1 ui-monospace, monospace; transform: rotate(-2deg); }
.topbar nav, footer nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 32px); }
.topbar nav a, footer a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 650; }
.topbar nav a:hover, footer a:hover { color: var(--blue); }

main { width: min(1400px, 100%); margin: 0 auto; }
.hero { min-height: 650px; padding: clamp(80px, 11vw, 150px) clamp(24px, 7vw, 104px) 70px; position: relative; overflow: hidden; }
.hero::after { content: ""; width: 460px; height: 460px; position: absolute; right: -130px; top: 55px; border: 82px solid var(--blue); border-radius: 50%; opacity: .96; z-index: -1; }
.eyebrow { margin: 0 0 18px; font: 750 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; color: var(--blue); }
h1, h2, h3, p { text-wrap: pretty; }
h1 { font-size: clamp(58px, 9.4vw, 138px); line-height: .86; letter-spacing: -.072em; margin: 0; font-weight: 840; max-width: 1080px; }
h1 span, h2 span { color: var(--blue); }
.lede, .tool-hero > p:last-child, .docs-hero > p { max-width: 700px; font-size: clamp(18px, 2.1vw, 26px); line-height: 1.45; color: var(--muted); margin: 36px 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0; }
.button { min-height: 46px; padding: 12px 18px; border: 1px solid var(--ink); border-radius: 9px; background: transparent; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 760; cursor: pointer; transition: transform .15s, background .15s, color .15s, opacity .15s; }
.button:hover { transform: translateY(-2px); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button.primary { background: var(--blue); border-color: var(--blue); color: white; box-shadow: 4px 4px 0 var(--ink); }
.button.primary:hover { background: var(--blue-dark); }
.signal { margin-top: 84px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 15px 0; display: flex; flex-wrap: wrap; gap: 14px 28px; color: var(--muted); font: 650 11px/1.3 ui-monospace, monospace; letter-spacing: .09em; }
.signal span { color: var(--blue); }

.section-head { padding: 75px clamp(24px, 5vw, 72px) 32px; display: flex; gap: 30px; justify-content: space-between; align-items: end; }
.section-head h2, .machine-strip h2, .api-callout h2, .config-section h2, .response-config h2 { font-size: clamp(34px, 5vw, 64px); line-height: .96; letter-spacing: -.055em; margin: 0; }
.search { display: grid; gap: 8px; min-width: min(360px, 100%); color: var(--muted); font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); padding: 12px 13px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36, 71, 255, .12); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }

.tool-grid { padding: 0 clamp(24px, 5vw, 72px) 100px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tool-card { min-height: 440px; padding: 28px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; position: relative; overflow: hidden; box-shadow: 0 0 0 rgba(0,0,0,0); transition: transform .18s, box-shadow .18s; }
.tool-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.tool-card[hidden] { display: none; }
.tool-number { position: absolute; right: 22px; top: 16px; color: var(--line); font: 800 72px/1 ui-monospace, monospace; letter-spacing: -.1em; }
.tool-card h3 { font-size: 44px; letter-spacing: -.055em; margin: 50px 0 12px; }
.tool-card p:not(.eyebrow) { color: var(--muted); font-size: 17px; line-height: 1.5; }
.tool-card ul { padding: 0; list-style: none; margin: auto 0 28px; border-top: 1px solid var(--line); }
.tool-card li { padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--muted); font: 600 12px/1.3 ui-monospace, monospace; }
.tool-card > a { font-weight: 800; color: var(--blue); text-decoration: none; display: flex; justify-content: space-between; }
.machine-strip, .api-callout { margin: 0 clamp(24px, 5vw, 72px) 96px; padding: clamp(32px, 5vw, 62px); background: var(--ink); color: var(--white); border-radius: var(--radius); display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: end; position: relative; overflow: hidden; }
.machine-strip::after { content: "/>"; position: absolute; right: -18px; bottom: -40px; font: 900 180px/1 ui-monospace, monospace; color: rgba(199,243,107,.11); }
.machine-strip .eyebrow, .api-callout .eyebrow { color: var(--lime); }
.machine-strip > p { color: #b9bbb8; line-height: 1.55; font-size: 18px; }
.machine-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.machine-links a { padding: 8px 12px; border: 1px solid #4e5358; border-radius: 7px; text-decoration: none; color: var(--lime); font: 600 12px ui-monospace, monospace; }

.tool-hero, .docs-hero { padding: clamp(72px, 9vw, 118px) clamp(24px, 6vw, 88px) 54px; border-bottom: 1px solid var(--line); }
.tool-hero.compact h1, .docs-hero h1 { font-size: clamp(54px, 7.5vw, 106px); }
.workbench { padding: 54px clamp(24px, 5vw, 72px) 90px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; }
.panel { border: 1px solid var(--line); background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: 0 7px 30px rgba(16, 19, 25, .04); }
.panel-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font: 700 11px/1 ui-monospace, monospace; letter-spacing: .08em; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.panel-head > div { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.status-dot { width: 8px; height: 8px; background: var(--lime); border: 1px solid var(--ink); border-radius: 50%; display: inline-block; box-shadow: 0 0 0 3px rgba(199,243,107,.25); }
.editor-panel { padding-bottom: 14px; }
.editor-panel textarea { min-height: 430px; resize: vertical; border: 0; border-radius: 0; background: transparent; padding: 25px 0; box-shadow: none; font: 14px/1.62 ui-monospace, SFMono-Regular, Menlo, monospace; }
.form-row { display: flex; align-items: end; gap: 12px; }
.form-row > label { min-width: 135px; }
.form-row .grow { flex: 1; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.form-panel { display: grid; gap: 18px; align-content: start; }
.result-panel { background: var(--ink); color: var(--white); }
.result-panel .eyebrow { color: var(--lime); }
.result-panel h2 { margin: 0 0 12px; font-size: 34px; letter-spacing: -.045em; }
.result-panel p { color: #bdc0bd; line-height: 1.55; }
.result-panel code { color: var(--lime); word-break: break-all; }
.result-panel .result-block { border-top: 1px solid #41464c; padding-top: 16px; margin-top: 16px; }
.result-panel dl { display: grid; grid-template-columns: minmax(100px, .5fr) 1fr; gap: 8px 14px; margin: 12px 0; }
.result-panel dt { color: #8f9594; font: 600 11px ui-monospace, monospace; }
.result-panel dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; }
.result-panel .pass { color: var(--lime); }
.result-panel .fail { color: #ff776b; }
.check { display: flex; grid-template-columns: 20px 1fr; align-items: start; gap: 10px; line-height: 1.45; }
.check input { width: 18px; height: 18px; margin: 0; }
.danger-confirm { border: 1px solid rgba(216,59,45,.35); background: rgba(216,59,45,.08); padding: 12px; border-radius: 8px; color: var(--red); }
.notice, .error-banner { margin-top: 16px; padding: 13px; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.error-banner { color: #7a211a; border-color: #df8f87; background: #fff1ef; }
.success-banner { color: #1b4d2e; border-color: #7ac694; background: #effbf2; }

.api-callout { grid-template-columns: .65fr 1.35fr; }
pre { margin: 0; overflow: auto; }
pre code { font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; }
.api-callout pre, .config-grid pre { background: #090b10; border: 1px solid #343940; border-radius: 10px; padding: 22px; color: #d9e1d7; }
.config-section { padding-bottom: 100px; }
.config-grid { padding: 0 clamp(24px, 5vw, 72px); display: grid; grid-template-columns: .7fr 1.3fr; gap: 18px; }
.config-grid pre { min-height: 330px; }

.viewer, .bin-viewer { padding: clamp(60px, 8vw, 100px) clamp(24px, 5vw, 72px) 100px; }
.viewer-head, .bin-top { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 30px; }
.viewer h1, .bin-viewer h1 { font-size: clamp(42px, 7vw, 84px); }
.viewer-meta, #bin-meta { color: var(--muted); }
.viewer-actions { display: flex; gap: 10px; }
.paste-code { min-height: 420px; padding: 28px; border: 1px solid var(--line); background: #12151a; color: #e8ebdf; border-radius: var(--radius); white-space: pre-wrap; word-break: break-word; }
.tok-comment { color: #8c968b; font-style: italic; }
.tok-string { color: #c7f36b; }
.tok-keyword { color: #83a1ff; font-weight: 750; }
.tok-number { color: #ffaf75; }
.connection { border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; font: 700 11px ui-monospace, monospace; display: flex; gap: 9px; align-items: center; }
.connection.offline .status-dot { background: #ff776b; }
.capture-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--blue); color: white; padding: 14px 16px 14px 20px; border-radius: 11px; margin-bottom: 18px; }
.capture-bar code { white-space: nowrap; overflow: auto; }
.capture-bar .button { color: white; border-color: rgba(255,255,255,.55); flex: 0 0 auto; }
.management-bar { display: flex; justify-content: flex-end; gap: 18px; margin: -4px 2px 18px; }
.danger-link { color: var(--red); }
.danger-button { color: var(--red); border-color: var(--red); }
.inbox-grid { display: grid; grid-template-columns: minmax(300px, .65fr) minmax(0, 1.35fr); gap: 18px; min-height: 620px; }
.request-list-panel { padding: 0; overflow: hidden; }
.request-list-panel .panel-head { padding: 20px; }
.request-list-panel > input { width: calc(100% - 28px); margin: 14px; }
.request-list { border-top: 1px solid var(--line); max-height: 525px; overflow: auto; }
.request-item { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); padding: 15px 18px; background: transparent; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.request-item:hover, .request-item[aria-current="true"] { background: var(--paper-2); }
.method { padding: 5px 7px; border-radius: 5px; background: var(--ink); color: var(--lime); font: 800 10px ui-monospace, monospace; }
.request-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 12px ui-monospace, monospace; }
.request-item time { color: var(--muted); font-size: 11px; }
.empty { padding: 35px 20px; color: var(--muted); text-align: center; }
.request-detail { overflow: hidden; }
.request-detail h2 { font-size: 34px; margin: 0 0 12px; }
.detail-table { display: grid; grid-template-columns: 120px 1fr; border-top: 1px solid var(--line); margin-top: 18px; }
.detail-table dt, .detail-table dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.detail-table dt { color: var(--muted); font: 650 11px ui-monospace, monospace; }
.detail-table dd { font-size: 13px; }
.body-preview { margin-top: 20px; padding: 18px; min-height: 160px; max-height: 330px; background: #12151a; color: #e8ebdf; border-radius: 9px; white-space: pre-wrap; word-break: break-word; }
.response-config { margin-top: 18px; display: grid; grid-template-columns: .55fr 1.45fr; gap: 24px; }
.response-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.response-form .wide { grid-column: 1 / -1; }
.link-button { border: 0; padding: 0; background: none; color: var(--blue); cursor: pointer; font: inherit; }

.prose { max-width: 850px; padding: clamp(70px, 9vw, 120px) 24px 120px; margin: 0 auto; }
.prose h1 { font-size: clamp(55px, 8vw, 100px); margin-bottom: 50px; }
.prose h2 { margin: 50px 0 15px; font-size: 32px; letter-spacing: -.04em; }
.prose p, .prose li { font-size: 18px; line-height: 1.7; color: #474b47; }
.prose code { font-family: ui-monospace, monospace; color: var(--blue); }
.prose pre { padding: 20px; background: var(--ink); color: var(--white); border-radius: 10px; }
.updated { margin-top: 60px; font: 650 12px ui-monospace, monospace !important; }
.docs-copy { padding-top: 20px; }
.docs-hero { background: var(--lime); }
.docs-hero .eyebrow { color: var(--ink); }
.docs-hero > p { color: #39402d; }

footer { width: min(1400px, 100%); margin: 0 auto; padding: 28px clamp(24px, 5vw, 72px) 50px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 24px; color: var(--muted); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .hero { min-height: auto; }
  .hero::after { width: 310px; height: 310px; border-width: 55px; right: -165px; top: 90px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 390px; }
  .machine-strip, .api-callout, .workbench, .config-grid, .response-config { grid-template-columns: 1fr; }
  .inbox-grid { grid-template-columns: 1fr; }
  .request-list { max-height: 330px; }
  .section-head, .viewer-head, .bin-top { align-items: stretch; flex-direction: column; }
}

@media (max-width: 640px) {
  .topbar { align-items: flex-start; gap: 14px; position: static; }
  .topbar nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
  .brand > span:last-child { display: none; }
  .signal { margin-top: 50px; }
  .form-row { flex-direction: column; align-items: stretch; }
  .form-row > label { width: 100%; }
  .panel { padding: 18px; }
  .editor-panel textarea { min-height: 300px; }
  .capture-bar { align-items: stretch; flex-direction: column; }
  .response-form { grid-template-columns: 1fr; }
  .response-form .wide { grid-column: auto; }
  .detail-table { grid-template-columns: 90px 1fr; }
  footer { flex-direction: column; }
  footer nav { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #0f1217;
    --paper-2: #1b2028;
    --ink: #eef1e9;
    --muted: #abb0aa;
    --line: #343a43;
    --blue: #7089ff;
    --blue-dark: #526ef0;
    --lime: #c7f36b;
    --red: #ff776b;
    --white: #171b22;
    --shadow: 0 22px 60px rgba(0, 0, 0, .32);
  }
  .topbar { background: rgba(15, 18, 23, .92); }
  .brand-mark { background: var(--lime); color: #101319; }
  .hero::after { opacity: .76; }
  .result-panel, .machine-strip, .api-callout { background: #080a0e; color: #f4f1e9; }
  .result-panel h2, .result-panel dd, .machine-strip h2, .api-callout h2 { color: #f4f1e9; }
  .notice { background: #1b2028; }
  .success-banner { color: #bcebc9; border-color: #315f3f; background: #13251a; }
  .error-banner { color: #ffb3ab; border-color: #743e38; background: #2a1715; }
  .prose p, .prose li { color: #c4c9c1; }
  .docs-hero { color: #101319; }
  .docs-hero h1, .docs-hero code { color: #101319; }
}
