/* Tilth — analytics consent panel.
 *
 * A compact bottom panel, never a blocking full-screen modal. It is positioned
 * so it sits below the floating header and clear of the Contact form's submit
 * row, and it uses the same tokens as the rest of the site so it reads as part
 * of the system in both themes. Colours fall back to literal values when the
 * panel renders on a page whose family tokens are not present.
 */

.tilth-consent {
  position: fixed;
  z-index: 1000;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 560px;
  margin-inline: auto;
  padding: 18px 20px 20px;
  background: var(--bg, #101310);
  color: var(--fg, #F3F5F1);
  border: 1px solid var(--line2, rgba(243, 245, 241, .22));
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

.tilth-consent__h {
  margin: 0 0 8px;
  font-family: Syne, sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
  line-height: 1.2;
  color: var(--fg, #F3F5F1);
}

.tilth-consent__b {
  margin: 0 0 16px;
  font-family: Chivo, system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--stone, #A7ACA5);
}

.tilth-consent__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.tilth-consent__btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 18px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--fg, #F3F5F1);
  background: transparent;
  border: 1px solid var(--line2, rgba(243, 245, 241, .3));
  border-radius: 2px;
  cursor: pointer;
  transition: background .25s, border-color .25s, color .25s;
}

.tilth-consent__btn:hover {
  border-color: var(--mosstext, #BEF54F);
  color: var(--mosstext, #BEF54F);
}

.tilth-consent__btn--yes {
  background: var(--moss, #BEF54F);
  border-color: var(--moss, #BEF54F);
  color: #101310;
}

.tilth-consent__btn--yes:hover {
  background: var(--moss, #BEF54F);
  border-color: var(--moss, #BEF54F);
  color: #101310;
  filter: brightness(1.06);
}

.tilth-consent__link {
  margin-left: auto;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--stone, #A7ACA5);
  border-bottom: 1px solid var(--line2, rgba(243, 245, 241, .25));
  padding-bottom: 2px;
  text-decoration: none;
}

.tilth-consent__link:hover { color: var(--fg, #F3F5F1); }

/* The site's focus ring, restated here so the panel is operable on any page
   family whose stylesheet may not be loaded. */
.tilth-consent :focus-visible {
  outline: 2px solid var(--mosstext, #BEF54F);
  outline-offset: 3px;
}

/* 390: the two actions stack full width and the policy link drops onto its own
   line, so nothing is cut off and every target stays at least 44px tall. */
@media (max-width: 479px) {
  .tilth-consent { left: 10px; right: 10px; bottom: 10px; padding: 16px 16px 18px; }
  .tilth-consent__row { gap: 8px; }
  .tilth-consent__btn { flex: 1 1 100%; padding: 0 14px; }
  .tilth-consent__link { margin-left: 0; margin-top: 4px; flex: 1 1 100%; }
}

/* Light theme follows the same token switch the rest of the site uses. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .tilth-consent {
    box-shadow: 0 18px 50px rgba(16, 19, 16, .16);
  }
}
:root[data-theme="light"] .tilth-consent {
  box-shadow: 0 18px 50px rgba(16, 19, 16, .16);
}

/* No entrance animation at all under reduced motion; the panel simply appears,
   and it never animates layout, so it cannot contribute to CLS. */
@media (prefers-reduced-motion: no-preference) {
  .tilth-consent { animation: tilthConsentIn .28s cubic-bezier(.16, 1, .3, 1) both; }
  @keyframes tilthConsentIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .tilth-consent { animation: none; }
  .tilth-consent__btn { transition: none; }
}
