:root {
  --night: #120d1f;
  --night-2: #1d1530;
  --violet-deep: #2b1a45;
  --violet: #7c3fd6;
  --violet-light: #b48bec;
  --gold: #f2c46d;
  --gold-deep: #d9a23f;
  --paper: #fdfcff;
  --mist: #f3f0f8;
  --line: #e1dbec;
  --text: #18141f;
  --muted: #5d5670;
  --ok: #1d7a46;
  --err: #b42318;
  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-body: 'Work Sans', -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { display: block; }

/* ---------- Header ---------- */
.hdr {
  position: relative;
  background: radial-gradient(120% 140% at 80% 0%, #2d1f4a 0%, var(--night) 60%);
  color: #f4f0fb;
  padding-bottom: 2.4rem;
}
.hdr-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 0.02em;
  color: #fff; text-decoration: none;
}
.brand-badge { background: var(--paper); border-radius: 8px; padding: 3px; line-height: 0; }
.brand-badge img { height: 30px; width: auto; }
.brand-accent { color: var(--violet-light); }
.hdr-contact { display: flex; align-items: center; gap: 0.5rem; }
.hdr-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  color: #fff; text-decoration: none; font-weight: 600; font-size: 0.9rem;
  border: 1px solid rgba(255,255,255,0.25); border-radius: 999px; padding: 0.4rem 0.8rem;
}
.hdr-link:hover { background: rgba(255,255,255,0.08); }
.hdr-link svg { width: 16px; height: 16px; fill: var(--gold); }
.hdr-phone { font-weight: 700; letter-spacing: 0.02em; margin-left: 0.3rem; }
.hdr-hero { max-width: 1280px; margin: 0 auto; padding: 1.2rem 1rem 0; }
.eyebrow {
  font-weight: 700; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 0.4rem;
}
.hdr h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.05; margin: 0; max-width: 18ch;
}
.hdr-sub { color: #cfc6e2; max-width: 52ch; margin: 0.6rem 0 0; line-height: 1.5; }

/* the string of lights along the bottom of the header */
.string {
  position: absolute; left: 0; right: 0; bottom: 0.7rem; height: 22px;
  background:
    radial-gradient(circle at 12px 14px, #ffd27a 0 3.5px, rgba(255,190,90,0.45) 4.5px, transparent 10px) 0 0 / 120px 22px repeat-x,
    radial-gradient(circle at 42px 16px, #ff6b6b 0 3.5px, rgba(255,80,80,0.4) 4.5px, transparent 10px) 0 0 / 120px 22px repeat-x,
    radial-gradient(circle at 72px 14px, #fff4dc 0 3.5px, rgba(255,230,190,0.4) 4.5px, transparent 10px) 0 0 / 120px 22px repeat-x,
    radial-gradient(circle at 102px 16px, #6fe39b 0 3.5px, rgba(80,220,130,0.4) 4.5px, transparent 10px) 0 0 / 120px 22px repeat-x;
}
.string::before {
  content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 1px;
  background: rgba(255,255,255,0.18);
}

/* ---------- Layout ---------- */
.studio {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) 400px;
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "stage steps"
    "stage panel"
    "stage estimate";
  align-items: start;
}
.steps { grid-area: steps; }
.stage { grid-area: stage; position: sticky; top: 1rem; }
.panel { grid-area: panel; }
.estimate { grid-area: estimate; }

@media (max-width: 900px) {
  .studio {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "steps" "stage" "panel" "estimate";
    padding: 0.75rem 0.75rem 6rem;
    gap: 0.75rem;
  }
  .stage { position: static; }
  .hdr-phone { display: none; }
  .hdr-hero { padding-top: 0.4rem; }
  .hdr-sub { font-size: 0.95rem; }
}

/* ---------- Steps ---------- */
.steps {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.15rem;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0.3rem;
}
.steps::-webkit-scrollbar { display: none; }
.step {
  min-width: 0; border: 0; background: transparent; border-radius: 9px; letter-spacing: -0.01em;
  padding: 0.5rem 0.15rem; font-weight: 600; font-size: 0.8rem; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; white-space: nowrap;
}
.step b {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: var(--mist); font-size: 0.75rem; color: var(--muted);
}
.step.on { background: var(--violet-deep); color: #fff; }
.step.on b { background: var(--gold); color: var(--night); }
.step.done b { background: var(--ok); color: #fff; }

/* ---------- Stage ---------- */
.canvas-wrap {
  position: relative;
  background: var(--night);
  border-radius: 14px;
  overflow: hidden;
  min-height: 340px;
  box-shadow: 0 10px 30px rgba(18, 13, 31, 0.18);
}
#cv {
  display: block; width: 100%; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.dropzone {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.6rem; text-align: center; padding: 2rem 1.5rem; color: #e9e3f5; cursor: pointer;
  background: radial-gradient(80% 70% at 50% 40%, #2a1e44 0%, var(--night) 75%);
  border: 2px dashed rgba(242, 196, 109, 0.35); border-radius: 14px;
}
.dropzone.drag { border-color: var(--gold); background: #241a3b; }
.dropzone svg { width: 56px; height: 56px; fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.dropzone strong { font-size: 1.15rem; }
.dropzone span { color: #b9afcf; max-width: 34ch; line-height: 1.45; font-size: 0.93rem; }
.dropzone .btn { color: var(--night); margin-top: 0.4rem; }

.tools {
  position: absolute; top: 0.6rem; right: 0.6rem; display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end;
}
.tools button {
  height: 40px; min-width: 40px; border-radius: 10px; border: 0;
  background: rgba(18, 13, 31, 0.78); color: #fff; backdrop-filter: blur(4px);
  display: inline-grid; place-items: center; padding: 0 0.6rem; font-weight: 600; font-size: 0.85rem;
}
.tools button:hover { background: rgba(43, 26, 69, 0.95); }
.tools svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tools button[aria-pressed="true"] { background: var(--gold); color: var(--night); }
.tools button:disabled { opacity: 0.4; }

.hint {
  position: absolute; left: 0.6rem; bottom: 0.6rem; right: 0.6rem; width: fit-content; max-width: calc(100% - 1.2rem);
  background: rgba(18, 13, 31, 0.82); color: #fff; font-size: 0.88rem; font-weight: 500;
  border-radius: 10px; padding: 0.5rem 0.75rem; pointer-events: none; backdrop-filter: blur(4px);
}

.night-row {
  display: flex; align-items: center; gap: 0.6rem; margin-top: 0.6rem;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0.5rem 0.8rem;
  font-weight: 600; font-size: 0.9rem;
}
.night-row svg { width: 18px; height: 18px; fill: var(--violet-deep); }
.night-row input { flex: 1; accent-color: var(--violet); }
.night-row span { min-width: 3ch; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Panels ---------- */
.panel, .estimate {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.1rem 1.2rem;
}
.panel h2, .estimate h2 {
  font-family: var(--font-display); font-weight: 400; font-size: 1.45rem; letter-spacing: 0.01em;
  margin: 0 0 0.5rem; color: var(--violet-deep);
}
.panel p { line-height: 1.5; margin: 0 0 0.8rem; }
.tips, .how { margin: 0 0 0.9rem; padding-left: 1.2rem; line-height: 1.5; color: var(--muted); font-size: 0.93rem; }
.how { color: var(--text); }
.how li, .tips li { margin-bottom: 0.25rem; }
.label { font-weight: 700; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0.9rem 0 0.45rem !important; }
.fine { font-size: 0.84rem; color: var(--muted); line-height: 1.45; }
.ok { color: var(--ok); font-weight: 600; }
.err { color: var(--err); font-weight: 600; font-size: 0.92rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 1px solid transparent; border-radius: 10px; padding: 0.7rem 1.05rem; min-height: 44px;
  font-weight: 700; font-size: 0.95rem; text-decoration: none;
}
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-gold { background: var(--gold); color: var(--night); }
.btn-gold:hover:not(:disabled) { background: var(--gold-deep); }
.btn-dark { background: var(--violet-deep); color: #fff; }
.btn-dark:hover:not(:disabled) { background: #3a2359; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--violet-deep); }
.btn-ghost:hover:not(:disabled) { background: var(--mist); }
.btn-block { width: 100%; margin-top: 0.6rem; }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.45rem; }
.chip {
  border: 1px solid var(--line); background: var(--mist); border-radius: 10px; padding: 0.55rem 0.4rem;
  font-weight: 600; font-size: 0.82rem; line-height: 1.25;
}
.chip small { color: var(--violet); font-weight: 700; font-size: 0.85rem; }
.chip:hover, .chip.on { border-color: var(--violet); background: #efe7fb; }

.field { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.7rem; }
.field input, .field textarea {
  display: block; width: 100%; margin-top: 0.3rem; padding: 0.65rem 0.75rem;
  border: 1px solid #cfc6df; border-radius: 9px; background: #fff; font-size: 16px; font-weight: 400;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--violet-light); border-color: var(--violet); }
.field.inline span { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.3rem; }
.field.inline input { width: 7rem; margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }

.colors { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.color {
  display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 0.35rem 0.7rem 0.35rem 0.4rem; font-size: 0.85rem; font-weight: 600; min-height: 36px;
}
.color.on { border-color: var(--violet); background: #efe7fb; box-shadow: inset 0 0 0 1px var(--violet); }
.swatch { width: 20px; height: 20px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.3rem; background: var(--mist); padding: 0.25rem; border-radius: 10px; }
.seg button { border: 0; background: transparent; border-radius: 8px; padding: 0.55rem 0.3rem; font-weight: 600; font-size: 0.86rem; min-height: 40px; }
.seg button.on { background: #fff; color: var(--violet-deep); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }

.list { margin: 1rem 0; display: grid; gap: 0.4rem; }
.item {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.6rem; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; font-size: 0.9rem;
}
.item.on { border-color: var(--violet); background: #f6f1fd; }
.item-main { flex: 1; min-width: 0; cursor: pointer; }
.item-main b { display: block; }
.item-main small { color: var(--muted); }
.item select { border: 1px solid var(--line); border-radius: 8px; padding: 0.3rem; background: #fff; font-size: 0.85rem; max-width: 9.5rem; }
.icon-btn { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); flex: none; }
.icon-btn:hover { background: #fdeceb; color: var(--err); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Estimate ---------- */
.est-lines { display: grid; gap: 0.35rem; font-size: 0.92rem; }
.est-line { display: flex; justify-content: space-between; gap: 1rem; }
.est-line span:first-child { color: var(--muted); }
.est-line span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.est-line.sub span { font-size: 0.85rem; }
.est-empty { color: var(--muted); font-size: 0.9rem; margin: 0; }
.addons { margin: 0.9rem 0 0; padding-top: 0.8rem; border-top: 1px dashed var(--line); display: grid; gap: 0.5rem; }
.addon { display: flex; align-items: flex-start; gap: 0.55rem; font-size: 0.9rem; line-height: 1.35; cursor: pointer; }
.addon input[type=checkbox] { width: 20px; height: 20px; margin: 0; accent-color: var(--violet); flex: none; }
.addon .price { margin-left: auto; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.addon-qty { display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.3rem; font-size: 0.85rem; color: var(--muted); }
.addon-qty input { width: 4.2rem; padding: 0.3rem 0.4rem; border: 1px solid var(--line); border-radius: 7px; font-size: 16px; }
.est-total {
  display: flex; justify-content: space-between; align-items: baseline; margin-top: 0.9rem; padding-top: 0.8rem;
  border-top: 2px solid var(--violet-deep);
}
.est-total span { font-weight: 700; }
.est-total strong { font-family: var(--font-display); font-weight: 400; font-size: 2rem; color: var(--violet-deep); font-variant-numeric: tabular-nums; }

.sent { background: #ecf7f0; border: 1px solid #b9e2c8; border-radius: 12px; padding: 1rem; margin-bottom: 0.4rem; }
.sent h3 { margin: 0 0 0.3rem; color: var(--ok); }
.sent p { margin: 0; }

/* ---------- Mobile bottom bar ---------- */
.bar { display: none; }
@media (max-width: 900px) {
  .bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
    background: rgba(18, 13, 31, 0.96); color: #fff; backdrop-filter: blur(6px);
  }
  .bar small { display: block; color: #b9afcf; font-size: 0.75rem; }
  .bar strong { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; letter-spacing: 0.02em; }
  .hdr-link span { display: none; }
  .hdr-link { padding: 0.5rem; }
}

.foot { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 1rem 1rem 2rem; }
.foot a { color: var(--violet-deep); }
@media (max-width: 420px) {
  .step { flex-direction: column; gap: 0.15rem; font-size: 0.72rem; padding: 0.4rem 0.1rem; }
}
@media (max-width: 420px) {
  .tools { top: 0.4rem; right: 0.4rem; gap: 0.25rem; }
  .tools button { height: 34px; min-width: 34px; padding: 0 0.45rem; font-size: 0.76rem; border-radius: 8px; }
  .tools svg { width: 17px; height: 17px; }
  .hint { font-size: 0.8rem; padding: 0.4rem 0.6rem; left: 0.4rem; bottom: 0.4rem; }
}
