:root {
  color-scheme: light;
  --paper: #f5efe4;
  --paper-2: #ece2d0;
  --card: #fffaf2;
  --ink: #2a2019;
  --ink-2: #6b5a4b;
  --ink-3: #9a8775;
  --line: #ddcfb9;
  --accent: #a8462a;
  --accent-hover: #913a21;
  --accent-soft: #f3dfd3;
  --ok: #3b7650;
  --danger: #a33a2c;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(60 40 20 / 0.06), 0 8px 28px rgb(60 40 20 / 0.08);
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgb(168 70 42 / 0.07), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgb(184 137 43 / 0.08), transparent 60%),
    var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  min-height: 100vh;
}
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }

.demo-banner {
  background: #2a2019;
  color: #f5efe4;
  text-align: center;
  font-size: 13px;
  padding: 8px 16px;
}

.site-header {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 22px/1 var(--serif);
  color: var(--ink);
  text-decoration: none;
}
.brand svg { width: 30px; height: 30px; fill: var(--accent); }
.brand svg .brand-inner { fill: var(--paper); }
.header-price {
  font-size: 14px;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
}
.header-price b { color: var(--accent); }

main { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Hero */
.hero {
  display: grid;
  gap: 32px;
  padding: 24px 0 56px;
  align-items: center;
}
.eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero h1 { font-size: clamp(32px, 6vw, 54px); letter-spacing: -0.01em; }
.hero h1 em { color: var(--accent); font-style: italic; font-weight: 500; }
.lede { font-size: 18px; color: var(--ink-2); margin-top: 18px; max-width: 34em; }
.lede b { color: var(--ink); }
.hero-points {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 14px;
  color: var(--ink-2);
}
.hero-points li::before { content: '✓'; color: var(--ok); font-weight: 700; margin-right: 6px; }

.upload-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  box-shadow: var(--shadow);
  transform: rotate(0.6deg);
}
.modes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  margin-bottom: 12px;
  background: var(--paper-2);
  border-radius: 12px;
}
.modes button {
  min-height: 42px;
  padding: 6px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font: 600 14px/1.2 var(--sans);
  cursor: pointer;
}
.modes button:hover { color: var(--ink); }
.modes button[aria-checked="true"] { background: var(--card); color: var(--accent); box-shadow: 0 1px 3px rgb(60 40 20 / 0.15); }
.modes button:focus-visible { outline: 3px solid rgb(168 70 42 / 0.35); outline-offset: 1px; }
@media (max-width: 420px) {
  .modes { grid-template-columns: repeat(2, 1fr); }
}
.options { display: grid; gap: 10px; margin-bottom: 12px; padding: 0 4px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  aspect-ratio: 3 / 4;
  padding: 12px 8px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  cursor: pointer;
  background: repeating-linear-gradient(45deg, transparent 0 12px, rgb(221 207 185 / 0.18) 12px 13px);
}
.slot:hover, .slot:focus-within { border-color: var(--accent); }
.slot::before {
  content: '+';
  position: absolute;
  top: 38%; left: 50%;
  transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font: 400 30px/1 var(--sans);
}
.slot input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot.has-image { border-style: solid; border-color: var(--accent); }
.slot.has-image::before { display: none; }
.slot.has-image .slot-title, .slot.has-image .slot-sub { position: relative; color: #fff; text-shadow: 0 1px 4px rgb(0 0 0 / 0.7); }
.slot-title { font: 600 16px/1.2 var(--serif); }
.slot-sub { font-size: 12px; color: var(--ink-3); }
.combine-btn { width: 100%; margin-top: 12px; }
.options:not(:has(> :not([hidden]))) { display: none; }
.year-field label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; color: var(--ink-2); }
.year-field output { font: 600 20px/1 var(--serif); color: var(--accent); white-space: nowrap; }
.year-field input { width: 100%; margin: 8px 0 2px; accent-color: var(--accent); }
.year-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; line-height: 1.4; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.check b { color: var(--ink); }

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  min-height: 240px;
  padding: 28px 20px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: repeating-linear-gradient(45deg, transparent 0 12px, rgb(221 207 185 / 0.18) 12px 13px);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background-color: var(--accent-soft); }
.dropzone:focus-within { outline: 3px solid rgb(168 70 42 / 0.35); outline-offset: 3px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dz-icon {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  margin-bottom: 10px;
}
.dz-icon svg { width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.dz-title { font: 600 20px/1.3 var(--serif); }
.dz-sub { color: var(--ink-2); }
.dz-sub u { color: var(--accent); text-underline-offset: 3px; }
.dz-meta { color: var(--ink-3); font-size: 13px; margin-top: 6px; }
.upload-note { font-size: 13px; color: var(--ink-3); padding: 12px 6px 4px; }

.form-error {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f8e1dc;
  color: var(--danger);
  font-size: 14px;
}

/* Workspace */
.workspace {
  display: grid;
  gap: 24px;
  padding: 8px 0 56px;
  align-items: start;
}
.viewer { min-width: 0; }
.compare {
  --pos: 50%;
  --ar: 4 / 3;
  position: relative;
  aspect-ratio: var(--ar);
  width: min(100%, calc(72vh * var(--ar-num, 1.333)));
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-2);
  box-shadow: var(--shadow);
  user-select: none;
  touch-action: pan-y;
}
.compare img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.compare img:not([src]) { visibility: hidden; }
#img-after { clip-path: inset(0 0 0 var(--pos)); }
.compare-line {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--pos);
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 6px rgb(0 0 0 / 0.35);
  pointer-events: none;
}
.compare-line span {
  position: absolute;
  top: 50%; left: 50%;
  width: 40px; height: 40px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.3);
}
.compare-line span::before {
  content: '‹ ›';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font: 700 18px/1 var(--sans);
  color: var(--accent);
  letter-spacing: 2px;
}
.tag {
  position: absolute;
  top: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgb(42 32 25 / 0.72);
  color: #fff;
  pointer-events: none;
}
.tag-before { left: 12px; }
.tag-after { right: 12px; background: var(--accent); }
#compare-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.compare:has(#compare-range:focus-visible) .compare-line span { outline: 3px solid var(--accent); }
/* Цээж зураг: үр дүнг бүтнээр, эх зургийг буланд жижгээр харуулна. */
.compare.is-result #img-after { clip-path: none; }
.compare.is-result #img-before {
  inset: auto 12px 12px auto;
  width: 24%;
  height: auto;
  aspect-ratio: var(--ar);
  border: 3px solid #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.3);
  z-index: 1;
}
.compare.is-result .compare-line,
.compare.is-result .tag,
.compare.is-result #compare-range { display: none; }
.compare, .compare img { -webkit-touch-callout: none; -webkit-user-drag: none; }
.scan { display: none; position: absolute; inset: 0; pointer-events: none; }
.compare.is-single #img-after,
.compare.is-single .compare-line,
.compare.is-single .tag,
.compare.is-single #compare-range { display: none; }
.compare.is-scanning .scan {
  display: block;
  background: linear-gradient(180deg, transparent 0%, rgb(255 250 242 / 0.0) 40%, rgb(255 250 242 / 0.55) 50%, rgb(255 250 242 / 0) 60%, transparent 100%);
  background-size: 100% 220%;
  animation: scan 2.2s ease-in-out infinite;
}
.compare.is-scanning img { filter: saturate(0.7) blur(0.5px); }
@keyframes scan { from { background-position: 0 100%; } to { background-position: 0 -100%; } }
.viewer-hint { text-align: center; font-size: 13px; color: var(--ink-3); margin-top: 10px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.panel > div { display: flex; flex-direction: column; gap: 12px; }
.panel h2 { font-size: 26px; }
.panel p { color: var(--ink-2); }
.step-label { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3) !important; }
.step-label.ok { color: var(--ok) !important; }
.checks { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 8px; }
.checks li { padding-left: 26px; position: relative; }
.checks li::before {
  content: '✓';
  position: absolute; left: 0; top: 1px;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #dfeee3;
  color: var(--ok);
  font-size: 11px;
  font-weight: 700;
}
.amount { font: 600 36px/1 var(--serif); color: var(--ink) !important; }
.qr-wrap {
  align-self: center;
  width: 232px;
  max-width: 100%;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.qr-hint { text-align: center; font-size: 14px; }
.banks { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.banks:empty { display: none; }
.banks a {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}
.banks img { width: 36px; height: 36px; border-radius: 9px; object-fit: contain; }
.demo-pay {
  border: 1px dashed var(--accent);
  border-radius: 12px;
  padding: 14px;
  background: var(--accent-soft);
  display: grid;
  gap: 10px;
}
.demo-pay p { font-size: 14px; color: var(--ink) !important; }
.waiting { font-size: 14px; display: flex; gap: 10px; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; transform: scale(0.7); } }
.file-meta { font-size: 15px; }
.small { font-size: 13px; color: var(--ink-3) !important; }

.progress { height: 6px; border-radius: 999px; background: var(--paper-2); overflow: hidden; margin-top: 4px; }
.progress span { display: block; height: 100%; width: 40%; border-radius: inherit; background: var(--accent); animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 12px;
  border: 0;
  font: 600 16px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-link {
  align-self: center;
  background: none;
  border: 0;
  padding: 6px;
  color: var(--ink-2);
  font: 500 14px/1.4 var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.btn-link:hover { color: var(--accent); }

/* Info sections */
.how, .faq { padding: 48px 0; border-top: 1px solid var(--line); }
.how h2, .faq h2 { font-size: 30px; margin-bottom: 24px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.steps span {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 16px/1 var(--serif);
  margin-bottom: 12px;
}
.steps h3 { font-size: 19px; margin-bottom: 6px; }
.steps p { color: var(--ink-2); font-size: 15px; }
.steps b { color: var(--ink); }
.features {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 48px;
}
.features div { background: var(--card); padding: 20px; }
.features h3 { font-size: 18px; margin-bottom: 4px; }
.features p { color: var(--ink-2); font-size: 15px; }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--accent); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq details p { color: var(--ink-2); margin-top: 10px; max-width: 46em; }

.site-footer { border-top: 1px solid var(--line); padding: 28px 16px 40px; text-align: center; font-size: 14px; color: var(--ink-3); }

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .site-header { padding: 28px 24px; }
  main { padding: 0 24px; }
  .hero { grid-template-columns: 1.1fr 1fr; gap: 56px; padding: 40px 0 80px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; padding-top: 16px; }
  .panel { position: sticky; top: 24px; }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .features { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
