:root {
  color-scheme: dark;
  --bg: #080b0e;
  --panel: #0f1418;
  --panel-soft: #12191e;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f3f7f5;
  --muted: #8b9796;
  --cyan: #68f5d2;
  --amber: #ffb95c;
  --danger: #ff7d72;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
.shell { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.ambient { position: fixed; border-radius: 999px; filter: blur(110px); opacity: .13; pointer-events: none; z-index: -1; }
.ambient-one { width: 420px; height: 420px; background: var(--cyan); right: -100px; top: 80px; }
.ambient-two { width: 360px; height: 360px; background: var(--amber); left: -180px; top: 820px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 78px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 14, .82);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(104,245,210,.45); color: var(--cyan); font: 700 18px var(--mono); transform: rotate(45deg); }
.brand-mark::first-letter { transform: rotate(-45deg); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: .04em; }
.brand small { color: var(--muted); font-size: 11px; }
.topbar nav { display: flex; gap: 30px; color: #b2bcba; font-size: 13px; }
.topbar nav a:hover { color: var(--cyan); }
.token-trigger { justify-self: end; border: 1px solid var(--line); border-radius: 99px; background: rgba(255,255,255,.035); padding: 9px 14px; font-size: 12px; cursor: pointer; }
.token-trigger:hover { border-color: rgba(104,245,210,.4); }
.token-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #6f7878; }
.token-dot.ready { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }

.hero { min-height: 650px; display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 80px; padding-block: 86px 70px; }
.eyebrow, .section-index { font: 650 11px var(--mono); letter-spacing: .14em; color: var(--cyan); }
.eyebrow { display: flex; align-items: center; gap: 9px; }
.eyebrow span { width: 30px; height: 1px; background: var(--cyan); }
.hero h1 { margin: 22px 0 26px; font-size: clamp(50px, 6.2vw, 82px); letter-spacing: -.055em; line-height: .99; font-weight: 660; }
.hero h1 em { color: var(--cyan); font-style: normal; }
.hero-copy > p { max-width: 620px; color: #aab5b3; font-size: 17px; line-height: 1.8; }
.hero-actions { display: flex; align-items: center; gap: 12px; margin-top: 34px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 28px; border: 1px solid var(--line); padding: 0 18px; background: transparent; border-radius: 3px; font-size: 13px; cursor: pointer; }
.button.primary { background: var(--cyan); color: #06100e; border-color: var(--cyan); font-weight: 700; }
.button.primary:hover { background: #94ffe4; }
.button.ghost:hover { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.04); }
.button.danger { color: var(--danger); }

.status-panel { border: 1px solid var(--line); background: linear-gradient(150deg, rgba(20,29,34,.96), rgba(11,15,18,.96)); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.status-head { height: 64px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); font: 650 11px var(--mono); letter-spacing: .11em; color: var(--muted); }
.live-pill { color: #d3dbd9; letter-spacing: 0; }
.live-pill i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: #88918f; }
.live-pill.online i { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.live-pill.offline i { background: var(--danger); }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; }
.metric-grid div { min-height: 126px; padding: 26px 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric-grid div:nth-child(2n) { border-right: 0; }
.metric-grid strong, .metric-grid span { display: block; }
.metric-grid strong { font-size: 28px; font-weight: 560; }
.metric-grid span { margin-top: 7px; color: var(--muted); font-size: 12px; }
.endpoint-strip { display: flex; align-items: center; gap: 10px; padding: 18px 22px; overflow: hidden; }
.endpoint-strip code { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #b9c4c2; font: 11px var(--mono); }
.pulse { width: 6px; height: 6px; flex: 0 0 auto; background: var(--cyan); border-radius: 50%; }

.section { padding-block: 104px; border-top: 1px solid var(--line); scroll-margin-top: 78px; }
.section-heading { margin-bottom: 38px; }
.section-heading h2 { margin: 8px 0 8px; font-size: clamp(32px, 4vw, 48px); letter-spacing: -.04em; line-height: 1.1; }
.section-heading p { margin: 0; color: var(--muted); }
.split-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.search-box { width: min(390px, 100%); height: 48px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.22); }
.search-box:focus-within { border-color: var(--cyan); }
.search-box span { color: var(--cyan); font-size: 24px; }
.search-box input { min-width: 0; flex: 1; background: transparent; border: 0; outline: 0; color: var(--text); }
.search-box kbd { border: 1px solid var(--line); color: var(--muted); padding: 2px 7px; border-radius: 3px; font: 11px var(--mono); }

.model-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.model-card { position: relative; min-height: 330px; padding: 30px; border: 1px solid var(--line); background: rgba(15,20,24,.74); overflow: hidden; transition: transform .2s ease, border-color .2s ease; }
.model-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.24); }
.model-card::after { content: ""; position: absolute; width: 220px; height: 220px; right: -110px; top: -130px; border: 1px solid currentColor; border-radius: 50%; opacity: .16; }
.model-card.cyan { color: var(--cyan); }
.model-card.amber { color: var(--amber); }
.model-card-head { display: flex; justify-content: space-between; align-items: start; }
.model-number { font: 11px var(--mono); letter-spacing: .12em; }
.availability { font: 11px var(--mono); color: #aeb8b6; }
.availability i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; background: currentColor; }
.model-card h3 { margin: 45px 0 8px; color: var(--text); font-size: 28px; letter-spacing: -.03em; }
.model-id { display: block; color: currentColor; font: 12px var(--mono); overflow-wrap: anywhere; }
.model-card p { max-width: 480px; min-height: 52px; color: #99a4a2; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 24px 0 30px; }
.tag { border: 1px solid var(--line); border-radius: 99px; padding: 5px 9px; color: #c4ccca; font-size: 11px; }
.model-meta { display: grid; grid-template-columns: repeat(3, 1fr); padding-top: 18px; border-top: 1px solid var(--line); }
.model-meta span, .model-meta strong { display: block; }
.model-meta span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.model-meta strong { margin-top: 4px; color: var(--text); font: 12px var(--mono); }
.empty-state { text-align: center; padding: 60px; color: var(--muted); border: 1px dashed var(--line); }

.connect-layout { display: grid; grid-template-columns: .9fr 1.1fr; border: 1px solid var(--line); background: var(--panel); }
.endpoint-card { padding: 30px; border-right: 1px solid var(--line); }
.card-label { color: var(--muted); font: 11px var(--mono); letter-spacing: .12em; }
.endpoint-tabs, .code-tabs { display: flex; gap: 4px; margin-top: 20px; }
.endpoint-tabs button, .code-tabs button { border: 0; padding: 8px 11px; border-radius: 3px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.endpoint-tabs button.active, .code-tabs button.active { background: rgba(104,245,210,.11); color: var(--cyan); }
.copy-line { display: flex; align-items: stretch; margin-top: 20px; border: 1px solid var(--line); background: #090d10; }
.copy-line code { flex: 1; min-width: 0; padding: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 12px var(--mono); color: #d8e0de; }
.copy-button { border: 0; border-left: 1px solid var(--line); padding: 0 16px; background: transparent; color: var(--cyan); font-size: 12px; cursor: pointer; }
.connection-notes { display: grid; gap: 11px; margin-top: 24px; color: #aeb8b6; font-size: 12px; }
.check { display: inline-block; width: 8px; height: 5px; margin-right: 8px; border-left: 1px solid var(--cyan); border-bottom: 1px solid var(--cyan); transform: rotate(-45deg) translateY(-2px); }
.code-card { min-width: 0; background: #080c0f; }
.code-toolbar { min-height: 64px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.code-tabs { margin: 0; }
.text-button { border: 0; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.text-button:hover { color: var(--cyan); }
.code-card pre { min-height: 270px; margin: 0; padding: 28px; overflow: auto; color: #bfcbc8; font: 12px/1.85 var(--mono); white-space: pre-wrap; }

.refresh-button { border: 1px solid var(--line); padding: 10px 13px; background: rgba(255,255,255,.025); color: #cbd3d1; cursor: pointer; font-size: 12px; }
.refresh-button:hover { border-color: var(--cyan); color: var(--cyan); }
.playground-grid { display: grid; grid-template-columns: .9fr 1.1fr; min-height: 520px; border: 1px solid var(--line); background: var(--panel); }
.prompt-panel { padding: 28px; border-right: 1px solid var(--line); }
.form-row { display: grid; grid-template-columns: 1fr 118px; gap: 14px; }
.prompt-panel label > span { display: block; margin-bottom: 8px; color: var(--muted); font: 11px var(--mono); letter-spacing: .06em; }
select, input[type="number"], .token-dialog input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 0; outline: 0; background: #0a0e11; color: var(--text); padding: 0 12px; }
select:focus, input:focus, textarea:focus { border-color: rgba(104,245,210,.65); }
.prompt-field { position: relative; display: block; margin-top: 24px; }
textarea { width: 100%; resize: vertical; min-height: 240px; padding: 15px; border: 1px solid var(--line); border-radius: 0; outline: 0; background: #0a0e11; color: var(--text); line-height: 1.7; }
.prompt-field small { position: absolute; right: 11px; bottom: 10px; color: var(--muted); font-size: 10px; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.form-footer > span { color: var(--muted); font-size: 11px; }
.send-button { min-width: 150px; }
.send-button:disabled { opacity: .5; cursor: wait; }
.response-panel { min-width: 0; display: flex; flex-direction: column; background: #090d10; }
.response-toolbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--line); color: var(--muted); font: 10px var(--mono); letter-spacing: .08em; }
.response-toolbar i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 7px; background: #6e7776; }
.response-toolbar i.active { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.response-toolbar > div { display: flex; gap: 12px; align-items: center; }
.response-content { flex: 1; min-height: 420px; padding: 28px; overflow: auto; white-space: pre-wrap; color: #d9e1df; font: 13px/1.85 var(--mono); }
.response-placeholder { height: 100%; min-height: 350px; display: grid; place-content: center; text-align: center; color: #606b69; }
.response-placeholder span { font-size: 35px; color: rgba(104,245,210,.38); }

footer { min-height: 110px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: #697371; font: 10px var(--mono); letter-spacing: .08em; }

dialog { width: min(520px, calc(100% - 32px)); padding: 0; border: 1px solid rgba(255,255,255,.16); background: #10161a; color: var(--text); box-shadow: 0 40px 100px #000; }
dialog::backdrop { background: rgba(0,0,0,.74); backdrop-filter: blur(8px); }
.token-dialog { padding: 30px; }
.dialog-top { display: flex; justify-content: space-between; gap: 24px; }
.dialog-top h2 { margin: 7px 0 0; font-size: 28px; }
.close-button { border: 0; background: transparent; color: var(--muted); font-size: 28px; cursor: pointer; }
.token-dialog > p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.token-dialog > label { display: block; margin-top: 24px; }
.token-dialog label span { display: block; margin-bottom: 8px; font: 11px var(--mono); color: var(--muted); }
.dialog-actions { display: flex; justify-content: space-between; margin-top: 24px; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 50; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 16px; border: 1px solid var(--line); background: #17201f; color: #dce6e3; font-size: 12px; transition: .2s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar nav { display: none; }
  .hero { grid-template-columns: 1fr; gap: 44px; }
  .hero-copy > p { max-width: none; }
  .model-grid, .connect-layout, .playground-grid { grid-template-columns: 1fr; }
  .endpoint-card, .prompt-panel { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 28px, 1180px); }
  .topbar { height: 68px; padding-inline: 14px; }
  .brand small { display: none; }
  .token-trigger { padding: 8px 10px; }
  .hero { min-height: auto; padding-block: 70px 58px; }
  .hero h1 { font-size: 48px; }
  .section { padding-block: 74px; }
  .split-heading { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .model-card { padding: 23px; }
  .model-card h3 { font-size: 24px; }
  .model-meta { gap: 10px; }
  .connect-layout, .playground-grid { border-left: 0; border-right: 0; }
  .form-row { grid-template-columns: 1fr; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .send-button { width: 100%; }
  .response-content { min-height: 360px; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 8px; }
}

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