@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=DM+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

:root,
:root[data-theme="light"] {
  --page-width: 1600px;
  --page-gutter: 44px;
  --control-radius: 6px;
  --surface-radius: 8px;
  color-scheme: light;
  --hf-bg: #f7f8fa;
  --hf-ink: #1a2130;
  --hf-muted: #647084;
  --hf-line: #dce1e8;
  --hf-faint: #e9edf3;
  --hf-bar: #c0c8d8;
  --hf-solid: #2445e7;
  --hf-accent: #2445e7;
  --hf-warning: #946000;
  --hf-dialog: #fff;
  --hf-button-ink: #fff;
  --hf-logo-filter: none;
  --bg-color: var(--hf-bg);
  --bg-secondary: #f0f2f5;
  --bg-tertiary: #e9edf3;
  --text-color: var(--hf-ink);
  --text-secondary: #414c60;
  --muted-color: var(--hf-muted);
  --border-color: var(--hf-line);
  --border-color-strong: #b8c1cf;
  --card-bg: var(--hf-dialog);
  --code-bg: #eef1f5;
  --code-text: var(--hf-ink);
  --code-keyword: #1d4ed8;
  --code-string: #047857;
  --error-color: #b91c1c;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --hover-bg: #edf0f5;
  --link-color: var(--hf-accent);
  --link-hover: #1934bd;
  --nav-bg: var(--hf-bg);
  --litellm-primary: var(--hf-accent);
  --litellm-dark: #1934bd;
  --litellm-on-primary: var(--hf-button-ink);
  --focus-ring: rgba(36, 69, 231, 0.16);
  --success-color: #15803d;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --aurora-mesh: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --hf-bg: #111215;
  --hf-ink: #f1f3f6;
  --hf-muted: #a2a6af;
  --hf-line: #33373e;
  --hf-faint: #ffffff05;
  --hf-bar: #414650;
  --hf-solid: #91a2ff;
  --hf-accent: #91a2ff;
  --hf-warning: #e5b876;
  --hf-dialog: #191b20;
  --hf-button-ink: #111215;
  --hf-logo-filter: brightness(0) invert(1);
  --bg-secondary: #191b20;
  --bg-tertiary: #24272d;
  --text-secondary: #c8cbd2;
  --border-color-strong: #535a66;
  --code-bg: #181a1f;
  --code-keyword: #93c5fd;
  --code-string: #6ee7b7;
  --error-color: #fca5a5;
  --error-bg: #341d21;
  --error-border: #71383e;
  --link-hover: #b3bfff;
  --litellm-dark: #b3bfff;
  --hover-bg: #23262c;
  --focus-ring: rgba(145, 162, 255, 0.2);
  --success-color: #86dba1;
}

html {
  background: var(--hf-bg);
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--hf-bg);
  color: var(--hf-ink);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
::selection {
  background: var(--hf-ink);
  color: var(--hf-bg);
}
:focus-visible {
  outline: 2px solid var(--hf-ink);
  outline-offset: 4px;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.handoff-app {
  min-height: 100vh;
  background: var(--hf-bg);
}
.hf-header {
  border-bottom: 1px solid var(--hf-line);
  background: var(--hf-bg);
  position: relative;
  z-index: 30;
}
.hf-header-inner {
  min-height: 84px;
  max-width: var(--page-width);
  margin: auto;
  padding: 0 var(--page-gutter);
  display: flex;
  align-items: center;
  gap: 34px;
}
.hf-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 16px;
  text-decoration: none;
}
.hf-brand img {
  width: 132px;
  height: 32px;
  object-fit: contain;
}
.hf-brand span {
  font:
    400 10px/1.2 "IBM Plex Mono",
    monospace;
  letter-spacing: 1.4px;
  color: var(--hf-muted);
  white-space: nowrap;
}
.hf-nav {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 25px;
}
.hf-nav a {
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--hf-muted);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.hf-nav a[aria-current="page"],
.hf-nav a:hover {
  color: var(--hf-accent);
  border-bottom-color: var(--hf-accent);
}
.hf-header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 240px;
  min-width: 150px;
  height: 36px;
  border: 1px solid var(--hf-line);
  border-radius: var(--control-radius);
  padding: 0 11px;
  color: var(--hf-muted);
}
.hf-header-search:focus-within {
  border-color: var(--hf-ink);
}
.hf-header-search input {
  width: 100%;
  min-width: 0;
  background: transparent;
  color: var(--hf-ink);
  border: 0;
  outline: 0;
  border-radius: 0;
  font-size: 12px;
}
.hf-header-search input::placeholder {
  color: var(--hf-muted);
  opacity: 1;
}
.hf-header-search svg {
  flex-shrink: 0;
}
.hf-header-search kbd {
  flex-shrink: 0;
  font:
    9px "IBM Plex Mono",
    monospace;
  opacity: 0.8;
}
.hf-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}
@media (min-width: 641px) {
  .hf-header-search + .hf-header-actions {
    margin-left: 0;
  }
}
.hf-docs {
  font-size: 12px;
  white-space: nowrap;
  text-decoration: none;
  color: var(--hf-muted);
}
.hf-docs:hover {
  color: var(--hf-ink);
}
.hf-theme-toggle,
.hf-more-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--hf-ink);
  background: transparent;
  border: 1px solid var(--hf-line);
  border-radius: var(--control-radius);
  padding: 0;
}
.hf-theme-toggle:hover,
.hf-more-toggle:hover {
  background: var(--hf-faint);
  border-color: var(--hf-ink);
}
.hf-more-toggle {
  font-size: 25px;
  line-height: 1;
  padding-bottom: 10px;
  letter-spacing: 1px;
}
.hf-more {
  position: relative;
}
.hf-more-menu {
  position: absolute;
  top: 45px;
  right: 0;
  min-width: 210px;
  padding: 8px;
  background: var(--hf-dialog);
  border: 1px solid var(--hf-line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}
.hf-more-menu a,
.hf-more-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  color: var(--hf-ink);
  border: 0;
  background: transparent;
  font-size: 13px;
  text-decoration: none;
}
.hf-more-menu a:hover,
.hf-more-menu button:hover {
  background: var(--hf-faint);
}
.hf-route {
  min-height: calc(100vh - 85px);
}

/* Existing catalog components keep their behavior and use the same brand surface. */
.handoff-app .main-title,
.handoff-app .page-title {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.handoff-app .search-input,
.handoff-app .filter-input,
.handoff-app .table-container,
.handoff-app .provider-dropdown,
.handoff-app .search-shortcut,
.handoff-app .mode-filter,
.handoff-app .filter-button,
.handoff-app .btn,
.handoff-app .add-model-section {
  border-radius: var(--control-radius);
  box-shadow: none;
}
.handoff-app .provider-logo {
  background: transparent;
  border-radius: 0;
}
.handoff-app .hero {
  background: transparent;
}
.handoff-app option {
  background: var(--hf-dialog);
  color: var(--hf-ink);
}

@media (max-width: 1180px) {
  .hf-header-inner {
    padding-inline: var(--page-gutter);
    gap: 24px;
  }
  .hf-brand span {
    display: none;
  }
  .hf-nav {
    gap: 20px;
  }
  .hf-header-actions {
    gap: 10px;
  }
  .hf-docs {
    display: none;
  }
}
@media (min-width: 641px) and (max-width: 900px) {
  .hf-header-inner {
    padding-inline: var(--page-gutter);
    gap: 16px;
  }
  .hf-brand img {
    width: 116px;
    height: 28px;
  }
  .hf-nav {
    gap: 16px;
  }
  .hf-nav a {
    font-size: 12px;
  }
  .hf-header-search {
    width: 160px;
    min-width: 140px;
  }
  .hf-header-search kbd {
    display: none;
  }
  .hf-header-actions {
    gap: 6px;
  }
}
@media (max-width: 640px) {
  .hf-header-inner {
    padding: 18px var(--page-gutter) 0;
    min-height: auto;
    flex-wrap: wrap;
    gap: 18px;
  }
  .hf-brand {
    order: 0;
  }
  .hf-brand img {
    width: 116px;
    height: 28px;
  }
  .hf-header-actions {
    order: 1;
    margin-left: auto;
  }
  .hf-header-search {
    order: 2;
    width: 100%;
    margin: 0;
    height: 38px;
  }
  .hf-nav {
    order: 3;
    width: 100%;
    height: 44px;
    gap: 28px;
  }
  .hf-nav a {
    font-size: 13px;
  }
  .hf-route {
    min-height: calc(100vh - 190px);
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Shared page grid; individual reading blocks may be narrower. */
.hf-hero-wrap {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}
@media (max-width: 1100px) {
  :root,
  :root[data-theme] {
    --page-gutter: 28px;
  }
}
@media (max-width: 640px) {
  :root,
  :root[data-theme] {
    --page-gutter: 20px;
  }
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
.hf-header a {
  text-decoration: none;
}
.hf-header-search {
  flex-shrink: 1;
}
.hf-header-actions {
  flex-shrink: 0;
}
.hf-more summary {
  list-style: none;
  cursor: pointer;
}
.hf-more summary::-webkit-details-marker {
  display: none;
}
.hf-more-menu {
  border-radius: var(--surface-radius);
}
.hf-more-menu a {
  box-sizing: border-box;
}
.hf-more-menu a[aria-current="page"] {
  color: var(--hf-accent);
}
.hf-logo-dark {
  display: none;
}
[data-theme="dark"] .hf-logo-light {
  display: none;
}
[data-theme="dark"] .hf-logo-dark {
  display: block;
}
@media (pointer: coarse) {
  .handoff-app .search-input,
  .hf-header-search input {
    font-size: 16px;
  }
}
@media (max-width: 640px) {
  .hf-nav {
    gap: 24px;
    overflow-x: auto;
  }
}

.theme-sun {
  display: none;
}
[data-theme="dark"] .theme-moon {
  display: none;
}
[data-theme="dark"] .theme-sun {
  display: block;
}

/* One subscription affordance across the app and generated archives. */
.rss-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.rss-link::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: currentColor;
  -webkit-mask: url("/rss.svg") center / contain no-repeat;
  mask: url("/rss.svg") center / contain no-repeat;
}

/* Segmented controls share geometry; each page decides where they belong. */
.segmented-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: var(--hf-faint);
}
.segmented-tabs > :is(button, a) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--hf-muted);
  font:
    500 13px/1.3 "DM Sans",
    sans-serif;
  text-align: center;
  text-decoration: none;
}
.segmented-tabs > :is([aria-selected="true"], [aria-current="page"]) {
  background: var(--hf-dialog);
  border-color: var(--hf-line);
  color: var(--hf-accent);
  box-shadow: 0 1px 3px #00000008;
}
.segmented-tabs > :is(button, a):hover {
  color: var(--hf-accent);
  text-decoration: none;
}
@media (max-width: 500px) {
  .segmented-tabs > :is(button, a) {
    min-height: 48px;
    padding: 6px;
    font-size: 12px;
  }
}
