/* =============================================================================
   Accessibility Widget — Integrations directory
   Tokens drive both themes; data-theme on <html> flips the palette.
   ========================================================================== */

:root {
  --accent: #0058a3;
  --accent-700: #00477f;
  --accent-soft: rgba(0, 88, 163, 0.16);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1140px;
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 10px 30px rgba(8, 15, 40, 0.1);
}

html[data-theme='dark'] {
  --bg: #0b1020;
  --bg-grad: radial-gradient(1100px 520px at 80% -10%, rgba(0, 88, 163, 0.3), transparent 60%);
  --surface: #121a30;
  --surface-2: #0f1730;
  --border: #233152;
  --text: #eef2fb;
  --text-dim: #a9b4cf;
  --code-bg: #0a1124;
}

html[data-theme='light'] {
  --bg: #f6f8fc;
  --bg-grad: radial-gradient(1100px 520px at 80% -10%, rgba(0, 88, 163, 0.12), transparent 60%);
  --surface: #ffffff;
  --surface-2: #ffffff;
  --border: #dfe5f1;
  --text: #0c1530;
  --text-dim: #51607f;
  --code-bg: #0c1530;
  --shadow: 0 1px 2px rgba(16, 33, 80, 0.05), 0 12px 30px rgba(16, 33, 80, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-grad), var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* Focus — visible and consistent everywhere */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 1000;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
  text-decoration: none;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.6em 1.05em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.05s ease;
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px);
}
.btn:hover {
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-700);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent);
}
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  padding: 0.5em 0.7em;
}
.btn-ghost:hover {
  color: var(--text);
  background: var(--accent-soft);
}
.btn[aria-disabled='true'] {
  opacity: 0.55;
  pointer-events: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover {
  border-color: var(--accent);
}
.icon-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.icon-btn .i-moon {
  display: none;
}
html[data-theme='light'] .icon-btn .i-sun {
  display: none;
}
html[data-theme='light'] .icon-btn .i-moon {
  display: block;
}

/* Segmented control (lang + filters) */
.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  padding: 0.4em 0.8em;
  border-radius: 7px;
  cursor: pointer;
}
.seg-btn:hover {
  color: var(--text);
}
.seg-btn.is-active,
.seg-btn[aria-pressed='true'] {
  background: var(--accent);
  color: #fff;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
}
.brand:hover {
  text-decoration: none;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-text strong {
  font-size: 0.98rem;
}
.brand-text small {
  color: var(--text-dim);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  padding: clamp(2.5rem, 7vw, 5rem) 0 1rem;
}
.eyebrow {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.78rem;
  margin: 0 0 0.5rem;
}
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  margin: 0 0 0.8rem;
}
.lead {
  font-size: clamp(1.02rem, 2vw, 1.18rem);
  color: var(--text-dim);
  max-width: 64ch;
  margin: 0 0 1.4rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.6rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4em 0.8em;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.badge-standards {
  background: var(--accent-soft);
  color: var(--text);
  border-color: transparent;
}
.badge-version {
  background: var(--surface);
  color: var(--text);
}
.badge-version::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2bd576;
  box-shadow: 0 0 0 3px color-mix(in srgb, #2bd576 25%, transparent);
}
.badge-version:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 2.2rem;
}

/* CDN snippet */
.snippet {
  margin: 0;
  max-width: 760px;
}
.snippet figcaption {
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.snippet-box {
  position: relative;
}
.snippet-box pre {
  margin: 0;
  background: var(--code-bg);
  color: #dce6ff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 6.5rem 1rem 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
}
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35em 0.7em;
  cursor: pointer;
}
.copy-btn:hover {
  border-color: var(--accent);
}
.snippet-note {
  color: var(--text-dim);
  font-size: 0.86rem;
  margin: 0.6rem 0 0;
}

/* ── Catalog ─────────────────────────────────────────────────────────────── */
.catalog {
  padding: 2.5rem 0 1rem;
  scroll-margin-top: 80px;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
}
.filters {
  flex-wrap: wrap;
}
.search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45em 0.75em;
  min-width: min(280px, 100%);
}
.search svg {
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 1.9;
  flex: none;
}
.search input {
  font: inherit;
  border: 0;
  background: transparent;
  color: var(--text);
  width: 100%;
}
.search input:focus {
  outline: none;
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.result-count {
  color: var(--text-dim);
  font-size: 0.86rem;
  margin: 1rem 0 1.2rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
}

.cat-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 1.4rem 0 0.2rem;
}
.cat-heading:first-child {
  margin-top: 0;
}
.cat-heading h2 {
  font-size: 1.05rem;
  margin: 0;
}
.cat-heading span {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow);
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}
.card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  transform: translateY(-2px);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.mono-tile {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.card-title {
  display: flex;
  flex-direction: column;
}
.card-title strong {
  font-size: 1.05rem;
}
.card-title .req {
  color: var(--text-dim);
  font-size: 0.8rem;
}
.card-ver {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-dim);
  background: var(--code-bg);
  color: #9fb4e6;
  padding: 0.2em 0.5em;
  border-radius: 6px;
}
html[data-theme='light'] .card-ver {
  background: var(--accent-soft);
  color: var(--accent-700);
}
.card-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0;
  flex: 1;
}

.card-install {
  position: relative;
}
.card-install pre {
  margin: 0;
  background: var(--code-bg);
  color: #dce6ff;
  border-radius: 9px;
  padding: 0.6rem 2.6rem 0.6rem 0.75rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.card-install .copy-btn {
  top: 6px;
  right: 6px;
  padding: 0.25em 0.5em;
  font-size: 0.72rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.card-actions .btn {
  font-size: 0.84rem;
  padding: 0.5em 0.85em;
}
.link-row {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 0.1rem;
}
.link-row a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}
.link-row a:hover {
  color: var(--accent);
}
.dl-size {
  color: var(--text-dim);
  font-size: 0.76rem;
}

.no-results {
  text-align: center;
  color: var(--text-dim);
  padding: 3rem 0;
}

/* ── How it works ────────────────────────────────────────────────────────── */
.how {
  padding: 3rem 0;
}
.how h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin: 0 0 1.6rem;
}
.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.how-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
}
.how-num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 0.8rem;
}
.how-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}
.how-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.92rem;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 2.5rem 0;
}
.footer-inner {
  display: grid;
  gap: 1.6rem 2rem;
  grid-template-columns: 1.4fr 1fr 1fr;
  align-items: start;
}
.footer-brand {
  display: flex;
  flex-direction: column;
}
.footer-brand strong {
  letter-spacing: 0.04em;
}
.footer-brand span {
  color: var(--text-dim);
  font-size: 0.85rem;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.footer-h {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin: 0;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-links a {
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
}
.footer-links a:hover {
  color: var(--accent);
}
.footer-license {
  grid-column: 1 / -1;
  color: var(--text-dim);
  font-size: 0.82rem;
  margin: 0;
  max-width: 80ch;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 720px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* ── Legal pages (Impressum / Barrierefreiheit) ──────────────────────────── */
.legal {
  padding: clamp(2rem, 6vw, 4rem) 0 3rem;
}
.legal .back {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.legal h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  margin: 0 0 0.4rem;
}
.legal .legal-sub {
  color: var(--text-dim);
  margin: 0 0 2rem;
}
.legal-doc {
  max-width: 72ch;
}
.legal-doc h2 {
  font-size: 1.05rem;
  margin: 2rem 0 0.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
}
.legal-doc h2:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.legal-doc h3 {
  font-size: 0.95rem;
  margin: 1.2rem 0 0.3rem;
}
.legal-doc p,
.legal-doc address {
  color: var(--text-dim);
  margin: 0 0 0.8rem;
  font-style: normal;
  line-height: 1.7;
}
.legal-doc a {
  font-weight: 600;
}
.lang-block {
  margin-bottom: 2.5rem;
}
.lang-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.25em 0.7em;
  border-radius: 999px;
  margin-bottom: 1rem;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 0.7em 1.2em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  z-index: 200;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .brand-text small {
    display: none;
  }
  .header-actions .btn-ghost {
    display: none;
  }
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  .search {
    width: 100%;
  }
}
