/* ===========================================================
   Imperum — Cookie consent (banner + preferences modal)
   Self-contained, prefixed `ck-`. The static site has no
   tokens.css, so the tokens this file needs are resolved on
   .ck-root below. Everything else is a 1:1 port of the React
   cookie-consent.css.
   =========================================================== */

.ck-root {
  --font-sans: "ImperumSans", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Site rule: no monospace anywhere. Eyebrow labels use the sans stack. */
  --font-mono: "ImperumSans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --imperum-red: #EF3341;
  --imperum-red-300: #FF6E78;
  --resolve-green: #22C55E;
  --grad-emphasis: linear-gradient(135deg, #EF3341, #FF6E78);
}

.ck-root { position: relative; z-index: 1300; }

/* ---------- shared buttons ---------- */
.ck-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 13.5px/1 var(--font-sans, sans-serif);
  padding: 11px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, filter 180ms ease, transform 120ms ease;
}
.ck-btn:active { transform: translateY(1px); }
.ck-btn--primary {
  background: var(--grad-emphasis, linear-gradient(135deg,#EF3341,#FF6E78));
  color: #fff; box-shadow: 0 8px 24px rgba(239,51,65,0.26);
}
.ck-btn--primary:hover { filter: brightness(1.06) saturate(1.05); }
.ck-btn--ghost {
  background: rgba(255,255,255,0.05); color: #EDEFF4;
  border-color: rgba(255,255,255,0.16);
}
.ck-btn--ghost:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.28); }
.ck-btn:focus-visible { outline: 2px solid var(--imperum-red-300, #FF6E78); outline-offset: 2px; }

/* ===========================================================
   BANNER — fixed bottom, dark command surface
   =========================================================== */
.ck-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1300;
  padding: 16px;
  display: flex; justify-content: center;
  animation: ck-rise 360ms cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes ck-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.ck-banner__card {
  width: 100%; max-width: 1180px;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px 28px;
  background: #0E1118; color: #EDEFF4;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 24px 60px -18px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.04);
}
.ck-banner__text { min-width: 0; }
.ck-banner__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 700 10px/1 var(--font-mono, sans-serif); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--imperum-red-300, #FF6E78); margin-bottom: 9px;
}
.ck-banner__dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.ck-banner__text p {
  margin: 0; font: 400 14px/1.55 var(--font-sans, sans-serif); color: rgba(255,255,255,0.82);
  max-width: 70ch; text-wrap: pretty;
}
.ck-banner__text a { color: var(--imperum-red-300, #FF6E78); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(255,110,120,0.4); }
.ck-banner__text a:hover { color: #fff; border-bottom-color: #fff; }
.ck-banner__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 880px) {
  .ck-banner__card { grid-template-columns: 1fr; gap: 16px; }
  .ck-banner__actions { justify-content: stretch; }
  .ck-banner__actions .ck-btn { flex: 1; }
}
@media (max-width: 520px) {
  .ck-banner { padding: 10px; }
  .ck-banner__card { padding: 18px; border-radius: 14px; }
  .ck-banner__actions { flex-direction: column; }
  .ck-banner__actions .ck-btn { width: 100%; }
}

/* Keep the card above the home indicator on notched phones. Sits after the
   media queries so the shorthand padding above cannot reset it. */
.ck-banner { padding-bottom: max(16px, env(safe-area-inset-bottom)); }

/* ===========================================================
   MODAL — preferences
   =========================================================== */
.ck-scrim {
  position: fixed; inset: 0; z-index: 1400;
  background: rgba(8,9,12,0.62); backdrop-filter: blur(4px);
  animation: ck-fade 200ms ease both;
}
@keyframes ck-fade { from { opacity: 0; } to { opacity: 1; } }

.ck-modal {
  position: fixed; z-index: 1410; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow: auto;
  background: #0E1118; color: #EDEFF4;
  border: 1px solid rgba(255,255,255,0.10); border-radius: 18px;
  box-shadow: 0 40px 90px -24px rgba(0,0,0,0.7);
  animation: ck-pop 240ms cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes ck-pop { from { opacity: 0; transform: translate(-50%,-46%) scale(0.98); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }

.ck-modal__head { padding: 24px 26px 14px; position: relative; border-bottom: 1px solid rgba(255,255,255,0.07); }
.ck-modal__eyebrow { font: 700 10px/1 var(--font-mono, sans-serif); letter-spacing: 0.14em; text-transform: uppercase; color: var(--imperum-red-300, #FF6E78); }
.ck-modal__head h2 { margin: 10px 0 0; font: 600 22px/1.2 var(--font-sans, sans-serif); letter-spacing: -0.018em; color: #fff; }
.ck-modal__head p { margin: 10px 0 0; font: 400 13.5px/1.55 var(--font-sans, sans-serif); color: rgba(255,255,255,0.66); }
.ck-modal__close {
  position: absolute; top: 18px; right: 18px; width: 32px; height: 32px;
  display: grid; place-items: center; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); color: rgba(255,255,255,0.72);
  transition: background 160ms ease, color 160ms ease;
}
.ck-modal__close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.ck-modal__close svg { width: 15px; height: 15px; }

.ck-cats { padding: 8px 26px; }
.ck-cat {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: start;
  padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.ck-cat:last-child { border-bottom: 0; }
.ck-cat__title { font: 600 15px/1.3 var(--font-sans, sans-serif); color: #fff; }
.ck-cat__desc { margin: 6px 0 0; font: 400 13px/1.55 var(--font-sans, sans-serif); color: rgba(255,255,255,0.62); max-width: 52ch; }
.ck-cat__state { grid-row: 1; grid-column: 2; }

/* toggle switch */
.ck-switch { position: relative; display: inline-flex; align-items: center; }
.ck-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ck-track {
  width: 44px; height: 26px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.16);
  transition: background 180ms ease, border-color 180ms ease;
  display: inline-flex; align-items: center; padding: 2px;
}
.ck-knob { width: 20px; height: 20px; border-radius: 999px; background: #fff; transition: transform 200ms cubic-bezier(0.22,1,0.36,1); box-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.ck-switch input:checked + .ck-track { background: var(--imperum-red, #EF3341); border-color: var(--imperum-red, #EF3341); }
.ck-switch input:checked + .ck-track .ck-knob { transform: translateX(18px); }
.ck-switch input:focus-visible + .ck-track { outline: 2px solid var(--imperum-red-300, #FF6E78); outline-offset: 2px; }
.ck-switch input:disabled + .ck-track { cursor: not-allowed; }

.ck-always {
  font: 600 11px/1 var(--font-mono, sans-serif); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--resolve-green, #22C55E); background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3); border-radius: 999px; padding: 7px 11px; white-space: nowrap;
}

.ck-modal__foot {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end;
  padding: 18px 26px 24px; border-top: 1px solid rgba(255,255,255,0.07);
}
.ck-modal__foot .ck-btn--save { margin-left: auto; }
@media (max-width: 520px) {
  .ck-modal__foot { padding: 16px; }
  .ck-modal__foot .ck-btn { flex: 1 1 100%; margin-left: 0; }
  .ck-cat { grid-template-columns: 1fr; }
  .ck-cat__state { grid-row: auto; grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ck-banner, .ck-scrim, .ck-modal, .ck-knob { animation: none !important; transition: none !important; }
}
