/* The shared site stylesheet owns layout. This layer gives the public surfaces
   a more deliberate type, data, and interaction hierarchy. */
:root {
  --bg: #fdfefe;
  --surface: #f3f6f9;
  --ink: #172332;
  --muted: #526174;
  --line: #d5dfe8;
  --accent: #245b98;
  --accent-hover: #164779;
  --code: #111e2c;
  --code-ink: #eff5fb;
  --focus: #166fc4;
  --shadow: 0 12px 34px rgba(18, 38, 60, .075);
  --raised: #fff;
  --code-bar: #eaf0f5;
}

[data-theme="dark"] {
  --bg: #111a24;
  --surface: #1a2936;
  --ink: #edf4f8;
  --muted: #afc0ce;
  --line: #405364;
  --accent: #91bdff;
  --accent-hover: #b5d3ff;
  --code: #0b141e;
  --code-ink: #f0f6fc;
  --focus: #afd3ff;
  --shadow: 0 12px 34px rgba(0, 0, 0, .2);
  --raised: #203141;
  --code-bar: #1b2b3a;
}

body {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  letter-spacing: -.005em;
  transition: background-color .18s ease, color .18s ease;
}

h1, h2, h3 { text-wrap: balance; }
h1 { font-weight: 710; line-height: 1.06; letter-spacing: -.055em; }
h2 { font-weight: 680; line-height: 1.12; letter-spacing: -.045em; }
h3 { font-weight: 660; letter-spacing: -.025em; }
.page-intro h1 { font-size: clamp(3rem, 5.1vw, 4.8rem); }
.page-intro > p:not(.eyebrow) { max-width: 710px; line-height: 1.58; }
.section { padding-block: clamp(4rem, 6vw, 6rem); }
.page-intro { padding-block: clamp(3.75rem, 6vw, 5.75rem) clamp(3.5rem, 5vw, 5rem); }
.section .eyebrow {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .84rem;
  font-weight: 720;
  letter-spacing: .015em;
  text-transform: none;
}
.section-heading { margin-bottom: 2.35rem; }

/* Brand, navigation, and controls. */
.site-header, .site-footer, .closing, .endpoint-panel, .note-panel, .featured-note,
.contact-form, .doc-links a, .code-tabs-bar, .code-tabs, .fact-grid,
.model-row, .button, .copy-button, .theme-toggle {
  transition: background-color .17s ease, border-color .17s ease, color .17s ease, box-shadow .17s ease;
}
.site-header { background: var(--bg); }
.header-inner { min-height: 76px; }
.brand { font-weight: 760; letter-spacing: -.052em; }
[data-theme="dark"] .brand img { filter: brightness(0) invert(1); opacity: .94; }
.desktop-nav a { position: relative; padding-block: .3rem; }
.desktop-nav a::after {
  content: "";
  position: absolute;
  height: 2px;
  left: 0;
  right: 100%;
  bottom: -.2rem;
  background: var(--accent);
  transition: right .17s ease;
}
.desktop-nav a:hover, .desktop-nav a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.desktop-nav a:hover::after, .desktop-nav a[aria-current="page"]::after { right: 0; }
.button { font-weight: 680; letter-spacing: -.01em; box-shadow: 0 2px 0 rgba(0, 0, 0, .045); }
.button:hover { box-shadow: 0 7px 17px rgba(27, 78, 131, .14); }
.button:active { transform: translateY(1px); box-shadow: none; }
.button-outline { box-shadow: none; }
.button-outline:hover { box-shadow: 0 5px 15px rgba(27, 78, 131, .1); }
.text-link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: .22em; transition: color .17s ease, text-decoration-color .17s ease; }
.text-link:hover { text-decoration-color: currentColor; }
.theme-toggle { border: 1px solid var(--line); border-radius: 5px; padding: .4rem .65rem; }
.theme-toggle:hover { color: var(--ink); background: var(--raised); }

/* A compact, published product example makes the first view specific. */
.hero { padding-block: clamp(4.5rem, 7vw, 6.3rem) clamp(3.75rem, 5vw, 4.8rem); }
.hero-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, .8fr); gap: clamp(2.75rem, 5vw, 5.5rem); align-items: end; }
.hero h1 { font-size: clamp(3.6rem, 5.8vw, 5.6rem); max-width: 800px; margin-bottom: 1.5rem; }
.hero-copy { max-width: 650px; line-height: 1.5; }
.hero .actions { margin-top: 2.2rem; }
.hero-proof { border-top: 2px solid var(--accent); border-bottom: 1px solid var(--line); padding: 1.2rem 0 0; min-width: 0; }
.proof-kicker { margin-bottom: 1.45rem; color: var(--accent); font: 700 .72rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; letter-spacing: .075em; }
.proof-route { border-bottom: 1px solid var(--line); padding-bottom: 1.15rem; }
.proof-route span, .proof-values span { display: block; color: var(--muted); font-size: .75rem; line-height: 1.4; margin-bottom: .42rem; }
.proof-route code { display: block; color: var(--ink); font-size: 1.04rem; font-weight: 650; }
.proof-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; padding-block: 1.25rem; }
.proof-values strong { font-size: 1.22rem; letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.proof-endpoint { border-top: 1px solid var(--line); margin: 0; padding-block: .9rem; display: flex; gap: .75rem; align-items: center; color: var(--ink); }
.proof-endpoint span { color: var(--accent); font: 700 .7rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.proof-endpoint code { font-size: .79rem; }

/* Numerical hierarchy is shared by the homepage, catalog, and pricing. */
.model-table { border-top-color: var(--ink); }
.model-table .model-row { gap: 1.3rem; padding-block: 1.48rem; }
.model-table .model-head { padding-block: .85rem; }
.model-head span:nth-child(2), .model-head span:nth-child(3), .model-head span:nth-child(4) { text-align: right; }
.model-cell.model-price, .model-cell.model-context { text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.model-price strong { font-size: 1.16rem; font-weight: 720; letter-spacing: -.035em; white-space: nowrap; }
.model-context strong { font-size: 1.08rem; font-weight: 660; letter-spacing: -.025em; white-space: nowrap; }
.model-name a { font-size: 1.13rem; font-weight: 720; letter-spacing: -.025em; }
.model-name span { max-width: 470px; }
.model-name code { letter-spacing: 0; }
.model-action a { display: inline-flex; gap: .25rem; border-bottom: 1px solid transparent; padding-bottom: .1rem; }
.model-action a:hover { border-color: currentColor; text-decoration: none; }
.model-row:not(.model-head):hover, .model-row:not(.model-head):focus-within { background: var(--surface); }
.model-row:not(.model-head):hover .model-name a { color: var(--accent); }
.fact-grid strong { font-variant-numeric: tabular-nums lining-nums; font-weight: 720; }
.table-note { max-width: 700px; line-height: 1.55; }

/* Code stays compact while token color and active controls make it easier to scan. */
.code-tabs { border-color: var(--line); background: var(--code); box-shadow: var(--shadow); }
.code-tabs-bar { background: var(--code-bar); gap: .35rem; padding: .48rem; }
.code-tabs-bar button { border: 1px solid transparent; padding: .48rem .88rem; transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
.code-tabs-bar button:hover { color: var(--ink); background: var(--raised); }
.code-tabs-bar button[aria-selected="true"] { background: var(--raised); border-color: var(--line); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .045); }
.code-panel-header { padding: .8rem 1.15rem .45rem; color: #b9cce0; }
.code-panel pre { padding: .2rem 1.15rem 1.45rem; font-size: .86rem; line-height: 1.72; }
.copy-button { border-color: #7891aa; min-width: 50px; }
.copy-button:hover { border-color: #bdd2e8; background: #2b4155; }
.syntax-string { color: #a8e1c7; }
.syntax-keyword { color: #9ec8ff; }
.syntax-command { color: #e9c481; }
.syntax-variable { color: #f2d598; }
.syntax-number { color: #eac99c; }
.syntax-comment { color: #91a7bb; }

/* Docs use one clear first destination instead of three equal cards. */
.doc-links { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 0 2.5rem; }
.doc-links a { min-height: 0; transition: background-color .17s ease, border-color .17s ease, color .17s ease; }
.doc-links .doc-link-primary { grid-row: span 2; min-height: 320px; padding: 2rem; border-top: 3px solid var(--accent); background: var(--surface); }
.doc-links .doc-link-primary strong { font-size: clamp(2rem, 3vw, 2.7rem); letter-spacing: -.045em; }
.doc-links a:not(.doc-link-primary) { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 1.25rem 0; }
.doc-links a:not(.doc-link-primary):last-child { border-bottom: 1px solid var(--line); }
.doc-links a:not(.doc-link-primary) strong { font-size: 1.35rem; }
.doc-links a:not(.doc-link-primary):hover { background: transparent; border-color: var(--accent); }
.doc-links a:hover strong { color: var(--accent); }

/* A real investigation moves before the capabilities and process outline. */
.engineering-evidence { background: var(--surface); }
.evidence-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
.evidence-layout > div > p:not(.eyebrow) { max-width: 560px; }
.evidence-feature { display: flex; flex-direction: column; gap: 1.45rem; min-height: 315px; padding: 2rem; border: 1px solid var(--line); border-radius: 8px; background: var(--code); color: var(--code-ink); box-shadow: var(--shadow); transition: border-color .17s ease, box-shadow .17s ease; }
.evidence-feature:hover { color: var(--code-ink); text-decoration: none; border-color: var(--accent); box-shadow: 0 15px 36px rgba(10, 23, 37, .16); }
.evidence-meta { color: #9ec8ff; font: 650 .75rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.evidence-feature strong { color: var(--code-ink); font-size: clamp(1.45rem, 2.15vw, 2.05rem); line-height: 1.2; letter-spacing: -.035em; }
.evidence-action { margin-top: auto; color: #a9ceff; font-weight: 650; font-size: .86rem; }
.process-list { max-width: 850px; }
.process-list li { padding-block: 1.15rem; }
.process-list span { min-width: 30px; }

/* One research article is presented as a deliberate editorial feature. */
.research-layout { grid-template-columns: minmax(0, 1.7fr) minmax(230px, .62fr); gap: clamp(3rem, 7vw, 8rem); }
.research-feature { border-top: 3px solid var(--accent); padding-top: 1.8rem; }
.research-feature h2 { font-size: clamp(2.25rem, 3.6vw, 3.55rem); line-height: 1.1; max-width: 790px; }
.research-feature > p:not(.byline) { max-width: 670px; font-size: 1.08rem; }
.research-feature > p.research-topics { margin: 1.7rem 0; color: var(--ink); font: 650 .75rem/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; }
.research-topics span { color: var(--accent); margin-inline: .3rem; }
.research-feature .byline { border-top: 1px solid var(--line); padding-top: 1.15rem; }
.research-aside { margin-top: .1rem; }

/* Footer and narrow research affordances. */
.site-footer { padding-top: 3.4rem; }
.footer-grid { gap: 3rem; }
.footer-grid h2 { color: var(--ink); }
.footer-grid a:not(.brand) { width: fit-content; text-underline-offset: .2em; }
.footer-grid a:not(.brand):hover { color: var(--accent); text-decoration: underline; }
.footer-bottom { margin-top: 2.6rem; }
.article-body .table-scroll-hint { display: none; }

@media (max-width: 900px) {
  .header-actions { margin-left: auto; }
  .menu-toggle { width: 44px; height: 44px; padding: 10px; border-radius: 7px; transition: background-color .16s ease, border-color .16s ease; }
  .menu-toggle:hover { background: var(--surface); border-color: var(--accent); }
  .menu-toggle span { transition: transform .18s ease, opacity .13s ease; }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-6px) rotate(-45deg); }
  .js .mobile-panel:not(.is-open) { display: flex; max-height: 0; padding-bottom: 0; opacity: 0; transform: translateY(-7px); visibility: hidden; pointer-events: none; overflow: hidden; transition: max-height .2s ease, opacity .16s ease, transform .2s ease, padding-bottom .2s ease, visibility 0s linear .2s; }
  .js .mobile-panel.is-open { max-height: 480px; padding-bottom: 1rem; opacity: 1; transform: none; visibility: visible; overflow: hidden; transition: max-height .2s ease, opacity .16s ease, transform .2s ease, padding-bottom .2s ease, visibility 0s; }
  .mobile-panel > a:not(.button):hover { color: var(--accent); text-decoration: none; }
  .doc-links { gap: 0 1.5rem; }
}

@media (max-width: 760px) {
  .hero { padding-block: 4rem 3.7rem; }
  .hero-layout, .evidence-layout { grid-template-columns: 1fr; gap: 2.7rem; }
  .hero h1 { font-size: clamp(3rem, 8vw, 4.1rem); }
  .hero-copy { font-size: 1.18rem; }
  .hero-proof { max-width: 520px; }
  .model-table .model-row.model-head { display: none !important; }
  .model-table .model-row { gap: .65rem 1rem; padding-block: 1.4rem; }
  .model-cell.model-price, .model-cell.model-context { text-align: left; }
  .model-price strong { font-size: 1.08rem; }
  .model-context strong { font-size: 1.04rem; }
  .doc-links { grid-template-columns: 1fr; gap: 0; }
  .doc-links .doc-link-primary { grid-row: auto; min-height: 225px; margin-bottom: 1.5rem; }
  .research-layout { grid-template-columns: 1fr; gap: 2.4rem; }
  .research-feature h2 { font-size: clamp(2rem, 6vw, 2.8rem); }
  .evidence-feature { min-height: 255px; }
  .footer-grid { gap: 2.2rem; }
}

@media (max-width: 520px) {
  .header-inner { min-height: 66px; }
  .header-actions { gap: 0; }
  .hero { padding-top: 3.7rem; }
  .hero h1 { font-size: clamp(2.8rem, 11vw, 3.15rem); }
  .hero-proof { margin-top: .1rem; }
  .proof-values strong { font-size: 1.12rem; }
  .code-tabs-bar button { padding: .46rem .55rem; font-size: .75rem; }
  .code-panel pre { font-size: .78rem; line-height: 1.68; }
  .article-body pre { font-size: .77rem; line-height: 1.65; }
  .article-body .table-scroll-hint { display: block; margin: 1.7rem 0 -.9rem; color: var(--muted); font: 650 .72rem ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
  .js .article-body .table-scroll-hint { display: none; }
  .js .article-body .table-scroll-hint.is-scrollable { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
