/* =====================================================================
   Deep Data — The Bureau of Deep Statistics
   Page-only styles. Shared tokens live in abyss.css.
   ===================================================================== */

/* ------------------------------------------------------------- hero */
.dd-hero { position: relative; padding: clamp(56px, 8vw, 110px) 0 clamp(40px, 5vw, 64px); overflow: hidden; }
.dd-fan { inset: -10% -10% auto -10%; height: 120%; opacity: .18; }
.dd-hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: end; }
.dd-title { margin: 20px 0 22px; max-width: 13ch; }
.dd-hero-tags { margin-top: 26px; }
@media (max-width: 980px) { .dd-hero-grid { grid-template-columns: minmax(0, 1fr); } }

/* live terminal */
.dd-term { padding: 22px 22px 18px; font-family: var(--f-mono); font-size: 12.5px; }
.dd-term-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 10.5px; letter-spacing: .18em; color: var(--gold-hi); padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.dd-led { width: 7px; height: 7px; border-radius: 50%; background: var(--bio); box-shadow: 0 0 10px var(--bio); animation: pulse 1.8s infinite; }
.dd-term-rows { margin: 10px 0 0; }
.dd-term-rows > div { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px dashed rgba(160, 205, 220, .08); }
.dd-term-rows dt { color: var(--ink-3); flex-shrink: 0; }
.dd-term-rows dt::after { content: ''; }
.dd-term-rows dd { margin-left: auto; display: flex; align-items: baseline; gap: 10px; min-width: 0; text-align: right; }
.dd-term-rows dd b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dd-term-rows dd span { color: var(--ink-4); font-size: 11px; white-space: nowrap; }
.dd-log { margin-top: 12px; height: 74px; overflow: hidden; color: var(--ink-3); font-size: 11px; line-height: 1.65; mask-image: linear-gradient(180deg, transparent, #000 30%); -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%); }
.dd-log p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: dd-line .5s var(--ease-out) both; }
.dd-log p b { color: var(--gold); font-weight: 400; }
.dd-log p:last-child::after { content: '▍'; color: var(--bio); margin-left: 4px; animation: dd-blink 1s steps(2) infinite; }
@keyframes dd-line { from { opacity: 0; transform: translateY(8px); } }
@keyframes dd-blink { 50% { opacity: 0; } }
@media (max-width: 420px) { .dd-term-rows dd span { display: none; } }

/* KPI tiles */
.dd-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); margin-top: clamp(36px, 5vw, 64px); }
.dd-kpis .card { padding: 20px 22px; }
.dd-kpis .stat .v { font-size: clamp(1.8rem, 3.2vw, 2.7rem); white-space: nowrap; }
@media (max-width: 1080px) { .dd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 400px) { .dd-kpis .card { padding: 16px; } .dd-kpis .stat .v { font-size: 1.6rem; } }

/* -------------------------------------------------------- filter bar */
.dd-filter {
  position: sticky; top: calc(var(--nav-h) + var(--ticker-h)); z-index: 60;
  background: rgba(3, 13, 21, .82); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
}
.dd-filter-in { display: flex; align-items: center; gap: 18px; min-height: 56px; }
.dd-range { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--hair-2); border-radius: 999px; flex-shrink: 0; }
.dd-range-lbl { font-size: 9.5px; letter-spacing: .2em; color: var(--ink-4); padding: 0 8px 0 10px; }
.dd-chip { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .06em; color: var(--ink-3); padding: 6px 11px; border-radius: 999px; transition: color .2s, background .2s, box-shadow .2s; }
.dd-chip:hover { color: var(--ink); background: rgba(160, 205, 220, .07); }
.dd-chip[aria-pressed="true"] { color: #1b1305; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); box-shadow: 0 4px 16px -6px rgba(230, 192, 105, .7); }
.dd-status { font-size: 11px; letter-spacing: .08em; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dd-status b { color: var(--gold-hi); font-weight: 500; }
.dd-depts { display: flex; gap: 2px; margin-left: auto; flex-shrink: 0; }
.dd-depts a { font-size: 12.5px; color: var(--ink-3); padding: 6px 10px; border-radius: 999px; transition: color .2s, background .2s; white-space: nowrap; }
.dd-depts a:hover { color: var(--ink); }
.dd-depts a.on { color: var(--gold-hi); background: rgba(230, 192, 105, .08); }
@media (max-width: 1240px) { .dd-depts { display: none; } }
@media (max-width: 720px) {
  .dd-filter-in { flex-direction: column; align-items: stretch; gap: 6px; padding-top: 8px; padding-bottom: 8px; min-height: 0; }
  .dd-range { overflow-x: auto; scrollbar-width: none; justify-content: space-between; }
  .dd-range::-webkit-scrollbar { display: none; }
  .dd-range-lbl { display: none; }
  .dd-chip { padding: 6px 9px; flex: 1; }
  .dd-status { text-align: center; font-size: 10px; }
}

/* -------------------------------------------------------- departments */
.dd-dept { padding: clamp(56px, 8vw, 104px) 0 0; }
.dd-dept-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: clamp(16px, 2.6vw, 32px); align-items: end; margin-bottom: clamp(22px, 3vw, 36px); padding-bottom: clamp(18px, 2.4vw, 26px); border-bottom: 1px solid var(--hair); }
.dd-numeral { font-family: var(--f-display); font-style: italic; font-size: clamp(3.6rem, 8vw, 7rem); line-height: .8; color: transparent; -webkit-text-stroke: 1px rgba(230, 192, 105, .6); }
.dd-dept-head .h-1 { margin: 10px 0 8px; }
.dd-dept-head .body-2 { max-width: 60ch; font-size: .98rem; }
@media (max-width: 640px) {
  .dd-dept-head { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .dd-dept-head > .tag { justify-self: start; }
  .dd-numeral { font-size: 3.4rem; }
}

.bento { grid-auto-flow: dense; align-items: stretch; }
.bento .chart-card { min-width: 0; }
.bento .chart-card .chart-foot { margin-top: 2px; }
.chart-card .chart-title { margin: 0; }
.chart-card .chart-foot a { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 721px) and (max-width: 1080px) {
  .bento > .span-4, .bento > .span-5, .bento > .span-6, .bento > .span-7 { grid-column: span 6; }
  .bento > .span-8, .bento > .span-12 { grid-column: span 12; }
}
@media (max-width: 720px) { .bento .card { padding: 18px 16px; } }

/* -------------------------------------------------------- methodology */
.dd-method { padding-top: clamp(80px, 10vw, 140px); }
.dd-method-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: clamp(28px, 5vw, 80px); margin-top: clamp(40px, 6vw, 72px); }
.dd-method-list { list-style: none; counter-reset: m; display: grid; gap: 4px; }
.dd-method-list li { counter-increment: m; position: relative; padding: 18px 0 18px 64px; border-bottom: 1px solid var(--hair); color: var(--ink-2); line-height: 1.6; }
.dd-method-list li::before { content: counter(m, upper-roman) '.'; position: absolute; left: 0; top: 14px; font-family: var(--f-display); font-style: italic; font-size: 1.7rem; color: var(--gold); line-height: 1; }
.dd-method-list b { color: var(--ink); font-weight: 600; }
.dd-disclaimer { margin-top: clamp(48px, 6vw, 80px); }
.dd-disclaimer-in { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: end; }
@media (max-width: 860px) {
  .dd-method-grid, .dd-disclaimer-in { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) { .dd-method-list li { padding-left: 48px; } }

/* keep plots centered when a card stretches to its row-mate's height */
.bento .chart-card .chart-plot { margin: auto 0; }
@media (max-width: 520px) { .dd-hero .eyebrow .num { display: none; } }
