/* DS Bot Marketplace — design system.
   Palette and shapes follow the DS Bot product page; all assets are our own. */

:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --bg-tint: radial-gradient(70% 60% at 50% -10%, #e8eeff 0%, rgba(232, 238, 255, 0) 70%);
  --surface: #ffffff;
  --surface-soft: #f3f6fb;
  --ink: #0b0f1a;
  --text: #6b7280;
  --muted: #8a93a6;
  --line: #e6eaf2;
  --line-strong: #d5dbe7;
  --accent: #2d5bff;
  --accent-soft: #eef2ff;
  --cyan: #22d3ee;
  --cyan-soft: #e6fbff;
  --magenta: #f43f5e;
  --orange: #fb923c;
  --ok: #129a63;
  --ok-soft: #e5f7ee;
  --shadow: 0 1px 2px rgba(11, 15, 26, 0.04), 0 8px 24px rgba(11, 15, 26, 0.06);
  --shadow-lg: 0 2px 4px rgba(11, 15, 26, 0.05), 0 20px 48px rgba(11, 15, 26, 0.1);
  --radius: 18px;
  --radius-sm: 12px;
  --pill: 999px;
  --wrap: 1120px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b0f1a;
    --bg-tint: radial-gradient(70% 60% at 50% -10%, #16234a 0%, rgba(22, 35, 74, 0) 70%);
    --surface: #121826;
    --surface-soft: #171f30;
    --ink: #f3f6fc;
    --text: #a9b3c6;
    --muted: #7e8aa0;
    --line: #1e2637;
    --line-strong: #2b364c;
    --accent: #6b8cff;
    --accent-soft: #16203a;
    --cyan-soft: #0f2b33;
    --ok: #4fd39d;
    --ok-soft: #12301f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 20px 48px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-tint), var(--bg);
  background-repeat: no-repeat;
  background-size: 100% 720px, auto;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: inline-block; vertical-align: middle; }
a { color: var(--accent); text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap { width: min(100% - 44px, var(--wrap)); margin-inline: auto; }

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 40;
  padding: 10px 18px;
  border-radius: var(--pill);
  background: var(--ink);
  color: var(--surface);
  font-weight: 600;
  text-decoration: none;
  transition: top 120ms ease;
}
.skip-link:focus { top: 14px; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.brand-text { font-size: 17px; }
.brand-sub { color: var(--muted); font-weight: 500; }
.brand:hover .brand-sub { color: var(--ink); }

.header-nav { display: flex; align-items: center; gap: 18px; }

.header-link {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.header-link:hover { color: var(--ink); }

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
}
.lang-button {
  min-width: 38px;
  padding: 4px 9px;
  border: 0;
  border-radius: var(--pill);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.lang-button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.lang-button:hover:not([aria-pressed="true"]) { color: var(--ink); }

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--pill);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, background 120ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: none; }

.button-dark { background: var(--ink); color: var(--surface); }
.button-dark:hover { filter: brightness(1.15); }

.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { filter: brightness(1.06); }

.button-quiet {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
}
.button-quiet:hover:not(:disabled) { background: var(--surface); }
.button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Hero */

main { padding-block: 56px 72px; }

.hero {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}

.mascot { margin-bottom: 18px; }

.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(38px, 5.6vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.lede {
  margin: 0 auto;
  max-width: 58ch;
  color: var(--text);
  font-size: 17px;
}

.search {
  position: relative;
  max-width: 560px;
  margin: 30px auto 0;
}
.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 54px;
  padding: 0 22px 0 52px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  box-shadow: var(--shadow);
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input:hover { border-color: var(--line-strong); }
.search input:focus-visible { outline-offset: 2px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.chip-button {
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.chip-button:hover { border-color: var(--line-strong); color: var(--ink); }
.chip-button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip-button .count { margin-left: 6px; opacity: 0.65; font-weight: 500; }

/* Toolbar and grid */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 40px 0 18px;
}

.status { margin: 0; color: var(--text); font-size: 14px; }

.toolbar-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
}
.segment {
  padding: 6px 13px;
  border: 0;
  border-radius: var(--pill);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.segment[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.segment:hover:not([aria-pressed="true"]) { color: var(--ink); }

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

.card { display: flex; }

.card-link {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.card-link:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
}
.card-link:focus-visible { outline-offset: 3px; }

.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--pill);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-installable { background: var(--accent-soft); color: var(--accent); }
.badge-skill { background: var(--cyan-soft); color: #0e7490; }
.badge-reference { background: var(--surface-soft); color: var(--text); border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) {
  .badge-skill { color: #67e8f9; }
}

.tier-chip {
  margin-left: auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.package-head .tier-chip { margin-left: 0; }

.card-name {
  margin: 4px 0 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.card-summary {
  margin: 0;
  color: var(--text);
  font-size: 14.5px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
}
.author-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
}
.author-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verified { display: inline-flex; width: 15px; height: 15px; color: var(--ok); flex: none; }

.card-meta { white-space: nowrap; }

/* Empty and failure */

.empty {
  margin-top: 28px;
  padding: 40px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.empty h2 { margin: 0 0 6px; font-size: 21px; letter-spacing: -0.02em; }
.empty p { margin: 0 0 18px; color: var(--text); }

/* Detail */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 26px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

.package {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: start;
}

.package-main { min-width: 0; display: flex; flex-direction: column; gap: 26px; }

.package-head { display: flex; flex-direction: column; gap: 12px; }

#package-title {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.package-version { color: var(--muted); font-size: 15px; font-weight: 500; }

.package-summary { margin: 0; font-size: 18px; color: var(--text); }

.package-author { display: flex; align-items: center; gap: 10px; }

.meta-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin: 4px 0 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.meta-list dt { margin: 0 0 3px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.meta-list dd { margin: 0; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }

.package-body { display: flex; flex-direction: column; gap: 26px; }
.package-section h2 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.prose p { margin: 0 0 12px; color: var(--text); }
.prose p:last-child { margin-bottom: 0; }

.list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.list li { position: relative; padding-left: 22px; color: var(--text); overflow-wrap: anywhere; }
.list li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.package-aside {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.package-aside h2 { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.package-aside p { margin: 0; font-size: 14px; color: var(--text); }
.package-aside .button { width: 100%; }

.steps { margin: 4px 0 0; padding-left: 20px; color: var(--text); font-size: 14px; }
.steps li { margin-bottom: 8px; }
.steps li:last-child { margin-bottom: 0; }
.steps code, .inline-code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.callout {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 14px;
}
.callout strong { color: var(--ink); }
.callout-warn { border-color: color-mix(in srgb, var(--orange) 45%, var(--line)); background: color-mix(in srgb, var(--orange) 10%, var(--surface)); }
.callout-ok { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); }

.muted { color: var(--muted); }

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-block: 30px;
  font-size: 13px;
  color: var(--text);
}
.footer-inner { display: flex; flex-direction: column; gap: 10px; }
.footer-brand { display: flex; flex-direction: column; gap: 4px; }
.footer-note, .footer-license { margin: 0; max-width: 70ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: var(--text); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.footer-license { color: var(--muted); }

/* Responsive */

@media (max-width: 960px) {
  .package { grid-template-columns: 1fr; }
  .package-aside { position: static; }
}

@media (max-width: 720px) {
  .header-nav { gap: 12px; }
  .header-link { display: none; }
  .header-inner { min-height: 64px; }
  main { padding-block: 36px 56px; }
  .toolbar { margin-top: 30px; }
  .grid { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .wrap { width: min(100% - 32px, var(--wrap)); }
  .brand-sub { display: none; }
  .toolbar-controls { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card-link:hover, .button:hover { transform: none; }
}

@media (forced-colors: active) {
  .card-link, .package-aside, .meta-list, .search input, .lang-switch, .segmented { border-color: CanvasText; }
  .list li::before { background: CanvasText; }
}
