/* 03-closets (tcls): Custom Closets Walk-In & Reach-In Anatomy */
.tcls-root {
  margin: 0;
  padding: clamp(1.25rem, 3vw, 2.5rem) clamp(0.75rem, 2.5vw, 1.5rem);
  background: var(--tcr-paper, #FFFFFF);
  color: var(--tcr-navy, #212326);
  font-family: var(--tcr-font-sans, 'Inter', system-ui, sans-serif);
  overflow-x: hidden;
  transition: background-color 0.55s ease, color 0.55s ease;
}

.tcls-root[data-tcls-light="evening"] {
  background: var(--tcr-deep, #0a1f24);
  color: #FFFFFF;
}

.tcls-frame {
  max-width: 1180px;
  margin: 0 auto;
  background: var(--tcr-warm, #FAF7F2);
  border: 1px solid var(--tcr-line, #e0e1e4);
  border-radius: var(--tcr-radius-lg, 20px);
  box-shadow: var(--tcr-shadow, 0 12px 32px -12px rgba(14, 122, 142, 0.14));
  padding: clamp(1rem, 2.5vw, 1.75rem);
  overflow: hidden;
  transition: background-color 0.55s ease, border-color 0.55s ease, box-shadow 0.55s ease;
}

.tcls-root[data-tcls-light="evening"] .tcls-frame {
  background: #132329;
  border-color: rgba(26, 163, 190, 0.35);
  box-shadow: 0 22px 50px -18px rgba(0, 0, 0, 0.65);
}

.tcls-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem 1.5rem;
  margin-bottom: 1.15rem;
}

.tcls-head-copy {
  flex: 1 1 320px;
  min-width: 0;
}

.tcls-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--tcr-teal-ink, #0a6575);
}

.tcls-root[data-tcls-light="evening"] .tcls-eyebrow {
  color: #9dd8e4;
}

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

.tcls-root[data-tcls-light="evening"] .tcls-title {
  color: #FFFFFF;
}

.tcls-sub {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--tcr-text, #434549);
  max-width: 58ch;
}

.tcls-root[data-tcls-light="evening"] .tcls-sub {
  color: #dce8eb;
}

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

.tcls-seg-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  background: #e9edf0;
  border: 1px solid var(--tcr-line-strong, #c8ccd2);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
}

.tcls-root[data-tcls-light="evening"] .tcls-seg-wrap {
  background: #0d191e;
  border-color: rgba(157, 216, 228, 0.3);
}

.tcls-seg,
.tcls-led-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--tcr-navy, #212326);
  font-family: var(--tcr-font-sans, 'Inter', system-ui, sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.1;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}

.tcls-seg:hover {
  background: rgba(14, 122, 142, 0.1);
}

.tcls-seg[aria-pressed="true"] {
  background: var(--tcr-teal, #0e7a8e);
  color: #FFFFFF;
}

.tcls-root[data-tcls-light="evening"] .tcls-seg {
  color: #e6f4f7;
}

.tcls-root[data-tcls-light="evening"] .tcls-seg[aria-pressed="true"] {
  background: var(--tcr-teal-l, #1aa3be);
  color: #0a1f24;
}

.tcls-led-btn {
  background: #FFFFFF;
  border-color: var(--tcr-teal, #0e7a8e);
  color: var(--tcr-teal-ink, #0a6575);
}

.tcls-led-btn:hover {
  background: var(--tcr-teal-soft, #e6f4f7);
}

.tcls-led-btn[aria-pressed="true"] {
  background: #212326;
  border-color: var(--tcr-led-glow, #f3c45a);
  color: var(--tcr-led, #ffdfa0);
}

.tcls-led-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tcr-oak, #c89b6e);
  box-shadow: 0 0 0 2px rgba(200, 155, 110, 0.25);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.tcls-led-btn[aria-pressed="true"] .tcls-led-dot {
  background: var(--tcr-led, #ffdfa0);
  box-shadow: 0 0 10px 2px rgba(243, 196, 90, 0.85);
}

.tcls-seg:focus-visible,
.tcls-led-btn:focus-visible {
  outline: 3px solid var(--tcr-teal, #0e7a8e);
  outline-offset: 2px;
}

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

.tcls-root[data-tcls-light="evening"] .tcls-motion-slot .tcrm-btn {
  background: #FFFFFF;
  color: #141617;
  border-color: rgba(255, 255, 255, 0.9);
}

.tcls-stage {
  position: relative;
  border-radius: var(--tcr-radius, 14px);
  border: 1px solid var(--tcr-line, #e0e1e4);
  background: #f6f2ea;
  overflow: hidden;
}

.tcls-root[data-tcls-light="evening"] .tcls-stage {
  border-color: rgba(26, 163, 190, 0.35);
  background: #0d1d23;
}

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

/* Lighting mode transitions inside SVG */
.tcls-plate-night {
  opacity: 0;
  transition: opacity 0.65s ease;
}

.tcls-root[data-tcls-light="evening"] .tcls-plate-night {
  opacity: 1;
}

.tcls-floor {
  transition: fill 0.65s ease;
}

.tcls-root[data-tcls-light="evening"] .tcls-floor {
  fill: #182930;
}

.tcls-bp-text {
  transition: fill 0.55s ease;
}

.tcls-root[data-tcls-light="evening"] .tcls-bp-text {
  fill: #9dd8e4;
}

.tcls-led-cone,
.tcls-led-floor {
  opacity: 0.7;
}

.tcls-root[data-tcls-light="evening"] .tcls-led-cone,
.tcls-root[data-tcls-light="evening"] .tcls-led-floor {
  opacity: 1;
}

/* Walk-In Island vs Reach-In System transitions */
.tcls-island {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1), transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.tcls-reachin-stack {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.tcls-mirror {
  opacity: 1;
  transition: opacity 0.45s ease;
}

.tcls-root[data-tcls-mode="reachin"] .tcls-island {
  opacity: 0;
  transform: translateY(26px);
  pointer-events: none;
}

.tcls-root[data-tcls-mode="reachin"] .tcls-mirror {
  opacity: 0;
}

.tcls-root[data-tcls-mode="reachin"] .tcls-reachin-stack {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Pre-arrival JS state (only added when motion is allowed) */
.tcls-root.tcls-wait .tcls-bp-line {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.tcls-root.tcls-wait .tcls-bp-text {
  opacity: 0;
}

.tcls-root.tcls-wait .tcls-cabinetry {
  opacity: 0;
}

.tcls-root.tcls-wait .tcls-led-strip,
.tcls-root.tcls-wait .tcls-led-cone,
.tcls-root.tcls-wait .tcls-led-floor {
  opacity: 0;
}

/* Arrival choreography (~2s): Blueprint -> Millwork -> 2700K LEDs */
.tcls-root.tcls-play .tcls-bp-line {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: tcls-draw 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.tcls-root.tcls-play .tcls-bp-d2 {
  animation-delay: 0.14s;
}

.tcls-root.tcls-play .tcls-bp-d3 {
  animation-delay: 0.28s;
}

.tcls-root.tcls-play .tcls-bp-text {
  opacity: 0;
  animation: tcls-fade-in 0.55s ease 0.4s forwards;
}

.tcls-root.tcls-play .tcls-cabinetry {
  opacity: 0;
  animation: tcls-fade-in 0.85s ease 0.65s forwards;
}

.tcls-root.tcls-play .tcls-led-strip {
  opacity: 0;
  animation: tcls-fade-in 0.55s ease 1.3s forwards;
}

.tcls-root.tcls-play .tcls-led-cone,
.tcls-root.tcls-play .tcls-led-floor {
  opacity: 0;
  animation: tcls-led-on 0.7s ease 1.4s forwards;
}

/* Continuous living motion after arrival */
.tcls-root.tcls-live .tcls-glass-sheen {
  animation: tcls-glass-sweep 5.4s ease-in-out infinite;
}

.tcls-garment {
  transform-box: fill-box;
  transform-origin: 50% 0%;
}

.tcls-root.tcls-live .tcls-sway-1 {
  animation: tcls-sway 4.2s ease-in-out infinite alternate;
}

.tcls-root.tcls-live .tcls-sway-2 {
  animation: tcls-sway 4.9s ease-in-out 0.6s infinite alternate-reverse;
}

.tcls-root.tcls-live .tcls-sway-3 {
  animation: tcls-sway 5.5s ease-in-out 1.1s infinite alternate;
}

.tcls-live-note {
  margin: 0;
  padding: 0.55rem 0.9rem;
  font-size: 0.82rem;
  color: var(--tcr-teal-ink, #0a6575);
  background: rgba(255, 255, 255, 0.82);
  border-top: 1px solid var(--tcr-line, #e0e1e4);
  transition: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease;
}

.tcls-root[data-tcls-light="evening"] .tcls-live-note {
  background: rgba(14, 42, 48, 0.92);
  color: #9dd8e4;
  border-top-color: rgba(26, 163, 190, 0.3);
}

.tcls-caption {
  margin-top: 1rem;
}

.tcls-zones {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.65rem;
}

.tcls-zone {
  background: #FFFFFF;
  border: 1px solid var(--tcr-line, #e0e1e4);
  border-radius: var(--tcr-radius-sm, 8px);
  padding: 0.65rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: background-color 0.45s ease, border-color 0.45s ease, color 0.45s ease;
}

.tcls-zone b {
  font-family: var(--tcr-font-display, 'Quicksand', system-ui, sans-serif);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--tcr-teal-ink, #0a6575);
}

.tcls-zone span {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--tcr-text, #434549);
}

.tcls-root[data-tcls-light="evening"] .tcls-zone {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(157, 216, 228, 0.22);
}

.tcls-root[data-tcls-light="evening"] .tcls-zone b {
  color: var(--tcr-led, #ffdfa0);
}

.tcls-root[data-tcls-light="evening"] .tcls-zone span {
  color: #dce8eb;
}

@keyframes tcls-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes tcls-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes tcls-led-on {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.7;
  }
}

@keyframes tcls-glass-sweep {
  0%, 15% {
    transform: translateX(-20px);
    opacity: 0;
  }
  45% {
    opacity: 0.36;
  }
  80%, 100% {
    transform: translateX(300px);
    opacity: 0;
  }
}

@keyframes tcls-sway {
  0% {
    transform: rotate(-0.9deg);
  }
  100% {
    transform: rotate(0.9deg);
  }
}

html.tcrm-paused .tcls-root *,
html.tcrm-paused .tcls-root *::before,
html.tcrm-paused .tcls-root *::after {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  .tcls-root,
  .tcls-root *,
  .tcls-root *::before,
  .tcls-root *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 640px) {
  .tcls-frame {
    padding: 0.9rem;
    border-radius: 14px;
  }
  .tcls-controls {
    width: 100%;
    justify-content: flex-start;
  }
  .tcls-seg {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
  .tcls-led-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }
  .tcls-zones {
    grid-template-columns: 1fr;
  }
}
