/* Match the light surfaces of the stealth landing page. */
:root {
  --brand-paper: #e2edf3;
  --brand-chrome: var(--brand-paper);
  --brand-panel: #edf3f2;
  --brand-soft: #dae7ea;
  --brand-line: #a5b6bb;
  color-scheme: only light;
  background: var(--brand-paper);
  color: var(--brand-ink);
  font: 16px/1.6 var(--font-ui);
}

* { box-sizing: border-box; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

main { flex: 1; }

a { color: inherit; }
a:hover { color: var(--brand-action); }

:focus-visible {
  outline: 2px solid var(--brand-action);
  outline-offset: 4px;
}

.registry-skip {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
  padding: 8px 12px;
  background: var(--brand-panel);
  transform: translateY(calc(-100% - 16px));
}

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

.registry-width {
  width: min(100% - 2 * clamp(20px, 5vw, 68px), 1240px);
  margin-inline: auto;
}

.registry-header, .registry-footer { background: var(--brand-chrome); }
.registry-header, .registry-hero, .registry-intro { border-bottom: 1px solid var(--brand-line); }

.registry-masthead, .registry-footer > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.registry-masthead { min-height: 76px; gap: 12px; }

.registry-masthead nav, .provider-metadata {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px clamp(14px, 3vw, 28px);
  font-size: 14px;
}

.registry-masthead nav { gap: 8px clamp(8px, 2.2vw, 28px); }

.registry-menu-toggle { display: none; }

.registry-masthead a {
  text-decoration: none;
}

.registry-brand img {
  display: block;
  width: clamp(120px, 17vw, 160px);
  height: auto;
}

.registry-masthead [aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--brand-action);
  text-underline-offset: 6px;
}

.registry-dashboard {
  padding: 6px 12px;
  border: 1px solid var(--brand-line);
  border-radius: 5px;
  white-space: nowrap;
}

.registry-dashboard:hover { border-color: var(--brand-action); }

.registry-hero {
  padding-block: clamp(42px, 7.6vw, 104px) clamp(40px, 6vw, 76px);
}

.registry-hero h1, .registry-intro h1 {
  margin: 0;
  font: 700 clamp(44px, 6.3vw, 80px)/1 var(--font-ui);
  letter-spacing: -.035em;
}

.registry-hero h1 {
  overflow-wrap: anywhere;
}

.registry-hero p {
  max-width: 54ch;
  margin: 22px 0 0;
  color: var(--brand-muted);
  font-size: clamp(16px, 2vw, 19px);
  overflow-wrap: anywhere;
}

/* Match the wordmark geometry in the stealth landing rail. */
.registry-index .registry-header {
  --registry-wordmark-width: 185px;
  --registry-wordmark-top: 38px;
  --registry-wordmark-inset: 28px;
  position: relative;
}

.registry-index .registry-masthead {
  display: grid;
  grid-template-columns:
    minmax(var(--registry-wordmark-width), 1fr) minmax(220px, 480px)
    minmax(var(--registry-wordmark-width), 1fr);
  min-height: max(76px, calc(var(--registry-wordmark-top) + 42px));
  gap: 16px 24px;
}

.registry-index .registry-brand {
  position: absolute;
  inset-block-start: var(--registry-wordmark-top);
  inset-inline-start: var(--registry-wordmark-inset);
}

.registry-index .registry-brand img {
  width: var(--registry-wordmark-width);
}

.registry-index .registry-masthead nav {
  grid-row: 1;
  grid-column: 3;
  justify-self: end;
}

.registry-index main {
  display: flex;
  flex-direction: column;
}

.registry-search {
  display: grid;
  grid-row: 1;
  grid-column: 2;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  background: var(--brand-paper);
}

.registry-search input, .registry-search button {
  min-height: 44px;
  border: 0;
  font: inherit;
}

.registry-search input {
  min-width: 0;
  padding: 8px 14px;
  border-radius: 7px 0 0 7px;
  background: transparent;
  color: var(--brand-ink);
}

.registry-search input::placeholder { color: var(--brand-muted); }

.registry-search input:focus-visible {
  outline-color: transparent;
  outline-offset: -2px;
  box-shadow: inset 0 -2px var(--brand-action);
}

.registry-search button {
  padding: 8px 14px;
  border-inline-start: 1px solid var(--brand-line);
  border-radius: 0 7px 7px 0;
  background: var(--brand-highlight);
  color: var(--brand-on-highlight);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.registry-search button:hover { background: var(--brand-highlight-hover); }

.registry-intro {
  padding-block: clamp(52px, 7vw, 100px) clamp(56px, 8vw, 112px);
  text-align: center;
}

.registry-intro p {
  max-width: 48ch;
  margin: 16px auto 0;
  color: var(--brand-muted);
  font-size: clamp(16px, 2vw, 20px);
}

.registry-catalog {
  flex: 1;
  padding-block: clamp(32px, 4vw, 56px) clamp(48px, 6vw, 80px);
}

.registry-catalog h2 {
  margin: 0 0 20px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  letter-spacing: -.025em;
  scroll-margin-top: 24px;
}

.registry-search-results {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}

.registry-search-results p {
  min-width: 0;
  margin: 0;
  color: var(--brand-muted);
  overflow-wrap: anywhere;
}

.registry-search-results a { color: var(--brand-action); }

.registry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.registry-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(18px, 2vw, 24px);
  border: 1px solid var(--brand-line);
  border-radius: 10px;
  background: var(--brand-panel);
}

.registry-card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
}

.registry-card h3 {
  min-width: 0;
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}

.registry-card h3 a {
  text-decoration: none;
  text-underline-offset: 3px;
}

.registry-card h3 a:hover { text-decoration: underline; }

.registry-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-inline-start: auto;
}

.registry-card-version {
  min-width: 0;
  color: var(--brand-muted);
  font: 13px/1.5 var(--font-code);
  overflow-wrap: anywhere;
}

.registry-maintainer {
  position: relative;
  display: inline-flex;
  flex: none;
}

.registry-maintainer-check {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #67529a;
  color: #fff;
}

.registry-maintainer-check::before {
  content: "";
  width: 8px;
  height: 4px;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg);
}

.registry-maintainer-tooltip {
  position: absolute;
  z-index: 1;
  inset-block-end: 100%;
  inset-inline-end: 0;
  visibility: hidden;
  width: max-content;
  max-width: min(230px, 70vw);
  padding: 6px 10px;
  border: 1px solid var(--brand-line);
  border-radius: 6px;
  background: var(--brand-panel);
  color: var(--brand-ink);
  font: 13px/1.45 var(--font-ui);
}

.registry-maintainer:hover .registry-maintainer-tooltip,
.registry-maintainer:focus-within .registry-maintainer-tooltip { visibility: visible; }

.registry-card-repository { margin-block: 12px 16px; }

.registry-card-repository .provider-repo-badge { vertical-align: top; }

.provider-repo-github { flex: none; }

.registry-card p {
  margin: 0 0 22px;
  color: var(--brand-muted);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.registry-card-actions {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--brand-line);
  font-size: 14px;
}

.registry-card-actions a { color: var(--brand-action); font-weight: 650; text-decoration: none; }
.registry-card-actions a:hover { text-decoration: underline; }

.provider-repo-badge {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  padding: 4px 10px;
  border: 1px solid var(--brand-line);
  border-radius: 5px;
  background: var(--brand-paper);
  color: var(--brand-ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.provider-repo-badge:hover { border-color: var(--brand-action); }

.provider-repo-path {
  position: absolute;
  visibility: hidden;
  inline-size: max-content;
}

.provider-repo-badge.has-repository-path .provider-repo-path {
  position: static;
  visibility: visible;
}

.provider-repo-star { font-size: 17px; line-height: 1; }

.provider-repo-count {
  padding-inline-start: 6px;
  border-inline-start: 1px solid var(--brand-line);
  font-variant-numeric: tabular-nums;
}

.registry-empty { margin: 0; color: var(--brand-muted); }

.registry-footer {
  border-top: 1px solid var(--brand-line);
  color: var(--brand-muted);
  font-size: 13px;
}

.registry-footer > div { min-height: 76px; }
.registry-footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.registry-footer a { text-underline-offset: 3px; }

.registry-hero--detail { padding-block: clamp(30px, 5vw, 64px); }

.provider-back {
  display: inline-block;
  margin-bottom: 22px;
  color: var(--brand-action);
  font-size: 14px;
  text-underline-offset: 4px;
}

.provider-metadata {
  margin-top: 20px;
  color: var(--brand-muted);
  overflow-wrap: anywhere;
}

.provider-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 780px);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
  padding-block: clamp(30px, 5vw, 64px);
}

.provider-nav {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px 24px;
  font-size: 14px;
}

.provider-nav a { text-underline-offset: 4px; }

.provider-documentation { min-width: 0; overflow-wrap: anywhere; }

.provider-documentation section + section {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--brand-line);
}

.provider-documentation h2 {
  margin: 0 0 12px;
  font: 400 36px/1.1 var(--font-display);
  scroll-margin-top: 24px;
}

.provider-documentation a { text-underline-offset: 3px; }
.provider-documentation code { font: .875em var(--font-code); }

.provider-documentation pre, .ck-code--snippet {
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--brand-line);
  border-radius: 6px;
  background: var(--brand-soft);
}

.provider-documentation pre {
  font: 13px/1.55 var(--font-code);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.provider-documentation pre code {
  font: inherit;
}

.provider-documentation > section > pre, .provider-documentation .ck-code--snippet {
  margin-block: 16px;
}

.ck-code--snippet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ck-code--snippet > pre {
  flex: 1;
  margin: 0;
  padding: 0;
  border: 0;
}

.ck-code__toolbar { order: 1; }

.ck-code__copy {
  min-width: 54px;
  min-height: 36px;
  padding: 4px 6px;
  border: 1px solid var(--brand-line);
  border-radius: 4px;
  background: transparent;
  color: var(--brand-ink);
  font: 500 12px var(--font-ui);
  cursor: pointer;
}

.ck-code__copy:hover { color: var(--brand-action); border-color: var(--brand-action); }

@media (min-width: 1600px) {
  .registry-index .registry-header {
    --registry-wordmark-top: 45px;
    --registry-wordmark-inset: 36px;
  }
}

@media (min-width: 851px) and (max-width: 1150px) {
  .registry-index .registry-header {
    --registry-wordmark-top: 30px;
    --registry-wordmark-inset: 22px;
  }
}

@media (min-width: 851px) and (max-height: 760px) {
  .registry-index .registry-header { --registry-wordmark-top: 24px; }
}

@media (max-width: 850px) {
  .registry-width {
    --registry-gutter: clamp(14px, calc(5vw - 6px), 68px);
    width: auto;
    margin-inline: max(var(--registry-gutter), env(safe-area-inset-left)) max(var(--registry-gutter), env(safe-area-inset-right));
  }

  .registry-masthead, .registry-index .registry-masthead {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    gap: 10px;
    padding-block: calc(10px + env(safe-area-inset-top)) 10px;
  }

  .registry-brand, .registry-index .registry-brand {
    position: static;
    display: flex;
    align-items: center;
    justify-self: start;
    grid-area: 1 / 1;
    min-height: 44px;
  }

  .registry-brand img, .registry-index .registry-brand img {
    width: clamp(128px, 32vw, 180px);
    max-width: 100%;
  }

  .registry-menu-ready .registry-menu-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    grid-area: 1 / 2;
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid var(--brand-line);
    border-radius: 5px;
    background: transparent;
    color: inherit;
    font: 650 14px var(--font-ui);
    cursor: pointer;
  }

  .registry-menu-toggle::after {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid;
    border-bottom: 1.5px solid;
    transform: translateY(-2px) rotate(45deg);
  }

  .registry-menu-toggle[aria-expanded="true"] {
    background: var(--brand-soft);
  }

  .registry-menu-toggle[aria-expanded="true"]::after {
    transform: translateY(2px) rotate(225deg);
  }

  .registry-masthead nav, .registry-index .registry-masthead nav {
    display: grid;
    grid-area: 2 / 1 / 3 / -1;
    justify-self: stretch;
    gap: 0;
  }

  .registry-menu-ready .registry-menu-toggle[aria-expanded="false"] + nav {
    display: none;
  }

  .registry-masthead nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px;
    border: 0;
    border-radius: 0;
  }

  .registry-masthead nav a + a { border-top: 1px solid var(--brand-line); }

  .registry-search { grid-area: 3 / 1 / 4 / -1; }
}

@media (max-width: 640px) {
  .provider-layout { grid-template-columns: minmax(0, 1fr); }
  .provider-nav { position: static; flex-flow: row wrap; }
}
