@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --bg: #191916;
  --panel: #20201c;
  --line: #393932;
  --muted: #929187;
  --text: #e6e1d3;
  --accent: #da7953;
  --mono: "IBM Plex Mono", monospace;
  --sans: "DM Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
}

button,
a,
input,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
label:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

button {
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.2s;
}

button:hover:not(:disabled) {
  filter: brightness(1.12);
}

header {
  height: 87px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4%;
}

.brand {
  font-size: 29px;
  letter-spacing: -1.4px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  color: var(--accent);
  font-size: 38px;
}

.brand-sub {
  font: 9px var(--mono);
  letter-spacing: 1.7px;
  margin-left: 22px;
  max-width: 90px;
  line-height: 1.6;
}

.room {
  font: 10px var(--mono);
  letter-spacing: 1.5px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.room i {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 15px #dc6b44;
}

.quiet {
  border: 0;
  background: none;
  font-size: 11px;
  padding: 6px 0;
  color: var(--muted);
}

header .quiet span {
  margin-left: 20px;
}

main {
  max-width: 1550px;
  margin: auto;
  padding: 0 4%;
}

.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 43px 0 31px;
}

.eyebrow {
  font: 9px var(--mono);
  letter-spacing: 1.8px;
  color: var(--muted);
}

h1 {
  font-family: Georgia, serif;
  font-size: 44px;
  font-weight: 400;
  letter-spacing: -1.5px;
  margin: 9px 0 0;
}

.heading p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 12px;
  margin: 0;
}

.studio {
  display: grid;
  grid-template-columns: 220px minmax(300px, 1fr) 229px;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 2rem;
}

.library,
.controls {
  padding: 23px 20px;
  background: var(--panel);
}

.section-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-top h2 {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

.section-top>span {
  font: 10px var(--mono);
  color: var(--muted);
}

.muted {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.7;
}

.upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
  border: 1px dashed #5a5547;
  padding: 16px 6px;
  margin-top: 23px;
  cursor: pointer;
  font-size: 11px;
}

.upload>span {
  font-size: 17px;
  color: var(--accent);
}

.upload small {
  font-size: 8px;
  flex-basis: 100%;
  text-align: center;
  color: var(--muted);
}

#library {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 25px;
}

.film-card {
  background: transparent;
  border: 0;
  min-width: 0;
  text-align: left;
  padding: 0;
}

.film-thumb {
  padding: 9px 6px;
  background: #38372e;
  border: 1px solid #5c5845;
  position: relative;
  box-shadow: 2px 5px 10px #0005;
  transform: rotate(-3deg);
}

.film-card:nth-child(even) .film-thumb {
  transform: rotate(4deg);
}

.film-thumb:before,
.film-thumb:after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  height: 3px;
  background: repeating-linear-gradient(90deg, #171713 0 5px, transparent 5px 10px);
}

.film-thumb:before {
  top: 2px;
}

.film-thumb:after {
  bottom: 2px;
}

.film-thumb canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  filter: grayscale(1) invert(1);
  opacity: 0.8;
}

.film-card small {
  font: 8px var(--mono);
  color: var(--muted);
  display: block;
  margin-top: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.note>span {
  font-size: 22px;
  color: var(--accent);
}

.demo {
  margin-top: 17px;
  font-size: 9px;
}

.workspace {
  min-width: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.workspace-top,
.workspace-bottom {
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 9px var(--mono);
  color: var(--muted);
  gap: 10px;
}

.workspace-top {
  border-bottom: 1px solid var(--line);
}

.workspace-top .quiet {
  font: 9px var(--mono);
}

.bench {
  height: 485px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 40%, #4b45382e, transparent 70%),
    repeating-linear-gradient(0deg, #00000008 0 1px, transparent 1px 4px), #25251f;
}

.paper-wrap {
  width: 304px;
  aspect-ratio: 4/5;
  position: relative;
  background: #eee9dc;
  box-shadow:
    0 2px 2px #0004,
    0 15px 30px #0006;
  touch-action: none;
  isolation: isolate;
}

.paper-wrap:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.8' numOctaves='3' seed='7'/%3E%3C/filter%3E%3Cpath fill='%23888888' filter='url(%23n)' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  z-index: 5;
}

#paper {
  width: 100%;
  height: 100%;
  display: block;
}

#layers {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.negative {
  position: absolute;
  cursor: grab;
  transform-origin: center;
  touch-action: none;
  user-select: none;
  padding: 5px;
  background: #514a31a8;
  border: 1px solid #7f755a88;
  box-shadow: 1px 2px 4px #0003;
  mix-blend-mode: multiply;
}

.negative.selected {
  outline: 1px solid #b4684d;
  outline-offset: 6px;
}

.negative canvas {
  display: block;
  width: 100%;
  height: 100%;
  filter: invert(1) grayscale(1);
  opacity: 0.88;
  pointer-events: none;
}

.paper-stamp {
  position: absolute;
  bottom: 6px;
  left: 10px;
  font: 5px var(--mono);
  letter-spacing: 1px;
  color: #78766b;
  pointer-events: none;
}

.ruler {
  width: 304px;
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  color: #79796b;
  font: 8px var(--mono);
  letter-spacing: 1px;
}

#exposure-light {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse, #fff4ca30, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.exposing #exposure-light {
  opacity: 1;
}

.exposing .negative.selected {
  outline: none;
}

.workspace-bottom {
  font-size: 8px;
  min-height: 45px;
}

.workspace-bottom #hint {
  flex: 1;
}

.paper-dot {
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 100%;
}

.timer {
  margin: 25px 0 24px;
  text-align: center;
  background: #141512;
  border: 1px solid #36372d;
  padding: 17px 0;
  box-shadow: inset 0 3px 15px #0005;
  border-radius: 3px;
}

.timer>span {
  font: 40px var(--mono);
  color: #e1c8a7;
  letter-spacing: 1px;
  line-height: 1;
}

.timer small {
  display: block;
  font: 7px var(--mono);
  letter-spacing: 2px;
  color: #7e7c6a;
  margin-top: 9px;
}

.control-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  margin: 20px 0 11px;
}

.control-label output {
  font: 9px var(--mono);
  color: var(--accent);
}

input[type="range"] {
  width: 100%;
  height: 3px;
  accent-color: var(--accent);
  cursor: pointer;
  display: block;
  margin: 12px 0;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font: 7px var(--mono);
  color: #77776b;
  margin: 10px 0 20px;
}

.primary,
.secondary,
.develop {
  border-radius: 2px;
  font-size: 11px;
  padding: 13px 10px;
  width: 100%;
}

.primary {
  background: var(--accent);
  color: #211a15;
  border: 1px solid var(--accent);
  font-weight: 600;
}

.secondary {
  background: transparent;
  border: 1px solid #4b4a3e;
  margin-top: 9px;
}

.tools {
  border-top: 1px solid var(--line);
  margin-top: 23px;
  padding-top: 20px;
}

.tool-row {
  display: flex;
  gap: 6px;
  margin-top: 13px;
}

.tool {
  flex: 1;
  background: transparent;
  border: 1px solid #454438;
  padding: 9px 0 7px;
  font-size: 21px;
}

.tool small {
  display: block;
  font-size: 8px;
  margin-top: 5px;
  color: var(--muted);
}

.tool.active {
  border-color: var(--accent);
  color: var(--accent);
  background: #d4795010;
}

.tools .muted {
  font-size: 9px;
  margin-bottom: 0;
}

.develop {
  border: 1px solid #82765c;
  background: #3b382d;
  margin-top: 20px;
  color: #e2d3b6;
}

.wet-area {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 25px;
  margin: 28px 0 26px;
  align-items: center;
}

.wet-title p {
  color: var(--muted);
  font: italic 17px Georgia;
  line-height: 1.5;
  max-width: 180px;
}

.trays {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.tray {
  height: 128px;
  border: 1px solid #59564b;
  border-radius: 9px;
  background: linear-gradient(145deg, #48463c, #2a2c26);
  box-shadow:
    0 7px 12px #0003,
    inset 0 1px 1px #ffffff18;
  position: relative;
  padding: 12px;
  color: var(--text);
  overflow: hidden;
}

.liquid {
  position: absolute;
  inset: 8px 8px 39px;
  border: 2px solid #1d201a;
  border-radius: 6px;
  box-shadow: inset 0 3px 7px #0009;
  background:
    repeating-radial-gradient(ellipse at 40% 70%, #ffffff04 0 1px, transparent 2px 18px),
    #494b32;
}

.fixer .liquid {
  background-color: #3c483b;
}

.wash .liquid {
  background-color: #364648;
}

.tray-number {
  position: absolute;
  z-index: 2;
  top: 18px;
  left: 18px;
  font: 9px var(--mono);
  color: #bcb7a477;
}

.tray-label {
  position: absolute;
  bottom: 13px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.tray-label small {
  font: 7px var(--mono);
  letter-spacing: 1px;
  color: var(--muted);
}

.tray.active {
  border-color: var(--accent);
  box-shadow: 0 0 25px #d4795025;
}

.tray.active .liquid {
  animation: ripple 1.7s infinite alternate;
}

.tray.drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: 5px;
}

footer {
  border-top: 1px solid var(--line);
  padding: 19px 0 25px;
  display: flex;
  justify-content: space-between;
  color: #77766b;
  font: 8px var(--mono);
  letter-spacing: 1px;
}

footer span:last-child {
  font: italic 12px Georgia;
  letter-spacing: 0;
}

dialog {
  background: #24241f;
  color: var(--text);
  border: 1px solid #555144;
  border-radius: 5px;
  padding: 35px;
  max-width: 550px;
  width: 90%;
  box-shadow: 0 30px 100px #0009;
}

dialog::backdrop {
  background: #090b09c9;
  backdrop-filter: blur(5px);
}

dialog h2 {
  font: 30px Georgia;
  letter-spacing: -0.7px;
  margin: 12px 0 22px;
}

dialog p,
dialog li {
  color: #aaa99c;
  font-size: 12px;
  line-height: 1.9;
}

dialog ol {
  padding-left: 20px;
}

dialog li {
  padding: 4px 0;
}

.close {
  position: absolute;
  right: 15px;
  top: 9px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 23px;
}

#result {
  max-width: 510px;
  text-align: center;
}

#result-canvas {
  max-height: 50vh;
  max-width: 100%;
  width: auto;
  box-shadow: 0 8px 20px #0008;
  display: block;
  margin: 0 auto 22px;
  background: #eee9dc;
}

.result-actions {
  display: flex;
  gap: 10px;
}

.result-actions button {
  flex: 1;
  margin: 0;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 25px;
  transform: translateX(-50%) translateY(100px);
  background: #e1d7bf;
  color: #29261e;
  padding: 14px 22px;
  border-radius: 3px;
  box-shadow: 0 6px 25px #0006;
  font-size: 12px;
  transition: transform 0.3s;
  z-index: 100;
}

#toast.visible {
  transform: translateX(-50%) translateY(0);
}

#brush-cursor {
  display: none;
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 1px dashed #cc7855;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: #cc78551a;
  z-index: 8;
}

.processing #layers {
  display: none;
}

.processing .paper-wrap {
  pointer-events: none;
}

.flying-print {
  position: fixed;
  z-index: 99;
  pointer-events: none;
  box-shadow: 0 8px 25px #0007;
  transition: all 1.1s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.flying-print canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#test-options {
  display: flex;
  gap: 5px;
  margin-bottom: 18px;
}

#test-options button {
  flex: 1;
  background: #39382f;
  border: 1px solid #68604c;
  padding: 8px 0;
  font: 10px var(--mono);
}

@keyframes ripple {
  to {
    background-position: 12px 5px;
    filter: brightness(1.2);
  }
}

@media (min-width: 1450px) {
  .bench {
    height: 560px;
  }

  .paper-wrap,
  .ruler {
    width: 350px;
  }
}

@media (max-width: 1050px) {
  .studio {
    grid-template-columns: 165px minmax(280px, 1fr) 200px;
  }

  .library,
  .controls {
    padding: 18px 14px;
  }

  .brand-sub {
    display: none;
  }

  .wet-area {
    grid-template-columns: 165px 1fr;
  }

  .trays {
    gap: 14px;
  }

  .tray-label small {
    font-size: 6px;
  }

  .workspace-bottom #hint {
    max-width: 150px;
  }

  .paper-wrap,
  .ruler {
    width: 270px;
  }
}

@media (max-width: 760px) {
  header {
    height: 70px;
  }

  .room {
    font-size: 8px;
  }

  .heading {
    padding: 28px 0 23px;
  }

  h1 {
    font-size: 35px;
  }

  .heading p {
    display: none;
  }

  .studio {
    grid-template-columns: minmax(0, 1fr) 180px;
  }

  .library {
    grid-column: 1/-1;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 15px;
  }

  .library .muted,
  .note,
  .demo {
    display: none;
  }

  .library .section-top {
    min-width: 110px;
    gap: 12px;
  }

  .upload {
    margin: 0;
    padding: 8px 12px;
  }

  .upload small {
    display: none;
  }

  #library {
    display: flex;
    gap: 15px;
    margin: 0;
  }

  .film-card {
    width: 43px;
  }

  .film-card small {
    display: none;
  }

  .film-thumb {
    padding: 5px 3px;
  }

  .film-thumb canvas {
    height: 40px;
  }

  .workspace {
    border-left: 0;
  }

  .bench {
    height: 430px;
  }

  .paper-wrap,
  .ruler {
    width: 230px;
  }

  .workspace-top {
    padding: 12px;
    font-size: 7px;
  }

  .workspace-bottom {
    padding: 12px;
    flex-wrap: wrap;
  }

  .workspace-bottom #hint {
    flex-basis: 100%;
    max-width: none;
  }

  .wet-area {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .wet-title {
    display: flex;
    gap: 20px;
    align-items: center;
  }

  .wet-title p {
    max-width: none;
    font-size: 13px;
    margin: 0;
  }

  .tray {
    height: 110px;
  }

  .tray-label {
    left: 10px;
    right: 10px;
  }

  .tray-label small {
    display: none;
  }

  footer span:first-child {
    font-size: 6px;
  }
}

@media (max-width: 480px) {
  header .quiet {
    font-size: 9px;
  }

  .brand {
    font-size: 24px;
  }

  .brand-icon {
    font-size: 30px;
  }

  .room {
    display: none;
  }

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

  .workspace {
    border-right: 0;
  }

  .controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
    border-top: 1px solid var(--line);
  }

  .controls>.section-top,
  .controls>.timer,
  .controls>.tools,
  .controls>#selection,
  .controls>.develop {
    grid-column: 1/-1;
  }

  .controls>.control-label,
  .controls>input,
  .controls>.range-labels {
    grid-column: 1/-1;
  }

  .timer {
    margin: 18px 0 5px;
    padding: 10px;
  }

  .controls .tools {
    margin-top: 20px;
  }

  .paper-wrap,
  .ruler {
    width: 260px;
  }

  .bench {
    height: 410px;
  }

  .workspace-bottom #hint {
    flex-basis: auto;
  }

  .wet-title p {
    display: none;
  }

  .trays {
    gap: 10px;
  }

  .tray {
    height: 100px;
  }

  .tray-label {
    font-size: 10px;
  }

  .library {
    gap: 12px;
  }

  .heading .eyebrow {
    font-size: 8px;
  }

  .result-actions {
    flex-direction: column;
  }

  dialog {
    padding: 28px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}

/* Film controls remain visible beside the object and in the inspector. */
.negative-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 23px;
  height: 23px;
  border: 1px solid #e4d8c0;
  border-radius: 50%;
  background: #302b22;
  color: #fff1d8;
  font: 18px/18px var(--sans);
  padding: 0;
  z-index: 4;
  box-shadow: 0 2px 5px #0006;
  cursor: pointer;
}

.negative-remove:hover {
  background: #a9472d;
}

.negative-remove:disabled {
  display: none;
}

.selection-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.selection-title h3 {
  font-size: 10px;
  font-weight: 500;
  margin: 0;
}

.remove-negative {
  background: #d4795010;
  border: 1px solid #94573c;
  color: #edac8c;
  padding: 5px 7px;
  font-size: 9px;
  border-radius: 2px;
}

.slider-reset {
  display: flex;
  gap: 10px;
  align-items: center;
}

.slider-reset input {
  flex: 1;
  min-width: 0;
}

.reset-control {
  flex: 0 0 46px;
  background: #2c2c25;
  border: 1px solid #655b47;
  color: #e0c6a4;
  border-radius: 2px;
  padding: 6px 3px;
  font: 9px var(--mono);
}

#selection .control-label {
  margin-top: 14px;
  margin-bottom: 3px;
}

.workspace-material {
  font: 7px var(--mono);
  letter-spacing: 1px;
  color: #77776b;
}

.paper-supply {
  position: relative;
  height: 76px;
  overflow: hidden;
  background: linear-gradient(#1e1f1a, #181915);
  border-top: 1px solid #34352c;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.paper-supply>span {
  font: 7px var(--mono);
  letter-spacing: 1.1px;
  color: #79796a;
  max-width: 95px;
  line-height: 1.8;
}

.fresh-sheet {
  position: absolute;
  left: 50%;
  bottom: -117px;
  transform: translateX(-50%) rotate(-3deg);
  width: 144px;
  height: 180px;
  border: 1px solid #f8f2e6;
  background: linear-gradient(135deg, #f8f2e5, #d7d0bf);
  color: #4a4436;
  box-shadow: 0 -2px 15px #0005;
  transition:
    bottom 0.25s,
    transform 0.25s;
  touch-action: none;
  user-select: none;
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
}

.fresh-sheet:hover:not(:disabled),
.fresh-sheet:focus-visible {
  bottom: -106px;
  transform: translateX(-50%) rotate(0deg);
}

.fresh-arrow {
  font: 21px/20px Georgia;
}

.fresh-sheet strong {
  font: italic 16px/18px Georgia;
}

.fresh-sheet small {
  font: 6px var(--mono);
  letter-spacing: 1px;
  margin-top: 2px;
}

.fresh-sheet:disabled {
  opacity: 0.35;
}

.fresh-flight {
  position: fixed;
  pointer-events: none;
  z-index: 100;
  background: linear-gradient(135deg, #f8f2e5, #e8e1d1);
  box-shadow: 0 6px 24px #0006;
  transform: rotate(-3deg);
  border: 1px solid #fff7e6;
}

.fresh-flight.landing {
  transition:
    left 0.65s cubic-bezier(0.2, 0.6, 0.3, 1),
    top 0.65s cubic-bezier(0.2, 0.6, 0.3, 1),
    width 0.65s,
    height 0.65s,
    transform 0.65s,
    opacity 0.2s;
}

.sheet-drop-target {
  outline: 1px dashed var(--accent);
  outline-offset: -10px;
}

.paper-wrap {
  transition: opacity 0.2s;
}

@media (max-width: 760px) {
  .paper-supply>span {
    display: none;
  }

  .workspace-material {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fresh-flight.landing {
    transition: none;
  }
}