/* Bitkom Universe — shared design base, modelled on bahn-zu-spaet
   (stone palette, square edges, Fraunces display, Geist body, JetBrains Mono labels). */

:root {
  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;
  --rose-700: #be123c;
  --emerald-700: #047857;
  --amber-700: #b45309;
  --sky-800: #075985;
  --violet-700: #6d28d9;
  --teal-700: #0f766e;

  /* Legacy token names still referenced from inline styles and JS */
  --bg-primary: var(--stone-100);
  --bg-secondary: var(--stone-50);
  --bg-card: #ffffff;
  --bg-card-hover: var(--stone-50);
  --border: var(--stone-300);
  --text-primary: var(--stone-900);
  --text-secondary: var(--stone-600);
  --text-muted: var(--stone-500);
  --accent-teal: var(--stone-900);
  --accent-blue: var(--stone-900);
  --accent-purple: var(--violet-700);
  --accent-pink: var(--rose-700);
  --accent-orange: var(--amber-700);
  --accent-red: var(--rose-700);
  --accent-green: var(--emerald-700);

  --font-body: "Geist", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-display: "Fraunces", Georgia, serif;
  --wrap: 1024px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--stone-100);
  color: var(--stone-900);
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: inherit;
}
::selection {
  background: var(--stone-900);
  color: var(--stone-50);
}
:focus-visible {
  outline: 2px solid var(--stone-900);
  outline-offset: 2px;
}

/* ---------- Typography helpers ---------- */
.font-display {
  font-family: var(--font-display);
  font-feature-settings: "ss01";
  letter-spacing: -0.01em;
  font-weight: 400;
}
.font-mono,
.mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
}
.tnum {
  font-variant-numeric: tabular-nums;
}
.eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--stone-500);
}
.label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--stone-500);
}
.muted {
  color: var(--stone-500);
}

.grain {
  background-image: radial-gradient(
    rgba(28, 25, 23, 0.04) 1px,
    transparent 1px
  );
  background-size: 4px 4px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 640px) {
  .wrap {
    padding: 0 40px;
  }
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 249, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--stone-300);
}
.topbar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
@media (min-width: 640px) {
  .topbar-inner {
    padding: 8px 40px;
  }
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.brand-name em {
  font-style: italic;
  color: var(--stone-500);
}
.brand-by {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--stone-500);
}
.topbar-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
}
.topbar-tabs::-webkit-scrollbar {
  display: none;
}
.topbar-meta {
  display: none;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--stone-500);
  white-space: nowrap;
}
.topbar-meta strong {
  color: var(--stone-900);
  font-weight: 500;
}
@media (min-width: 1440px) {
  .topbar-meta {
    display: flex;
  }
}

/* ---------- Buttons / pills ---------- */
.pill,
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  border: 1px solid var(--stone-300);
  background: #fff;
  color: var(--stone-700);
  cursor: pointer;
  text-decoration: none;
  transition:
    border-color 0.15s,
    background-color 0.15s,
    color 0.15s;
  flex-shrink: 0;
}
.pill:hover,
.btn:hover {
  border-color: var(--stone-700);
}
.pill.active,
.pill[aria-selected="true"],
.btn-ink {
  background: var(--stone-900);
  color: var(--stone-50);
  border-color: var(--stone-900);
}
.btn-ink:hover {
  background: var(--stone-700);
  border-color: var(--stone-700);
}
.pill svg,
.btn svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.field {
  background: #fff;
  border: 1px solid var(--stone-300);
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--stone-900);
  border-radius: 0;
}
.field:focus {
  outline: none;
  border-color: var(--stone-900);
}

/* ---------- Sections ---------- */
.hero-band {
  background-color: var(--stone-50);
  border-bottom: 1px solid var(--stone-200);
  padding: 28px 0;
}
@media (min-width: 640px) {
  .hero-band {
    padding: 40px 0;
  }
}
.hero-headline {
  font-family: var(--font-display);
  font-feature-settings: "ss01";
  letter-spacing: -0.01em;
  font-weight: 400;
  font-size: 40px;
  line-height: 1.02;
  color: var(--stone-900);
}
@media (min-width: 640px) {
  .hero-headline {
    font-size: 64px;
  }
}
.hero-lede {
  margin-top: 10px;
  color: var(--stone-600);
  max-width: 40rem;
}

.band {
  background: var(--stone-50);
  border-bottom: 1px solid var(--stone-200);
  padding: 32px 0;
}
.band-title {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 4px 0 16px;
}

.panel {
  background: #fff;
  border: 1px solid var(--stone-200);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--stone-200);
}

/* ---------- Code ---------- */
pre,
code,
kbd {
  font-family: var(--font-mono);
}
.codeblock {
  background: var(--stone-900);
  color: var(--stone-100);
  padding: 14px 16px;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--stone-200);
  background: var(--stone-50);
  margin-top: 16px;
}
.site-footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--stone-500);
}
@media (min-width: 640px) {
  .site-footer-inner {
    padding: 24px 40px;
  }
}
.site-footer a {
  color: var(--stone-600);
}
.site-footer a:hover {
  color: var(--stone-900);
}

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(250, 250, 249, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--stone-300);
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}
.bottom-nav button,
.bottom-nav a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 0;
  background: none;
  border: 0;
  color: var(--stone-500);
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
}
.bottom-nav svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
.bottom-nav .active {
  color: var(--stone-900);
}
.bottom-nav .active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--stone-900);
}
body.has-bottom-nav {
  padding-bottom: 64px;
}
@media (min-width: 900px) {
  .bottom-nav {
    display: none;
  }
  body.has-bottom-nav {
    padding-bottom: 0;
  }
}

/* ---------- Motion ---------- */
@keyframes pulse-soft {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}
.pulse-dot {
  animation: pulse-soft 2.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Legal / publisher bar ---------- */
.legal-bar { border-top: 1px solid var(--stone-200); }
.legal-bar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 14px 20px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 12px;
  color: var(--stone-600);
}
@media (min-width: 640px) { .legal-bar-inner { padding: 14px 40px 20px; } }
.legal-bar a { color: var(--stone-900); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.legal-bar a:hover { text-decoration-style: solid; }
.legal-links { font-family: var(--font-mono); white-space: nowrap; }
