:root {
  --paper: #fffdf8;
  --sand: #f5eee1;
  --sand-deep: #ebdfc8;
  --line: #e2d5bc;
  --emerald: #0f4a3c;
  --emerald-deep: #0a372c;
  --sage-soft: #e5eee8;
  --gold: #c49a45;
  --gold-ink: #87631f;
  --ink: #1e2b27;
  --muted: #5b6862;
  --danger: #a5402f;
  --danger-soft: #f6e4de;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

img { display: block; max-width: 100%; height: auto; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

[hidden] { display: none !important; }

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

/* ---------- top bar ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 16px 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--emerald);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.15rem;
}

.brand-mark { width: 30px; height: 30px; }
.brand-mark path { fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark rect { fill: var(--emerald); }

.lang select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--ink);
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%230f4a3c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 16px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 10px 42px 10px 16px;
  min-height: 44px;
  cursor: pointer;
}

[dir="rtl"] .lang select {
  background-position: left 14px center;
  padding: 10px 16px 10px 42px;
}

.lang select:hover { border-color: var(--gold); }

/* ---------- the sheet holding the three steps ---------- */

main { padding-bottom: 0; }

.sheet {
  position: relative;
  max-width: 760px;
  margin: 0 12px;
  padding: 22px 20px 30px;
  background: var(--paper);
  border-radius: 28px;
  box-shadow: 0 0 0 1px rgb(15 74 60 / 0.08), 0 30px 60px -28px rgb(10 55 44 / 0.45);
}

@media (min-width: 784px) {
  .sheet { margin: 0 auto; padding: 30px 44px 40px; }
}

.sheet h1 {
  margin: 0;
  color: var(--emerald-deep);
  font-size: clamp(1.35rem, 4.6vw, 1.75rem);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

[dir="rtl"] .sheet h1 { letter-spacing: 0; line-height: 1.45; }

.step { padding-top: 22px; }
.step + .step { margin-top: 10px; border-top: 1.5px dashed var(--line); }

h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--emerald-deep);
  font-size: 1.35rem;
  line-height: 1.3;
  font-weight: 600;
}

.step-no {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--emerald);
  color: var(--paper);
  font-size: 1.02rem;
  font-weight: 600;
}

/* document choice */
.docs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.doc {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px 14px;
  background: var(--sand);
  border: 2px solid transparent;
  border-radius: 22px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.doc:hover { background: var(--sand-deep); }

.doc input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }

.doc:has(input:checked) {
  background: #fff;
  border-color: var(--emerald);
  box-shadow: 0 10px 24px -16px rgb(10 55 44 / 0.6);
}

.doc:has(input:checked)::after {
  content: "";
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--emerald) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 12.5l3.2 3.2L17 9' fill='none' stroke='%23fffdf8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}

.doc:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 3px; }

.doc-art {
  width: 100%;
  max-width: 132px;
  aspect-ratio: 1;
  object-fit: contain;
  margin-bottom: 4px;
}

.doc-name {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  hyphens: manual;
}

.doc-spec { margin-top: 3px; color: var(--muted); font-size: 0.86rem; line-height: 1.35; }
.doc-spec .nums { white-space: nowrap; direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }

/* file pickers */
.pickers { display: grid; gap: 12px; }

.picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--sand);
  border: 2px dashed var(--line);
  border-radius: 22px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.picker:hover { border-color: var(--gold); }
.picker input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.picker:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 3px; }
.picker.dragging { border-color: var(--emerald); background: var(--sage-soft); }
.picker.filled { border-style: solid; border-color: var(--emerald); background: #fff; }

.picker-art { width: 96px; height: 96px; flex: none; object-fit: contain; }

.picker-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.picker-side { font-weight: 600; }

.picker-button {
  display: inline-block;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--emerald);
  color: var(--paper);
  font-weight: 500;
  font-size: 1.04rem;
  line-height: 1.3;
}

.picker:hover .picker-button { background: var(--emerald-deep); }

.picker.filled .picker-button {
  background: transparent;
  color: var(--emerald);
  box-shadow: inset 0 0 0 2px var(--emerald);
}

.picker-file { color: var(--muted); font-size: 0.92rem; overflow-wrap: anywhere; }
.picker-file:empty { display: none; }

.hint { margin: 12px 0 0; color: var(--muted); font-size: 0.95rem; }

.promise {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
  color: var(--emerald);
  font-size: 0.95rem;
  font-weight: 500;
}

.promise svg { width: 18px; height: 18px; flex: none; }
.promise rect, .promise path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.status { margin: 12px 0 0; font-weight: 500; }
.status:empty { display: none; }
.status.error { padding: 12px 16px; border-radius: 14px; background: var(--danger-soft); color: var(--danger); }
.status.done:not(:empty) { padding: 12px 16px; border-radius: 14px; background: var(--sage-soft); color: var(--emerald-deep); }

/* several images: position, arrows and a strip of thumbnails */
.queue { margin-bottom: 14px; }

.queue-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.queue-pos {
  flex: 1;
  display: grid;
  margin: 0;
  text-align: center;
  line-height: 1.35;
  min-width: 0;
}

.queue-pos strong { font-weight: 600; color: var(--emerald-deep); font-size: 1.08rem; }
.queue-pos span { color: var(--muted); font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-button {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--emerald);
  background: var(--paper);
  color: var(--emerald);
  cursor: pointer;
}

.nav-button svg { width: 20px; height: 20px; }
.nav-button path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nav-button:disabled { border-color: var(--line); color: var(--line); cursor: default; }
[dir="rtl"] .nav-button svg { transform: scaleX(-1); }

.thumbs {
  display: flex;
  gap: 10px;
  margin: 12px 0 0;
  padding: 8px 8px 6px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
}

.thumb-entry { position: relative; flex: none; }

.thumb {
  position: relative;
  display: block;
  width: 60px;
  height: 76px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.75;
}

.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb.current { border-color: var(--emerald); opacity: 1; box-shadow: 0 6px 14px -8px rgb(10 55 44 / 0.7); }

.thumb.saved::after {
  content: "";
  position: absolute;
  bottom: 4px;
  inset-inline-end: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--emerald) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 12.5l3.2 3.2L17 9' fill='none' stroke='%23fffdf8' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}

.thumb-remove {
  position: absolute;
  top: -6px;
  inset-inline-end: -6px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.5 8.5l7 7M15.5 8.5l-7 7' fill='none' stroke='%23fffdf8' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% no-repeat;
  cursor: pointer;
}

/* result: the finished image shown like a measured print */
.drawing {
  position: relative;
  display: grid;
  justify-items: center;
  margin: 6px 0 0;
  padding: 22px 44px 44px;
  background: var(--sand);
  border-radius: 22px;
}

.frame {
  position: relative;
  line-height: 0;
  background: #fff;
  box-shadow: 0 1px 2px rgb(10 55 44 / 0.2), 0 18px 34px -20px rgb(10 55 44 / 0.55);
}

.frame::before, .frame::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--gold);
  pointer-events: none;
}
.frame::before { top: -10px; left: -10px; border-right: 0; border-bottom: 0; }
.frame::after { bottom: -10px; right: -10px; border-left: 0; border-top: 0; }

#preview { display: block; max-width: 100%; max-height: 60vh; height: auto; touch-action: none; }
#preview.movable { cursor: grab; }
#preview.movable:active { cursor: grabbing; }

.dim {
  position: absolute;
  color: var(--gold-ink);
  font-size: 0.9rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  direction: ltr;
}
.dim-w { bottom: 14px; left: 0; right: 0; text-align: center; }
.dim-h { top: 50%; right: 6px; transform: translateY(-50%) rotate(90deg); }
[dir="rtl"] .dim-h { right: auto; left: 6px; transform: translateY(-50%) rotate(-90deg); }

.framing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
  margin-top: 14px;
}

.zoom { display: flex; align-items: center; gap: 12px; flex: 1 1 240px; font-weight: 500; }
.zoom input { flex: 1; accent-color: var(--emerald); min-height: 44px; }
.framing .hint { flex-basis: 100%; margin: 0; }

.link-button {
  font: inherit;
  font-weight: 500;
  color: var(--emerald);
  background: none;
  border: 0;
  padding: 10px 4px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.checks {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checks li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: var(--sage-soft);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.checks li::before {
  content: "";
  width: 13px;
  height: 7px;
  margin-top: -4px;
  border: solid var(--emerald);
  border-width: 0 0 2.5px 2.5px;
  transform: rotate(-45deg);
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 220px;
  min-height: 56px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 2px solid var(--emerald);
  background: transparent;
  color: var(--emerald);
  font: inherit;
  font-weight: 500;
  font-size: 1.1rem;
  text-decoration: none;
  cursor: pointer;
}

.button.primary { background: var(--emerald); color: var(--paper); }
.button.primary:hover { background: var(--emerald-deep); }

/* ---------- photo guide ---------- */

.guide, .privacy {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 20px 0;
}

.guide h2, .privacy h2 { font-size: 1.5rem; }

.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.example {
  position: relative;
  margin: 0;
  padding: 10px 10px 18px;
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgb(15 74 60 / 0.06);
}

.example img { width: 100%; aspect-ratio: 1; object-fit: contain; }

.example::before {
  content: "";
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--emerald) center / 100% no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 12.5l3.2 3.2L17 9' fill='none' stroke='%23fffdf8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.example.bad::before {
  background-color: var(--danger);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.5 8.5l7 7M15.5 8.5l-7 7' fill='none' stroke='%23fffdf8' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

.example figcaption { display: grid; gap: 4px; padding: 6px 8px 0; }
.example strong { font-weight: 600; font-size: 1.05rem; color: var(--emerald-deep); }
.example.bad strong { color: var(--danger); }
.example span { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }

.more-tips { margin: 22px 0 0; padding-inline-start: 1.2em; color: var(--muted); }
.more-tips li { margin-bottom: 8px; max-width: 38em; }
.more-tips li::marker { color: var(--gold); }

.privacy p { margin: 0; max-width: 36em; color: var(--muted); }

.landscape {
  width: 100%;
  height: clamp(220px, 34vw, 440px);
  margin-top: 56px;
  object-fit: cover;
  object-position: 50% 78%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 30%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 30%);
}

.foot {
  padding: 36px 20px 44px;
  background: var(--emerald-deep);
  color: rgb(255 253 248 / 0.78);
}

.foot p { max-width: 720px; margin: 0 auto; font-size: 0.9rem; }
.foot .contact { margin-top: 10px; }
.foot a { color: var(--paper); text-underline-offset: 3px; }

/* ---------- small screens ---------- */

@media (max-width: 520px) {
  .sheet { padding-inline: 14px; }
  .docs { gap: 7px; }
  .doc { padding-inline: 4px; border-radius: 18px; }
  .doc-name { font-size: 0.92rem; }
  .doc:has(input:checked)::after { width: 20px; height: 20px; top: 7px; inset-inline-end: 7px; }
  .picker { padding: 12px 14px; gap: 12px; }
  .picker-art { width: 72px; height: 72px; }
  .picker-button { padding: 12px 18px; font-size: 1rem; }
  .drawing { padding: 18px 42px 40px 18px; }
  [dir="rtl"] .drawing { padding: 18px 18px 40px 42px; }
  .compare { gap: 10px; }
  .example span { font-size: 0.9rem; }
}
