/* stagemyroom — one stylesheet for the site, the app and the share page.
   Plain on purpose: the pictures are the product, and the page should get
   out of their way. */

:root {
  color-scheme: light dark;
  --ink: #1d2128;
  --bg: #f5f3ef;
  --paper: #ffffff;
  --line: #e0dcd4;
  --muted: #5c6370;
  --brand: #2d4a6b;
  --brand-ink: #f6f3ee;
  --accent: #b5652e;
  --good: #1f7a4d;
  --bad: #b23b3b;
  --warn: #9a6200;
  --warn-bg: #fff4dc;
  --warn-line: #ecc77a;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6e8ec; --bg: #111418; --paper: #191d23; --line: #2b313a; --muted: #9aa2ae;
    --brand: #8db4e0; --brand-ink: #0e1217; --accent: #e09a62; --good: #4cc08a; --bad: #ef7d7d; --warn: #e2b04a;
    --warn-bg: #2d2717; --warn-line: #6d5a2c;
  }
}

* { box-sizing: border-box; }
/* Classes that set display (.claim, .btn, .card…) must not win over hidden. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--brand); }
h1 { font-size: clamp(28px, 4.6vw, 42px); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 12px; }
h2 { font-size: 22px; letter-spacing: -0.01em; margin: 32px 0 10px; }
h3 { font-size: 17px; margin: 20px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small, .hint { font-size: 14px; }
.hint { color: var(--muted); margin-top: 6px; }
.error { color: var(--bad); min-height: 1em; }
.ok { color: var(--good); }
.bad { color: var(--bad); font-weight: 650; }
.warn { color: var(--warn); font-weight: 650; }
.lede { font-size: 19px; color: var(--muted); max-width: 680px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; font-weight: 700; color: var(--accent); margin: 0 0 4px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--paper); padding: 8px 12px; z-index: 10; }

main { max-width: 820px; margin: 0 auto; padding: 36px 20px 64px; }
main.wide { max-width: 1080px; }

/* ── Header and footer ─────────────────────────────────────────────────── */

.site-header {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.site-header nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); text-decoration: none; font-weight: 550; }
.site-header nav a[aria-current="page"], .site-header nav a:hover { color: var(--ink); }
.site-header .account { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.sync-dot[data-state="synced"] { background: var(--good); }
.sync-dot[data-state="syncing"] { background: var(--accent); }
.sync-dot[data-state="error"], .sync-dot[data-state="offline"] { background: var(--bad); }

.claim { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 10px 20px; background: var(--warn-bg); border-bottom: 1px solid var(--warn-line); }

.site-footer {
  display: flex; gap: 18px; justify-content: space-between; flex-wrap: wrap;
  padding: 24px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

/* ── Controls ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 10px 18px; border-radius: 8px; border: 1px solid var(--brand);
  background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 650;
  text-decoration: none; cursor: pointer;
}
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.small { padding: 5px 11px; font-size: 14px; }
.btn.big { padding: 13px 24px; font-size: 18px; }
.wide-btn { width: 100%; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 4px; }
label.inline { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; margin: 0; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
}
input[type="checkbox"], input[type="radio"] { width: auto; }
input[type="file"] { padding: 6px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px; }
.honeypot { position: absolute; left: -5000px; }
progress { width: 100%; height: 8px; accent-color: var(--brand); }

/* ── Blocks ────────────────────────────────────────────────────────────── */

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 14px 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.narrow { max-width: 440px; }
details.card summary { cursor: pointer; }
details.card[open] summary { margin-bottom: 10px; }
.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; }
.empty { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.pill { display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); color: var(--muted); vertical-align: 1px; }
.pill.good { color: var(--good); border-color: var(--good); }
.pill.bad { color: var(--bad); border-color: var(--bad); }
blockquote { margin: 10px 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--line); }
.quote { white-space: pre-wrap; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
th, td { padding: 9px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }

/* ── App ───────────────────────────────────────────────────────────────── */

.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.room-card { display: block; margin: 0; padding: 0; overflow: hidden; text-decoration: none; color: var(--ink); }
.room-card img, .room-card .thumb { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--line); }
.room-card .body { padding: 10px 14px 12px; }
.room-card strong { display: block; }
.drop { display: grid; place-items: center; gap: 6px; text-align: center; padding: 28px 18px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--paper); cursor: pointer; }
.drop.over { border-color: var(--brand); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 6px 0 4px; }
.choice { display: block; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); cursor: pointer; font-weight: 500; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice strong { display: block; font-size: 15px; }
.choice span { display: block; font-size: 13px; color: var(--muted); line-height: 1.35; }
.choice:has(input:checked) { border-color: var(--brand); outline: 2px solid var(--brand); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); }
.staging { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 18px; }
.staging header { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.variants { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.variant { margin: 0; padding: 10px; }
.variant .row { margin-top: 8px; }
.variant.chosen { border-color: var(--good); outline: 2px solid var(--good); }
.pending { display: grid; place-items: center; aspect-ratio: 3 / 2; background: var(--line); border-radius: 8px; color: var(--muted); text-align: center; padding: 12px; }
.share-box input { font-size: 13px; }

/* ── Before / after ────────────────────────────────────────────────────── */

.compare { position: relative; overflow: hidden; border-radius: 8px; background: var(--line); touch-action: pan-y; user-select: none; }
.compare img { display: block; width: 100%; height: auto; pointer-events: none; }
.compare .after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--split, 50%)); }
.compare .after img { width: 100%; height: 100%; object-fit: cover; }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); }
.compare .handle::after { content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #222; font-weight: 800; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3); }
.compare .tag { position: absolute; top: 10px; padding: 2px 9px; border-radius: 99px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 12px; font-weight: 700; }
.compare .tag.before { left: 10px; }
.compare .tag.after-tag { right: 10px; }
.compare input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare input[type="range"]:focus-visible + .handle { background: var(--accent); }

/* ── Share page ────────────────────────────────────────────────────────── */

.shared { max-width: 1100px; }
body.embed .site-header, body.embed .site-footer, body.embed .claim { display: none !important; }
body.embed main { padding: 0; max-width: none; }
body.embed .shared-meta { padding: 6px 2px 0; font-size: 13px; }

/* ── Marketing ─────────────────────────────────────────────────────────── */

.hero { padding: 24px 0 8px; }
.hero h1 { max-width: 760px; }
.hero.end { text-align: center; padding: 40px 0 0; }
.hero.end .btn { margin-top: 6px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.features .card { margin: 0; }
.features h3 { margin-top: 0; }
.steps { padding-left: 22px; display: grid; gap: 4px; }
.steps h3 { margin: 10px 0 2px; }
.kept { border: 2px solid var(--brand); }
.plan ul { padding-left: 18px; }
.illustration { margin: 18px 0 6px; }
.illustration figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
