/* ── COOKIE CONSENT — banner & modal ────────────────────────────
   Style-coherent with index.html: same dark palette, same fonts,
   same edge sensibility. No external deps. */

:root {
  --consent-bg: #111318;
  --consent-ink: #f5f4f0;
  --consent-accent: #2d5cff;
}

/* ── BANNER ─────────────────────────────────────────────── */
.consent-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10000;
  background: var(--consent-bg);
  border-top: 1px solid color-mix(in srgb, var(--consent-ink) 14%, transparent);
  box-shadow: 0 -12px 40px rgba(0,0,0,0.5);
  padding: 22px 32px;
  color: var(--consent-ink);
  font-family: 'JetBrains Mono', monospace;
  max-height: 25vh;
  overflow-y: auto;
}
.consent-banner-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
}
.consent-banner-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.65;
  color: color-mix(in srgb, var(--consent-ink) 82%, transparent);
  margin: 0;
  max-width: 760px;
}
.consent-banner-text a {
  color: var(--consent-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.consent-banner-text a:hover { color: var(--consent-accent); }
.consent-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ── BUTTONS ───────────────────────────────────────────── */
.consent-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--consent-ink);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--consent-ink) 38%, transparent);
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
  min-width: 130px;
  text-align: center;
}
.consent-btn:hover {
  background: color-mix(in srgb, var(--consent-ink) 8%, transparent);
  border-color: color-mix(in srgb, var(--consent-ink) 65%, transparent);
}
.consent-btn:focus-visible {
  outline: 2px solid var(--consent-accent);
  outline-offset: 2px;
}
/* "Primary" only adds fill — same dimensions, same weight as the other two,
   so legal equivalence is preserved. */
.consent-btn--primary {
  background: var(--consent-ink);
  color: var(--consent-bg);
  border-color: var(--consent-ink);
}
.consent-btn--primary:hover {
  background: var(--consent-accent);
  color: #fff;
  border-color: var(--consent-accent);
}

/* ── MODAL ─────────────────────────────────────────────── */
.consent-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.consent-modal.open {
  display: flex;
  opacity: 1;
}
.consent-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.consent-modal-box {
  position: relative;
  background: var(--consent-bg);
  border: 1px solid color-mix(in srgb, var(--consent-ink) 14%, transparent);
  border-radius: 16px;
  width: min(560px, 92vw);
  max-height: min(85vh, 720px);
  overflow-y: auto;
  padding: 40px 36px 32px;
  color: var(--consent-ink);
  font-family: 'DM Sans', sans-serif;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.consent-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  background: none;
  border: 1px solid color-mix(in srgb, var(--consent-ink) 18%, transparent);
  border-radius: 50%;
  color: var(--consent-ink);
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.55;
  transition: opacity 0.2s, background 0.2s, border-color 0.2s;
}
.consent-modal-close:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--consent-ink) 6%, transparent);
  border-color: color-mix(in srgb, var(--consent-ink) 38%, transparent);
}
.consent-modal-close:focus-visible {
  outline: 2px solid var(--consent-accent);
  outline-offset: 2px;
}
.consent-modal[data-dismissible="false"] .consent-modal-close { display: none; }

.consent-modal-title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0 0 12px;
  color: var(--consent-ink);
}
.consent-modal-intro {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.65;
  color: color-mix(in srgb, var(--consent-ink) 72%, transparent);
  margin: 0 0 24px;
}

/* ── ROWS ──────────────────────────────────────────────── */
.consent-row {
  padding: 20px 0;
  border-top: 1px solid color-mix(in srgb, var(--consent-ink) 10%, transparent);
}
.consent-row:first-of-type { border-top: none; padding-top: 8px; }
.consent-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.consent-row-title {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--consent-ink);
  margin: 0;
  line-height: 1.3;
}
.consent-row-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  line-height: 1.65;
  color: color-mix(in srgb, var(--consent-ink) 62%, transparent);
  margin: 8px 0 0;
}

/* ── SWITCH ────────────────────────────────────────────── */
.consent-switch {
  position: relative;
  display: inline-block;
  cursor: pointer;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
}
.consent-switch input {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  z-index: 2;
}
.consent-switch-track {
  display: block;
  width: 44px; height: 24px;
  background: color-mix(in srgb, var(--consent-ink) 18%, transparent);
  border-radius: 999px;
  transition: background 0.2s;
  position: relative;
}
.consent-switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: var(--consent-ink);
  border-radius: 50%;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.consent-switch input:checked ~ .consent-switch-track {
  background: var(--consent-accent);
}
.consent-switch input:checked ~ .consent-switch-track .consent-switch-thumb {
  transform: translateX(20px);
  background: #fff;
}
.consent-switch input:focus-visible ~ .consent-switch-track {
  outline: 2px solid var(--consent-accent);
  outline-offset: 2px;
}
.consent-switch--locked { opacity: 0.55; cursor: not-allowed; }
.consent-switch--locked input { cursor: not-allowed; }

/* ── ACTIONS ───────────────────────────────────────────── */
.consent-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.consent-modal-actions .consent-btn {
  flex: 1;
  min-width: 0;
}
.consent-link {
  display: block;
  width: 100%;
  margin: 18px auto 0;
  background: none;
  border: none;
  color: color-mix(in srgb, var(--consent-ink) 65%, transparent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 8px;
  transition: color 0.18s;
  text-align: center;
}
.consent-link:hover { color: var(--consent-ink); }
.consent-link:focus-visible {
  outline: 2px solid var(--consent-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 820px) {
  .consent-banner {
    padding: 20px;
    max-height: 60vh;
  }
  .consent-banner-inner {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .consent-banner-actions {
    flex-direction: column;
    width: 100%;
  }
  .consent-btn {
    width: 100%;
    min-width: 0;
  }
  .consent-modal-box {
    padding: 32px 22px 22px;
  }
  .consent-modal-title { font-size: 22px; }
  .consent-modal-actions { flex-direction: column; }
  .consent-modal-actions .consent-btn { width: 100%; }
}

/* When index.html's custom cursor is active, hide it on our controls */
body.cursor-hover .consent-btn,
body.cursor-hover .consent-switch,
body.cursor-hover .consent-modal-close,
body.cursor-hover .consent-link { cursor: pointer; }
