/* ClutterSnap — "Martha Stewart" edition: linen, sage, brass, serif calm. */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #faf7f1;           /* warm linen */
  --bg-card: #ffffff;
  --bg-tint: #f1ede3;      /* deeper linen */
  --line: #e4ddcf;         /* hairline borders */
  --text: #33403a;         /* deep green-ink */
  --text-dim: #8a8577;     /* warm gray */
  --accent: #47634f;       /* sage green */
  --accent-soft: #eef1ea;  /* sage wash */
  --money: #a07c3b;        /* muted brass */
  --radius: 12px;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(51, 64, 58, .05), 0 6px 20px rgba(51, 64, 58, .06);
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

.screen {
  display: none;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  min-height: 100vh;
}
.screen.active { display: block; animation: screenIn .3s ease; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.hidden { display: none !important; }

h1, h2, .logo, .card-value { font-family: var(--serif); }

/* ---------- Home ---------- */
.hero { text-align: center; padding: 44px 0 28px; }
.logo {
  font-size: 1.1rem; font-weight: 700; color: var(--accent);
  letter-spacing: .02em; margin-bottom: 30px; font-style: italic;
}
.hero h1 { font-size: 2.4rem; font-weight: 600; line-height: 1.15; margin-bottom: 14px; }
.tagline { color: var(--text-dim); font-size: 1rem; line-height: 1.65; max-width: 400px; margin: 0 auto; }

.cta-stack { display: flex; flex-direction: column; gap: 12px; margin: 30px 0 16px; }

.btn {
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 15px 22px; font-size: 1rem; font-weight: 600;
  font-family: var(--sans); cursor: pointer;
  color: var(--text); background: var(--bg-card);
  transition: transform .06s ease, filter .15s ease, background .15s ease;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--accent); color: #fdfcf9; box-shadow: var(--shadow); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { border-color: var(--line); box-shadow: var(--shadow); }
.btn-secondary:hover { background: var(--accent-soft); }
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--accent); }
.btn-small { padding: 10px 18px; font-size: .9rem; white-space: nowrap; }
.btn:disabled { opacity: .45; cursor: wait; }

.model-status {
  text-align: center; color: var(--text-dim); font-size: .82rem; min-height: 1.2em;
  letter-spacing: .02em;
}
.model-status.ready { color: var(--accent); }

.lifetime-stats {
  margin-top: 38px; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.lifetime-stats h2 {
  font-family: var(--sans); font-size: .74rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--text-dim); margin-bottom: 16px; text-align: center;
}
.stat-row { display: flex; justify-content: space-around; }
.stat { text-align: center; }
.stat span { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; display: block; }
.stat label { color: var(--text-dim); font-size: .78rem; }

.fine-print {
  text-align: center; color: var(--text-dim); font-size: .74rem;
  margin-top: 30px; line-height: 1.6;
}

/* ---------- Camera (stays dark — it's a viewfinder) ---------- */
#screen-camera { padding: 0; max-width: none; position: relative; background: #141815; }
.camera-stage { position: relative; height: 100vh; overflow: hidden; }
#camera-feed { width: 100%; height: 100%; object-fit: cover; display: block; }
#camera-feed.mirrored { transform: scaleX(-1); }

/* Rule-of-thirds framing guide */
.camera-grid {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to right,  transparent calc(33.33% - .5px), rgba(253,252,249,.28) 33.33%, transparent calc(33.33% + .5px)),
    linear-gradient(to right,  transparent calc(66.66% - .5px), rgba(253,252,249,.28) 66.66%, transparent calc(66.66% + .5px)),
    linear-gradient(to bottom, transparent calc(33.33% - .5px), rgba(253,252,249,.28) 33.33%, transparent calc(33.33% + .5px)),
    linear-gradient(to bottom, transparent calc(66.66% - .5px), rgba(253,252,249,.28) 66.66%, transparent calc(66.66% + .5px));
}

.camera-tip {
  position: absolute; top: calc(20px + env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  background: rgba(20, 24, 21, .62); color: #fdfcf9;
  font-family: var(--serif); font-style: italic; font-size: .95rem;
  padding: 9px 20px; border-radius: 999px; white-space: nowrap;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(253,252,249,.18);
}

#capture-flash {
  position: absolute; inset: 0; background: #fdfcf9;
  opacity: 0; pointer-events: none; transition: opacity .28s ease;
}
#capture-flash.firing { opacity: .85; transition: opacity .05s ease; }

.camera-controls {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px calc(24px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(20,24,21,.65));
}
.camera-controls .btn-ghost { color: #fdfcf9; width: 72px; text-align: left; }
.shutter {
  width: 74px; height: 74px; border-radius: 50%;
  border: 4px solid #fdfcf9; background: transparent;
  cursor: pointer; position: relative; transition: transform .1s ease;
}
.shutter::after {
  content: ""; position: absolute; inset: 5px; border-radius: 50%;
  background: #fdfcf9; transition: transform .1s ease;
}
.shutter:active { transform: scale(.94); }
.shutter:active::after { transform: scale(.9); }
.btn-flip {
  width: 72px; display: flex; justify-content: flex-end;
  background: none; border: none; cursor: pointer;
}
.btn-flip span, .btn-flip {
  color: #fdfcf9; font-size: 1.5rem;
}
.btn-flip:active { transform: rotate(-180deg); transition: transform .3s ease; }

/* ---------- Analyzing ---------- */
#screen-analyzing { display: none; }
#screen-analyzing.active { display: flex; align-items: center; justify-content: center; }
.analyzing-box { text-align: center; }
.analyzing-box h2 { font-size: 1.5rem; font-weight: 600; }
.spinner {
  width: 48px; height: 48px; margin: 0 auto 24px;
  border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.analyzing-sub { color: var(--text-dim); margin-top: 10px; font-size: .9rem; }

/* ---------- Results ---------- */
.results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.view-toggle {
  display: flex; background: var(--bg-tint); border: 1px solid var(--line);
  border-radius: 10px; padding: 3px;
}
.toggle-btn {
  border: none; background: transparent; color: var(--text-dim);
  padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: .88rem;
  font-family: var(--sans); cursor: pointer;
}
.toggle-btn.active { background: var(--bg-card); color: var(--accent); box-shadow: var(--shadow); }

.canvas-wrap {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-tint); border: 1px solid var(--line); box-shadow: var(--shadow);
}
#result-canvas { width: 100%; display: block; }
.after-badge {
  position: absolute; bottom: 10px; left: 10px; right: 10px;
  background: rgba(253,252,249,.92); color: var(--accent);
  font-size: .76rem; font-weight: 600; padding: 8px 12px;
  border-radius: 9px; text-align: center; border: 1px solid var(--line);
}

.summary-cards { display: flex; gap: 10px; margin: 18px 0; }
.card {
  flex: 1; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 8px; text-align: center;
  box-shadow: var(--shadow);
}
.card-value { font-size: 1.4rem; font-weight: 600; display: block; }
.card-money .card-value { color: var(--money); }
.card-label { color: var(--text-dim); font-size: .72rem; }

.item-list-wrap h2 { font-size: 1.25rem; font-weight: 600; margin: 4px 0 12px; }
.item-list-wrap .hint { font-family: var(--sans); color: var(--text-dim); font-weight: 400; font-size: .78rem; }
.item-list { list-style: none; }
.item-list li {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
}
.item-list li.excluded { opacity: .5; background: transparent; box-shadow: none; }
.item-list input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--accent); }
.item-name { flex: 1; text-transform: capitalize; font-weight: 600; font-size: .95rem; }
.item-conf { color: var(--text-dim); font-size: .73rem; display: block; font-weight: 400; }
.item-price { color: var(--money); font-weight: 700; white-space: nowrap; font-size: .92rem; }
.item-price.no-value { color: var(--text-dim); font-weight: 400; font-size: .8rem; }
.live-tag {
  background: var(--accent-soft); color: var(--accent);
  font-size: .64rem; font-weight: 700; letter-spacing: .06em;
  padding: 2px 6px; border-radius: 5px; vertical-align: 2px;
  border: 1px solid #d7e0d3;
}

.pro-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--accent-soft); border: 1px solid #d7e0d3;
  border-radius: var(--radius); padding: 18px; margin-top: 20px;
}
.pro-banner strong { font-family: var(--serif); font-size: 1.05rem; }
.pro-banner p { color: var(--text-dim); font-size: .8rem; margin-top: 5px; line-height: 1.5; }
