/* lightroom bench · concrete · mint cut */

:root {
  --concrete: #e4e6ea;
  --concrete-deep: #cdd1d8;
  --slab: #b8bec8;
  --ink: #1a1d22;
  --muted: #5f6570;
  --mint: #2db88a;
  --mint-hot: #3ad4a4;
  --mint-soft: #dff5ec;
  --line: rgba(26, 29, 34, 0.1);
  --font-ui: "Figtree", sans-serif;
  --font-text: "Spectral", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(900px 400px at 0% 0%, rgba(45, 184, 138, 0.1), transparent 55%),
    linear-gradient(168deg, #eef0f3 0%, var(--concrete) 42%, var(--concrete-deep) 100%);
  -webkit-font-smoothing: antialiased;
}

.bench-glow {
  position: fixed;
  inset: 20% auto auto 50%;
  width: 45vw;
  height: 50vh;
  transform: translateX(-30%);
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.65), transparent 68%);
  opacity: 0.75;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

.workbench {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem 4.5rem;
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 0 1rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  text-decoration: none;
  color: var(--ink);
}

.brand strong {
  display: block;
  font-size: 1.08rem;
  font-weight: 700;
}

.brand em {
  font-style: normal;
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bar nav {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.bar a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.bar a:hover { color: var(--mint); border-bottom-color: var(--mint); }

.intro {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  padding: 2rem 0 1.75rem;
  align-items: end;
  animation: rise 0.65s ease both;
}

@media (max-width: 900px) {
  .intro, .stage { grid-template-columns: 1fr; }
}

.kicker {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mint);
}

.intro h1 {
  margin: 0;
  font-family: var(--font-text);
  font-size: clamp(1.9rem, 4.2vw, 2.7rem);
  font-weight: 600;
  line-height: 1.12;
}

.intro .lead {
  margin: 0.85rem 0 1rem;
  font-family: var(--font-text);
  color: var(--muted);
  max-width: 40ch;
  font-size: 1.05rem;
}

.jump {
  display: inline-flex;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  color: #fff;
  background: var(--ink);
  padding: 0.48rem 0.95rem;
  border-bottom: 3px solid var(--mint);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.jump:hover {
  transform: translateY(-2px);
  border-color: var(--mint-hot);
}

.gloss {
  background: #fff;
  border: 1px solid var(--line);
  padding: 1rem 1.1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  box-shadow: 10px 10px 0 var(--slab);
  font-family: var(--font-text);
}

.gloss b { color: var(--mint); }

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.25rem;
  align-items: start;
}

.stage-main { animation: rise 0.72s ease 0.06s both; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem;
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 0.75rem;
  box-shadow: 0 8px 24px rgba(26, 29, 34, 0.06);
}

.toolbar label,
.toolbar button {
  font-size: 0.85rem;
  font-weight: 600;
}

.file-pick {
  position: relative;
  overflow: hidden;
  padding: 0.45rem 0.85rem;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}

.file-pick input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.thresh-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.toolbar button {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  background: var(--mint-soft);
  cursor: pointer;
  transition: transform 0.18s ease;
}

.toolbar button:hover { transform: translateY(-1px); }

.toolbar button.is-on {
  background: var(--mint);
  color: #fff;
  border-color: var(--mint);
}

.toolbar button.export {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.toolbar input[type="range"] {
  width: 120px;
  accent-color: var(--mint);
}

.canvas-wrap {
  background:
    repeating-conic-gradient(#d8dce2 0% 25%, #eceff3 0% 50%) 50% / 16px 16px;
  border: 1px solid var(--line);
  position: relative;
  isolation: isolate;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.cut-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 42%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--mint), transparent);
  box-shadow: 0 0 12px rgba(45, 184, 138, 0.55);
  pointer-events: none;
  z-index: 2;
  animation: cut-sweep 5s ease-in-out infinite;
  opacity: 0.55;
}

.canvas-wrap:not(.is-empty) .cut-line { opacity: 0.25; }

.canvas-wrap canvas {
  max-width: 100%;
  display: block;
  touch-action: none;
  position: relative;
  z-index: 1;
}

.mask-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: auto;
  z-index: 3;
}

.canvas-wrap.is-empty::after {
  content: "Положите фото — увидите поле и контур";
  position: absolute;
  color: var(--muted);
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 1;
}

.stage-note {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  min-height: 1.3em;
}

#note { margin: 0.65rem 0 0; font-size: 0.88rem; color: var(--muted); }

.rail {
  display: grid;
  gap: 0.85rem;
}

.rail-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 1rem;
  font-size: 0.88rem;
  border-left: 3px solid var(--mint);
  transition: transform 0.25s ease;
}

.rail-card:hover { transform: translateX(4px); }

.rail-card h2 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.rail-card p {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-text);
  font-size: 0.95rem;
}

.limits {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--mint);
}

.limits h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-family: var(--font-text);
}

.limit-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 820px) {
  .limit-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.limit-cards li {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.limit-cards li:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(26, 29, 34, 0.08);
}

.limit-cards b {
  display: block;
  font-size: 0.78rem;
  color: var(--mint);
  margin-bottom: 0.35rem;
}

.limit-cards strong { display: block; margin-bottom: 0.2rem; }
.limit-cards span { color: var(--muted); font-family: var(--font-text); font-size: 0.95rem; }

.foot {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.75rem;
}

.foot a { color: var(--ink); }

.prose {
  padding: 1.5rem 0 3rem;
  max-width: 52ch;
  font-family: var(--font-text);
}

.cookie {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  background: var(--ink);
  color: #e8eaed;
  font-size: 0.85rem;
  z-index: 40;
  border-radius: 6px;
  border-bottom: 3px solid var(--mint);
  box-shadow: 0 16px 40px rgba(26, 29, 34, 0.35);
}

.cookie a { color: var(--mint-hot); }

.cookie button {
  border: 0;
  background: var(--mint);
  color: #fff;
  font-weight: 700;
  padding: 0.45rem 1rem;
  cursor: pointer;
}

.cookie[hidden] { display: none !important; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cut-sweep {
  0%, 100% { transform: translateY(0); opacity: 0.45; }
  50% { transform: translateY(6px); opacity: 0.75; }
}

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