:root {
  --black: #050505;
  --ink: #151411;
  --muted: #706b63;
  --paper: #f3efe7;
  --stone: #d4cec3;
  --white: #ffffff;
  --signal: #b51e1e;
  --line: rgba(21, 20, 17, 0.16);
  --item-color: #f2f0ea;
  --item-accent: #111111;
  --item-outline: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

img,
svg {
  display: block;
}

.lab-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 clamp(16px, 4vw, 48px);
  background: rgba(243, 239, 231, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.lab-header nav {
  display: flex;
  gap: 22px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.lab-shell {
  padding: clamp(20px, 4vw, 48px);
}

.lab-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  gap: clamp(20px, 5vw, 80px);
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.lab-intro h1,
.panel-head h2,
.analysis-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 0.94;
}

.lab-intro h1 {
  max-width: 980px;
  font-size: clamp(48px, 7vw, 110px);
}

.lab-intro > p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.lab-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(320px, 0.82fr) minmax(360px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.product-picker,
.item-panel,
.photo-panel {
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--line);
}

.product-picker {
  display: grid;
  grid-template-rows: auto 1fr;
  max-height: calc(100svh - 130px);
  overflow: hidden;
}

.picker-head,
.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.picker-head span,
.panel-head strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.product-list {
  overflow: auto;
}

.product-option {
  display: grid;
  width: 100%;
  padding: 15px 18px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
}

.product-option strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1;
}

.product-option span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.product-option.active,
.product-option:hover {
  color: var(--white);
  background: var(--ink);
}

.product-option.active span,
.product-option:hover span {
  color: rgba(255, 255, 255, 0.72);
}

.item-panel {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto auto;
}

.panel-head h2 {
  font-size: clamp(34px, 4.8vw, 72px);
}

.isolated-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: clamp(22px, 4vw, 46px);
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(21, 20, 17, 0.07) 0 1px, transparent 1px 56px),
    linear-gradient(160deg, #ffffff, #ded8cc);
  isolation: isolate;
}

.isolated-stage::after {
  content: "";
  position: absolute;
  inset: clamp(22px, 4vw, 46px);
  z-index: 2;
  pointer-events: none;
  background: var(--item-color);
  mix-blend-mode: color;
  opacity: var(--item-tint-opacity, 0);
  transition: background 160ms ease, opacity 160ms ease;
}

.item-photo {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  height: auto;
  max-height: 460px;
  aspect-ratio: 1;
  object-fit: contain;
  background: #e9e2d8;
  box-shadow: 0 30px 48px rgba(0, 0, 0, 0.18);
  filter: saturate(1.04) contrast(1.03);
}

.color-tools {
  padding: 18px;
  border-top: 1px solid var(--line);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.swatch {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: var(--swatch-color);
  border: 1px solid rgba(21, 20, 17, 0.28);
  cursor: pointer;
}

.swatch.active {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
}

.item-description {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  border-top: 1px solid var(--line);
}

.photo-panel {
  display: grid;
  grid-template-rows: minmax(520px, 1fr) auto;
  overflow: hidden;
  background: var(--black);
}

.photo-stage {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  background: var(--black);
}

.photo-stage img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
  object-position: center 18%;
  opacity: 0.9;
}

.photo-outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.photo-outline polygon {
  fill: color-mix(in srgb, var(--item-color) 18%, transparent);
  stroke: var(--item-outline);
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 9px rgba(255, 255, 255, 0.78)) drop-shadow(0 16px 24px rgba(0, 0, 0, 0.56));
}

.outline-label {
  position: absolute;
  top: calc(var(--outline-y, 14%) + 8px);
  left: calc(var(--outline-x, 20%) + 8px);
  padding: 8px 10px;
  color: var(--white);
  background: rgba(5, 5, 5, 0.78);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.analysis-card {
  padding: 22px;
  color: var(--ink);
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.analysis-card h2 {
  font-size: clamp(32px, 4vw, 58px);
}

.analysis-card p:last-child {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .lab-workspace {
    grid-template-columns: minmax(220px, 300px) 1fr;
  }

  .photo-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .lab-header {
    align-items: start;
    flex-direction: column;
    gap: 10px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .lab-intro,
  .lab-workspace {
    grid-template-columns: 1fr;
  }

  .product-picker {
    max-height: none;
  }

  .product-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 360px;
  }

  .product-option {
    min-height: 112px;
  }

  .item-panel,
  .photo-panel {
    grid-template-rows: auto;
  }
}
