.materials-demo {
  --seat-overhead: 205px;
  --seat-frame-width: min(100%, max(140px, calc((100svh - var(--seat-overhead)) * 1.4)));
  display: grid;
  grid-template-columns: minmax(0, .64fr) minmax(0, 1.36fr);
  grid-template-rows: auto auto 1fr auto;
  gap: 10px clamp(24px, 4vw, 64px);
  align-items: start;
  padding-block: 6px clamp(20px, 3vw, 40px);
}
.materials-demo > .crumbs { grid-area: 1 / 1; align-self: center; justify-self: start; padding: 0 }
.materials-heading { display: contents }
.materials-heading > h1 {
  grid-area: 2 / 1; margin: 0;
  font-size: clamp(35px, 3.65vw, 56px);
  line-height: 1.06;
  text-wrap: balance;
}
.materials-demo .material-scene { display: none }
.materials-demo .material-scene.active { display: contents }
.materials-demo .material-explain { grid-area: 3 / 1; padding: 4px 0 0 }
.materials-demo .material-explain h2 { max-width: 25ch; font-size: clamp(22px, 2.1vw, 32px); text-wrap: balance }
.materials-demo .material-explain > p { margin: 14px 0; }
.materials-demo .material-explain .model-name {color:var(--accent-hover);margin:5px 0 10px;font-weight:550}
.materials-demo .material-render {
  grid-area: 2 / 2 / 4 / 3;
  justify-self: end;
  width: var(--seat-frame-width);
}
.materials-heading .exhibit-pager { grid-area: 1 / 2; justify-self: end; gap: 12px }
.materials-heading .exhibit-position { gap: 5px }
.materials-heading .exhibit-next {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  min-height: 44px; width: auto; padding: 4px 9px;
}
.materials-heading .exhibit-next strong { min-width: 5ch; font-size: 16px; line-height: 1.2 }
.materials-heading .exhibit-next svg,.materials-heading .exhibit-prev svg { width: 14px; height: 14px }
.materials-demo .material-models { grid-area: 4 / 1 / 5 / -1; margin-top: 4px }
.material-render { background: transparent; overflow: visible }
.seat-study { margin: 0; width: 100%; min-width: 0 }
.seat-screen {
  position: relative;
  overflow: hidden;
  aspect-ratio: 7 / 5;
  background: #e4e1d9;
  border-radius: 7px;
}
.seat-screen img,.seat-screen video { width: 100%; height: 100%; position: absolute; inset: 0; display: block; object-fit: contain }
.seat-screen video[hidden],.seat-modes[hidden] { display: none }
.seat-labels {position:absolute;inset:0;pointer-events:none;container-type:inline-size}
.seat-labels svg {display:block;width:100%;height:100%;overflow:hidden}
.seat-labels path {visibility:hidden;fill:none;stroke:#29352f;stroke-width:1.45;stroke-linejoin:round;stroke-linecap:round;filter:drop-shadow(0 0 1.25px #fff) drop-shadow(0 0 .75px #fff)}
.seat-label {position:absolute;visibility:hidden;transform:translateY(-50%);padding:.28em .52em;background:#faf9f5f2;color:#202b23;border:1px solid #9b9f93;border-radius:4px;white-space:nowrap;font:550 clamp(11px,1.8cqw,16px)/1.18 var(--sans)}
.seat-label-left {left:1.8%}.seat-label-right {right:1.8%}
.material-intro {padding-block:clamp(16px,2.2vw,36px)}
.material-intro h1 {max-width:30ch}
.material-intro .lead {max-width:65ch;margin-top:14px}
.material-document {display:block;position:relative;background:white;border-radius:7px;overflow:hidden}
.material-document img {width:100%;height:auto;max-height:min(72vh,850px);object-fit:contain}
.construction-cutaway {padding-block:clamp(22px,3vw,44px)}
.seat-modes {
  display: flex; gap: 5px;
  align-items: stretch; flex-wrap: wrap;
  margin-top: 10px; padding: 0;
}
.seat-modes button {
  border: 1px solid var(--outline); border-radius: 5px;
  background: transparent; color: var(--ink);
  min-height: 44px; padding: 6px clamp(11px,1.25vw,21px);
  font: 550 clamp(14px,1.1vw,17px)/1.2 var(--sans);
}
.seat-modes button:hover { border-color: var(--accent) }
.seat-modes button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff }
@media (max-width: 800px) and (min-height: 521px), (max-width: 620px) {
  .materials-demo { --seat-overhead: 238px; grid-template-columns: minmax(0,1fr); grid-template-rows: auto; gap: 8px; padding-block: 4px 23px }
  .materials-heading .exhibit-pager { grid-area: 1 / 1 }
  .materials-heading > h1 {font-size:clamp(27px,5.8vw,38px); text-wrap:initial}
  .materials-demo .material-render { grid-area: 3 / 1; justify-self:center }
  .materials-demo .material-explain { grid-area: 4 / 1; padding:0 }
  .materials-demo .material-models { grid-area: 5 / 1; margin: 0 }
  .materials-demo .material-explain h2 { max-width: 34ch; font-size: 23px }
  .materials-demo .material-explain > p { margin: 8px 0 }
  .seat-modes {margin-top:7px}
  .seat-modes button { flex: 1 1 auto; min-height: 44px; padding-inline: 6px; font-size: 14px }
}
@media (max-width: 620px) {
  .materials-demo { --seat-overhead: 270px }
  .materials-heading .exhibit-pager { grid-area: 3 / 1; justify-self:stretch; justify-content:space-between }
  .materials-demo .material-render { grid-area: 4 / 1 }
  .materials-demo .material-explain { grid-area: 5 / 1 }
  .materials-demo .material-models { grid-area: 6 / 1 }
}
@media (max-width: 360px) {
  .materials-heading .exhibit-pager { gap: 4px }
  .materials-heading .exhibit-next { padding-inline: 5px; gap: 4px }
  .materials-heading .exhibit-prompt { font-size: 13px; white-space: nowrap }
  .materials-heading .exhibit-next strong { font-size: 15px }
}
@media (min-width: 621px) and (max-height: 520px) {
  .materials-demo .material-render { width: 100% }
  .materials-demo .seat-screen {
    width: var(--seat-frame-width);
    margin-inline: auto;
  }
  .materials-demo .seat-modes { justify-content: center }
  .materials-demo .seat-modes button { padding-inline: 7px; font-size: 14px }
}
