/*
 * Cookie notice (#consent), driven by js/consent.js.
 * Bottom-left, never blocks the page, enters with a short bounce after the
 * first section has finished typing. On phones it sits above the bottom card;
 * consent.js sets --cb to that card's height.
 */

#consent {
  position: fixed;
  left: 16px;
  bottom: 48px;
  z-index: 60;
  width: min(320px, calc(100vw - 32px));
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  color: var(--fg);
  font-size: .88rem;
  line-height: 1.45;
  opacity: 0;
  visibility: hidden;
}
#consent.show {
  visibility: visible;
  animation:
    consent-in .9s cubic-bezier(.22, 1, .36, 1) both,
    consent-ring 1.5s ease-out .95s 2;      /* two soft pulses to catch the eye, no shaking */
}
#consent.hide {
  transition: opacity .25s ease, transform .25s ease;
  opacity: 0;
  transform: translateY(14px);
}
@keyframes consent-in {
  0%   { opacity: 0; transform: translateY(46px) scale(.94); }
  55%  { opacity: 1; transform: translateY(-8px) scale(1.01); }
  78%  { transform: translateY(3px); }
  100% { opacity: 1; transform: none; }
}
@keyframes consent-ring {
  0%   { box-shadow: var(--shadow), 0 0 0 0 rgba(30, 167, 232, .5); }
  100% { box-shadow: var(--shadow), 0 0 0 16px rgba(30, 167, 232, 0); }
}

#consent p {
  margin: 0 0 .65rem;
}
#consent a {
  color: inherit;
  text-decoration: underline;
  white-space: nowrap;
}

/* The receipt line: only shown when a choice was made before (consent.js fills and unhides it). */
#consent .cid {
  font-size: .78rem;
  opacity: .85;
  overflow-wrap: anywhere;
}
#consent .cid code {
  font-size: .95em;
}

/* Accept and Reject have the same size and weight on purpose. */
#consent .cbtns {
  display: flex;
  gap: .5rem;
}
#consent button {
  flex: 1;
  min-height: 36px;
  padding: .4rem .8rem;
  font: 600 .85rem var(--font);
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
}
#consent button:hover {
  opacity: .85;
}

@media (max-width: 700px) {
  #consent {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: var(--cb, 12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #consent.show {
    animation: consent-fade .3s both;
  }
  @keyframes consent-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
}
