:root {
  color-scheme: dark;
  --base: #17131f;
  --ink: #fff1e5;
  --muted: #cbbfcf;
  --accent: #ff9d83;
  --accent-ink: #261320;
  --surface: #211a2a;
  --tile: #292033;
  --hover: #34273e;
  --line: #514259;
  --control-line: #9b829e;
  --mono: ui-monospace, "SFMono-Regular", Menlo, monospace;
  --edge: clamp(20px, 5.5vw, 80px);
  font: 16px/1.5 system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--base); color: var(--ink); }
a { color: inherit; text-underline-offset: .19em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(100% - 2 * var(--edge), 1280px); margin-inline: auto; }
.header, .header nav, .brand, .footer { display: flex; align-items: center; }
.header { min-height: 80px; justify-content: space-between; gap: 12px; }
.header nav { gap: clamp(14px, 3vw, 44px); }
.header nav a, .brand { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
.header nav a:hover, .catalog-link:hover { text-decoration: underline; }
.header .sign-in {
  border: 1px solid var(--accent); color: var(--accent); padding-inline: 16px;
  gap: 10px; border-radius: 7px; font-weight: 650; white-space: nowrap;
}
.header .sign-in:hover { background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.brand { gap: 9px; font-weight: 720; letter-spacing: -.025em; font-size: 23px; }
.brand img { flex: none; }
.skip { position: absolute; left: var(--edge); top: 12px; transform: translateY(-200%); background: var(--base); padding: 10px; z-index: 2; }
.skip:focus { transform: none; }

.hero {
  display: grid; justify-items: center; gap: clamp(32px, 5vw, 56px);
  padding-block: clamp(50px, 7.5vw, 108px) clamp(52px, 6vw, 86px);
}
.hero-copy { text-align: center; animation: arrive 480ms ease-out both; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } }
h1, h2, p { margin: 0; }
h1 {
  max-width: 1120px; font-size: clamp(40px, 5.7vw, 82px);
  letter-spacing: -.04em; line-height: 1.04; text-wrap: balance; font-weight: 660;
}
.hero-copy p {
  max-width: 48ch; margin: 19px auto 0; color: var(--muted);
  font-size: clamp(16px, 1.44vw, 21px); text-wrap: balance;
}
.hero-copy .offer {
  margin: 24px auto 13px; color: var(--accent);
  font-weight: 690; font-size: clamp(17px, 1.55vw, 23px);
}
.catalog-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; gap: 13px;
  padding: 9px 15px; border-radius: 7px; background: var(--accent); color: var(--accent-ink);
  font-weight: 670; text-decoration: none; transition: background 160ms;
}
.catalog-link:hover { background: #ffb59f; text-decoration: none; }
.catalog-link span { transition: transform 160ms; }
.catalog-link:hover span { transform: translateY(3px); }

.routing {
  --segment: clamp(14px, 7vw, 88px);
  --branch: clamp(18px, 8vw, 96px);
  --port-gap: 6px;
  --port-size: 32px;
  --route-line: #c38189;
  display: grid; grid-template-columns: minmax(0, 1fr) var(--segment) minmax(0, 1fr) var(--branch) minmax(0, 1fr);
  align-items: center; width: min(760px, 100%); margin: 0; padding: 20px 18px;
  background: var(--surface); border-radius: 13px;
}
.route-node, .route-output {
  min-width: 0; display: grid; place-items: center; min-height: 42px; padding-inline: 3px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--tile);
}
.route-request, .route-output { font: 500 clamp(11px, 1.4vw, 14px)/1.2 var(--mono); }
.route-gateway {
  min-height: 56px; color: var(--accent); border-color: #8a5c63; background: #35232e;
  font-size: clamp(13px, 2vw, 21px); font-weight: 710; letter-spacing: -.025em;
}
.route-arrow, .route-branch { position: relative; color: var(--route-line); }
.route-arrow { border-top: 1px solid currentColor; }
.route-arrow::after {
  content: ""; position: absolute; right: 2px; top: -3px; width: 6px; height: 6px;
  border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg);
}
.route-branch {
  height: calc(2 * (var(--port-size) + var(--port-gap)));
  background: linear-gradient(currentColor, currentColor) left center / 50% 1px no-repeat;
}
.route-branch::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid currentColor;
}
.route-outputs { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--port-gap); }
.route-output { position: relative; min-height: var(--port-size); }
.route-output::before {
  content: ""; position: absolute; top: 50%; right: 100%; width: calc(var(--branch) / 2 + 1px);
  border-top: 1px solid var(--route-line);
}

.catalog { padding-block: 56px 68px; background: var(--surface); }
h2 { font-size: clamp(33px, 4vw, 62px); font-weight: 660; letter-spacing: -.035em; line-height: 1.06; }
.catalog-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-block-end: 28px; }
.catalog-intro { margin-block-start: 12px; color: var(--muted); }
.directory-button {
  color: var(--accent); background: transparent; min-height: 44px; padding: 8px 13px;
  border: 1px solid var(--accent); border-radius: 6px; cursor: pointer;
  font: inherit; font-weight: 650; white-space: nowrap;
}
.directory-button span { margin-inline-start: 7px; }
.directory-button:hover { background: var(--hover); }
.makers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.maker, .directory-maker {
  position: relative; display: flex; flex-direction: column; justify-content: center;
  gap: 4px; color: var(--ink); text-align: start; font: inherit; padding: 14px 28px 14px 17px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--tile);
  cursor: pointer; width: 100%; min-width: 0;
}
.maker { min-height: 85px; transition: border-color 160ms, background-color 160ms; }
.maker::after, .directory-maker::after {
  content: "→" / ""; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--accent);
}
.maker:hover, .directory-maker:hover { background: var(--hover); border-color: var(--accent); }
.wordmark { font-size: clamp(17px, 1.65vw, 25px); font-weight: 680; line-height: 1.15; letter-spacing: -.028em; overflow-wrap: anywhere; }
.maker-family { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
body:has(dialog[open]) { overflow: hidden; }
.catalog-dialog {
  width: min(640px, calc(100% - 28px)); max-height: calc(100% - 28px);
  max-height: calc(100dvh - 28px); margin: auto; padding: 0; overflow: hidden;
  border: 1px solid var(--control-line); border-radius: 13px; box-shadow: 0 24px 55px #0e0915a0;
  background: var(--tile); color: var(--ink);
}
.catalog-dialog[open] { display: flex; flex-direction: column; }
#maker-dialog { max-height: min(560px, calc(100dvh - 28px)); }
.catalog-dialog::backdrop { background: #0e0b14c9; }
.dialog-head {
  padding: 17px 20px 13px; display: flex; flex: none; align-items: center;
  justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line);
}
.dialog-head h2 { font-size: clamp(25px, 5vw, 41px); overflow-wrap: anywhere; }
.dialog-close {
  width: 44px; height: 44px; flex: none; border: 1px solid var(--line); border-radius: 7px;
  display: grid; place-items: center; color: var(--accent); background: transparent;
  cursor: pointer; font-size: 25px; line-height: 1;
}
.dialog-close:hover { background: var(--hover); }
.dialog-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 20px 14px; }
.dialog-body[tabindex]:focus-visible { outline-offset: -3px; }
.model-list, .directory-group ul { margin: 0; padding: 0; list-style: none; }
.model-list li { padding-block: 12px; }
.model-list li + li, .directory-group + .directory-group { border-top: 1px solid var(--line); }
.model-list h3, .directory-group h3 { font-size: 16px; margin: 0 0 3px; }
.model-list p { font-size: 14px; color: var(--muted); }
.directory-dialog { width: min(760px, calc(100% - 28px)); }
.directory-controls { padding: 12px 20px 0; flex: none; }
.directory-controls label { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 650; }
.directory-controls input {
  display: block; width: 100%; min-height: 44px; padding: 7px 11px; border-radius: 6px;
  border: 1px solid var(--control-line); color: var(--ink); background: var(--base); font: inherit;
}
.directory-controls p { color: var(--muted); margin-top: 8px; font-size: 14px; }
.directory-group { padding-block: 13px; }
.directory-group ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 3px 4px; }
.directory-maker { min-height: 54px; border-radius: 6px; padding-block: 6px; }
.directory-maker .wordmark { font-size: 15px; letter-spacing: -.02em; }
.not-found { padding-block: 12vh; }
.footer { min-height: 72px; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
@media (max-width: 1020px) {
  .makers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 790px) {
  .header { min-height: 68px; }
  .hero { gap: 32px; padding-block: 48px 42px; }
  .routing {
    --segment: clamp(12px, 5vw, 30px); --branch: clamp(15px, 6vw, 36px);
    --port-size: 27px; --port-gap: 5px; width: min(520px, 100%); padding: 14px 10px;
  }
  .route-gateway { min-height: 47px; }
  .route-request { min-height: 36px; }
  .catalog { padding-block: 38px 44px; }
  .makers { gap: 10px; }
  .catalog-head { align-items: start; flex-direction: column; }
  .maker { padding-left: 12px; min-height: 77px; }
}
@media (max-width: 370px) {
  .brand { font-size: 20px; gap: 6px; }
  .brand img { width: 26px; height: 26px; }
  .header nav { gap: 12px; font-size: 14px; }
  .header .sign-in { gap: 6px; padding-inline: 10px; }
  .hero { padding-block-start: 35px; }
  h1 { font-size: 39px; }
  .hero-copy p { margin-block-start: 14px; }
  .hero-copy .offer { margin-block: 19px 10px; }
  .directory-group ul { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-copy { animation: none; }
  .maker, .catalog-link, .catalog-link span { transition: none; }
}
