/* =============================================================
   phase5.css — Double-Bezel Stat Cards
   Scope: index.html .dbs-* only
   Constraint: black / white / gray only — no hue except amber pulse dot
   ============================================================= */

/* ── SECTION WRAPPER ───────────────────────────────────────── */
.dbs-section {
  background: var(--surface-container-low);
  padding: 56px 5vw;
  border-bottom: 1px solid var(--outline-variant);
  position: relative;
  z-index: 1;
}

/* ── 4-COLUMN GRID ─────────────────────────────────────────── */
.dbs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
}

/* ── OUTER SHELL (Doppelrand layer 1) ──────────────────────── */
.dbs-outer {
  border-radius: 2rem;
  padding: 6px;                         /* p-1.5 equivalent */
  background: rgba(0, 0, 0, 0.04);     /* bg-black/4 */
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.07),     /* ring-1 ring-black/7 */
    inset 0 1px 0 rgba(255,255,255,0.6); /* inner top highlight */
  transition: box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              transform  0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.dbs-outer:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.10),
    0 8px 28px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.7);
}

/* ── INNER CORE (Doppelrand layer 2) ───────────────────────── */
.dbs-inner {
  border-radius: calc(2rem - 0.375rem); /* concentric — mathematically correct */
  background: var(--surface-container-lowest, #fff);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.05),  /* depth cavity */
    inset 0 1px 2px rgba(0, 0, 0, 0.04),
    0 1px 0 rgba(255,255,255,0.9);        /* bottom edge lift */
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

/* ── VALUE ROW (value + pulse dot side by side) ────────────── */
.dbs-value-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── VALUE NUMBER ───────────────────────────────────────────── */
.dbs-value {
  font-family: var(--display);
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--on-surface);
  line-height: 1;
}

/* ── LABEL ──────────────────────────────────────────────────── */
.dbs-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--outline);
  font-weight: 400;
  line-height: 1.5;
}

/* ── AMBER BREATHING PULSE DOT ─────────────────────────────── */
/*  Only exception to the B&W constraint — per spec.           */
.dbs-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;                  /* amber-400 */
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
  flex-shrink: 0;
  animation: dbsPulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  will-change: transform, box-shadow;
}

@keyframes dbsPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.45);
  }
  50% {
    transform: scale(1.35);
    box-shadow: 0 0 0 7px rgba(245, 158, 11, 0);
  }
}

/* ── ENTRY ANIMATION (IntersectionObserver adds .dbs-visible) ── */
.dbs-outer {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity  0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.dbs-outer.dbs-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger via nth-child */
.dbs-outer:nth-child(1) { transition-delay: 0ms; }
.dbs-outer:nth-child(2) { transition-delay: 80ms; }
.dbs-outer:nth-child(3) { transition-delay: 160ms; }
.dbs-outer:nth-child(4) { transition-delay: 240ms; }

/* ── REDUCED MOTION ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .dbs-outer {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .dbs-pulse-dot {
    animation: none;
  }
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .dbs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 520px) {
  .dbs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .dbs-inner {
    padding: 20px 18px 16px;
  }
  .dbs-outer {
    border-radius: 1.5rem;
  }
  .dbs-inner {
    border-radius: calc(1.5rem - 0.375rem);
  }
}
