:root {
  --wall: #2a2725;
  --floor: #1f1d1b;
  --rig: #353230;
  --rig-line: #48443f;
  --print: #f7f7f5;
  --text: #efebe5;
  --muted: #a39e95;
  --tungsten: #ffcf8a;
  --ok: #7fd49b;
  --warn: #ffb067;
  --backdrop: #db1514;
  --cond: "wdth" 72;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 400 16px/1.5 "Archivo", system-ui, sans-serif;
  /* studio wall above, floor below, one warm pool of light in the middle */
  background:
    radial-gradient(60% 45% at 38% 28%, rgb(255 207 138 / 0.07), transparent 70%),
    linear-gradient(to bottom, var(--wall) 0%, var(--wall) 62%, var(--floor) 100%);
  background-attachment: fixed;
}
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--tungsten); outline-offset: 3px; }

.top, .studio, .foot { max-width: 1280px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.top { padding-top: 32px; padding-bottom: 8px; }
.brand {
  margin: 0;
  font-weight: 800;
  font-variation-settings: var(--cond);
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.lede { margin: 10px 0 0; color: var(--muted); max-width: 56ch; }

.studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
  padding-top: 20px;
}
@media (max-width: 960px) { .studio { grid-template-columns: minmax(0, 1fr); } }

/* ---------- backdrop rolls ---------- */
.set { position: relative; }
.rail {
  height: 6px; margin: 0 6%;
  border-radius: 3px;
  background: linear-gradient(#77726b, #3b3834);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.5);
}
.rolls {
  display: flex; justify-content: center; gap: clamp(10px, 3vw, 28px);
  margin: -3px 6% 0;
  min-height: 112px;
}
.roll {
  --c: #888;
  position: relative;
  width: clamp(64px, 12vw, 104px);
  border: 0; padding: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
}
.roll .tube {
  width: 100%; height: 16px; border-radius: 8px;
  background:
    linear-gradient(to bottom, rgb(255 255 255 / 0.35), transparent 45%, rgb(0 0 0 / 0.35)),
    var(--c);
  box-shadow: 0 3px 8px rgb(0 0 0 / 0.45);
  position: relative; z-index: 1;
}
.roll .drop {
  width: 88%; height: 26px; margin-top: -4px;
  background:
    linear-gradient(to bottom, rgb(0 0 0 / 0.25), transparent 30%),
    var(--c);
  transition: height 420ms cubic-bezier(.2, .8, .2, 1);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.roll[aria-pressed="true"] .drop { height: 58px; }
.roll .name {
  margin-top: 8px; font-size: 14px; color: var(--muted);
  font-variation-settings: var(--cond); font-weight: 600;
}
.roll[aria-pressed="true"] .name { color: var(--text); }
.roll:hover .drop { height: 40px; }
.roll[aria-pressed="true"]:hover .drop { height: 58px; }
.roll input[type="color"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

/* ---------- stage ---------- */
.stage {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  gap: 18px;
  align-items: center;
  margin-top: 6px;
}
.softbox {
  height: 62%;
  min-height: 140px;
  border-radius: 6px;
  background: linear-gradient(#4a4642, #2f2c29);
  border: 2px solid #55504a;
  position: relative;
  display: grid; place-items: center;
}
.softbox i {
  position: absolute; inset: 7px; border-radius: 3px;
  background: #5b5650;
  transition: background 500ms ease, box-shadow 500ms ease;
}
.stage[data-light="ok"] .softbox i {
  background: #fff4e2;
  box-shadow: 0 0 22px 6px rgb(255 207 138 / 0.55), 0 0 80px 24px rgb(255 207 138 / 0.18);
}
.stage[data-light="low"] .softbox i {
  background: #9c8b72;
  box-shadow: 0 0 14px 2px rgb(255 176 103 / 0.25);
}
@media (max-width: 720px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .softbox { display: none; }
}

.viewfinder {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #0f0e0d;
  box-shadow: 0 0 0 1px #4a4641, 0 30px 60px -20px rgb(0 0 0 / 0.7);
}
.viewfinder video { display: none; }
.viewfinder canvas { width: 100%; height: 100%; object-fit: contain; display: block; }

/* empty set: the chosen paper, lit from the front, curving into the floor */
.vf-empty {
  position: absolute; inset: 0;
  display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(55% 60% at 50% 38%, rgb(255 255 255 / 0.22), transparent 70%),
    linear-gradient(to bottom, transparent 70%, rgb(0 0 0 / 0.35)),
    var(--backdrop);
  transition: background-color 420ms ease;
}
.vf-card {
  background: rgb(20 18 17 / 0.78);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 22px 24px;
  text-align: center;
  max-width: 360px;
}
.vf-title {
  margin: 0 0 14px; font-weight: 700; font-size: 22px;
  font-variation-settings: var(--cond);
}
.vf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.vf-note { margin: 12px 0 0; color: var(--muted); font-size: 13px; }

.corner { position: absolute; width: 22px; height: 22px; border: 2px solid rgb(255 255 255 / 0.7); pointer-events: none; }
.corner.tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.corner.tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; }
.corner.br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }
.vf-empty:not([hidden]) ~ .corner, .vf-empty:not([hidden]) ~ .hud { display: none; }

.hud {
  position: absolute; top: 14px; left: 44px; right: 44px; margin: 0;
  display: flex; justify-content: space-between;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  font-variation-settings: var(--cond);
  color: rgb(255 255 255 / 0.85);
  text-shadow: 0 1px 3px rgb(0 0 0 / 0.6);
  pointer-events: none;
}
.hud:empty { display: none; }

.count {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-weight: 800; font-variation-settings: var(--cond);
  font-size: clamp(96px, 18vw, 200px); color: #fff;
  text-shadow: 0 6px 40px rgb(0 0 0 / 0.55);
  pointer-events: none;
}
.count:empty { display: none; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.on { animation: flash 480ms ease-out; }
@keyframes flash { from { opacity: 0.95; } to { opacity: 0; } }

/* ---------- console under the camera ---------- */
.console { margin: 18px 74px 0; }
@media (max-width: 720px) { .console { margin: 16px 0 0; } }

.status {
  margin: 0 0 10px;
  font-size: 20px; font-weight: 600; line-height: 1.3;
  display: flex; align-items: center; gap: 10px;
}
.status .dot { width: 10px; height: 10px; border-radius: 50%; background: #5b5650; flex: none; }
.status.ok .dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.status.warn .dot { background: var(--warn); }

.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.checks li {
  font-size: 13px; padding: 3px 10px; border-radius: 999px;
  background: var(--rig); color: var(--muted);
}
.checks li.ok { color: var(--ok); }
.checks li.bad { color: var(--warn); background: rgb(255 176 103 / 0.12); }

.controls {
  margin-top: 18px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.controls-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.controls-side.end { align-items: flex-end; }
.controls select {
  padding: 7px 10px; border-radius: 8px; border: 1px solid var(--rig-line);
  background: var(--rig); max-width: 100%;
}
.toggle { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--tungsten); }

.shutter {
  width: 76px; height: 76px; border-radius: 50%;
  border: 4px solid var(--text); background: transparent; padding: 5px; cursor: pointer;
}
.shutter span {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  background: var(--text);
  transition: transform 120ms ease, background 200ms ease;
}
.shutter:hover span { background: #fff; }
.shutter:active span { transform: scale(0.9); }
.shutter:disabled { opacity: 0.35; cursor: not-allowed; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; cursor: pointer;
}
.btn.light { background: var(--print); color: #1d1b19; }
.btn.light:hover { background: #fff; }
.btn.outline { border-color: rgb(255 255 255 / 0.28); background: transparent; }
.btn.outline:hover { border-color: rgb(255 255 255 / 0.6); }
.btn.wide { width: 100%; }

/* ---------- print desk ---------- */
.desk {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(#36332f, #2c2926);
  border: 1px solid var(--rig-line);
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.8);
}
.block { margin: 0; padding: 0; border: 0; }
.block legend, .adjust summary, .print-title {
  font-weight: 700; font-variation-settings: var(--cond); font-size: 17px;
}
.block legend { padding: 0; margin-bottom: 12px; float: left; width: 100%; }
.adjust { border-top: 1px solid var(--rig-line); padding-top: 14px; }
.adjust summary { cursor: pointer; }
.adjust[open] summary { margin-bottom: 4px; }

.sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: end; clear: both; }
.size {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 4px 10px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; cursor: pointer;
}
.size:hover { background: rgb(255 255 255 / 0.04); }
.size .paper {
  background: var(--print);
  padding: 3px;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.5);
  transition: transform 200ms ease;
}
.size .paper span {
  display: block; width: 100%; height: 100%;
  background:
    radial-gradient(22% 17% at 50% 38%, rgb(255 255 255 / 0.55) 98%, transparent 100%),
    radial-gradient(40% 22% at 50% 100%, rgb(255 255 255 / 0.55) 98%, transparent 100%),
    var(--backdrop);
  transition: background-color 420ms ease;
}
.size b { font-size: 15px; font-variation-settings: var(--cond); }
.size small { color: var(--muted); font-size: 12px; line-height: 1.25; text-align: center; }
.size[aria-pressed="true"] { border-color: var(--rig-line); background: rgb(255 255 255 / 0.06); }
.size[aria-pressed="true"] .paper { transform: translateY(-3px) rotate(-2deg); }

.range { display: block; margin-top: 12px; font-size: 14px; }
.range span { display: flex; justify-content: space-between; color: var(--muted); }
.range output { color: var(--text); font-variant-numeric: tabular-nums; }
.range input { width: 100%; accent-color: var(--tungsten); }

.prints { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--rig-line); padding-top: 16px; }
.print { background: var(--print); padding: 6px; box-shadow: 0 6px 16px rgb(0 0 0 / 0.55); }
.print canvas { display: block; width: 100%; height: auto; }
.print-single { display: flex; gap: 14px; align-items: flex-start; }
.print-single .print { width: 112px; flex: none; transform: rotate(-2deg); }
.print-title { margin: 0 0 4px; }
.note { margin: 0; color: var(--muted); font-size: 13px; }
.note.warn { color: var(--warn); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.sheet-head select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--rig-line); background: var(--rig); }
.sheet-wrap { padding: 0; }
.desk-empty { margin: 0; color: var(--muted); font-size: 14px; border-top: 1px solid var(--rig-line); padding-top: 14px; }

.foot { padding-top: 36px; padding-bottom: 40px; color: var(--muted); font-size: 14px; }
.foot p { margin: 0; max-width: 70ch; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
