/* =========================================================
   Departments page (night theme). Shared bar/signal/close: night.css.
   Night opener and index, Daylight department sections, night close.
   ========================================================= */

/* ---------- Opener ---------- */
.dx-hero { position: relative; min-height: 58svh; display: grid; align-items: end; overflow: clip; background: var(--night); color: #fff; }
.dx-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 42%; }
.dx-hero-scrim { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(11, 15, 20, 0.92) 0%, rgba(11, 15, 20, 0.7) 32%, rgba(11, 15, 20, 0) 68%); }
.dx-hero-copy { position: relative; z-index: 2; padding-block: clamp(96px, 20svh, 200px) clamp(40px, 7svh, 72px); }
.dx-title { margin: 0; font-size: clamp(3rem, 8vw, 7rem); line-height: 0.95; letter-spacing: -0.045em; color: #fff; }
.dx-lead { margin: 1.1rem 0 0; max-width: 44ch; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: #dde3ea; }
@media (prefers-reduced-motion: no-preference) {
  .dx-hero-img { animation: dx-settle 1.6s var(--sc-ease-out) both; }
}
@keyframes dx-settle { from { transform: scale(1.06); } to { transform: scale(1); } }

/* ---------- Sticky index with scroll-spy ---------- */
.dx-index { position: sticky; top: 68px; z-index: 40; background: rgba(11, 15, 20, 0.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.dx-index ul { list-style: none; display: flex; gap: 6px; margin: 0 auto; padding-block: 10px; overflow-x: auto; scrollbar-width: none; }
.dx-index a { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; text-decoration: none; color: rgba(245, 247, 250, 0.72); font-weight: 600; white-space: nowrap; transition: background-color 160ms var(--sc-ease-out), color 160ms var(--sc-ease-out); }
.dx-index a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.dx-index a[aria-current] { color: #fff; background: rgba(236, 109, 77, 0.18); box-shadow: inset 0 0 0 1px rgba(236, 109, 77, 0.55); }
.dx-index li { flex: none; }
.dx-index-badge { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; }
@media (max-width: 600px) { .dx-index a { padding: 4px 12px 4px 4px; gap: 8px; font-size: 0.92rem; } .dx-index-badge { width: 28px; height: 28px; } }

/* ---------- Department sections (Daylight) ---------- */
.dx-dept { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100svh - 68px - 53px); background: var(--bg); color: var(--text); border-bottom: 1px solid var(--border); scroll-margin-top: calc(68px + 53px); }
.dx-dept:nth-of-type(even) { background: var(--bg-alt); }
.dx-dept--trail .dx-media { order: 2; }
.dx-media { position: relative; margin: 0; overflow: clip; min-height: 320px; }
.dx-media img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; transform: scale(calc(1.14 - var(--sc-p, 0.5) * 0.14)); }
.dx-body { display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 7svh, 88px) clamp(24px, 5vw, 80px); }
.dx-badge { width: 60px; height: 60px; border-radius: 16px; object-fit: cover; margin-bottom: 1.2rem; box-shadow: 0 10px 24px -14px rgba(60, 45, 30, 0.5); }
.dx-badge-icon { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 1.8rem; }
.dx-name { margin: 0; font-size: clamp(2rem, 3.4vw, 3.2rem); line-height: 1.02; letter-spacing: -0.035em; }
.dx-short { color: var(--muted); font-family: var(--font); font-weight: 500; font-size: 0.42em; letter-spacing: 0; margin-left: 4px; }
.dx-sum { margin: 0.9rem 0 0; max-width: 46ch; color: var(--muted); font-size: 1.08rem; }
.dx-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 40px; margin-top: 2rem; }
.dx-lists h3 { font-family: var(--font); font-size: 0.95rem; font-weight: 600; color: var(--text); margin: 0 0 0.8rem; }
.dx-item { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 0.55rem; font-size: 0.98rem; color: var(--text); }
.dx-item .icon { color: var(--accent); margin-top: 0.22em; font-size: 1em; }
.dx-body .btn-row { margin-top: 2rem; }
.dx-docs { padding-block: 1.5rem; text-align: center; color: var(--muted); font-size: 0.95rem; margin: 0 auto; }
.dx-docs a { color: var(--accent); }
@media (max-width: 960px) {
  .dx-dept { grid-template-columns: 1fr; min-height: 0; }
  .dx-dept--trail .dx-media { order: 0; }
  .dx-media { min-height: 0; aspect-ratio: 16 / 9; }
  .dx-lists { grid-template-columns: 1fr; gap: 20px; }
}
@media (prefers-reduced-motion: reduce) { .dx-media img { transform: none; } }
