/* ==========================================================================
   pin. — shadcn-inspired, strictly monochrome
   ========================================================================== */

:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /** [Stack Sans Notch](https://fonts.google.com/specimen/Stack+Sans+Notch) for actsense wordmark */
  --font-actsense: "Stack Sans Notch", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Menlo", "Cascadia Mono", "Roboto Mono", Consolas, monospace;

  /* Palette: black, white, and grays only. */
  --bg: #ffffff;
  --bg-muted: #fafafa;
  --bg-sunken: #f4f4f5;
  --surface: #ffffff;
  --surface-hover: #f4f4f5;

  --border: #e4e4e7;
  --border-strong: #d4d4d8;

  --text: #09090b;
  --text-dim: #52525b;
  --text-subtle: #71717a;
  --text-faint: #a1a1aa;

  --primary: #09090b;
  --primary-fg: #ffffff;
  --primary-hover: #1c1c1f;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-md: 8px;

  --shadow-xs: 0 1px 2px 0 rgba(9, 9, 11, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(9, 9, 11, 0.08), 0 1px 2px -1px rgba(9, 9, 11, 0.06);
  --shadow: 0 4px 12px -4px rgba(9, 9, 11, 0.12), 0 2px 4px -2px rgba(9, 9, 11, 0.06);

  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary);

  --max-w: 760px;
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.12s ease, color 0.12s ease;
}
a:hover {
  text-decoration-color: var(--text);
}

button {
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius);
}
/* Inputs manage their own focus affordance via .input-shell:focus-within. */
#q:focus,
#q:focus-visible,
.registry-trigger:focus,
.registry-trigger:focus-visible {
  outline: none;
  box-shadow: none;
}

.font-actsense {
  font-family: var(--font-actsense);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  top: -80px;
  left: 16px;
  background: var(--bg);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  z-index: 10;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip:focus {
  top: 12px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary[disabled] { opacity: 0.55; cursor: progress; }

.btn-ghost {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--border-strong); }

/* ==========================================================================
   Hero
   ========================================================================== */

main {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(40px, 8vw, 80px) clamp(16px, 4vw, 28px) 48px;
}

.hero {
  text-align: center;
}

.title {
  margin: 0 0 10px;
  font-size: clamp(2.75rem, 8vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.title-dot {
  color: var(--text-subtle);
}
.title-by {
  font-size: 0.38em;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  text-transform: lowercase;
  padding-bottom: 0.1em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.title-by:hover {
  color: var(--text);
  border-bottom-color: var(--border-strong);
}

.subtitle {
  margin: 0 0 12px;
  color: var(--text-dim);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

/* Provider brand logos (decorative; muted until hover) */

.providers-block {
  margin: 10px auto 4px;
  max-width: 560px;
}

.providers {
  list-style: none;
  margin: 0 auto;
  padding: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 22px;
}

.provider-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 2px;
}

.provider-logo .provider-logo-asset {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: block;
  filter: grayscale(1) brightness(0.92);
  opacity: 0.52;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.provider-logo:hover .provider-logo-asset {
  filter: none;
  opacity: 1;
}

.provider-logo-asset,
.provider-logo img {
  user-select: none;
  -webkit-user-drag: none;
}

.providers-caption {
  margin: 0 auto 28px;
  color: var(--text-subtle);
  font-size: 0.875rem;
  text-align: center;
}

/* ==========================================================================
   Search
   ========================================================================== */

.search { margin-top: 8px; }

.input-shell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  gap: 0;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.input-shell:focus-within {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.registry-field {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.registry-combobox {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex: 0 1 auto;
}

.registry-combobox.is-open {
  z-index: 35;
}

.registry-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 4.75rem;
  max-width: 11rem;
  margin: 0;
  padding: 10px 12px 10px 14px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-transform: uppercase;
  color: var(--text-subtle);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.registry-trigger-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.registry-chevron {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    center / contain no-repeat;
  transition: transform 0.15s ease;
}

.registry-combobox.is-open .registry-chevron {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .registry-chevron {
    transition: none;
  }
}

.registry-trigger:hover {
  background-color: var(--surface-hover);
  color: var(--text);
}

.registry-trigger:active {
  background-color: var(--bg-sunken);
}

.registry-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(280px, calc(100vw - 32px));
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  max-height: 280px;
  overflow-y: auto;
}

.registry-list[hidden] {
  display: none;
}

.registry-option {
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
  white-space: nowrap;
}

.registry-option:hover {
  background: var(--surface-hover);
}

.registry-option[aria-selected="true"] {
  background: var(--bg-sunken);
  font-weight: 600;
}

.registry-option.registry-option--active {
  outline: 1px solid var(--border-strong);
  outline-offset: -1px;
}

.input-shell[data-provider="dockerhub"] .registry-trigger-label,
.input-shell[data-provider="ghcr"] .registry-trigger-label,
.input-shell[data-provider="gitlab"] .registry-trigger-label,
.input-shell[data-provider="ghaction"] .registry-trigger-label {
  color: var(--text);
}

.input-shell[data-registry-mode="manual"] .registry-trigger-label {
  color: var(--text);
}

.input-shell[data-provider="invalid"] .registry-trigger-label,
.input-shell[data-provider="empty"] .registry-trigger-label {
  color: var(--text-subtle);
}

#q {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  padding: 12px 14px;
  min-width: 0;
}
#q::placeholder { color: var(--text-faint); }
#q:focus { outline: none; }

.btn .kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  opacity: 0.8;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.15);
  color: var(--primary-fg);
}

.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 14px;
}
.chip {
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.chip:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

/* ==========================================================================
   Result card
   ========================================================================== */

.result {
  margin-top: 32px;
  display: grid;
  gap: 14px;
  min-width: 0;
}
.result:empty { display: none; }

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(18px, 3vw, 24px);
  box-shadow: var(--shadow-xs);
  animation: pop-in 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-title {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 1rem;
  word-break: break-all;
}
.card-title .muted {
  color: var(--text-subtle);
  font-size: 0.75rem;
  font-family: var(--font-sans);
}
.card-title .muted code {
  font-family: var(--font-mono);
  background: var(--bg-sunken);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.tags {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--bg);
  color: var(--text-dim);
}
.tag-cached { background: var(--bg-sunken); color: var(--text); }
.tag-fresh  { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.tag-stale  { background: var(--bg); color: var(--text); border-style: dashed; }
.tag-revalidated { background: var(--bg-sunken); color: var(--text); }

.pin {
  position: relative;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 80px 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text);
  word-break: break-all;
  overflow: hidden;
  user-select: all;
}
.pin .label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 6px;
  user-select: none;
}
.pin .hash-prefix { color: var(--text-subtle); }
.pin .hash { color: var(--text); font-weight: 500; }

.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.copy:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}
.copy.ok {
  color: var(--primary-fg);
  background: var(--primary);
  border-color: var(--primary);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 0.8125rem;
}
.meta .kv {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.meta .kv .k {
  color: var(--text-subtle);
  font-weight: 500;
}
.meta .kv .v {
  color: var(--text);
  font-family: var(--font-mono);
}
.meta a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.meta a:hover { text-decoration-color: var(--text); }
.meta a svg { opacity: 0.6; }

.advanced {
  margin-top: 16px;
  border-top: 1px dashed var(--border);
  padding-top: 14px;
}
.advanced summary {
  cursor: pointer;
  color: var(--text-subtle);
  font-size: 0.8125rem;
  list-style: none;
  user-select: none;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before {
  content: "›";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.15s ease;
}
.advanced[open] summary::before { transform: rotate(90deg); }
.advanced pre {
  margin: 12px 0 0;
  padding: 14px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
  overflow: auto;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 360px;
}

/* Skeleton loading ------------------------------------------------------- */

.skeleton {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}
.skeleton .bar {
  height: 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--bg-sunken) 0%, var(--bg-muted) 50%, var(--bg-sunken) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}
.skeleton .bar + .bar { margin-top: 10px; }
.skeleton .bar.w-60 { width: 60%; }
.skeleton .bar.w-80 { width: 80%; }
.skeleton .bar.w-40 { width: 40%; }
.skeleton .block {
  height: 54px;
  margin-top: 18px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--bg-sunken) 0%, var(--bg-muted) 50%, var(--bg-sunken) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton .bar, .skeleton .block { animation: none; }
}

/* Error card ------------------------------------------------------------- */

.error {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.error h3 {
  margin: 0 0 6px;
  font-size: 0.9375rem;
  color: var(--text);
  font-weight: 600;
}
.error p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.875rem;
}
.error .hint {
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--text-subtle);
}
.error .hint code {
  background: var(--bg-sunken);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  color: var(--text);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-foot {
  padding: 24px clamp(16px, 4vw, 28px) 32px;
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.8125rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.site-foot .sep { padding: 0 8px; }

.site-foot .foot-link {
  color: var(--text-subtle);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.12s ease, border-color 0.12s ease;
}
.site-foot .foot-link:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 16px);
  padding: 8px 14px;
  background: var(--primary);
  color: var(--primary-fg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.8125rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 50;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   Suggestions dropdown (fuzzy-matched cache)
   ========================================================================== */

.search-box {
  position: relative;
}

.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 4px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 20;
}
.suggestions[hidden] { display: none; }

.suggestion {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  text-align: left;
  color: var(--text);
  transition: background 0.1s ease;
}
.suggestion:hover,
.suggestion[aria-selected="true"] {
  background: var(--bg-sunken);
}

.suggestion .s-provider {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 62px;
  text-align: center;
}
.suggestion .s-ref {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.suggestion .s-hash {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12ch;
}

.suggestion mark {
  background: var(--bg-sunken);
  color: var(--text);
  padding: 0 1px;
  border-radius: 2px;
}

/* ==========================================================================
   Small screens
   ========================================================================== */

@media (max-width: 560px) {
  .input-shell {
    grid-template-columns: 1fr auto;
  }
  .registry-field {
    grid-column: 1 / 3;
    border-bottom: 1px solid var(--border);
  }
  .registry-combobox {
    width: 100%;
    flex: 1 1 auto;
    max-width: none;
  }
  .registry-trigger {
    max-width: none;
    border-right: 0;
  }
  .registry-list {
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
  }
  .btn .kbd { display: none; }
  .chip { font-size: 0.7rem; }
  .title { gap: 8px; }
  .title-by { font-size: 0.4em; }

  .providers { gap: 6px 16px; padding-bottom: 10px; }
  .provider-logo .provider-logo-asset { width: 18px; height: 18px; }
  .suggestion .s-hash { display: none; }
  .suggestion { grid-template-columns: auto 1fr; }
}
