/* ============================================================
   Architectural drawings for case studies
   Loaded only by pages that contain drawings (stateful-robotics, prismea).
   Architectural: 1px strokes, no fills, square corners,
   ink plus the site's single deep blue accent.
   ============================================================ */

.dw-figure {
  --dw-grid: #e9ecf0;
  margin-top: 3.6rem;
  margin-bottom: 4rem;
}

.dw-kicker {
  display: block;
  margin-bottom: 1.6rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--body);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.dw-figure figcaption {
  max-width: 36rem;
  margin-top: 1.4rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-faint);
}

.dw-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dw-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.dw-hint {
  display: none;
}

@media (max-width: 720px) {
  .dw-scroll .dw-svg {
    min-width: 660px;
  }
  .dw-scroll .dw-map-svg {
    min-width: 540px;
  }
  .dw-hint {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.78rem;
    font-style: italic;
    color: var(--ink-faint);
  }
}

/* Lines */
.dw-figure .ln {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
}

.dw-figure .ln-soft { stroke: var(--ink-faint); }
.dw-figure .ln-rule { stroke: var(--rule); }
.dw-figure .ln-wall { stroke: var(--ink-soft); }
.dw-figure .ln-accent { stroke: var(--accent); }
.dw-figure .ln-strong { stroke-width: 1.5; }
.dw-figure .ln-pred { stroke-dasharray: 6 4; }
.dw-figure .ln-inf { stroke-dasharray: 1.5 3; }
.dw-figure .ln-grid {
  fill: none;
  stroke: var(--dw-grid);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* Shapes that sit on top of a line hide it with the paper colour. */
.dw-figure .node { fill: var(--paper); }

/* Type */
.dw-svg text,
.dw-spec text {
  font-family: var(--body);
  font-size: 11.5px;
  fill: var(--ink-soft);
  font-variant-numeric: lining-nums tabular-nums;
}

.dw-svg .t-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  fill: var(--ink);
}

.dw-svg .t-room {
  font-size: 9px;
  letter-spacing: 0.16em;
  fill: var(--ink-faint);
}

.dw-svg .t-note {
  font-family: var(--display);
  font-style: italic;
  font-size: 13px;
  fill: var(--ink-faint);
}

.dw-svg .t-small { font-size: 11px; fill: var(--ink-faint); }
.dw-svg .t-ink { fill: var(--ink); }
.dw-svg .t-faint { fill: var(--ink-faint); }
.dw-svg .t-accent { fill: var(--accent); }

.dw-svg .t-robot,
.dw-spec .t-robot {
  font-size: 9.5px;
  font-weight: 600;
  fill: var(--ink);
}

/* The map and its key */
.dw-map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 13.5rem;
  gap: 2.4rem;
  align-items: start;
}

.dw-legend {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dw-legend li {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  padding: 0.6rem 0;
  border-top: 1px solid var(--rule);
}

.dw-legend li:first-child {
  border-top: none;
  padding-top: 0;
}

.dw-legend p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.42;
  color: var(--ink-soft);
}

.dw-legend strong {
  display: block;
  font-weight: 500;
  color: var(--ink);
}

.dw-spec {
  display: block;
  width: 3.2rem;
  height: auto;
  margin-top: 0.25rem;
  overflow: visible;
}

@media (max-width: 820px) {
  .dw-map {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }
  .dw-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    column-gap: 2rem;
  }
  .dw-legend li:first-child {
    border-top: 1px solid var(--rule);
    padding-top: 0.8rem;
  }
}

/* One moving element: the envelope around robot B's inferred position
   breathes outward, as the uncertainty does while it stays silent. */
@media (prefers-reduced-motion: no-preference) {
  .dw-env {
    animation: dw-env 4.8s ease-in-out infinite;
  }
  .dw-env-2 { animation-delay: 0.5s; }
  .dw-env-3 { animation-delay: 1s; }
}

@keyframes dw-env {
  0%, 100% { opacity: 0.25; }
  45% { opacity: 1; }
}
