/* architect-wib.css — "Watch It Build" demo styles.
 * Inherits the architect page's obsidian + garnet tokens (defined in the
 * page's critical CSS): --garnet-main/-bright/-glow/-rim, --bg-obsidian,
 * --glass-bg, --glass-border, --text-*, --font-heading/-mono. */

.arc-wib .wib {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* ── Preset chips (radiogroup) ─────────────────────────────────────────── */
.wib-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.wib-chip {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0.6rem 1.05rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(6px);
}
.wib-chip:hover {
  color: var(--text-primary);
  border-color: var(--garnet-rim);
  transform: translateY(-1px);
}
.wib-chip[aria-checked="true"] {
  color: #fff;
  border-color: var(--garnet-main);
  box-shadow: 0 0 0 1px var(--garnet-main), 0 6px 22px rgba(170, 26, 51, 0.28);
  background: linear-gradient(180deg, rgba(170, 26, 51, 0.22), rgba(15, 15, 15, 0.6));
}
.wib-chip:focus-visible {
  outline: 2px solid var(--garnet-bright);
  outline-offset: 2px;
}

/* ── Build control ─────────────────────────────────────────────────────── */
.wib-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.wib-build {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--garnet-main);
  border: 1px solid var(--garnet-rim);
  border-radius: 8px;
  padding: 0.85rem 1.6rem;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(170, 26, 51, 0.25);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
}
.wib-build:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--garnet-bright);
  box-shadow: 0 10px 32px rgba(170, 26, 51, 0.45);
}
.wib-build:disabled {
  opacity: 0.6;
  cursor: progress;
}
.wib-build:focus-visible {
  outline: 2px solid var(--garnet-bright);
  outline-offset: 3px;
}

/* ── Stage cards ───────────────────────────────────────────────────────── */
.wib-stages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.wib-stage {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  transition: border-color 0.3s, opacity 0.3s;
  opacity: 0.55;
}
.wib-stage[data-state="running"],
.wib-stage[data-state="done"] {
  opacity: 1;
}
.wib-stage[data-state="running"] {
  border-color: var(--garnet-rim);
}
.wib-stage[data-state="done"] {
  border-color: rgba(170, 26, 51, 0.35);
}
.wib-stage[data-state="error"] {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.12);
}

.wib-stage__dot {
  width: 14px;
  height: 14px;
  margin-top: 0.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  justify-self: center;
  position: relative;
}
.wib-stage[data-state="running"] .wib-stage__dot {
  background: var(--garnet-main);
  box-shadow: 0 0 0 0 var(--garnet-glow);
  animation: wibPulse 1.4s ease-out infinite;
}
.wib-stage[data-state="done"] .wib-stage__dot {
  background: var(--garnet-bright);
  box-shadow: 0 0 10px var(--garnet-glow);
}
.wib-stage[data-state="error"] .wib-stage__dot {
  background: rgba(255, 255, 255, 0.25);
}
@keyframes wibPulse {
  0% { box-shadow: 0 0 0 0 var(--garnet-glow); }
  70% { box-shadow: 0 0 0 10px rgba(170, 26, 51, 0); }
  100% { box-shadow: 0 0 0 0 rgba(170, 26, 51, 0); }
}

.wib-stage__body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.wib-stage__label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}
.wib-stage__sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.wib-stage__out:not(:empty) {
  margin-top: 0.75rem;
}

/* ── Stage outputs ─────────────────────────────────────────────────────── */
.wib-plan {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.wib-img {
  display: block;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
}
.wib-audio {
  width: 100%;
  max-width: 420px;
}
.wib-3d {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: radial-gradient(ellipse at center, rgba(214, 58, 82, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
}
.wib-note {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}
a.wib-note {
  color: var(--garnet-bright);
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .wib-stage[data-state="running"] .wib-stage__dot {
    animation: none;
  }
  .wib-chip,
  .wib-build {
    transition: none;
  }
}

@media (max-width: 640px) {
  .wib-img,
  .wib-audio,
  .wib-3d {
    max-width: 100%;
  }
}
