@font-face {
  font-family: LabManrope;
  src: url("/assets/lab/manrope.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: LabCormorant;
  src: url("/assets/lab/cormorant-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
}
.interactive-lab {
  color: #f3f0e9;
  background: #100f13;
}
.lab-heading {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(24px, 5vw, 80px);
  align-items: end;
  margin-bottom: 35px;
}
.lab-heading h2 span {
  color: #b69cff;
}
.lab-heading > p {
  font-size: clamp(18px, 1.4vw, 21px);
  max-width: 43ch;
  color: #bdb8c7;
}
.lab-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #5b5367;
}
.lab-tabs button {
  min-width: 0;
  border: 0;
  border-right: 1px solid #5b5367;
  color: inherit;
  background: transparent;
  text-align: left;
  padding: 17px 20px;
}
.lab-tabs button:last-child {
  border: 0;
}
.lab-tabs button > span {
  display: block;
  font-size: clamp(20px, 1.9vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.035em;
  margin-bottom: 6px;
}
.lab-tabs small {
  display: block;
  font-size: 16px;
  color: #bdb8c7;
}
.lab-tabs button[aria-selected="true"] {
  color: #100f13;
  background: #b69cff;
}
.lab-tabs button[aria-selected="true"] small {
  color: #413450;
}
.lab-panel {
  position: relative;
  border: 1px solid #5b5367;
  border-top: 0;
  min-height: 420px;
  background: #201c28;
}
.lab-panel button {
  min-height: 46px;
  font-size: 17px;
}
.lab-panel p,
.lab-panel label,
.lab-panel figcaption {
  font-size: 17px;
  line-height: 1.45;
}
.lab-source {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  padding-top: 20px;
}
.lab-source p {
  color: #bdb8c7;
  font-size: 16px;
  max-width: 57ch;
}
.lab-source a {
  flex-shrink: 0;
}
.lab-light {
  position: relative;
  min-height: 420px;
}
.lab-light-art {
  margin: 0;
  position: relative;
}
.lab-light-art img {
  width: 100%;
  height: clamp(370px, 38vw, 590px);
  object-fit: cover;
  object-position: center;
}
.lab-light-art figcaption {
  position: absolute;
  top: 22px;
  left: 22px;
  max-width: 25ch;
  padding: 8px 12px;
  color: #f3f0e9;
  background: #100f13cc;
}
.lab-light-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 22px;
  background: linear-gradient(transparent, #100f13e8 25%);
}
.lab-light-controls p {
  max-width: 36ch;
  color: #f3f0e9;
}
.lab-switch {
  display: flex;
  border: 1px solid #f3f0e98c;
  background: #100f13c9;
}
.lab-switch button {
  border: 0;
  padding: 11px 24px;
  background: transparent;
  color: #f3f0e9;
  min-width: 110px;
}
.lab-switch button[aria-pressed="true"] {
  color: #100f13;
  background: #f3f0e9;
}
.lab-model-stage {
  position: relative;
  height: clamp(350px, 37vw, 550px);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, #34383a, #15191a);
}
.lab-model-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}
.lab-model-stage > img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.lab-model-state {
  position: relative;
  z-index: 1;
  background: #100f13dd;
  padding: 12px 18px;
  max-width: 42ch;
  margin: 20px;
  color: #f3f0e9;
}
.lab-model-stage:has(> img) .lab-model-state {
  align-self: end;
}
.lab-model-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  gap: 20px;
}
.lab-model-controls p {
  max-width: 44ch;
}
.lab-model-controls > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.lab-model-controls button {
  border: 1px solid #797183;
  padding: 8px 15px;
  min-width: 46px;
  background: transparent;
  color: inherit;
}
.lab-model-controls button:disabled {
  opacity: 0.5;
  cursor: default;
}
.lab-editor {
  background: #f4f0e9;
  color: #1f2a44;
  font-family: LabManrope, Onest, sans-serif;
}
.lab-editor-cap {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #d6cfc3;
}
.lab-editor-cap strong {
  font-weight: 750;
  font-size: 20px;
}
.lab-editor-cap > span {
  color: #7a1f2d;
  font-size: 16px;
}
.lab-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  align-items: stretch;
}
.lab-editor-fields {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 22px;
  border-right: 1px solid #d6cfc3;
}
.lab-editor-heading {
  font-weight: 750;
  margin: 0;
}
.lab-editor-fields label {
  display: grid;
  gap: 4px;
  font-weight: 650;
}
.lab-editor-fields input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  background: #fffdf8;
  border: 1px solid #b9b1a6;
  border-radius: 0;
  color: #1f2a44;
  font-size: 17px;
}
.lab-editor-fields > p:last-child {
  color: #645e58;
  margin: 0;
  font-size: 16px;
}
.lab-editor-reset {
  background: #1f2a44;
  color: #f4f0e9;
  padding: 10px 13px;
  border: 0;
  justify-self: start;
}
.lab-editor-preview {
  position: relative;
  margin: 0;
  background: #3d0710;
  min-height: 460px;
  overflow: hidden;
}
.lab-editor-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.lab-editor-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #26060fe8, #26060f23 85%);
  pointer-events: none;
}
.lab-editor-preview figcaption {
  position: relative;
  z-index: 1;
  color: #f4f0e9;
  padding: 8% 7%;
}
.lab-editor-preview figcaption > span {
  font-size: 16px;
  letter-spacing: 0.02em;
}
.lab-editor-preview strong {
  display: block;
  margin-top: 28px;
  max-width: 13ch;
  line-height: 0.99;
  letter-spacing: -0.055em;
  font-size: clamp(35px, 4.4vw, 68px);
  font-weight: 520;
  overflow-wrap: anywhere;
}
.lab-editor-preview strong > span,
.lab-editor-preview em {
  display: block;
}
.lab-editor-preview em {
  font-family: LabCormorant, Georgia, serif;
  font-size: 1.18em;
  line-height: 0.9;
}
.lab-education {
  background: #ffe983;
  color: #171527;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(22px, 5vw, 70px);
  padding: clamp(24px, 4.5vw, 70px);
  align-items: center;
}
.lab-education-heading > span {
  font-size: 16px;
  font-weight: 550;
}
.lab-education-heading h3 {
  font-size: clamp(34px, 4.3vw, 64px);
  font-weight: 750;
  line-height: 0.98;
  letter-spacing: -0.055em;
  margin: 28px 0;
}
.lab-question {
  color: #f3f0e9;
  background: #171527;
  padding: clamp(20px, 3vw, 42px);
  box-shadow:
    8px 8px 0 -1px #ffe983,
    8px 8px 0 0 #171527;
}
.lab-question > p:first-child {
  margin: 0 0 23px;
  color: #ffe983;
}
.lab-question h4 {
  font-size: clamp(27px, 3vw, 42px);
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0 0 23px;
  font-weight: 650;
}
.lab-answers {
  display: grid;
  gap: 8px;
}
.lab-answers button {
  display: flex;
  gap: 18px;
  background: none;
  color: #f3f0e9;
  border: 1px solid #8b849c;
  padding: 9px 13px;
  text-align: left;
  min-height: 46px;
}
.lab-answers button > span:first-child {
  min-width: 18px;
  color: #ffe983;
}
.lab-answers button[aria-pressed="true"] {
  background: #ffe983;
  color: #171527;
  border-color: #ffe983;
}
.lab-answers button[aria-pressed="true"] > span:first-child {
  color: #171527;
}
.lab-answer-feedback {
  padding-top: 20px;
  min-height: 82px;
  margin: 0;
}
.lab-question-reset {
  color: #ffe983;
  background: none;
  border: 0;
  padding: 6px 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.lab-panel [hidden] {
  display: none !important;
}
@media (max-width: 850px) {
  .lab-heading {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .lab-model-controls,
  .lab-light-controls {
    align-items: start;
    flex-direction: column;
    gap: 12px;
  }
  .lab-editor-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .lab-editor-fields {
    padding: 18px;
  }
  .lab-tabs button {
    padding: 16px 13px;
  }
  .lab-tabs button > span {
    font-size: 21px;
  }
}
@media (max-width: 620px) {
  .lab-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lab-tabs button {
    border: 0;
    border-bottom: 1px solid #5b5367;
  }
  .lab-tabs button:nth-child(odd) {
    border-right: 1px solid #5b5367;
  }
  .lab-tabs button:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
  .lab-source {
    flex-direction: column;
    gap: 9px;
  }
  .lab-light-art img {
    height: 410px;
  }
  .lab-light-art figcaption {
    top: 14px;
    left: 14px;
    max-width: 23ch;
  }
  .lab-light-controls {
    padding: 18px 14px;
  }
  .lab-light-controls p {
    font-size: 16px;
  }
  .lab-switch button {
    min-width: 95px;
    padding: 9px 19px;
  }
  .lab-model-stage {
    height: 350px;
  }
  .lab-model-controls {
    padding: 18px 14px;
  }
  .lab-model-controls p {
    font-size: 16px;
  }
  .lab-editor-cap {
    padding: 15px;
    gap: 4px;
  }
  .lab-editor-grid {
    grid-template-columns: 1fr;
  }
  .lab-editor-fields {
    border-right: 0;
  }
  .lab-editor-preview {
    min-height: 330px;
  }
  .lab-editor-preview strong {
    font-size: 45px;
  }
  .lab-education {
    grid-template-columns: 1fr;
    padding: 25px 18px;
    gap: 25px;
  }
  .lab-education-heading h3 {
    font-size: 40px;
    margin: 18px 0;
  }
  .lab-question {
    padding: 22px 17px;
  }
  .lab-answer-feedback {
    min-height: 0;
  }
}

/* Final polish keeps the lab as one continuous instrument, with a clear active mode. */
.lab-tabs {
  gap: 18px;
  border: 0;
  border-bottom: 1px solid #756582;
}
.lab-tabs button {
  position: relative;
  border: 0;
  padding: 17px 2px 19px;
  background: transparent;
  color: #bdb8c7;
  font-size: 18px;
  transition:
    color 0.22s ease,
    transform 0.22s ease;
}
.lab-tabs button::after {
  content: "";
  position: absolute;
  height: 3px;
  left: 0;
  right: 0;
  bottom: -1px;
  background: #b69cff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.lab-tabs button > span {
  font-size: 18px;
  letter-spacing: -0.025em;
  margin-bottom: 7px;
}
.lab-tabs small {
  font-size: 16px;
}
.lab-tabs button:hover {
  color: #f3f0e9;
  transform: translateY(-1px);
}
.lab-tabs button[aria-selected="true"] {
  background: transparent;
  color: #f3f0e9;
}
.lab-tabs button[aria-selected="true"] small {
  color: #cdb8ff;
}
.lab-tabs button[aria-selected="true"]::after {
  transform: scaleX(1);
}
.lab-mode-guide {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: 22px;
  padding: 23px 0;
}
.lab-mode-guide h3 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.12;
}
.lab-mode-guide p {
  font-size: 19px;
  line-height: 1.45;
  color: #c5bccf;
  max-width: 48ch;
}
.lab-panel {
  overflow: clip;
}
.lab-panel p {
  font-size: 19px;
}
.lab-panel label {
  font-size: 18px;
}
.lab-panel figcaption {
  font-size: 17px;
}
.lab-model-stage {
  background: radial-gradient(ellipse at center, #2a2730, #151419);
}
.lab-light-art {
  overflow: hidden;
}
.lab-model-controls p {
  font-size: 19px;
}
.lab-light-controls p {
  font-size: 18px;
}
.lab-editor-fields > p:last-child {
  font-size: 16px;
}
.lab-source p {
  font-size: 16px;
}
@media (max-width: 850px) {
  .lab-tabs {
    gap: 15px;
  }
  .lab-tabs button {
    padding: 16px 1px;
  }
  .lab-mode-guide {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
@media (max-width: 620px) {
  .lab-tabs {
    gap: 0 18px;
  }
  .lab-tabs button {
    border: 0;
    border-bottom: 1px solid #5b5367;
    padding: 16px 0;
  }
  .lab-tabs button:nth-child(odd) {
    border-right: 0;
  }
  .lab-tabs button:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
  .lab-mode-guide {
    padding: 22px 0;
  }
  .lab-mode-guide h3 {
    font-size: 28px;
  }
  .lab-mode-guide p,
  .lab-panel p,
  .lab-panel label,
  .lab-model-controls p,
  .lab-light-controls p {
    font-size: 17px;
    line-height: 1.5;
  }
  .lab-panel figcaption,
  .lab-editor-fields > p:last-child,
  .lab-source p {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lab-tabs button,
  .lab-tabs button::after {
    transition: none;
    transform: none;
  }
  .lab-tabs button:not([aria-selected="true"])::after {
    transform: scaleX(0);
  }
}
html[data-motion="reduced"] .lab-tabs button,
html[data-motion="reduced"] .lab-tabs button::after {
  transition: none;
}
