/* Lab layer: the light table, stock room, lamp house, edge prints, and the
   small photochemical touches. Loaded after site.css; overrides are marked. */

:root {
  --frame-radius: 6px;
  --edge-ink: rgba(214, 176, 112, 0.62);
  --lamp-r: #e2675c;
  --lamp-g: #5fcf86;
  --lamp-b: #6a95ec;
  --marks: rgba(255, 255, 255, 0.62);
}

/* A faint emulsion texture behind the page. It sits under the content, so no
   image is ever overlaid. */
.page-below {
  background: url("/img/grain-tile.png?v=20260929-lab") 0 0 / 160px 160px repeat, var(--bg);
}

/* ------------------------------------------------------- registration marks */

.lt-marks,
.wipe::before {
  position: absolute;
  z-index: 4;
  inset: 12px;
  background:
    linear-gradient(var(--marks), var(--marks)) left top / 14px 1px no-repeat,
    linear-gradient(var(--marks), var(--marks)) left top / 1px 14px no-repeat,
    linear-gradient(var(--marks), var(--marks)) right top / 14px 1px no-repeat,
    linear-gradient(var(--marks), var(--marks)) right top / 1px 14px no-repeat,
    linear-gradient(var(--marks), var(--marks)) left bottom / 14px 1px no-repeat,
    linear-gradient(var(--marks), var(--marks)) left bottom / 1px 14px no-repeat,
    linear-gradient(var(--marks), var(--marks)) right bottom / 14px 1px no-repeat,
    linear-gradient(var(--marks), var(--marks)) right bottom / 1px 14px no-repeat;
  content: "";
  pointer-events: none;
}

/* The halation square fades to the page at its edges; marks would float. */
.halation-wipe::before {
  display: none;
}

/* ------------------------------------------------------------- edge print */

.edge-print {
  position: relative;
  overflow: hidden;
  padding: 17px 0;
  background: #070708;
  color: var(--edge-ink);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

/* Perforations along both edges of the strip. */
.edge-print::before,
.edge-print::after {
  position: absolute;
  right: 0;
  left: 0;
  height: 5px;
  background: repeating-linear-gradient(to right, transparent 0 9px, rgba(255, 255, 255, 0.075) 9px 17px);
  content: "";
}

.edge-print::before {
  top: 4px;
}

.edge-print::after {
  bottom: 4px;
}

.edge-print span {
  display: inline-block;
  padding-left: 24px;
}

/* ------------------------------------------------------------ light table */

.light-table-section {
  padding: 64px 0 104px;
}

.lt-heading {
  margin-bottom: 38px;
}

.lt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 24px;
}

.lt-stage {
  display: contents;
}

.lt-frame,
.bench-frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--frame-radius);
  background: #000;
  aspect-ratio: 16 / 9;
}

.lt-frame {
  grid-column: 1 / -1;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.lt-frame picture,
.bench-frame picture {
  position: absolute;
  z-index: 1;
  inset: 0;
}

.lt-frame img,
.bench-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lt-frame .lt-layer-source {
  z-index: 3;
  opacity: 0;
  transition: opacity 260ms ease;
}

.lt-frame.is-source .lt-layer-source {
  opacity: 1;
}

.lt-frame picture.is-ghost,
.bench-frame picture.is-ghost {
  z-index: 2;
  opacity: 1;
  transition: opacity 380ms ease;
}

.lt-frame picture.is-ghost.is-leaving,
.bench-frame picture.is-ghost.is-leaving {
  opacity: 0;
}

.lt-tag {
  position: absolute;
  z-index: 5;
  top: 22px;
  left: 22px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.56);
  color: #fff;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  line-height: 1;
  backdrop-filter: blur(5px);
}

.lt-edge,
.bench-edge {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  margin: 0;
  padding: 16px 0 0;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
}

.lt-edge-count b {
  color: var(--green);
  font-weight: 500;
}

.lt-edge-title {
  color: var(--text);
}

.lt-edge-stock,
.bench-edge > span {
  color: var(--text-2);
}

.lt-edge i,
.bench-edge i {
  color: var(--edge-ink);
  font-style: normal;
}

.lt-toolbar {
  display: flex;
  gap: 8px;
  padding-top: 14px;
}

.lt-btn {
  display: inline-flex;
  min-width: 40px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.lt-btn:hover {
  border-color: rgba(63, 207, 119, 0.6);
  color: var(--text);
}

.lt-step {
  padding: 0;
  font-size: 13px;
}

.lt-compare-dot {
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.lt-compare[aria-pressed="true"] {
  border-color: var(--green);
  background: rgba(63, 207, 119, 0.08);
  color: var(--green);
}

.lt-compare[aria-pressed="true"] .lt-compare-dot {
  background: currentColor;
}

/* The filmstrip: a dark base with perforations top and bottom. */
.lt-strip {
  position: relative;
  display: flex;
  grid-column: 1 / -1;
  gap: 10px;
  margin-top: 26px;
  padding: 20px 14px 16px;
  overflow-x: auto;
  border-radius: var(--frame-radius);
  background:
    repeating-linear-gradient(to right, transparent 0 10px, rgba(255, 255, 255, 0.07) 10px 20px) left 5px / 100% 6px no-repeat,
    repeating-linear-gradient(to right, transparent 0 10px, rgba(255, 255, 255, 0.07) 10px 20px) left bottom 5px / 100% 6px no-repeat,
    #060607;
  scroll-padding-inline: 14px;
  scroll-snap-type: x proximity;
  scrollbar-color: #2a2a2e transparent;
  scrollbar-width: thin;
}

.lt-thumb {
  position: relative;
  flex: 0 0 148px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  opacity: 0.5;
  scroll-snap-align: start;
  transition: opacity 180ms ease;
}

.lt-thumb img {
  width: 100%;
  border-radius: 2px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.lt-thumb:hover,
.lt-thumb:focus-visible {
  opacity: 0.85;
}

.lt-thumb[aria-current="true"] {
  opacity: 1;
}

.lt-thumb[aria-current="true"] img {
  box-shadow: 0 0 0 1px var(--green), 0 0 0 4px rgba(63, 207, 119, 0.14);
}

.lt-thumb:focus-visible {
  outline-offset: 2px;
}

.lt-thumb-no {
  display: block;
  margin-top: 7px;
  color: var(--edge-ink);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-align: left;
}

.lt-thumb-no i {
  margin-left: 3px;
  font-style: normal;
  opacity: 0.55;
}

.lt-thumb[aria-current="true"] .lt-thumb-no {
  color: var(--green);
}

.lt-disclosure {
  grid-column: 1 / -1;
  margin-top: 22px;
}

/* Without the script the controls cannot act, so only the first frame shows. */
.lt:not(.is-live) .lt-toolbar,
.lt:not(.is-live) .lt-strip,
[data-stock-room]:not(.is-live) .stock-list,
[data-lamp-house]:not(.is-live) .lamp-presets {
  display: none;
}

/* --------------------------------------------------- stock room, lamp house */

.bench {
  display: grid;
  grid-template-columns: minmax(290px, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(36px, 6vw, 80px);
  margin-bottom: 118px;
}

.bench-reverse {
  grid-template-columns: minmax(0, 7fr) minmax(290px, 5fr);
}

.bench-reverse .bench-copy {
  order: 2;
}

.bench-figure {
  min-width: 0;
  margin: 0;
}

.bench-copy > p:not(.eyebrow):not(.lamp-note) {
  color: var(--text-2);
}

.stock-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 26px;
}

.stock-chip {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 2px 10px;
  padding: 10px 12px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.stock-chip:hover {
  border-color: #3b3b40;
  background: rgba(255, 255, 255, 0.035);
}

.stock-code {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.stock-kind {
  grid-row: 1;
  grid-column: 2;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.stock-name {
  grid-column: 1 / -1;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.stock-chip[aria-pressed="true"] {
  border-color: var(--green);
  background: rgba(63, 207, 119, 0.07);
}

.stock-chip[aria-pressed="true"] .stock-code {
  color: var(--green);
}

.lamp-readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 28px 0 14px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    var(--panel);
}

.lamp {
  display: grid;
  grid-template-columns: 8px 1fr;
  grid-template-rows: 1fr auto;
  column-gap: 12px;
  align-items: end;
}

.lamp-meter {
  position: relative;
  grid-row: 1 / 3;
  height: 66px;
  overflow: hidden;
  border-radius: 4px;
  background: #0a0a0b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* LAD neutral sits at 25 of 50. */
.lamp-meter::after {
  position: absolute;
  right: -2px;
  bottom: 49%;
  left: -2px;
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
  content: "";
}

.lamp-meter i {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: calc(var(--lamp, 0.49) * 100%);
  background: var(--lamp-color);
  opacity: 0.82;
  transition: height 360ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.lamp-r { --lamp-color: var(--lamp-r); }
.lamp-g { --lamp-color: var(--lamp-g); }
.lamp-b { --lamp-color: var(--lamp-b); }

.lamp-value {
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color 200ms ease;
}

.lamp.is-moved .lamp-value {
  color: var(--text);
}

.lamp-name {
  margin-top: 6px;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.lamp-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lamp-preset {
  display: grid;
  gap: 2px;
  padding: 9px 11px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

/* Neutral spans the row; below it each column is an opposing pair
   (warmer over cooler, magenta over green, darker over brighter). */
.lamp-preset[data-lamp-key="neutral"] {
  display: flex;
  grid-column: 1 / -1;
  align-items: baseline;
  justify-content: space-between;
}

.lamp-preset small {
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.lamp-preset:hover {
  border-color: #3b3b40;
}

.lamp-preset[aria-pressed="true"] {
  border-color: var(--green);
  background: rgba(63, 207, 119, 0.07);
}

.lamp-note {
  min-height: 3.2em;
  margin: 16px 0 0;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  line-height: 1.6;
}

/* -------------------------------------------------------------- in Resolve */

.in-resolve {
  margin: 0 0 96px;
}

.in-resolve img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

.in-resolve figcaption {
  margin-top: 14px;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------ comparisons */

/* Override: frames read as film frames, with a slimmer splice handle. */
.wipe {
  border-radius: var(--frame-radius);
}

.wipe-divider {
  width: 1px;
  transform: none;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.35);
}

.wipe-divider span {
  width: 26px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 13px;
  background: rgba(10, 10, 11, 0.72);
  font-size: 11px;
  letter-spacing: -0.1em;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.wipe:hover .wipe-divider span {
  border-color: var(--green);
}

/* ---------------------------------------------------------------- science */

/* Override: the decorative ring becomes a drawn characteristic curve. */
.science-curve {
  top: 50%;
  right: -3%;
  width: min(54vw, 660px);
  height: auto;
  border: 0;
  border-radius: 0;
  opacity: 0.2;
  transform: translateY(-50%);
}

.hd-curve {
  display: block;
  width: 100%;
  height: auto;
}

.hd-grid path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1;
}

.hd-line {
  fill: none;
  stroke-linecap: round;
  stroke-width: 2.5;
}

.hd-r { stroke: var(--lamp-r); }
.hd-g { stroke: var(--lamp-g); }
.hd-b { stroke: var(--lamp-b); }

.hd-labels text {
  fill: var(--text-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.step-wedge {
  display: grid;
  grid-template-columns: repeat(21, minmax(0, 1fr));
  height: 12px;
  margin: 14px 15px 4px;
  overflow: hidden;
  border-radius: 2px;
  background: linear-gradient(to right, rgb(248,248,248) 0% 4.762%, rgb(216,216,216) 4.762% 9.524%, rgb(188,188,188) 9.524% 14.286%, rgb(164,164,164) 14.286% 19.048%, rgb(143,143,143) 19.048% 23.810%, rgb(125,125,125) 23.810% 28.571%, rgb(109,109,109) 28.571% 33.333%, rgb(96,96,96) 33.333% 38.095%, rgb(84,84,84) 38.095% 42.857%, rgb(74,74,74) 42.857% 47.619%, rgb(65,65,65) 47.619% 52.381%, rgb(57,57,57) 52.381% 57.143%, rgb(51,51,51) 57.143% 61.905%, rgb(45,45,45) 61.905% 66.667%, rgb(40,40,40) 66.667% 71.429%, rgb(36,36,36) 71.429% 76.190%, rgb(32,32,32) 76.190% 80.952%, rgb(29,29,29) 80.952% 85.714%, rgb(26,26,26) 85.714% 90.476%, rgb(24,24,24) 90.476% 95.238%, rgb(21,21,21) 95.238% 100%);
}

.step-wedge i + i {
  border-left: 1px solid rgba(0, 0, 0, 0.25);
}

.science-card-title {
  border-bottom: 0;
}

.science-card .step-wedge + dl {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 1060px) {
  /* Override: keep Stocks in the nav and fold Science instead. */
  .nav-links a:nth-child(3) {
    display: inline;
  }

  .nav-links a:nth-child(5) {
    display: none;
  }
}

@media (max-width: 900px) {
  .bench,
  .bench-reverse {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  /* The picture leads so a tap on a chip shows its result without scrolling. */
  .bench .bench-figure {
    order: 1;
  }

  .bench .bench-copy,
  .bench-reverse .bench-copy {
    order: 2;
  }

  .science-curve {
    top: 12%;
    width: 92vw;
    opacity: 0.12;
    transform: none;
  }
}

@media (max-width: 720px) {
  .light-table-section {
    padding: 52px 0 84px;
  }

  .lt {
    grid-template-columns: 1fr;
  }

  .lt-toolbar {
    justify-content: space-between;
  }

  .lt-toolbar .lt-btn:not(.lt-step) {
    flex: 1;
  }

  .lt-strip {
    margin-right: -17px;
    margin-left: -17px;
    border-radius: 0;
  }

  .lt-thumb {
    flex-basis: 116px;
  }

  .lt-tag {
    top: 16px;
    left: 16px;
  }

  .lt-marks,
  .wipe::before {
    inset: 8px;
  }

  .bench {
    margin-bottom: 88px;
  }

  .in-resolve {
    margin-bottom: 72px;
  }

  .edge-print {
    padding: 15px 0;
    font-size: 8px;
  }
}

@media (max-width: 420px) {
  .lamp-preset {
    padding: 8px 9px 9px;
  }

  .lamp-value {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lamp-meter i,
  .lt-layer-source {
    transition: none;
  }
}
