/* IBM Plex is the fallback on systems without Apple's system font. */
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/assets/fonts/plex-sans-regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/assets/fonts/plex-sans-semibold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/fonts/plex-mono-regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* Black, white and grays. Blue marks links and actions. */
:root {
  color-scheme: dark;
  --background: #000000;
  --foreground: #f5f5f7;
  --tile: #161617;
  --tile-hover: #1c1c1e;
  --raised: #262628;
  --black: #000000;
  --white: #ffffff;
  --secondary: #a1a1a6;
  --muted: #86868b;
  --link: #2997ff;
  --action: #0071e3;
  --action-hover: #0066cc;
  --rule: rgb(255 255 255 / 0.14);
  --hairline: rgb(255 255 255 / 0.08);
  --control: #6e6e73;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);

  --sans: -apple-system, BlinkMacSystemFont, 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, 'IBM Plex Mono', monospace;
  --width: 1200px;
  --gutter: 32px;
  --header: 52px;
  --radius: 12px;
  --radius-tile: 28px;
  --pill: 980px;
}

/* Base */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 16px); }

body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font: 400 1.0625rem/1.47059 var(--sans);
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-weight: 600;
  line-height: 1.1;
  text-wrap: balance;
}

h1 { font-size: clamp(3rem, 2rem + 3.2vw, 5rem); line-height: 1.05; letter-spacing: -0.015em; }
h2 { font-size: 2rem; line-height: 1.125; letter-spacing: 0.004em; }
h3 { font-size: 1.3125rem; line-height: 1.19; letter-spacing: 0.011em; }

p { margin: 0 0 1em; text-wrap: pretty; }

a { color: var(--link); text-decoration: none; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration: underline; }

code, pre { font-family: var(--mono); letter-spacing: 0; }
code { font-size: 0.9em; }

img { max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }

:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
main { flex: 1; min-width: 0; }
main:focus { outline: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 8px 16px;
  border-radius: var(--pill);
  background: var(--action);
  color: var(--white);
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

.container { width: min(var(--width), 100% - 2 * var(--gutter)); margin-inline: auto; }

.meta, .note { color: var(--muted); font-size: 0.9375rem; letter-spacing: -0.016em; }
.note { margin-top: 1rem; }
.measure { max-width: 42em; }
.nowrap { white-space: nowrap; }

/* Standalone links read as "Label ›" and underline on hover. */
.link-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }

.link-row a::after, .resource-list a::after {
  content: '\00a0›';
  content: '\00a0›' / '';
}

/* Header: the wordmark returns home; the links cover the main sections. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--tile);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--header);
}

/* MedMLX and the AI-IR lab mark, separated by a thin vertical line. */
.brand, .lab-mark { display: flex; }
.lab-mark { margin-right: auto; }
.brand img, .lab-mark img { display: block; width: auto; height: 20px; }
.brand-rule { flex: none; width: 1px; height: 20px; margin-inline: -12px; background: rgb(255 255 255 / 0.32); }

#site-nav { display: flex; align-items: center; gap: 28px; }

#site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding-block: 8px;
  color: rgb(245 245 247 / 0.8);
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color 200ms var(--ease);
}

#site-nav a:hover, #site-nav a[aria-current] { color: var(--white); }
#site-nav a[aria-current] { text-decoration: underline; text-underline-offset: 6px; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 16px;
  border-radius: var(--pill);
  background: var(--action);
  color: var(--white);
  font-size: 0.8125rem;
  line-height: 1.33;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background-color 200ms var(--ease);
}

.nav-cta:hover { background: var(--action-hover); text-decoration: none; }
/* Phones reach Get started from the menu sheet instead of the header pill. */
#site-nav .nav-sheet-link { display: none; }

.menu-toggle { display: none; }
.menu-icon-close, .menu-toggle[aria-expanded='true'] .menu-icon-lines { display: none; }
.menu-toggle[aria-expanded='true'] .menu-icon-close { display: block; }

/* Static pages without the menu script show their few links directly. */
.simple-nav { display: flex; gap: 24px; }
.simple-nav a { color: rgb(245 245 247 / 0.8); font-size: 0.75rem; letter-spacing: -0.01em; }
.simple-nav a:hover { color: var(--white); text-decoration: none; }

/* Buttons */

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; margin-top: 32px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid var(--action);
  border-radius: var(--pill);
  background: var(--action);
  color: var(--white);
  font-size: 1.0625rem;
  text-decoration: none;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease), color 200ms var(--ease), transform 200ms var(--ease);
}

.button:hover { border-color: var(--action-hover); background: var(--action-hover); text-decoration: none; }
.button.secondary { border-color: var(--link); background: transparent; color: var(--link); }
.button.secondary:hover { border-color: var(--action); background: var(--action); color: var(--white); }
.button:active { transform: scale(0.98); }

/* Home */

.hero {
  position: relative;
  padding-block: clamp(48px, 7svh, 80px) 24px;
  background: var(--black);
}

/* The film's 1600 × 1000 frame has 640px of empty space on the left.
   Fit the remaining 960 × 1000 composition in its own grid column. */
.hero-media {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: min(100%, calc((100svh - 240px) * 0.96));
  aspect-ratio: 24 / 25;
  overflow: hidden;
  background: var(--black) url('/assets/hero/poster.webp') right center / calc(100% * 5 / 3) 100% no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%);
  mask-image: linear-gradient(90deg, transparent, #000 18%);
}

.hero-video { position: absolute; inset: 0 0 0 auto; display: block; width: calc(100% * 5 / 3); max-width: none; height: 100%; object-fit: contain; object-position: right center; opacity: 0; transition: opacity 1200ms var(--ease); }
.film-playing .hero-video { opacity: 1; }
.hero-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 3vw, 48px); }
.hero-inner { min-width: 0; }
.hero h1 { margin-bottom: 24px; font-size: clamp(2rem, 5.3vw, 4.25rem); line-height: 1.04; letter-spacing: -0.025em; text-wrap: initial; }
.hero-lead { max-width: 22em; margin-bottom: 0; color: var(--secondary); font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.5rem); line-height: 1.33; letter-spacing: 0.009em; }
.hero .actions { gap: 12px 24px; margin-top: 28px; }
.hero-article { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 1rem; white-space: nowrap; }
.hero-guide { display: inline-flex; align-items: center; gap: 0.25em; min-height: 44px; font-size: 1.0625rem; }
.hero .install-all { max-width: 560px; margin-top: 36px; }
.hero .install-all .meta { max-width: 36em; font-size: 0.8125rem; line-height: 1.5; }

.hero .command-line { background: var(--tile); }

.hero .command-line code { font-size: 0.8125rem; }
.hero-film-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 24px; }
.hero-film-bar p { margin: 0; color: var(--muted); font-size: 0.75rem; letter-spacing: -0.01em; }
.film-controls { display: inline-flex; align-items: center; flex-shrink: 0; gap: 2px; margin-left: auto; padding: 4px; border-radius: var(--pill); background: var(--tile); }
.film-controls[hidden] { display: none; }

.film-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--pill);
  background: transparent;
  color: var(--secondary);
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 200ms var(--ease), color 200ms var(--ease);
}

.film-toggle[hidden] { display: none; }
.film-toggle[data-film-toggle] { background: var(--raised); color: var(--foreground); }
.film-toggle:hover { background: var(--raised); color: var(--white); }
.film-toggle:focus-visible { outline-offset: 0; }
.film-toggle:disabled { opacity: 0.45; cursor: default; }

.section { padding-block: 120px; }
.section + .section { padding-top: 0; }

.section-title { max-width: 18em; margin-bottom: 12px; font-size: clamp(2.5rem, 1.75rem + 2.4vw, 3.5rem); line-height: 1.07; letter-spacing: -0.005em; }

/* A centered statement with key phrases in white. */
.statement-section { padding-block: 140px 120px; text-align: center; }

.statement {
  max-width: 24em;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1.75rem, 1.2rem + 1.7vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.002em;
}

.statement strong { color: var(--foreground); font-weight: inherit; }

.tile { padding: 56px; border-radius: var(--radius-tile); background: var(--tile); }
.tile :is(p, dl):last-child { margin-bottom: 0; }
.tile p { max-width: 42em; }
.tile-center { text-align: center; }
.tile-center p { margin-inline: auto; }
.tile-center .link-row { justify-content: center; }

.explore-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: last baseline; gap: 16px 32px; margin-bottom: 48px; }
.explore-heading .section-title, .explore-heading .link-row { margin-bottom: 0; }
.explore-heading .link-row { font-size: 1.0625rem; }

/* Tiles with a stretched title link; images drop their black on the tile. */
.featured-models { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }

.featured-models li {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding-bottom: 32px;
  border-radius: var(--radius-tile);
  background: var(--tile);
  transition: background-color 300ms var(--ease);
}

.featured-image { display: block; height: 260px; overflow: hidden; }
.featured-image img { display: block; width: 100%; height: 100%; padding: 28px 24px 12px; object-fit: contain; mix-blend-mode: lighten; transition: transform 700ms var(--ease); }
.featured-models h3 { margin: 12px 28px 8px; font-size: 1.3125rem; }
.featured-models h3 a { color: var(--foreground); text-decoration: none; }
.featured-models h3 a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.featured-models h3 a:focus-visible { outline: none; }
.featured-models li:has(a:focus-visible) { outline: 2px solid var(--link); outline-offset: 3px; }
.featured-models p { margin: 0 28px; color: var(--muted); font-size: 0.9375rem; letter-spacing: -0.016em; }

@media (hover: hover) {
  .featured-models li:hover { background: var(--tile-hover); }
  .featured-models li:hover img { transform: scale(1.04); }
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-card {
  isolation: isolate;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 32px;
  border-radius: var(--radius-tile);
  background: var(--tile);
  color: var(--foreground);
  text-decoration: none;
  transition: background-color 300ms var(--ease);
}

.task-card:hover { text-decoration: none; }
.task-item:hover .task-card { background: var(--tile-hover); }
.task-image { display: block; width: 100%; height: 220px; margin-bottom: 28px; object-fit: contain; mix-blend-mode: lighten; }
/* The title leads the link's name; the count shows above it. */
.task-card > h3 { order: 2; }
.task-card > p { order: 3; }
.task-link { order: 4; }
.task-count { order: 1; color: var(--muted); font-size: 0.8125rem; letter-spacing: -0.01em; }
.task-card h3 { margin: 6px 0 10px; font-size: 1.75rem; line-height: 1.14; letter-spacing: 0.007em; }
.task-card p { margin-bottom: 24px; color: var(--muted); font-size: 0.9375rem; letter-spacing: -0.016em; }
.task-link { margin-top: auto; color: var(--link); font-size: 1.0625rem; }
.task-item:hover .task-link { text-decoration: underline; }

/* Looping cards get a small pause button over the media, outside the card link. */
.task-item { position: relative; }

.media-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgb(66 66 69 / 0.72);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: var(--foreground);
  cursor: pointer;
  transition: background-color 200ms var(--ease);
}

.media-toggle[hidden] { display: none; }
.media-toggle:hover { background: rgb(88 88 92 / 0.8); }

/* The scan and text are excerpts of the same saved model run. */
/* The scan sits top left and the report card overlaps only its lower right corner. */
/* Specification lists */

.specs { margin: 24px 0; border-top: 1px solid var(--rule); font-size: 0.9375rem; letter-spacing: -0.016em; }

.specs > div {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 16px;
  padding-block: 12px;
  border-bottom: 1px solid var(--rule);
}

.specs dt { color: var(--muted); }
.specs dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.specs.files > div { grid-template-columns: 12rem minmax(0, 1fr); }
.specs.files dt { color: var(--foreground); }

/* Terminal: a dark macOS-style window. */

.terminal { overflow: hidden; border-radius: 18px; background: var(--tile); box-shadow: inset 0 0 0 1px var(--hairline); color: var(--white); }
.terminal :focus-visible { outline-color: var(--link); outline-offset: -2px; }

.terminal-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  min-height: 48px;
  padding: 8px 10px 8px 16px;
  border-bottom: 1px solid var(--hairline);
}

.window-dots { display: inline-flex; flex-shrink: 0; gap: 8px; }
.window-dots i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.window-dots i:nth-child(2) { background: #febc2e; }
.window-dots i:nth-child(3) { background: #28c840; }

.terminal-label { color: var(--muted); font-size: 0.8125rem; letter-spacing: -0.01em; }

.terminal pre {
  margin: 0;
  padding: 20px 24px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 0.875rem/1.7 var(--mono);
}

.terminal code { font-size: inherit; }

/* Quick start steps as a segmented control */
.terminal-tabs { display: flex; flex-wrap: wrap; max-width: 100%; gap: 2px; padding: 2px; border-radius: 9px; background: rgb(118 118 128 / 0.24); }

.terminal-tabs button {
  padding: 4px 14px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--secondary);
  font-size: 0.8125rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 200ms var(--ease), color 200ms var(--ease);
}

.terminal-tabs button:hover { color: var(--white); }
.terminal-tabs button[aria-selected='true'] { background: #636366; box-shadow: 0 3px 8px rgb(0 0 0 / 0.24); color: var(--white); }

.copy-button {
  flex-shrink: 0;
  min-width: 64px;
  min-height: 28px;
  margin-left: auto;
  padding: 4px 12px;
  border: 0;
  border-radius: var(--pill);
  background: rgb(255 255 255 / 0.1);
  color: var(--white);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background-color 200ms var(--ease);
}

.copy-button:hover { background: rgb(255 255 255 / 0.18); }
.copy-button:disabled { opacity: 0.4; cursor: not-allowed; }

/* One-line command with an inline copy button */
.install-all { max-width: 36rem; margin-top: 2rem; }
.install-all .meta { margin: 12px 0 0; font-size: 0.875rem; }

.command-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 18px;
  border-radius: 14px;
  background: var(--tile);
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--white);
}

/* Wrap rather than scroll so narrow screens show the whole command. */
.command-line code {
  flex: 1;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.875rem;
  line-height: 1.7;
}

.command-line code::before { content: '$ '; content: '$ ' / ''; color: var(--muted); }

/* Per-model install, collapsed until requested */
.install-details { grid-column: 1 / -1; margin-top: 14px; }
.install-details summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--pill);
  color: rgb(245 245 247 / 0.8);
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
  list-style: none;
  cursor: pointer;
  transition: border-color 200ms var(--ease), color 200ms var(--ease);
}

.install-details summary::-webkit-details-marker { display: none; }
.install-details summary::after { content: '+'; content: '+' / ''; color: var(--muted); }
.install-details[open] summary::after { content: '−'; content: '−' / ''; }
.install-details summary:hover { border-color: var(--link); color: var(--foreground); }
.install-details .terminal { margin-top: 12px; }

/* Inner pages */

.page-head { padding-block: 120px 64px; }
.page-head h1 { max-width: 16em; margin-bottom: 24px; }
.page-head .lead { max-width: 32em; color: var(--secondary); font-size: clamp(1.3125rem, 1.1rem + 0.6vw, 1.75rem); line-height: 1.29; letter-spacing: 0.007em; }
.page-body { padding-bottom: 140px; }

.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 24px; color: var(--muted); font-size: 0.875rem; }
.breadcrumb a { color: var(--secondary); }

.catalog-controls { display: grid; gap: 20px; }
.catalog-search { max-width: 36rem; }

.field.catalog-search input {
  padding-left: 44px;
  background: var(--tile) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='5.25' fill='none' stroke='%2386868b' stroke-width='1.5'/%3E%3Cpath d='M11 11l3.5 3.5' stroke='%2386868b' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") 16px center / 16px 16px no-repeat;
}

/* Task filter as a row of pills; the radio inputs stay native for keyboards. */
.task-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.task-chip { position: relative; }
.task-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }

.task-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: var(--pill);
  background: var(--tile);
  color: var(--secondary);
  font-size: 0.875rem;
  letter-spacing: -0.016em;
  white-space: nowrap;
  transition: background-color 200ms var(--ease), color 200ms var(--ease);
}

.task-chip:hover span { color: var(--foreground); }
.task-chip input:checked + span { background: var(--foreground); color: var(--black); }
.task-chip input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }

.catalog-status { margin: 20px 0 8px; }
.catalog-empty { padding-block: 24px; }
.catalog-group { padding-top: 48px; }
.catalog-group > h2 { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; font-size: 1.75rem; letter-spacing: 0.007em; }
.catalog-count { color: var(--muted); font-size: 1rem; font-weight: 400; letter-spacing: -0.016em; }
.catalog-list { margin: 0; padding: 0; list-style: none; }
/* The install toggle spans the row so its commands get the full width. */
.catalog-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 40px; padding-block: 24px; border-top: 1px solid var(--rule); }
.catalog-item h3 { margin-bottom: 6px; }
.catalog-item h3 a { color: var(--foreground); }
.catalog-item .catalog-body p { max-width: 40em; margin-bottom: 0; color: var(--muted); }
.catalog-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-top: 4px; font-size: 0.8125rem; }
.catalog-version { color: var(--muted); font-size: 0.8125rem; white-space: nowrap; }
.catalog-links { display: flex; gap: 16px; white-space: nowrap; }
.catalog-group[hidden], .catalog-item[hidden], .catalog-empty[hidden] { display: none; }

.model-request {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 56px;
  margin-top: 80px;
  padding: 48px;
  background: var(--tile);
}
.model-request:focus { outline: none; }
.model-request h2 { font-size: clamp(2rem, 1.5rem + 1vw, 2.5rem); }
.model-request p { max-width: 36em; }
.model-request p:last-child { margin-bottom: 0; }
.model-request .actions { margin-top: 0; gap: 16px 24px; }
.model-request .note { color: var(--secondary); }

/* Community: one request panel, followed by a short directory of destinations. */
.community-link { margin-top: 24px; }
.community-head { padding-bottom: 48px; }
.community-head > p:last-child { margin-bottom: 0; color: var(--secondary); }
.community-head .lead { max-width: 26em; }
.community-request {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 64px;
  padding: 48px;
  background: var(--tile);
}
.community-request:focus { outline: none; }
.community-request h2 { font-size: clamp(2rem, 1.5rem + 1vw, 2.5rem); }
.community-request p { max-width: 34em; }
.community-request p:last-child { margin-bottom: 0; }
.community-request .actions { margin-top: 0; gap: 16px 24px; }
.community-request .note { color: var(--secondary); }
.community-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px 64px; padding-top: 64px; }
.community-row h2 { margin: 0; }
.community-row p { max-width: 36em; }
.community-row p:last-child { margin-bottom: 0; }
.community-row .link-row a { display: inline-flex; align-items: center; min-height: 44px; }
.community-packages { margin-top: 12px; }
.community-packages summary { width: fit-content; padding-block: 10px; color: var(--link); cursor: pointer; }
.community-packages summary:hover { text-decoration: underline; }
.community-packages ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 12px 0 0; padding: 0; list-style: none; }
.community-packages a { display: flex; align-items: center; min-height: 44px; padding-block: 8px; overflow-wrap: anywhere; }
.community-note { margin: 64px 0 0; }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; }
.detail-section { padding-block: 48px; border-top: 1px solid var(--rule); }
.detail-section h2 { font-size: 1.75rem; letter-spacing: 0.007em; }
.detail-section h2:not(:first-child) { margin-top: 40px; }
.quickstart-section { max-width: 52rem; }

.resource-list { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0; padding: 0; list-style: none; }

.prose { max-width: 42rem; overflow-wrap: break-word; font-size: 1.1875rem; line-height: 1.58; letter-spacing: 0.011em; }
.prose h2 { margin-top: 56px; font-size: 1.75rem; letter-spacing: 0.007em; }
.prose h2:first-child { margin-top: 0; }

/* About */

.about-grid .detail-section p { max-width: 34em; }

.lab-credit { display: flex; align-items: center; gap: 48px; }
.lab-logo { flex-shrink: 0; }
.lab-logo img { display: block; width: auto; height: 112px; }
.lab-credit > p { max-width: 40em; margin: 0; color: var(--muted); font-size: 0.9375rem; letter-spacing: -0.016em; }

/* MCP guide */

.guide-section { max-width: 46rem; padding-block: 48px; border-top: 1px solid var(--rule); }
.guide-section:first-child { padding-top: 0; border-top: 0; }
.guide-section h2 { font-size: 1.75rem; letter-spacing: 0.007em; }
.guide-section h3 { margin-top: 40px; }
.guide-section .terminal { margin-block: 20px; }
.guide-section .terminal + .terminal { margin-top: 12px; }

.sequence { margin: 0 0 1em; padding: 0; list-style: none; counter-reset: sequence; }
.sequence li { position: relative; padding: 0 0 16px 44px; counter-increment: sequence; }

.sequence li::before {
  content: counter(sequence);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--raised);
  color: var(--foreground);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
}

.sequence li > .terminal { margin: 14px 0 8px; }

/* Client → server → runtimes, under the page title. */
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; max-width: 60rem; margin: 48px 0 0; padding: 0; list-style: none; }
.flow li { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 24px; border-radius: 20px; background: var(--tile); }
.flow li:not(:last-child)::after { content: '→'; content: '→' / ''; position: absolute; top: 50%; right: -30px; color: var(--muted); font-size: 1.25rem; transform: translateY(-50%); }
.flow strong { font-size: 1.1875rem; font-weight: 600; letter-spacing: 0.011em; }
.flow strong code { font-size: 1rem; }
.flow span { color: var(--muted); font-size: 0.9375rem; letter-spacing: -0.016em; }

/* Long guides: content with a sticky "On this page" list beside it. */
.doc-layout { display: grid; grid-template-columns: minmax(0, 46rem) 13rem; justify-content: space-between; gap: 64px; }
.doc-body { min-width: 0; }
.doc-toc { position: sticky; top: calc(var(--header) + 40px); align-self: start; order: 2; }
.doc-toc h2 { margin-bottom: 12px; color: var(--foreground); font-size: 0.8125rem; letter-spacing: -0.01em; }
.doc-toc ul { margin: 0; padding: 0; border-left: 1px solid var(--rule); list-style: none; }
.doc-toc a { display: block; padding: 6px 0 6px 16px; color: var(--secondary); font-size: 0.875rem; letter-spacing: -0.016em; }
.doc-toc a:hover { color: var(--foreground); text-decoration: none; }

.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 24px 0; padding: 0; list-style: none; }
.tool-grid li { display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: 16px; background: var(--tile); }
.tool-name { color: var(--foreground); font-size: 0.9375rem; }
.tool-args { color: var(--muted); font-size: 0.8125rem; letter-spacing: -0.01em; }
.tool-args code { font-size: 0.75rem; }
.tool-grid p { margin: 6px 0 0; color: var(--secondary); font-size: 0.9375rem; letter-spacing: -0.016em; }

/* Get started */

.guide-models { margin: 24px 0; padding: 0; border-top: 1px solid var(--rule); list-style: none; }
.guide-models li { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.guide-models span { color: var(--muted); font-size: 0.9375rem; }
.steps { max-width: 46rem; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps > li { padding-block: 48px; border-top: 1px solid var(--rule); counter-increment: step; }
.steps h2 { font-size: 1.75rem; letter-spacing: 0.007em; }
.steps h2 .optional { font-size: 1rem; }
.steps .terminal + p { margin-top: 1rem; }
.guide-single { max-width: 46rem; margin-top: 24px; }

.field { min-width: 0; margin: 0; padding: 0; border: 0; }

.field > label {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.016em;
}

.optional { color: var(--muted); font-weight: 400; }

.field input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--control);
  border-radius: var(--radius);
  background: var(--tile);
  font: 1.0625rem/1.4 var(--sans);
  letter-spacing: -0.022em;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.field input::placeholder { color: var(--muted); }
.field input:focus-visible {
  border-color: var(--link);
  outline: 2px solid transparent;
  box-shadow: 0 0 0 4px rgb(41 151 255 / 0.35);
}

/* Footer */

.site-footer {
  padding-block: 40px 32px;
  background: var(--tile);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.33;
  letter-spacing: -0.01em;
}

.footer-brand { display: inline-flex; }
.footer-brand img { display: block; width: auto; height: 18px; }

.footer-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 13rem)); gap: 28px 40px; margin-top: 32px; }
.footer-columns h2 { margin-bottom: 12px; color: var(--foreground); font-size: 0.875rem; line-height: 1.33; letter-spacing: -0.01em; }
.footer-columns ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.footer-columns li a { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.875rem; }
.site-footer a { color: var(--secondary); }
.site-footer a:hover { color: var(--foreground); }

.footer-note { margin: 36px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); }

/* Narrow screens */

@media (max-width: 1068px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .doc-toc { position: static; order: 0; }
  .doc-toc ul { display: flex; flex-wrap: wrap; gap: 0 24px; border: 0; }
  .doc-toc a { min-height: 44px; padding: 10px 0; font-size: 0.9375rem; }
  .featured-models { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .hero-lead { font-size: clamp(1rem, 2.1vw, 1.3125rem); }
}

@media (max-width: 860px) {
  :root { --radius-tile: 22px; }

  .detail-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .detail-grid .detail-section + .detail-section { padding-top: 0; border-top: 0; }
  .section { padding-block: 96px; }
  .statement-section { padding-block: 104px 96px; }
  .tile { padding: 40px 28px; }
}

@media (max-width: 720px) {
  :root { --gutter: 20px; --header: 56px; }
  body { font-size: 1rem; line-height: 1.5; }

  .site-header:not(.navigation-ready) { position: static; }
  .header-inner { flex-wrap: wrap; gap: 0 12px; height: auto; min-height: var(--header); }
  .brand-rule { margin-inline: -2px; }
  .nav-cta { display: none; }
  #site-nav .nav-sheet-link { display: block; }

  .navigation-ready .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    height: 44px;
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--foreground);
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
  }

  /* Without JavaScript, every link remains available below the wordmark. */
  #site-nav {
    flex: 0 0 100%;
    order: 3;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 20px;
  }

  .navigation-ready .header-inner { flex-wrap: nowrap; height: var(--header); }
  /* A compact dropdown keeps the current page visible below the navigation. */
  .navigation-ready #site-nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: var(--gutter);
    left: auto;
    width: min(320px, 100% - 2 * var(--gutter));
    max-height: calc(100dvh - var(--header) - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--rule);
    border-radius: 16px;
    background: var(--tile);
    box-shadow: 0 16px 40px rgb(0 0 0 / 0.45);
  }
  .navigation-ready #site-nav.is-open { display: flex; }
  #site-nav a { min-height: 44px; padding: 10px 14px; border-radius: 8px; color: var(--foreground); font-size: 1rem; font-weight: 400; line-height: 1.5; letter-spacing: -0.01em; }
  #site-nav a:hover { background: var(--raised); }
  #site-nav a[aria-current] { background: var(--raised); color: var(--foreground); font-weight: 600; text-decoration: none; }
  #site-nav a[aria-current]::after { content: ''; width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: var(--link); }
  .navigation-ready #site-nav .nav-sheet-link { display: flex; justify-content: center; margin-bottom: 4px; background: var(--action); color: var(--white); font-weight: 500; }
  .navigation-ready #site-nav .nav-sheet-link:hover { background: var(--action-hover); }
  .navigation-ready #site-nav .nav-sheet-link[aria-current]::after { display: none; }

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 24px 16px;
    padding: 36px var(--gutter) 24px;
  }
  .hero-layout, .hero-inner { display: contents; }
  .hero-copy { grid-column: 1; grid-row: 1; align-self: center; }
  .hero h1 { margin-bottom: 18px; font-size: clamp(1.875rem, 7.6vw, 2.75rem); line-height: 1.06; }
  .hero-lead { max-width: none; font-size: 1rem; line-height: 1.45; }
  /* Phones show the main output in the rightmost 560px of the film. */
  .hero-media { grid-column: 2; grid-row: 1; align-self: center; max-width: 168px; aspect-ratio: 14 / 25; background-size: calc(100% * 20 / 7) 100%; }
  .hero-video { width: calc(100% * 20 / 7); }
  .hero .install-all { grid-column: 1 / -1; grid-row: 3; max-width: none; margin: 0; }
  .hero .actions { grid-column: 1 / -1; grid-row: 2; gap: 12px 24px; margin: 0; }
  .hero .actions > .button { min-height: 44px; padding-inline: 16px; font-size: 0.875rem; }
  .hero-article { font-size: 0.875rem; }
  .hero .install-all .meta { font-size: 0.8125rem; }
  .command-line { gap: 12px; padding: 12px; }
  .command-line code, .hero .command-line code { font-size: 0.75rem; line-height: 1.6; }
  .command-line .copy-button { min-width: 44px; min-height: 44px; padding-inline: 8px; font-size: 0.75rem; }
  .hero-film-bar { grid-column: 1 / -1; grid-row: 4; align-items: center; width: 100%; margin: 0; padding: 0; }
  .hero-film-bar p { flex: 1 1 0; min-width: 0; }
  .film-toggle { min-height: 44px; }

  .statement-section { text-align: left; }
  .statement { margin: 0; font-size: 1.375rem; line-height: 1.35; }
  .section-title { font-size: clamp(1.75rem, 7.5vw, 2.25rem); }

  /* Featured models become a swipeable row. */
  .featured-models {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(78%, 300px);
    gap: 16px;
    margin-inline: calc(-1 * var(--gutter));
    padding: 4px var(--gutter);
    overflow-x: auto;
    scroll-padding-inline: var(--gutter);
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .featured-models::-webkit-scrollbar { display: none; }
  .featured-models li { scroll-snap-align: start; }
  .featured-image { height: 160px; }
  .featured-models li { padding-bottom: 24px; }
  .featured-models h3 { margin-inline: 24px; }
  .featured-models p { margin-inline: 24px; line-height: 1.5; }
  .featured-models li:has(a:focus-visible) { outline-offset: -2px; }

  .task-card { padding: 24px; }
  .task-image { height: 160px; margin-bottom: 20px; }
  .section { padding-block: 56px; }
  .statement-section { padding-block: 56px; }
  /* Long API labels wrap inside the panel; every tab remains reachable. */
  .window-dots { display: none; }
  .terminal-tabs { flex: 1 1 100%; }
  .terminal-tabs button { flex: 1 1 auto; min-height: 44px; }
  .terminal-tabs:has(> button:nth-child(4)) button { flex-basis: calc(50% - 1px); }
  .copy-button { min-height: 44px; }
  .media-toggle { width: 44px; height: 44px; top: 12px; right: 12px; }
  .task-chip span { min-height: 44px; }
  .install-details summary { min-height: 44px; }
  .task-card h3 { font-size: 1.5rem; }
  .catalog-item { grid-template-columns: minmax(0, 1fr); }
  .catalog-meta { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding-top: 8px; }
  .catalog-version { white-space: normal; overflow-wrap: anywhere; }
  .catalog-group { padding-top: 40px; }
  .model-request { grid-template-columns: minmax(0, 1fr); margin-top: 48px; padding: 32px 24px; }
  .community-request { grid-template-columns: minmax(0, 1fr); padding: 32px 24px; gap: 24px; }
  .community-row { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 48px; }
  .community-packages ul { grid-template-columns: minmax(0, 1fr); }
  .community-note { margin-top: 48px; }
  .guide-models li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .page-head { padding-block: 64px 40px; }
  .page-body { padding-bottom: 96px; }
  .tile { padding: 32px 24px; }
  .specs > div, .specs.files > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .terminal pre { padding: 16px 20px; font-size: 0.8125rem; }
  .terminal-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding-inline: 10px; }
  .terminal-label { min-width: 0; overflow-wrap: anywhere; }
  .terminal-tabs { min-width: 0; }
  .terminal-tabs button { min-height: 44px; padding-inline: 6px; }
  .copy-button, .film-toggle, .task-chip span, .install-details summary { min-height: 44px; }
  .media-toggle { width: 44px; height: 44px; }
  .brand, .lab-mark { min-height: 44px; align-items: center; }
  .catalog-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .lab-credit { flex-direction: column; align-items: flex-start; gap: 24px; }
  .lab-logo img { height: 80px; }

  .tool-grid { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .flow li:not(:last-child)::after { content: '↓'; content: '↓' / ''; top: auto; right: auto; bottom: -30px; left: 24px; transform: none; }
}

@media (max-width: 580px) {
  .task-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .task-card { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); column-gap: 16px; padding: 20px; }
  .task-image { grid-column: 1; grid-row: 1 / 5; align-self: center; height: 132px; margin: 0; }
  .task-count { grid-column: 2; grid-row: 1; }
  .task-card h3 { grid-column: 2; grid-row: 2; margin: 4px 0 8px; font-size: 1.25rem; line-height: 1.2; }
  .task-card p { grid-column: 2; grid-row: 3; margin: 0; font-size: 0.875rem; line-height: 1.45; }
  .task-link { grid-column: 2; grid-row: 4; display: flex; align-items: center; min-height: 44px; font-size: 0.9375rem; }
  .task-item .media-toggle { top: 4px; left: 4px; right: auto; }
  .explore-heading { margin-bottom: 24px; }
  .page-head h1 { font-size: clamp(2rem, 9vw, 2.75rem); overflow-wrap: anywhere; }
  .prose { font-size: 1.0625rem; letter-spacing: -0.022em; }
  .tile-center { text-align: left; }
  .tile-center .link-row { justify-content: flex-start; }
  .footer-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
}

@media (max-width: 380px) {
  .simple-nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .hero-video, .featured-image img, .button, .task-card, .featured-models li { transition: none; }
  .featured-models li:hover img, .button:active { transform: none; }
}
