/* 09-mud-room (tmud): Calm at Every Entry */
.tmud-root {
  margin: 0 auto;
  max-width: 1080px;
  padding: clamp(1rem, 2.5vw, 1.75rem);
  background: linear-gradient(180deg, #faf7f2 0%, #ffffff 100%);
  border: 1px solid #e0dbd0;
  border-radius: var(--tcr-radius-lg, 20px);
  box-shadow: var(--tcr-shadow, 0 12px 32px -12px rgba(14, 122, 142, 0.14));
  color: var(--tcr-navy, #212326);
  font-family: var(--tcr-font-sans, 'Inter', system-ui, sans-serif);
  box-sizing: border-box;
  overflow: hidden;
}

.tmud-root *,
.tmud-root *::before,
.tmud-root *::after {
  box-sizing: border-box;
}

.tmud-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.95rem;
}

.tmud-titles {
  min-width: 0;
  flex: 1 1 240px;
}

.tmud-root .tmud-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tcr-teal-ink, #0a6575);
}

.tmud-root .tmud-title {
  margin: 0;
  font-family: var(--tcr-font-display, 'Quicksand', system-ui, sans-serif);
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--tcr-navy, #212326);
}

.tmud-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.tmud-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 2px solid var(--tcr-teal, #0e7a8e);
  border-radius: 999px;
  background: #ffffff;
  color: var(--tcr-teal-ink, #0a6575);
  font-family: var(--tcr-font-sans, 'Inter', system-ui, sans-serif);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.tmud-toggle:hover {
  background: var(--tcr-teal-soft, #e6f4f7);
  border-color: var(--tcr-teal-d, #0b6b7c);
  color: var(--tcr-navy, #212326);
}

.tmud-toggle:active {
  transform: scale(0.98);
}

.tmud-toggle[aria-pressed="true"] {
  background: var(--tcr-teal, #0e7a8e);
  border-color: var(--tcr-teal-d, #0b6b7c);
  color: #ffffff;
}

.tmud-toggle-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tcr-teal-l, #1aa3be);
  flex: 0 0 auto;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.tmud-toggle[aria-pressed="true"] .tmud-toggle-dot {
  background: var(--tcr-led, #ffdfa0);
  transform: scale(1.2);
}

.tmud-motion-slot {
  display: inline-flex;
  align-items: center;
}

.tmud-stage {
  position: relative;
  border: 1px solid #d9d3c6;
  border-radius: var(--tcr-radius, 14px);
  background: #faf7f2;
  overflow: hidden;
}

.tmud-svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Resting still state: complete, lit cabinetry */
.tmud-blueprint {
  opacity: 0.14;
}

.tmud-cabinetry {
  opacity: 1;
}

.tmud-leds {
  opacity: 0.85;
}

.tmud-rush-zones {
  opacity: 0;
  transition: opacity 0.28s ease;
}

.tmud-basket {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.tmud-key-glint {
  opacity: 0.22;
  transform-box: fill-box;
  transform-origin: center;
}

/* Hidden Touch: Morning Rush state */
.tmud-rush .tmud-rush-zones {
  opacity: 1;
}

.tmud-rush .tmud-leds {
  opacity: 1;
}

.tmud-rush .tmud-basket-1 {
  transform: translate(-3px, -5px);
}

.tmud-rush .tmud-basket-2 {
  transform: translate(3px, -5px);
}

/* Arrival choreography (only armed when JS + motion allowed) */
.tmud-arm .tmud-blueprint {
  opacity: 0.94;
}

.tmud-arm .tmud-bp-line {
  stroke-dasharray: 2200;
  stroke-dashoffset: 2200;
}

.tmud-arm .tmud-cabinetry {
  opacity: 0.06;
}

.tmud-arm .tmud-leds {
  opacity: 0;
}

.tmud-arm.tmud-play .tmud-bp-line {
  animation: tmud-draw 1.15s cubic-bezier(0.32, 0.08, 0.24, 1) forwards;
}

.tmud-arm.tmud-play .tmud-blueprint {
  animation: tmud-bp-settle 2.1s ease forwards;
}

.tmud-arm.tmud-play .tmud-cabinetry {
  animation: tmud-cab-in 0.95s ease 0.55s forwards;
}

.tmud-arm.tmud-play .tmud-leds {
  animation: tmud-led-on 0.9s ease 1.15s forwards;
}

@keyframes tmud-draw {
  0% { stroke-dashoffset: 2200; }
  100% { stroke-dashoffset: 0; }
}

@keyframes tmud-bp-settle {
  0%, 58% { opacity: 0.94; }
  100% { opacity: 0.14; }
}

@keyframes tmud-cab-in {
  0% { opacity: 0.06; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes tmud-led-on {
  0% { opacity: 0; }
  100% { opacity: 0.85; }
}

.tmud-status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.95rem;
  border-top: 1px solid #e2ddd2;
  background: #ffffff;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--tcr-text, #434549);
}

.tmud-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tcr-teal, #0e7a8e);
  flex: 0 0 auto;
}

.tmud-rush .tmud-status-dot {
  background: var(--tcr-oak-ink, #6d4928);
}

.tmud-caption {
  margin-top: 0.95rem;
}

.tmud-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  counter-reset: tmud-step;
}

.tmud-step {
  counter-increment: tmud-step;
  position: relative;
  padding: 0.7rem 0.85rem 0.7rem 2.25rem;
  border: 1px solid #e5e0d5;
  border-radius: var(--tcr-radius-sm, 8px);
  background: #ffffff;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--tcr-text, #434549);
}

.tmud-step::before {
  content: counter(tmud-step);
  position: absolute;
  left: 0.7rem;
  top: 0.72rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--tcr-teal-soft, #e6f4f7);
  color: var(--tcr-teal-ink, #0a6575);
  font-size: 0.74rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.tmud-step strong {
  display: block;
  margin-bottom: 0.12rem;
  font-family: var(--tcr-font-display, 'Quicksand', system-ui, sans-serif);
  font-size: 0.92rem;
  color: var(--tcr-navy, #212326);
}

@media (max-width: 720px) {
  .tmud-steps {
    grid-template-columns: 1fr;
  }
  .tmud-toggle {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* Immediate freeze when TCRMotion pauses */
html.tcrm-paused .tmud-root *,
html.tcrm-paused .tmud-root *::before,
html.tcrm-paused .tmud-root *::after {
  animation-play-state: paused !important;
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .tmud-toggle,
  .tmud-toggle-dot,
  .tmud-rush-zones,
  .tmud-basket {
    transition: none !important;
  }
  .tmud-arm .tmud-blueprint,
  .tmud-arm .tmud-cabinetry,
  .tmud-arm .tmud-leds {
    opacity: 1;
  }
  .tmud-arm .tmud-blueprint {
    opacity: 0.14;
  }
  .tmud-arm .tmud-bp-line {
    stroke-dashoffset: 0;
  }
}
