/* Cookie / analytics consent banner — styled with the site design tokens
   (see :root in style.css). Paired with js/posthog.js. */

.ts-consent {
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: var(--space-4, 1rem);
  transform: translate(-50%, calc(100% + var(--space-4, 1rem)));
  width: min(680px, calc(100vw - 2 * var(--space-4, 1rem)));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3, 0.75rem) var(--space-4, 1rem);
  padding: var(--space-4, 1rem) var(--space-4, 1rem);
  background: color-mix(in oklab, var(--color-surface, #111114) 92%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border-strong, #3a3a44);
  border-radius: var(--radius-lg, 0.875rem);
  box-shadow: var(--shadow-lg, 0 24px 60px rgba(0, 0, 0, 0.55));
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.ts-consent.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.ts-consent.is-leaving {
  transform: translate(-50%, calc(100% + var(--space-4, 1rem)));
  opacity: 0;
}

.ts-consent__text {
  flex: 1 1 320px;
  margin: 0;
  font-size: var(--text-sm, 0.9rem);
  line-height: 1.5;
  color: var(--color-text, #ececee);
}

.ts-consent__text a {
  color: var(--color-primary, #ef4b3a);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ts-consent__actions {
  flex: 0 0 auto;
  display: flex;
  gap: var(--space-3, 0.75rem);
}

.ts-consent__actions .btn {
  min-height: 40px;
  padding-block: 0.6rem;
}

@media (max-width: 560px) {
  .ts-consent {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }
  .ts-consent__actions {
    width: 100%;
  }
  .ts-consent__actions .btn {
    flex: 1 1 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ts-consent {
    transition: opacity 0.2s ease;
  }
}
