/* ================================================================
   ROBSEEK — Diagrams CSS
   ================================================================ */
.dg { width: 100%; max-width: 560px; height: auto; display: block; margin: 0 auto; }

/* ============ LAYER STACK ============ */
.dg-stack {
  position: relative;
  display: grid;
  gap: 1px;
  background: var(--rs-hairline);
  border: 1px solid var(--rs-hairline-2);
}
.dg-stack__layer {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 26px 28px;
  background: var(--rs-ink);
  transition: background var(--rs-dur) var(--rs-ease), border-color var(--rs-dur) var(--rs-ease);
  position: relative;
  cursor: default;
}
.dg-stack__layer.is-hov { background: var(--rs-panel); }
.dg-stack__layer.is-accent { background: var(--rs-panel); }
.dg-stack__layer.is-accent.is-hov { background: var(--rs-panel-2); }
.dg-stack__layer.is-accent::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--rs-red);
}
.dg-stack__layer-num {
  font-family: var(--rs-mono);
  font-size: 14px;
  letter-spacing: 0.15em;
  color: var(--rs-red);
}
.dg-stack__layer-label {
  font-family: var(--rs-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--rs-white);
}
.dg-stack__layer-sub {
  color: var(--rs-gray-1);
  font-size: 13.5px;
  margin-top: 4px;
}
.dg-stack__layer-marks {
  display: flex;
  gap: 3px;
}
.dg-stack__layer-marks span {
  width: 2px; height: 16px; background: var(--rs-hairline-2);
  transition: background var(--rs-dur) var(--rs-ease);
}
.dg-stack__layer.is-hov .dg-stack__layer-marks span:nth-child(-n+4) { background: var(--rs-red); }
.dg-stack__axis {
  display: flex;
  justify-content: space-between;
  padding: 10px 28px 0;
  font-family: var(--rs-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rs-gray-2);
  background: transparent;
  border-top: 0;
}
.dg-stack > .dg-stack__axis { background: var(--rs-ink); }

/* ============ THREE-TIER ============ */
.dg-tier {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rs-hairline);
  border: 1px solid var(--rs-hairline-2);
  position: relative;
}
.dg-tier__col {
  background: var(--rs-ink);
  padding: 32px 28px 36px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.dg-tier__hdr { display: flex; align-items: baseline; gap: 16px; margin-bottom: 14px; }
.dg-tier__roman {
  font-family: var(--rs-display);
  font-size: 44px;
  font-weight: 600;
  color: var(--rs-red);
  line-height: 1;
}
.dg-tier__label {
  font-family: var(--rs-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--rs-white);
}
.dg-tier__count {
  font-family: var(--rs-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rs-gray-1);
  margin-top: 4px;
}
.dg-tier__desc {
  color: var(--rs-cream);
  font-size: 14px;
  line-height: 1.55;
  margin: 6px 0 28px;
}
.dg-tier__matrix {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 220px;
}
.dg-tier__matrix span {
  width: 10px; height: 10px;
  background: var(--rs-red);
  opacity: 0.85;
  animation: dgBlink 2.4s var(--rs-ease) infinite;
}
.dg-tier__col--mid .dg-tier__matrix span { opacity: 0.75; }
.dg-tier__col--sparse .dg-tier__matrix span { width: 14px; height: 14px; opacity: 0.55; background: var(--rs-beige); }
@keyframes dgBlink {
  0%, 100% { opacity: 0.2; }
  40%      { opacity: 0.9; }
}
.dg-tier__axis {
  position: absolute;
  left: 0; right: 0; bottom: -32px;
  display: flex; justify-content: space-between;
  padding: 0 4px;
  font-family: var(--rs-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rs-gray-2);
}
@media (max-width: 900px) {
  .dg-tier { grid-template-columns: 1fr; }
  .dg-tier__axis { display: none; }
}

/* ============ MAP ============ */
.dg-map { width: 100%; height: auto; aspect-ratio: 2 / 1; }

/* ============ TIMELINE ============ */
.dg-tl { position: relative; padding: 20px 0 4px; }
.dg-tl__rule {
  position: absolute;
  left: 0; right: 0;
  top: 38px;
  height: 1px;
  background: var(--rs-hairline-2);
}
.dg-tl__row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  position: relative;
}
.dg-tl__step { position: relative; padding-top: 56px; }
.dg-tl__year {
  position: absolute; top: 0; left: 0;
  font-family: var(--rs-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--rs-gray-1);
}
.dg-tl__dot {
  position: absolute;
  left: 0; top: 32px;
  width: 12px; height: 12px;
  border: 2px solid var(--rs-hairline-2);
  background: var(--rs-ink);
  border-radius: 50%;
}
.dg-tl__step.is-active .dg-tl__year { color: var(--rs-red); }
.dg-tl__step.is-active .dg-tl__dot {
  border-color: var(--rs-red);
  background: var(--rs-red);
  box-shadow: 0 0 0 4px var(--rs-red-glow);
}
.dg-tl__label {
  font-family: var(--rs-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--rs-white);
  margin-bottom: 8px;
}
.dg-tl__desc {
  color: var(--rs-gray-1);
  font-size: 13px;
  line-height: 1.55;
}
@media (max-width: 900px) {
  .dg-tl__rule { left: 6px; width: 1px; height: 100%; top: 0; right: auto; }
  .dg-tl__row { grid-template-columns: 1fr; gap: 32px; }
  .dg-tl__step { padding: 0 0 0 32px; }
  .dg-tl__year { position: relative; }
  .dg-tl__dot { left: 0; top: 4px; }
}
