/* Deep Inference — shared site styles.
 * Page bodies are generated from design/*.dc.html with inline styles; this file
 * owns everything shared (nav, footer, buttons) and the responsive overrides
 * those inline styles need on small screens. */

:root {
  --bg: #0b0b0b;
  --ink: #f2f2f4;
  --dim: #a1a1aa;
  --faint: #6b6b75;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--nav-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
button { font: inherit; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 4px; }
::selection { background: #fff; color: #0b0b0b; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.di-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px;
  font-family: var(--sans); font-weight: 500; font-size: 14px; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .2s ease;
}
.di-btn--primary { background: var(--ink); color: #0b0b0b; border-color: var(--ink); }
.di-btn--primary:hover { background: #fff; color: #0b0b0b; box-shadow: 0 0 28px rgba(255, 255, 255, .16); }
.di-btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.di-btn--ghost:hover { border-color: rgba(255, 255, 255, .4); color: #fff; }

/* ── Navigation ──────────────────────────────────────────────────────── */
.di-nav { position: sticky; top: 0; z-index: 100; }
/* The blur lives on an inner bar: a filter on the header itself would become
 * the containing block for the fixed-position mobile menu. */
.di-nav__bar {
  background: rgba(11, 11, 11, .8);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.di-nav__inner {
  max-width: 1240px; margin: 0 auto; padding: 0 24px; height: var(--nav-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.di-nav__brand {
  display: inline-flex; align-items: center; gap: 10px; justify-self: start;
  font-weight: 500; font-size: 16px; letter-spacing: -.01em; color: var(--ink); text-decoration: none;
}
.di-nav__brand svg { width: 24px; height: 24px; display: block; }
.di-nav__links { display: flex; align-items: center; gap: 2px; }
.di-nav__links a {
  position: relative; display: inline-flex; align-items: center; height: var(--nav-h);
  padding: 0 12px; font-size: 14px; color: var(--dim); text-decoration: none; transition: color .15s ease;
}
.di-nav__links a:hover { color: #fff; }
.di-nav__links a.is-active { color: #fff; }
.di-nav__links a.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 1px; background: #fff;
}
.di-nav__actions { display: flex; align-items: center; gap: 8px; justify-self: end; }

.di-nav__toggle {
  display: none; position: relative; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: #fff; cursor: pointer;
}
.di-nav__toggle:hover { background: rgba(255, 255, 255, .06); }
.di-nav__toggle span {
  position: absolute; left: 11px; right: 11px; height: 1.5px; background: currentColor; border-radius: 1px;
  transition: transform .22s ease, top .22s ease;
}
.di-nav__toggle span:nth-child(1) { top: 15px; }
.di-nav__toggle span:nth-child(2) { top: 24px; }
.di-nav.is-open .di-nav__toggle span:nth-child(1) { top: 19.5px; transform: rotate(45deg); }
.di-nav.is-open .di-nav__toggle span:nth-child(2) { top: 19.5px; transform: rotate(-45deg); }
.di-nav__menu { display: none; }

@media (max-width: 1100px) {
  .di-nav__actions .di-btn--ghost { display: none; }
}
@media (max-width: 900px) {
  .di-nav__inner { grid-template-columns: 1fr auto; }
  .di-nav__links { display: none; }
  .di-nav__toggle { display: block; }
  .di-nav__menu {
    display: block; position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0;
    background: var(--bg); padding: 8px 24px 32px; overflow: auto; border-top: 1px solid var(--line);
  }
  .di-nav__menu[hidden] { display: none; }
  .di-nav__menu nav { display: flex; flex-direction: column; }
  .di-nav__menu nav a {
    display: flex; align-items: center; justify-content: space-between; padding: 18px 0;
    font-size: 22px; font-weight: 500; letter-spacing: -.02em; color: var(--ink); text-decoration: none;
    border-bottom: 1px solid var(--line);
  }
  .di-nav__menu nav a::after { content: "\2192"; font-size: 16px; color: var(--faint); }
  .di-nav__menu nav a.is-active::after { color: #fff; }
  .di-nav__menu-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
  .di-nav__menu-actions .di-btn { height: 50px; font-size: 15px; border-radius: 12px; }
  .di-nav__menu-foot { margin-top: 28px; font-family: var(--mono); font-size: 13px; color: var(--faint); line-height: 1.7; }
  .di-nav__menu-foot a { color: var(--dim); text-decoration: none; }
  body.di-menu-open { overflow: hidden; }
}
@media (max-width: 420px) {
  .di-nav__inner { padding: 0 16px; }
  .di-nav__actions .di-btn--primary { height: 36px; padding: 0 12px; font-size: 13px; }
  .di-nav__menu { padding-left: 16px; padding-right: 16px; }
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.di-footer { border-top: 1px solid var(--line); padding: 56px 0 28px; color: var(--faint); font-size: 14px; }
.di-footer__inner {
  max-width: 1240px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr; gap: 32px;
}
.di-footer__brand { display: flex; flex-direction: column; gap: 14px; }
.di-footer__logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: 16px; color: var(--ink); text-decoration: none; }
.di-footer__logo svg { width: 22px; height: 22px; display: block; }
.di-footer__brand p { margin: 0; color: var(--dim); font-size: 15px; line-height: 1.6; max-width: 34ch; }
.di-footer h4 { margin: 0 0 10px; font-family: var(--mono); font-weight: 400; font-size: 12.5px; color: var(--faint); }
.di-footer__col a { display: block; color: var(--dim); font-size: 15px; line-height: 2.2; text-decoration: none; transition: color .15s ease; }
.di-footer__col a:hover { color: #fff; }
.di-footer__bar { max-width: 1240px; margin: 48px auto 0; padding: 0 24px; }
.di-footer__bar > div {
  border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 24px;
  display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12.5px; color: var(--faint);
}
@media (max-width: 860px) {
  .di-footer__inner { grid-template-columns: 1fr 1fr; gap: 28px 24px; }
  .di-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .di-footer__inner, .di-footer__bar { padding-left: 20px; padding-right: 20px; }
  .di-footer__inner { grid-template-columns: 1fr; }
}

/* ── Responsive overrides for the generated page bodies ─────────────── */
/* Decorative diagrams that duplicate nearby text: drop them on small screens. */
@media (max-width: 900px) { .di-deco { display: none !important; } }
/* Data charts keep their lines but lose labels that would render at ~5px. */
@media (max-width: 640px) { .di-chart text, .di-chart rect { display: none; } }

@media (max-width: 960px) {
  [style*="grid-template-columns:minmax(0,"],
  [style*="grid-template-columns:1fr 1fr;gap:48px"],
  [style*="grid-template-columns:1fr 1fr;gap:24px"],
  [style*="grid-template-columns:1.2fr .8fr"],
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns:240px minmax(0,1fr)"] { grid-template-columns: minmax(0, 1fr) !important; }
  [style*="position:sticky;top:96px"] { position: static !important; }
  [style*="min-height:min(92vh,900px)"] { min-height: 0 !important; }
  [style*="justify-content:flex-end"] { justify-content: flex-start !important; }
  /* docs sidebar becomes a row of pills */
  nav[aria-label="Docs"] { flex-direction: row !important; flex-wrap: wrap; gap: 8px !important; }
  nav[aria-label="Docs"] > div { display: none !important; }
  nav[aria-label="Docs"] a { border: 1px solid var(--line-2) !important; border-radius: 8px; padding: 8px 12px !important; }
}

@media (max-width: 720px) {
  [style*="grid-template-columns:"]:not([style*="grid-template-columns:28px"]):not([style*="grid-template-columns:1fr 1fr;gap:14px"]):not([style*="grid-template-columns:auto auto minmax(0,1fr)"]) {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  [style*="padding:0 32px"], [style*="padding:80px 32px 96px"], [style*="padding:72px 32px 96px"],
  [style*="padding:64px 32px 96px"], [style*="padding:96px 32px"] { padding-left: 20px !important; padding-right: 20px !important; }
  [style*="padding:80px 32px 96px"], [style*="padding:72px 32px 96px"], [style*="padding:64px 32px 96px"] { padding-top: 44px !important; padding-bottom: 64px !important; }
  [style*="padding:96px 0"] { padding-top: 56px !important; padding-bottom: 56px !important; }
  [style*="padding:36px 40px"] { padding: 24px 20px !important; }
  [style*="padding:28px 32px"], [style*="padding:32px 36px"], [style*="padding:28px 30px"] { padding: 22px 18px !important; }
  [style*="padding:clamp(36px,5vw,64px)"], [style*="padding:clamp(32px,4vw,56px)"], [style*="padding:clamp(28px,4vw,48px)"] { padding: 28px 22px !important; }
  [style*="width:260px"] { width: 100% !important; }
  [style*="font-size:clamp(64px,8vw,128px)"] { font-size: clamp(48px, 14vw, 72px) !important; }
  [style*="font-size:clamp(64px,7.5vw,112px)"] { font-size: 56px !important; }
  [style*="font-size:clamp(48px,5vw,72px)"] { font-size: 44px !important; }
  [style*="min-height:min(92vh,900px)"] { padding-top: 40px !important; padding-bottom: 40px !important; }
  [style*="margin-bottom:48px;max-width:900px"] { margin-bottom: 32px !important; }
  pre[style] { padding: 18px 16px !important; font-size: 12.5px !important; }
  table[style*="min-width:680px"] { min-width: 560px !important; font-size: 14px !important; }
  table[style*="min-width"] th, table[style*="min-width"] td { padding: 14px 16px !important; }
  table[style*="min-width"] td[style*="font-size:20px"] { font-size: 16px !important; }
  [style*="display:flex;gap:32px;flex-wrap:wrap;padding:20px 0"] { gap: 16px 24px !important; }
  /* research: stack the notify input and button */
  [style="display:flex;gap:8px;"] { flex-direction: column; }
  [style="display:flex;gap:8px;"] > input { width: 100%; }
  /* bullet lists: keep the dot on the first line when an item wraps */
  li[style*="align-items:center;gap:12px"] { align-items: flex-start !important; line-height: 1.7 !important; padding: 4px 0; }
  li[style*="align-items:center;gap:12px"] > span { margin-top: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  [data-rv] { opacity: 1 !important; }
  html { scroll-behavior: auto !important; }
}

@media (max-width: 420px) {
  /* model cards: stat numerals in the three-up row */
  [style*="grid-template-columns:auto auto minmax(0,1fr)"] { grid-template-columns: auto auto !important; gap: 10px 22px !important; }
  [style*="grid-template-columns:auto auto minmax(0,1fr)"] > div:last-child { grid-column: 1 / -1; text-align: left !important; }
  [style*="grid-template-columns:auto auto minmax(0,1fr)"] > div:last-child > div:first-child { padding-top: 0 !important; white-space: normal !important; }
  [style*="grid-template-columns:auto auto minmax(0,1fr)"] [style*="font-size:20px;font-weight:500;color:#ffffff"] { font-size: 17px !important; }
}

/* ── Announcement banner above the nav ─────────────────────────────── */
.di-banner { background: #f2f2f4; color: #0b0b0b; text-align: center; font-family: var(--mono); font-size: 12.5px; line-height: 1.4; padding: 9px 20px; }
.di-banner a { color: #0b0b0b; text-decoration: none; }
.di-banner a:hover { text-decoration: underline; }

/* ── Long-form pages (legal, about) ───────────────────────────────── */
.di-prose { color: #b5b5bd; font-size: 16.5px; line-height: 1.65; max-width: 72ch; }
.di-prose h2 { margin: 40px 0 12px; font-size: 24px; font-weight: 500; letter-spacing: -0.02em; color: #f2f2f4; }
.di-prose h3 { margin: 28px 0 8px; font-size: 18px; font-weight: 500; color: #f2f2f4; }
.di-prose p { margin: 0 0 14px; }
.di-prose ul, .di-prose ol { margin: 0 0 14px; padding-left: 22px; }
.di-prose li { margin: 0 0 6px; }
.di-prose a { color: #f2f2f4; border-bottom: 1px solid rgba(255,255,255,0.3); }
.di-prose table { width: 100%; border-collapse: collapse; margin: 8px 0 18px; font-family: var(--mono); font-size: 13.5px; }
.di-prose th, .di-prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.di-prose th { color: #6b6b75; font-weight: 400; }
.di-prose .di-note { font-family: var(--mono); font-size: 13px; color: #6b6b75; line-height: 1.7; }
@media (max-width: 1100px) { .di-footer__inner { grid-template-columns: 1fr 1fr 1fr; gap: 28px 24px; } .di-footer__brand { grid-column: 1 / -1; } }

/* ── Models playground: markup generated by the page script into data-html regions ── */
.di-play__log { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.di-play__empty { margin: auto 0; color: var(--dim); font-size: 15px; line-height: 1.55; max-width: 54ch; }
.di-play__empty p { margin: 0 0 10px; }
.di-play__fine { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.di-play__u { align-self: flex-end; max-width: 85%; background: #f2f2f4; color: #0b0b0b; padding: 10px 14px; border-radius: 14px 14px 4px 14px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.di-play__a { align-self: flex-start; max-width: 100%; min-width: 0; color: #d4d4d8; font-size: 15px; line-height: 1.55; }
.di-play__who { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-bottom: 6px; }
.di-play__a p { margin: 0 0 10px; }
.di-play__a p:last-child { margin-bottom: 0; }
.di-play__a ul, .di-play__a ol { margin: 0 0 10px; padding-left: 20px; }
.di-play__a li { margin: 0 0 4px; }
.di-play__a b { color: #fff; font-weight: 500; }
.di-play__a code { font-family: var(--mono); font-size: 13px; background: rgba(255, 255, 255, .07); padding: 1px 5px; border-radius: 5px; }
.di-play__a pre { position: relative; margin: 6px 0 12px; padding: 14px 16px; border-radius: 12px; background: #050505; border: 1px solid var(--line); overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: #b5b5bd; }
.di-play__a pre code { background: none; padding: 0; font-size: inherit; }
.di-play__a pre[data-lang]:not([data-lang=""])::before { content: attr(data-lang); position: absolute; top: 8px; right: 12px; font-size: 10.5px; color: var(--faint); }
.di-play__caret { display: inline-block; width: 7px; height: 15px; margin-left: 3px; vertical-align: -2px; background: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, .8); animation: di-caret 1s steps(2) infinite; }
@keyframes di-caret { 50% { opacity: 0; } }
.di-play__meta { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(255, 255, 255, .1); }

.di-hero { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.di-big { min-width: 0; }
.di-big__v { display: flex; align-items: baseline; gap: 6px; font-family: var(--mono); font-size: 34px; line-height: 1; letter-spacing: -.03em; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; transition: color .3s ease; }
.di-big__v span { font-size: 12px; color: var(--faint); letter-spacing: 0; }
.di-big__k { margin-top: 7px; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.di-hero[data-tag="reference"] .di-big__v { color: var(--dim); }
.di-hero[data-tag="streaming"] .di-big__v { text-shadow: 0 0 20px rgba(255, 255, 255, .4); }
.di-hero__line { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-family: var(--mono); font-size: 11.5px; color: var(--faint); min-width: 0; }
.di-hero__line span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.di-hero__dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #3f3f46; }
.di-hero[data-tag="streaming"] + .di-hero__line .di-hero__dot { background: #fff; box-shadow: 0 0 10px #fff; animation: di-breathe 1s ease-in-out infinite; }
.di-hero[data-tag="last run"] + .di-hero__line .di-hero__dot { background: #fff; }

.di-spark { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.di-spark__h { display: flex; justify-content: space-between; margin-bottom: 8px; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.di-spark svg { display: block; width: 100%; height: auto; overflow: visible; }
.di-spark text { font-family: var(--mono); font-size: 9px; fill: var(--faint); }
.di-spark__grid { stroke: rgba(255, 255, 255, .05); stroke-width: 1; }
.di-spark__axis { stroke: rgba(255, 255, 255, .14); stroke-width: 1; }
.di-spark__base { stroke: rgba(255, 255, 255, .32); stroke-width: 1; stroke-dasharray: 5 4; }
.di-spark__ind { stroke: rgba(255, 255, 255, .45); stroke-width: 1; stroke-dasharray: 1.5 3; }
.di-spark__area { fill: rgba(255, 255, 255, .09); }
.di-spark__ours { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .55)); }
.di-spark__ours--ref { stroke-width: 1.6; filter: none; }
.di-spark__head { fill: #fff; filter: drop-shadow(0 0 6px #fff); }
.di-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.di-legend span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.di-legend i { display: inline-block; width: 16px; border-top: 2px solid #fff; }
.di-legend__ind { border-top-style: dotted !important; border-top-color: rgba(255, 255, 255, .6) !important; }
.di-legend__base { border-top-style: dashed !important; border-top-color: rgba(255, 255, 255, .4) !important; }

.di-cmp { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-family: var(--mono); }
.di-cmp__row { display: grid; grid-template-columns: minmax(0, 1.1fr) repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.di-cmp__row:last-child { border-bottom: 0; padding-bottom: 0; }
.di-cmp__head { padding: 0 0 8px; font-size: 10.5px; color: var(--faint); border-bottom: 1px solid var(--line); }
.di-cmp__head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.di-cmp__head .is-ours { color: #fff; }
.di-cmp__label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--dim); min-width: 0; }
.di-cmp__label em { font-style: normal; font-size: 10px; color: var(--faint); }
.di-cmp__cell { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.di-cmp__cell b { font-weight: 500; font-size: 14px; color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.di-cmp__cell i { display: block; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .22); transform-origin: left; animation: di-bar-grow .8s cubic-bezier(.2, .7, .2, 1) both; }
.di-cmp__cell small { font-size: 10px; color: var(--faint); white-space: nowrap; }
.di-cmp__cell.is-ours b { color: #fff; }
.di-cmp__cell.is-ours i { background: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, .55); }
.di-cmp__cell.is-ours small { color: #d4d4d8; }
@keyframes di-bar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (max-width: 480px) {
  .di-cmp__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .di-cmp__label { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; }
  .di-cmp__head span:first-child { display: none; }
  .di-big__v { font-size: 28px; }
}
