/* Rabin-Interiors & Woods: Cabinet Anatomy. Themed through the --riw-* variables in core.css.
   Each layer carries --i (its height in the stack), --t (thickness), --edge, and its face background inline.
   With the ply peel on (.riw-cabinet--peel), the cabinet moves into .riw-cab-stage and the peel block follows it. */

.riw-cabinet:not(.riw-cabinet--peel), .riw-cab-stage { position: relative; border-radius: var(--riw-radius); border: 1px solid var(--riw-line); background: radial-gradient(circle at 50% 45%, rgba(212,168,90,.18), transparent 55%), var(--riw-bg-2); perspective: 1800px; display: grid; place-items: center; min-height: 560px; overflow: hidden; }
.riw-cabinet:not(.riw-cabinet--peel)::before, .riw-cab-stage::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--riw-line) 1px, transparent 1px), linear-gradient(90deg, var(--riw-line) 1px, transparent 1px); background-size: 40px 40px; -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 75%); mask-image: radial-gradient(circle at 50% 50%, #000, transparent 75%); }

.riw-stack { --gap: 12px; position: relative; width: min(320px, 60vw); aspect-ratio: 3/2; transform-style: preserve-3d; transform: rotateX(var(--rx, 58deg)) rotateZ(var(--rz, -36deg)); transition: transform .25s ease-out; margin-bottom: 60px; }
.riw-cabinet.is-open .riw-stack { --gap: 40px; }
.riw-stack-shadow { position: absolute; inset: 8%; background: rgba(0,0,0,.7); filter: blur(30px); transform: translateZ(-40px); }
.riw-layer { position: absolute; inset: 0; transform-style: preserve-3d; transform: translateZ(calc(var(--i) * var(--gap))); transition: transform .8s var(--riw-ease), filter .4s; border-radius: 4px; }
.riw-face { position: absolute; inset: 0; border-radius: 4px; box-shadow: 0 0 0 1px rgba(255,255,255,.06); background: #c9a272; }
.riw-e1, .riw-e2 { position: absolute; background: var(--edge, #c9a272); }
.riw-e1 { left: 0; bottom: 0; width: 100%; height: var(--t, 10px); transform-origin: bottom; transform: rotateX(90deg); }
.riw-e2 { right: 0; top: 0; width: var(--t, 10px); height: 100%; transform-origin: right; transform: rotateY(-90deg); }

/* A lit layer (its legend button hovered, focused or tapped) rises out of the stack; the others dim */
.riw-cabinet.has-lit .riw-layer { filter: brightness(.45) saturate(.6); }
.riw-cabinet.has-lit .riw-layer.is-lit { transform: translateZ(calc(var(--i) * var(--gap) + 46px)); filter: brightness(1.15); }
.riw-layer.is-lit .riw-face { box-shadow: 0 0 0 2px #f3d79b, 0 0 60px rgba(243,215,155,.35); }

.riw-cabinet__tag { position: absolute; left: 22px; top: 22px; font-size: .72rem; line-height: 1.5; letter-spacing: .2em; text-transform: uppercase; color: var(--riw-muted); z-index: 3; }
.riw-cabinet__tag b, .riw-cabinet__tag strong { color: var(--riw-accent-soft); font-weight: 500; }

.riw-legend { position: absolute; left: 16px; right: 16px; bottom: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; font-size: .76rem; z-index: 3; }
.riw .riw-leg { display: flex; align-items: center; gap: .6rem; padding: .45rem .8rem .45rem .45rem; border-radius: 999px; background: rgba(20,17,14,.7); border: 1px solid var(--riw-line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--riw-text); font: inherit; line-height: 1.4; text-align: left; cursor: pointer; transition: all .3s; outline: none; }
.riw .riw-leg:is(:hover, :focus, .is-lit) { border-color: var(--riw-accent); color: var(--riw-accent-soft); }
.riw .riw-leg:focus-visible { box-shadow: 0 0 0 2px var(--riw-accent); }
.riw-leg-dot { width: 20px; height: 20px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); background: #c9a272; }
.riw-leg-size { color: var(--riw-dim); margin-left: auto; padding-left: .5rem; }

/* Ply peel (optional) */
.riw-cabinet--peel { display: flex; flex-direction: column; gap: 20px; }
.riw .riw-cab-inside { position: absolute; right: 16px; top: 16px; z-index: 3; display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border-radius: 999px; border: 1px solid var(--riw-accent); background: rgba(20,17,14,.7); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--riw-accent-soft); font-size: .76rem; font-weight: 600; line-height: 1.2; cursor: pointer; transition: background .3s, color .3s; }
.riw .riw-cab-inside:hover { background: var(--riw-accent); color: #1c1712; }

.riw-pp { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 20px; align-items: start; outline: none; }
.riw-pp-stage { position: relative; min-height: 600px; padding: 56px 0 96px; border-radius: var(--riw-radius); background: radial-gradient(120% 90% at 50% 30%, #2a2119, #120e0b 70%); display: grid; place-items: center; overflow: hidden; perspective: 1600px; }
.riw-pp-tag { position: absolute; left: 20px; top: 20px; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: #a89580; }
.riw-pp-scale { --k: 1; transform: scale(var(--k)); transform-style: preserve-3d; }
.riw-pp-stack { position: relative; width: 340px; height: 230px; transform: rotateX(58deg) rotateZ(-38deg); transform-style: preserve-3d; }
.riw-pp-shadow { position: absolute; width: 340px; height: 230px; background: rgba(0,0,0,.55); filter: blur(28px); transform: rotateX(58deg) rotateZ(-38deg) translateZ(-40px); }
.riw .riw-pp-ly { position: absolute; inset: 0; padding: 0; border: 0; border-radius: 0; transform-style: preserve-3d; background-size: 340px 340px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); cursor: pointer; transition: transform .7s var(--riw-ease), filter .25s; }
.riw-pp-e1, .riw-pp-e2 { position: absolute; background-size: 340px 340px; }
.riw-pp-e1 { left: 0; top: 100%; width: 100%; height: var(--t); transform-origin: top; transform: rotateX(-90deg); filter: brightness(.62); }
.riw-pp-e2 { top: 0; left: 100%; width: var(--t); height: 100%; transform-origin: left; transform: rotateY(90deg); filter: brightness(.8); }
.riw-pp-e1::after, .riw-pp-e2::after { content: ""; position: absolute; background: var(--glue); }
.riw-pp-e1::after { left: 0; right: 0; top: 0; height: 2px; }
.riw-pp-e2::after { top: 0; bottom: 0; left: 0; width: 2px; }
.riw-pp-dir { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .3s; pointer-events: none; }
.riw-pp-dir svg { width: 110px; height: 110px; }
.riw-pp.is-apart .riw-pp-dir { opacity: .9; }
.riw .riw-pp-ly:hover { filter: brightness(1.15); }
.riw .riw-pp-ly.is-sel { filter: brightness(1.25); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25), 0 0 0 3px var(--riw-accent); }
.riw .riw-pp-ly:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.riw-pp-ctl { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: .7rem .9rem; border-radius: 16px; background: rgba(20,17,14,.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.08); }
.riw-pp-ctl label { flex: 1; min-width: 160px; display: flex; align-items: center; gap: .7rem; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: #cfc6b9; }
.riw-pp-ctl input { flex: 1; min-width: 0; accent-color: var(--riw-accent); }
.riw .riw-pp-play { padding: .55rem 1rem; border: 0; border-radius: 999px; background: #f3d79b; color: #1c1712; font-size: .78rem; font-weight: 600; line-height: 1.2; cursor: pointer; }

.riw-pp-side { background: var(--riw-card); border: 1px solid var(--riw-line); border-radius: var(--riw-radius); padding: 1.5rem; display: flex; flex-direction: column; gap: 1.1rem; }
.riw .riw-pp-g h4 { font-family: var(--riw-font); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--riw-muted); line-height: 1.4; margin-bottom: .55rem; }
.riw-pp-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.riw .riw-pp-opts button { padding: .42rem .85rem; border-radius: 999px; border: 1px solid var(--riw-line-strong); background: none; color: var(--riw-text); font-size: .8rem; font-weight: 600; line-height: 1.2; cursor: pointer; transition: all .25s; }
.riw .riw-pp-opts button:hover { border-color: var(--riw-accent); }
.riw .riw-pp-opts button.is-on { background: var(--riw-ink); border-color: var(--riw-ink); color: #f6f1e9; }
.riw--dark .riw-pp-opts button.is-on { background: var(--riw-accent-soft); border-color: var(--riw-accent-soft); color: #1c1712; }
.riw-pp-info { min-height: 150px; padding: 1rem 1.1rem; border-radius: 16px; border: 1px solid var(--riw-line); background: var(--riw-bg); }
.riw-pp-no { display: block; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--riw-accent); font-weight: 600; }
.riw .riw-pp-info h3 { font-size: 1.6rem; margin: .3rem 0 .45rem; }
.riw .riw-pp-info p { font-size: .85rem; line-height: 1.55; color: var(--riw-muted); }
.riw .riw-pp-spec { list-style: none; margin: 0; padding: 0; }
.riw-pp-spec li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed var(--riw-line-strong); font-size: .82rem; line-height: 1.4; color: var(--riw-muted); }
.riw-pp-spec li span:last-child { color: var(--riw-text); text-align: right; }
.riw .riw-pp-note { font-size: .72rem; line-height: 1.5; color: var(--riw-dim); }

@media (max-width: 1100px) {
	.riw-pp { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
	.riw-cabinet:not(.riw-cabinet--peel), .riw-cab-stage { min-height: 620px; place-items: start center; padding-top: 110px; }
	.riw-legend { grid-template-columns: 1fr; }
	.riw .riw-cab-inside { right: auto; left: 16px; top: 56px; }
	.riw-pp-stage { min-height: 440px; padding: 48px 0 120px; }
	.riw-pp-side { padding: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
	.riw-stack, .riw-layer, .riw .riw-leg, .riw .riw-pp-ly, .riw-pp-dir { transition: none; }
}
