/* Look follows the client's own ad creatives: black, serif caps headlines,
   warm tan/orange accent, white rectangular CTAs with black caps, thin white outline tags. */
:root {
  --bg: #f4f1ec;
  --card: #ffffff;
  --card-2: #f7f5f1;
  --ink: #111111;
  --muted: rgba(17,17,17,.6);
  --line: rgba(17,17,17,.22);
  --line-soft: rgba(17,17,17,.1);
  --accent: #b9733f;          /* tan from "ADD 20–35%", deepened for a light page */
  --accent-2: #d4691f;        /* orange from "PARENTS" */
  --cta: #111111;
  --cta-ink: #ffffff;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --serif: "Marcellus", Georgia, serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; }
body { font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }

#app { position: fixed; inset: 0; overflow: hidden; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#labels { position: absolute; inset: 0; pointer-events: none; }
.dim {
  position: absolute; transform: translate(-50%, -50%);
  background: #111; color: #fff; border: 0; font-weight: 700; font-size: 13px; letter-spacing: .04em;
  padding: 5px 9px; white-space: nowrap;
}

/* ---- guide (top) ---- */
.guide {
  position: absolute; left: 12px; right: 12px; top: calc(var(--safe-t) + 10px); z-index: 4;
  background: rgba(255,255,255,.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-soft); padding: 12px 10px 12px 14px;
}
.progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 0 4px 10px 0; }
.progress i { height: 3px; background: rgba(17,17,17,.1); transition: background .3s; }
.progress i.done { background: #111; }
.progress i.on { background: var(--accent); }
.guide-row { display: flex; align-items: center; gap: 10px; }
.guide-text { flex: 1; min-width: 0; }
.guide-step { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: .14em; text-transform: uppercase; }
.guide-title { font-family: var(--serif); font-size: 21px; line-height: 1.12; margin-top: 3px; text-transform: uppercase; letter-spacing: .01em; }
.guide-sub { font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 3px; line-height: 1.3; }
.guide-sub:empty { display: none; }

.btn {
  height: 50px; border: 0; font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px;
  transition: transform .12s, background .2s, opacity .2s, box-shadow .2s;
}
.btn:active { transform: scale(.96); }
.btn.next { flex: 0 0 auto; background: var(--cta); color: var(--cta-ink); height: 46px; padding: 0 14px 0 16px; }
.btn.next:disabled { background: transparent; color: rgba(17,17,17,.3); border: 1.5px solid rgba(17,17,17,.15); }
.btn.primary { background: var(--cta); color: var(--cta-ink); }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn.wide { width: 100%; }
.btn:disabled { pointer-events: none; }
.btn[hidden] { display: none; }

.back {
  position: absolute; left: 12px; z-index: 3; width: 42px; height: 42px; border: 1px solid var(--line-soft);
  background: rgba(255,255,255,.94); color: var(--ink); display: grid; place-items: center;
}
.back[hidden] { display: none; }

@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(212,105,31,.7); } 60% { box-shadow: 0 0 0 10px rgba(212,105,31,0); } }
.hint { animation: nudge 1.4s ease-out infinite; }

.toast {
  position: absolute; left: 50%; z-index: 5; transform: translate(-50%, -6px); opacity: 0; transition: opacity .2s, transform .2s;
  background: #111; color: #fff; font-weight: 700; font-size: 13px; padding: 9px 14px;
  pointer-events: none; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.price-fab {
  position: absolute; left: 50%; z-index: 4; transform: translateX(-50%);
  height: 54px; padding: 0 26px; border: 0; background: var(--cta); color: var(--cta-ink);
  font-weight: 700; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,.28); animation: fabIn .5s cubic-bezier(.2,1.4,.4,1) both;
  white-space: nowrap;
}
.price-fab[hidden] { display: none; }
@keyframes fabIn { from { opacity: 0; transform: translate(-50%, 20px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }

/* ---- bottom panel ---- */
.panel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  background: var(--card); border-top: 1px solid var(--line-soft);
  padding: 14px 16px calc(14px + var(--safe-b));
}
.slider { display: grid; grid-template-columns: 62px 1fr 60px; align-items: center; gap: 10px; height: 46px; }
.slider span { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.slider output { font-size: 16px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: none; margin: 0; touch-action: pan-y; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(to right, var(--accent) var(--p,50%), rgba(17,17,17,.14) var(--p,50%)); }
input[type=range]::-moz-range-track { height: 3px; background: rgba(17,17,17,.14); }
input[type=range]::-moz-range-progress { height: 3px; background: var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -12.5px; border-radius: 50%; background: #fff; border: 2px solid #111; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 0; }
.panel-note { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 4px; }

.row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; scroll-snap-type: x proximity; }
.row::-webkit-scrollbar { display: none; }

/* Sims-style build menu */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 10px; padding: 0 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px;
  border: 1.5px solid var(--line); background: transparent; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}
.tab svg { width: 19px; height: 19px; }
.tab.on { background: #111; color: #fff; border-color: #111; }
.tab .n { min-width: 18px; height: 18px; background: var(--accent-2); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 5px; letter-spacing: 0; }
.styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.style {
  border: 1.5px solid var(--line-soft); background: var(--card-2); padding: 4px 4px 7px; text-align: center;
  transition: border-color .15s, transform .12s, background .15s;
}
.style:active { transform: scale(.96); }
.style img { display: block; width: 100%; aspect-ratio: 22 / 17; object-fit: cover; background: #efebe4; }
.style b { display: block; font-size: 10.5px; font-weight: 700; margin-top: 6px; letter-spacing: .06em; line-height: 1.2; text-transform: uppercase; }
.style.on { border-color: var(--accent); background: #f6ebe1; box-shadow: inset 0 0 0 1px var(--accent); }
.style-cap { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.35; min-height: 17px; }
.style-cap b { color: var(--ink); font-weight: 700; }
.tools { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.chip {
  border: 1.5px solid var(--line); background: transparent; height: 34px; padding: 0 12px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: #111; color: #fff; border-color: #111; }
.count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

.opt {
  flex: 0 0 auto; min-width: 100px; border: 1.5px solid var(--line-soft); background: var(--card-2);
  padding: 8px 10px 10px; text-align: left; scroll-snap-align: start; transition: border-color .15s, background .15s, transform .12s;
}
.opt:active { transform: scale(.96); }
.opt b { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.opt small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; white-space: nowrap; }
.opt.on { border-color: var(--accent); background: #f6ebe1; box-shadow: inset 0 0 0 1px var(--accent); }
.opt .sw { width: 100%; height: 40px; margin-bottom: 8px; border: 1px solid rgba(0,0,0,.1); }
.opt.roof { text-align: center; min-width: 100px; }
.opt.roof svg { width: 58px; height: 40px; margin: 2px auto 6px; display: block; }

/* ---- modal ---- */
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(20,20,20,.45); display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
.modal.open { opacity: 1; pointer-events: auto; }
.modal-card {
  position: relative; width: 100%; max-width: 480px; max-height: 94dvh; overflow-y: auto;
  background: var(--card); border-top: 1px solid var(--line-soft); padding: 22px 16px calc(20px + var(--safe-b));
  transform: translateY(40px); transition: transform .3s cubic-bezier(.2,.9,.3,1);
}
.modal.open .modal-card { transform: none; }
.close { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border: 0; background: none; display: grid; place-items: center; color: var(--muted); }
.recap { display: flex; gap: 12px; align-items: center; padding-right: 40px; }
.recap img { width: 96px; height: 74px; object-fit: cover; border: 1px solid var(--line-soft); }
.recap-k { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .14em; }
.recap-v { font-size: 15px; font-weight: 600; margin-top: 3px; }
.modal h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.08; text-transform: uppercase; margin: 20px 0 8px; }
.modal h2 em { font-style: normal; color: var(--accent); }
#mDone h2 { margin-top: 6px; }
.sub { color: var(--muted); font-weight: 500; font-size: 14px; margin: 0 0 16px; line-height: 1.45; }
#lead label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 12px; letter-spacing: .12em; text-transform: uppercase; }
#lead input {
  display: block; width: 100%; height: 50px; margin-top: 6px; border: 1.5px solid var(--line); border-radius: 0;
  padding: 0 14px; font: 500 16px Manrope, sans-serif; color: var(--ink); background: transparent; outline: none; letter-spacing: 0; text-transform: none;
}
#lead input::placeholder { color: rgba(17,17,17,.3); }
#lead input:focus { border-color: #111; }
#lead input.bad { border-color: #c8321e; }
fieldset { border: 0; padding: 0; margin: 4px 0 12px; }
legend { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 8px; padding: 0; letter-spacing: .12em; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1.5px solid var(--line); background: transparent; height: 40px; padding: 0 14px; font-size: 14px; font-weight: 600; }
.chips button.on { border-color: #111; background: #111; color: #fff; }
.err { color: #c8321e; font-size: 13px; font-weight: 600; min-height: 18px; margin-bottom: 6px; }
.fine { font-size: 11.5px; color: rgba(17,17,17,.5); margin: 12px 0 0; line-height: 1.4; }
.next-steps { list-style: none; padding: 0; margin: 6px 0 18px; display: grid; gap: 8px; }
.next-steps li { border: 1.5px solid var(--line); padding: 12px 14px; font-size: 14px; font-weight: 500; line-height: 1.4; }
.next-steps b { font-weight: 700; color: var(--accent); }

/* no-WebGL fallback: only the lead form */
body.nogl #app { display: none; }
body.nogl .modal { background: var(--bg); }
.close[hidden], .recap img[hidden] { display: none; }

@media (min-width: 900px) {
  .guide { left: 24px; right: auto; width: 460px; top: 20px; }
  .panel { left: auto; right: 24px; bottom: 24px; width: 430px; border: 1px solid var(--line-soft); }
  .modal { align-items: center; }
  .modal-card { border: 1px solid var(--line-soft); }
}

/* coach: an animated finger that shows exactly where to tap next */
.coach { position: fixed; left: 0; top: 0; z-index: 6; pointer-events: none; opacity: 0; transition: opacity .25s; }
.coach.show { opacity: 1; }
.coach .ring { position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--accent-2); animation: ring 1.3s ease-out infinite; }
.coach svg { position: absolute; left: -6px; top: 4px; width: 46px; height: 58px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.3)); animation: tap 1.3s ease-in-out infinite; }
.coach.drag svg { animation: drag 1.8s ease-in-out infinite; }
.coach.drag .ring { animation: dragring 1.8s ease-in-out infinite; }
.coach .say { position: absolute; left: 50%; top: -64px; transform: translateX(-50%); background: var(--accent-2); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 6px 10px; white-space: nowrap; }
.coach .say:empty { display: none; }
.coach.below .say { top: auto; bottom: -96px; }
@keyframes ring { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes tap { 0%, 100% { transform: translate(8px, 10px); } 45% { transform: translate(0, 0) scale(.92); } }
@keyframes drag { 0%, 100% { transform: translate(-34px, 4px); } 50% { transform: translate(34px, 4px); } }
@keyframes dragring { 0%, 100% { transform: translateX(-40px) scale(.8); opacity: .9; } 50% { transform: translateX(40px) scale(.8); opacity: .9; } }
