/* /home2/qgcmhemy/dashboard.cdarsministries.org/assets/departments/departments.css
   CDARS — Departments Lobby (12 Domains) — SEALED UI (v2.0)
*/

:root{
  --bg0:#05060a;
  --bg1:#070915;
  --cardA: rgba(11,16,32,.92);
  --cardB: rgba(6,8,16,.92);

  --line: rgba(255,255,255,.10);
  --line2: rgba(255,255,255,.16);

  --text:#e9eefc;
  --muted: rgba(233,238,252,.72);

  --shadow: 0 20px 70px rgba(0,0,0,.55);
  --shadow2: 0 18px 60px rgba(0,0,0,.35);

  --gold:#ffd24d;
  --focus: rgba(255,210,77,.55);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

/* Cosmic field + grain */
.page-wrap{
  min-height:100vh;
  background:
    radial-gradient(1200px 600px at 15% 10%, rgba(120,220,255,.09), transparent 60%),
    radial-gradient(1000px 700px at 80% 18%, rgba(255,210,77,.08), transparent 60%),
    radial-gradient(900px 600px at 40% 86%, rgba(160,120,255,.08), transparent 60%),
    linear-gradient(180deg, #04050a, #050613 55%, #04050a);
  padding: 52px 26px 88px;
  position:relative;
}
.page-wrap:before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  opacity:.55;
  filter: blur(.2px);
  mix-blend-mode: screen;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,.18) 0, transparent 60%),
    radial-gradient(1px 1px at 25% 70%, rgba(255,255,255,.10) 0, transparent 60%),
    radial-gradient(1px 1px at 55% 40%, rgba(255,255,255,.12) 0, transparent 60%),
    radial-gradient(1px 1px at 80% 30%, rgba(255,255,255,.10) 0, transparent 60%),
    radial-gradient(1px 1px at 90% 75%, rgba(255,255,255,.09) 0, transparent 60%);
}

@media (max-width:480px){
  .page-wrap{ padding: 34px 14px 74px; }
}

.wrap{
  max-width: 1220px;
  margin: 0 auto;
  position:relative;
  z-index:1;
}

.top{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 18px;
  flex-wrap:wrap;
  margin-bottom: 18px;
}

.h1{
  margin:0;
  font-family: "Playfair Display", serif;
  font-size: 44px;
  letter-spacing:.2px;
}
.p{
  margin: 10px 0 0;
  max-width: 860px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 15.5px;
}

@media (max-width: 980px){
  .h1{ font-size: 38px; }
}
@media (max-width: 640px){
  .h1{ font-size: 34px; }
}

/* Buttons */
.top-actions{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  align-items:center;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  color: var(--text);
  text-decoration:none;
  font-weight: 700;
  font-size: 13px;
  user-select:none;
  white-space:nowrap;
  transition: transform .18s ease, border-color .18s ease, filter .18s ease, box-shadow .18s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  will-change: transform;
  cursor:pointer;
}
.btn:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.22);
  filter: brightness(1.07);
}
.btn.primary{
  border-color: rgba(255,210,77,.38);
  background: linear-gradient(180deg, rgba(255,210,77,.18), rgba(255,210,77,.06));
  box-shadow:
    0 0 0 1px rgba(255,210,77,.10),
    0 12px 40px rgba(255,210,77,.10),
    0 10px 30px rgba(0,0,0,.25);
}
.btn:focus-visible{
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* Grid */
.grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:18px;
  margin-top: 18px;
}
@media (max-width: 1000px){ .grid{ grid-template-columns:repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px){ .grid{ grid-template-columns:1fr; } }

/* Cards */
.card{
  position:relative;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 22px;
  overflow:hidden;
  padding: 18px 18px 16px;
  background:
    radial-gradient(900px 240px at 10% 0%, rgba(255,255,255,.06), transparent 60%),
    linear-gradient(180deg, var(--cardA), var(--cardB));
  box-shadow: var(--shadow);
  transform: translateY(0);
  transition: transform .18s ease, border-color .18s ease, filter .18s ease;
  will-change: transform;
}
.card:before{
  content:"";
  position:absolute;
  inset:-2px;
  
  /* Pointer-react anchor (JS writes --mx/--my) */
  background:
    radial-gradient(
      320px 200px
      at var(--mx, 18%) var(--my, 10%),
      var(--glow, rgba(255,210,77,.18)),
      transparent 62%
    );
  
  /* default off (activated on hover / focus / is-hovering) */
  opacity: 0;
  pointer-events:none;
  
  transition: opacity .22s ease;
}
.card:after{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(450px 220px at 85% 25%, rgba(120,220,255,.07), transparent 60%),
    radial-gradient(500px 240px at 20% 80%, rgba(255,210,77,.06), transparent 62%);
  opacity:.85;
  pointer-events:none;
  mix-blend-mode: screen;
}

.card:hover{
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.18);
  filter: brightness(1.04);
}

.card-top{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}

.kicker{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-size: 12px;
  letter-spacing:.16em;
  text-transform: uppercase;
  color: rgba(233,238,252,.70);
}

.dot{
  width:8px; height:8px;
  border-radius:999px;
  box-shadow: 0 0 18px rgba(255,255,255,.10);
}

.badge{
  position:relative;
  z-index:1;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: rgba(233,238,252,.85);
  cursor:pointer;
  transition: transform .18s ease, border-color .18s ease, filter .18s ease;
}
.badge:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.22);
  filter: brightness(1.06);
}
.badge:focus-visible{
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.title{
  position:relative;
  z-index:1;
  font-size: 22px;
  margin: 10px 0 6px;
  letter-spacing:.2px;
  font-weight: 900;
}
.sub{
  position:relative;
  z-index:1;
  margin:0 0 14px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13.6px;
}

.card-actions{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-top: 10px;
}

.enter{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--text);
  text-decoration:none;
  font-weight: 800;
  font-size: 13px;
  transition: transform .18s ease, border-color .18s ease, filter .18s ease, box-shadow .18s ease;
  box-shadow: var(--shadow2);
  min-width: 164px;
}
.enter:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.22);
  filter: brightness(1.07);
}
.enter:focus-visible{
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.mini{
  display:flex;
  align-items:center;
  gap: 10px;
  color: rgba(233,238,252,.62);
  font-size: 12.5px;
  user-select:none;
  white-space:nowrap;
}
.mini b{ color: rgba(233,238,252,.82); font-weight: 900; }
.mini-icn{ font-size: 16px; }

/* Legend */
.legend-wrap{
  margin-top: 26px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 22px;
  background: rgba(10,14,25,.55);
  padding: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
}
.legend-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap:wrap;
}
.legend-title{
  margin:0;
  font-size: 16px;
  letter-spacing:.12em;
  text-transform: uppercase;
  color: rgba(233,238,252,.82);
}
.legend-grid{
  margin-top: 14px;
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap: 12px;
}
@media (max-width: 980px){ .legend-grid{ grid-template-columns:repeat(3, minmax(0,1fr)); } }
@media (max-width: 720px){ .legend-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); } }

.color-tile{
  border-radius: 16px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(0,0,0,.12);
  cursor:pointer;
  box-shadow: 0 14px 40px rgba(0,0,0,.18);
  transition: transform .12s ease, filter .12s ease;
  user-select:none;
  text-align:left;
}
.color-tile:hover{ transform: translateY(-1px); filter: brightness(1.03); }
.color-tile:focus-visible{
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.color-name{ font-weight: 900; }
.color-domain{ font-size: 12px; opacity: .90; margin-top: 6px; font-weight: 800; }

.legend-foot{
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  flex-wrap:wrap;
}
.legend-note{
  color: rgba(233,238,252,.68);
  font-size: 13px;
}
.legend-actions{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  align-items:center;
}

/* Modal */
.modal-backdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.62);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 22px;
  z-index:9999;
}
.modal{
  width: min(860px, 96vw);
  border-radius: 24px;
  background: #fff;
  color: #0d1320;
  box-shadow: 0 40px 130px rgba(0,0,0,.55);
  overflow:hidden;
}
.modal-top{
  padding: 18px 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  border-bottom: 1px solid #00000012;
}
.modal-title{
  margin:0;
  font-size: 24px;
  font-weight: 1000;
  letter-spacing:.2px;
}
.modal-x{
  border:0;
  background: transparent;
  font-size: 26px;
  cursor:pointer;
  line-height: 1;
  opacity:.65;
}
.modal-x:hover{ opacity:.9; }
.modal-x:focus-visible{
  outline: 2px solid rgba(255,210,77,.55);
  outline-offset: 3px;
}
.modal-body{ padding: 18px 20px 22px; }
.swatch{
  border-radius: 16px;
  padding: 14px;
  font-weight: 900;
  display:flex;
  align-items:center;
  justify-content:center;
  margin: 12px 0 14px;
  border: 1px solid #00000014;
  text-align:center;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .btn,.enter,.badge,.card,.color-tile{ transition:none !important; }
}


/* ============================================================================
   ALIVE ENGINE — Breathing + Mouse Reactive Highlight (Departments)
   ============================================================================ */

/* Subtle “breathing” drift (professional, not cartoon) */
@keyframes deptBreath {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes deptGlowPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.05); }
}

/* Make cards alive by default - breathing is allowed only when NOT hovering/tilting */
.card.is-alive:not(.is-hovering){
  animation: deptBreath 6.6s ease-in-out infinite, deptGlowPulse 7.8s ease-in-out infinite;
  will-change: transform;
  transform: translateZ(0);
}

/* When JS is in control, CSS stops touching transform */
.card.is-hovering{
  animation: deptGlowPulse 7.8s ease-in-out infinite;
}

/* Mouse reactive highlight uses --mx/--my set by JS */
/* When hovering, bring in the light + tighten authority */
.card.is-hovering:before,
.card:hover:before{
  opacity: .95;
}

/* Add domainColor halo with controlled intensity - upgraded to use --glow */
.card.is-hovering{
  border-color: rgba(255,255,255,.18);
  box-shadow:
    0 22px 80px rgba(0,0,0,.45),
    0 0 0 1px rgba(255,255,255,.06) inset,
    0 0 60px color-mix(in srgb, var(--glow, #ffd24d) 55%, transparent);
}

/* Keep hover crisp but not violent */
.card:hover{
  filter: saturate(1.05) contrast(1.02);
}

/* Reduce motion: kill transforms/animations cleanly */
@media (prefers-reduced-motion: reduce){
  .card.is-alive{ animation: none !important; }
  .card{ transition: none !important; transform: none !important; }
}