/* ============================================================
   WERHINO 2.0 - Appliance Intelligence Center
   appliances.css · layers on platform.css (tokens, nav, footer)
   ============================================================ */

/* page header */
.ai2 { padding: calc(var(--nav-h) + clamp(2.5rem,7vh,5rem)) 0 clamp(2rem,5vh,3.5rem); }
.ai2__title { font-size: clamp(2.8rem, 6vw, 5rem); margin: 1.3rem 0 1.2rem; max-width: 16ch; }
.ai2__title em { font-style: italic; color: var(--accent); }
.ai2__sub { color: var(--muted); font-weight: 300; max-width: 54ch; line-height: 1.7; font-size: 1.05rem; }

/* brand filter */
.brands { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; }
.brands--cat { margin-top: .7rem; }
.brands--cat .brand { font-size: .66rem; padding: .5em 1em; opacity: .92; }
.brand {
  font-size: .72rem; font-weight: 600; letter-spacing: .08em;
  padding: .58em 1.15em; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
  transition: border-color .3s, color .3s, background .3s, transform .3s var(--ease);
}
.brand:hover { color: var(--text); border-color: var(--line-2); }
.brand.is-active { background: var(--accent); color: #1a1409; border-color: var(--accent); }

/* explorer layout */
.explorer { display: grid; grid-template-columns: 300px minmax(0,1fr) 380px; gap: clamp(.9rem,1.6vw,1.4rem); align-items: stretch; padding-bottom: clamp(4rem,9vh,7rem); }

/* appliance list (left) */
.alist { display: flex; flex-direction: column; gap: .6rem; max-height: 640px; overflow-y: auto; padding-right: .3rem; }
.alist__empty { color: var(--muted); font-size: .88rem; line-height: 1.6; padding: 1rem .2rem; }
.aitem {
  text-align: left; width: 100%;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-card);
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .25rem;
  transition: border-color .35s var(--ease), transform .35s var(--ease), background .35s var(--ease);
}
.aitem:hover { border-color: var(--line-2); transform: translateX(3px); }
.aitem.is-active { border-color: var(--accent); background: var(--accent-dim); }
.aitem__brand { font-size: .6rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.aitem__name { font-family: var(--font-d); font-weight: 500; font-size: 1.15rem; color: var(--text); line-height: 1.1; }
.aitem__type { font-size: .76rem; color: var(--muted); }

/* ---------- 3D diagram (center) ---------- */
.diagram {
  position: relative; border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: radial-gradient(ellipse 70% 60% at 50% 38%, rgba(201,168,106,.07), transparent 70%), var(--bg-card);
  min-height: 560px; overflow: hidden;
  display: flex; flex-direction: column;
}
.diagram__stage { flex: 1; display: flex; align-items: center; justify-content: center; perspective: 1500px; padding: 3.2rem 2rem 2rem; }
.scene {
  position: relative; transform-style: preserve-3d;
  width: var(--uw, 190px); height: var(--uh, 360px);
  transform: rotateX(var(--rx, 7deg)) rotateY(var(--ry, -22deg));
  transition: transform .5s var(--ease), width .6s var(--ease), height .6s var(--ease);
}
/* cabinet niche (recessed opening) */
.niche {
  position: absolute; inset: -20px -16px; border-radius: 6px;
  background: linear-gradient(160deg, #14110d, #0a0908);
  box-shadow: inset 0 0 70px rgba(0,0,0,.8), 0 50px 90px rgba(0,0,0,.5);
  transform: translateZ(-46px);
}
.niche::before { /* side return walls hint */
  content: ''; position: absolute; inset: 8px; border: 1px solid rgba(201,168,106,.10); border-radius: 4px;
}
/* appliance interior (revealed when door opens) */
.unit__interior {
  position: absolute; inset: 0; border-radius: 4px;
  background: linear-gradient(180deg, #1b1814, #100e0b);
  transform: translateZ(-8px);
  display: flex; flex-direction: column; justify-content: space-evenly; padding: 14% 10%;
  box-shadow: inset 0 0 30px rgba(0,0,0,.6);
}
.unit__interior span { display: block; height: 6%; background: rgba(201,168,106,.16); border-radius: 2px; }
/* the door / face panel */
.door {
  position: absolute; inset: 0; transform-origin: left center;
  border-radius: 4px;
  background:
    linear-gradient(115deg, rgba(255,255,255,.10), transparent 36%),
    linear-gradient(180deg, #3a2f22, #271f16);
  border: 1px solid rgba(201,168,106,.30);
  box-shadow: 0 18px 50px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06);
  transform: translateZ(2px);
  transition: transform .9s var(--ease);
}
.door__grain { position: absolute; inset: 8% 12%; border: 1px solid rgba(201,168,106,.16); border-radius: 3px; }
.door__handle { position: absolute; top: 14%; bottom: 14%; right: 8%; width: 5px; border-radius: 4px; background: linear-gradient(var(--accent-2), var(--accent)); box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.scene[data-swing="down"] .door { transform-origin: center bottom; }
.scene[data-swing="down"] .door__handle { top: 9%; bottom: auto; left: 14%; right: 14%; height: 5px; width: auto; }
.scene[data-swing="none"] .door__handle { display: none; }

/* OPEN states */
.scene.is-open[data-swing="side"] .door { transform: translateZ(2px) rotateY(-118deg); }
.scene.is-open[data-swing="down"] .door { transform: translateZ(2px) rotateX(95deg); }
.scene.is-open[data-swing="none"] .door { opacity: 0; }

/* ventilation grille + airflow */
.grille { position: absolute; left: 14%; right: 14%; top: 4%; height: 7%; transform: translateZ(4px);
  background: repeating-linear-gradient(90deg, rgba(201,168,106,.5) 0 2px, transparent 2px 6px); opacity: 0; transition: opacity .4s; border-radius: 2px; }
.scene.show-vent .grille { opacity: .9; }
.airflow { position: absolute; left: 50%; top: -38px; transform: translateX(-50%) translateZ(20px); display: flex; gap: 8px; opacity: 0; transition: opacity .4s; }
.scene.show-vent .airflow { opacity: 1; }
.airflow i { width: 3px; height: 26px; border-radius: 3px; background: linear-gradient(var(--accent), transparent); animation: rise 1.4s var(--ease) infinite; }
.airflow i:nth-child(2){ animation-delay:.25s } .airflow i:nth-child(3){ animation-delay:.5s }
@keyframes rise { 0%{ transform: translateY(8px); opacity:0 } 30%{ opacity:1 } 100%{ transform: translateY(-14px); opacity:0 } }

/* clearance callouts */
.clear { position: absolute; opacity: 0; transition: opacity .45s var(--ease), transform .45s var(--ease); transform: translateZ(30px); pointer-events: none; }
.scene.show-clear .clear { opacity: 1; }
.clear__line { background: var(--accent); }
.clear--top { left: 50%; top: -34px; transform: translate(-50%,0) translateZ(30px); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.clear--top .clear__line { width: 1px; height: 22px; }
.clear--side { top: 40%; right: -52px; display: flex; align-items: center; gap: 4px; }
.clear--side .clear__line { height: 1px; width: 30px; }
.clear__tag { font-size: .56rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); white-space: nowrap; background: rgba(10,9,8,.7); padding: .2em .5em; border-radius: 4px; }

/* diagram controls */
.diagram__controls { display: flex; gap: .5rem; padding: 1rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.d-ctrl {
  flex: 1; min-width: 110px; text-align: center;
  font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  padding: .8em 1em; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
  transition: border-color .3s, color .3s, background .3s;
}
.d-ctrl:hover { color: var(--text); border-color: var(--line-2); }
.d-ctrl.is-on { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.diagram__hint { position: absolute; top: 1rem; left: 1.1rem; font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); z-index: 2; }

/* ---------- spec panel (right) ---------- */
.spec { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--bg-card); padding: clamp(1.4rem,2vw,2rem); display: flex; flex-direction: column; gap: 1.3rem; }
.spec__head { display: flex; flex-direction: column; gap: .3rem; }
.spec__brand { font-size: .62rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.spec__name { font-family: var(--font-d); font-weight: 500; font-size: 1.7rem; line-height: 1.05; }
.spec__dims { display: grid; grid-template-columns: repeat(3,1fr); gap: .6rem; }
.spec__dim { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .6rem; text-align: center; }
.spec__dim b { display: block; font-family: var(--font-d); font-size: 1.4rem; color: var(--text); line-height: 1; }
.spec__dim span { font-size: .56rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.spec__groups { display: flex; flex-direction: column; gap: 1.05rem; }
.spec__row { display: flex; flex-direction: column; gap: .22rem; }
.spec__row h5 { font-size: .6rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.spec__row p { font-size: .9rem; color: var(--text); line-height: 1.55; }
.mistakes { border-top: 1px solid var(--line); padding-top: 1.1rem; }
.mistakes h5 { font-size: .6rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--hot); margin-bottom: .6rem; }
.mistakes li { list-style: none; display: flex; gap: .7rem; align-items: flex-start; font-size: .88rem; color: var(--muted); padding: .3rem 0; }
.mistakes li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--hot); margin-top: .5em; flex-shrink: 0; }
.spec__note { font-size: .72rem; color: var(--faint); line-height: 1.5; border-top: 1px solid var(--line); padding-top: .9rem; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .explorer { grid-template-columns: 1fr 1fr; }
  .alist { grid-column: 1 / -1; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; max-height: none; }
  .aitem { min-width: 220px; }
}
@media (max-width: 760px) {
  .explorer { grid-template-columns: 1fr; }
  .diagram { min-height: 460px; }
  .spec__dims { grid-template-columns: repeat(3,1fr); }
}
