/* DecoHub — functional first version. Layout: one column on phones; on wide screens the photo takes
   two-thirds and the product panel sits beside it. Final visual identity comes in the design pass. */
@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn-wght.woff2") format("woff2-variations"), url("/fonts/Vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f3f2ef;
  --surface: #ffffff;
  --ink: #1f2422;
  --muted: #646b68;
  --line: #dcdad4;
  --accent: #2f6f62;
  --accent-ink: #ffffff;
  --accent-soft: #e2efeb;
  --warn: #9a5b12;
  --warn-soft: #f7ecdc;
  --bad: #a83d2a;
  --radius: 10px;
  --font: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161a19; --surface: #1f2523; --ink: #e8ecea; --muted: #9aa5a1; --line: #323a37;
    --accent: #6fb7a5; --accent-ink: #0f1a17; --accent-soft: #20332e; --warn: #e3ae6b; --warn-soft: #3a2d1d; --bad: #ef9277;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.75;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: 40px;
}
[hidden] { display: none !important; }
h1, h2, h3 { text-wrap: balance; line-height: 1.4; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; max-width: 1200px; margin: 0 auto; padding: 14px 0 6px; }
.logo { font-weight: 800; font-size: 22px; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.tagline { color: var(--muted); font-size: 13px; }
main { max-width: 1200px; margin: 0 auto; }
.muted { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 18px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-decoration: none;
  color: var(--ink); font-weight: 600; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn svg, .tips svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload { position: relative; }
.upload:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Home */
.hero { padding: 28px 0 8px; max-width: 680px; display: grid; gap: 14px; justify-items: start; }
.hero h1 { font-size: clamp(24px, 5vw, 34px); margin: 0; font-weight: 800; }
.lead { margin: 0; color: var(--muted); font-size: 16px; max-width: 60ch; }
.tips { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
.tips li { display: flex; gap: 8px; align-items: center; }
.section-title { font-size: 18px; margin: 32px 0 12px; }
.samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.sample { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; text-align: start; padding: 0; }
.sample img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.sample span { padding: 10px 14px; font-weight: 600; }

/* Progress */
.progress-card { max-width: 560px; margin: 28px auto; display: grid; gap: 10px; }
.progress-card h2 { margin: 0; font-size: 20px; }
.progress-card p { margin: 0; }
.steps { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.steps li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--accent); border-color: var(--accent); }
.steps li.active { color: var(--ink); font-weight: 600; }
.steps li.active::before { border-color: var(--accent); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { background: var(--accent-soft); } }
@media (prefers-reduced-motion: reduce) { .steps li.active::before { animation: none; background: var(--accent-soft); } }
.result { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }
.result.good p:first-child { color: var(--accent); font-weight: 600; }
.result.fair p:first-child, .result.poor p:first-child { color: var(--warn); font-weight: 600; }
.result-tips { margin: 0; padding-inline-start: 20px; color: var(--muted); }

/* Try */
.try { display: grid; gap: 16px; grid-template-columns: 1fr; padding-top: 10px; }
@media (min-width: 900px) { .try { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; } }
.stage { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; }
.stage canvas { display: block; width: 100%; height: auto; touch-action: manipulation; }
.compare { position: absolute; inset-block-end: 10px; inset-inline-start: 10px; padding: 6px 12px; border-radius: 999px;
  border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 13px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.compare[aria-pressed="true"] { background: rgba(0, 0, 0, 0.85); }
.stage.picking canvas { cursor: crosshair; }
.busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.35); color: #fff; font-weight: 600; }
.hint { font-size: 13px; margin: 4px 0 0; }
.hint.error { color: var(--bad); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; min-width: 0; }
.panel-title { font-size: 14px; margin: 6px 0 0; color: var(--muted); font-weight: 600; }
.product-info { display: grid; gap: 4px; }
.product-info .name { font-size: 18px; font-weight: 700; }
.product-info .meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.product-info .price { font-weight: 600; font-variant-numeric: tabular-nums; }
.product-info .buy { margin-top: 4px; }
.product-info .buy .btn { width: 100%; }
.products { display: grid; grid-auto-flow: column; grid-auto-columns: 92px; gap: 10px; overflow-x: auto; padding-bottom: 6px;
  scroll-snap-type: x proximity; }
@media (min-width: 900px) { .products { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); grid-auto-columns: auto; overflow: visible; } }
.product { display: grid; gap: 4px; padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer;
  text-align: center; font-size: 12px; scroll-snap-align: start; color: var(--ink); }
.product img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
.product[aria-selected="true"] { border-color: var(--accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 4px 14px; cursor: pointer; min-height: 36px; }
.chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chips button:disabled { opacity: 0.4; cursor: default; }
.range { display: grid; grid-template-columns: auto 1fr 3.5em; align-items: center; gap: 10px; font-size: 14px; }
.range output { font-variant-numeric: tabular-nums; text-align: end; color: var(--muted); }
.actions { margin-top: 6px; }
.credit { font-size: 11px; margin: 0; overflow-wrap: anywhere; }
.credit a { color: inherit; }
.error { margin-top: 20px; border-color: var(--bad); color: var(--bad); }
