:root {
  --bg: #0e100f;
  --panel: rgba(17, 19, 18, 0.78);
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.18);
  --ink: #f2efe9;
  --muted: #a9a59c;
  --soft: #7d7a73;
  --accent: #d9b27c;
  --accent-ink: #1b1710;
  --panel-w: 440px;
  --hdr: 60px;
  --r: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.28), 0 30px 80px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 400 15px/1.5 'Hanken Grotesk', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* header */
.hdr { position: fixed; inset: 0 0 auto; height: var(--hdr); z-index: 10; display: flex; align-items: center; gap: 18px; padding: 0 22px;
  background: linear-gradient(rgba(10, 12, 11, 0.72), rgba(10, 12, 11, 0.45)); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line); }
.hdr__brand { display: flex; white-space: nowrap; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 500; letter-spacing: 0.01em; }
.hdr__mark { width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(from 210deg, var(--accent), #8f6d42, var(--accent)); box-shadow: inset 0 0 0 5px rgba(14, 16, 15, 0.9); }
.hdr__brand img { height: 26px; width: auto; }
.hdr__demo { color: var(--muted); font-size: 13px; padding-left: 18px; border-left: 1px solid var(--line-2); }
.hdr__makers { margin-left: auto; border: 1px solid rgba(217, 178, 124, 0.5); background: rgba(217, 178, 124, 0.08); color: var(--ink); border-radius: 999px; padding: 6px 14px; font-size: 13px; }
.hdr__makers:hover { background: rgba(217, 178, 124, 0.18); }
.lang { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.04); }
.lang button { border: 0; background: none; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 500; letter-spacing: 0.06em; color: var(--muted); }
.lang button[aria-pressed='true'] { background: var(--ink); color: var(--bg); }

/* layout */
.app { display: grid; grid-template-columns: 1fr var(--panel-w); height: 100svh; }
.stage { position: relative; overflow: hidden; min-height: 0; }
.stage__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.stage__canvas:active { cursor: grabbing; }
.stage__canvas.is-pick { cursor: pointer; }
.stage__veil { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 10, 9, 0.62) 0%, rgba(8, 10, 9, 0.18) 26%, rgba(8, 10, 9, 0) 42%, rgba(8, 10, 9, 0) 78%, rgba(8, 10, 9, 0.45) 100%); }
.stage__copy { position: absolute; left: clamp(20px, 3.4vw, 52px); top: calc(var(--hdr) + clamp(22px, 4vh, 46px)); max-width: 540px; pointer-events: none; }
.stage__title { margin: 0; font-weight: 300; font-size: clamp(34px, 3.9vw, 60px); line-height: 1.02; letter-spacing: -0.025em; text-wrap: balance; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35); }
.stage__lead { margin: 14px 0 0; max-width: 440px; color: rgba(242, 239, 233, 0.82); font-size: 16px; line-height: 1.55; text-wrap: pretty; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.5); }
.stage__facts { position: absolute; left: clamp(20px, 3.4vw, 52px); bottom: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.stage__facts span { padding: 8px 14px; border-radius: 999px; font-size: 13px; background: rgba(12, 14, 13, 0.6); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.stage__facts span:empty { display: none; }
.stage__facts .is-over { border-color: rgba(232, 140, 100, 0.6); color: #f3c2a8; }
.stage__reset { position: absolute; right: 18px; bottom: 24px; border: 1px solid var(--line); background: rgba(12, 14, 13, 0.6); border-radius: 999px; padding: 8px 14px; font-size: 13px; color: var(--muted); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.stage__reset:hover { color: var(--ink); }
.stage__loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg); transition: opacity 0.6s ease; }
.stage__loading span { width: 140px; height: 2px; background: var(--line); overflow: hidden; position: relative; }
.stage__loading span::after { content: ''; position: absolute; inset: 0; width: 40%; background: var(--accent); animation: load 1.2s ease-in-out infinite; }
.stage__loading.is-done { opacity: 0; pointer-events: none; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

.dims { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.dims line { stroke: rgba(255, 255, 255, 0.85); stroke-width: 1; }
.dims text { fill: #fff; font-size: 12px; font-weight: 500; text-anchor: middle; dominant-baseline: middle; paint-order: stroke; stroke: rgba(0, 0, 0, 0.55); stroke-width: 3px; }
.dims g { transition: opacity 0.2s; }

/* panel */
.cfg { position: relative; display: flex; flex-direction: column; min-height: 0; margin-top: var(--hdr); background: var(--panel); border-left: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(1.1); -webkit-backdrop-filter: blur(22px) saturate(1.1); }
.cfg__scroll { flex: 1; overflow-y: auto; padding: 8px 26px 26px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.cfg__g { border: 0; margin: 0; padding: 22px 0 20px; border-bottom: 1px solid var(--line); min-width: 0; }
.cfg__g > legend + * { clear: both; }
.cfg__g legend { float: left; width: 100%; display: flex; align-items: baseline; gap: 10px; padding: 0; margin-bottom: 14px; font-size: 17px; font-weight: 500; letter-spacing: -0.005em; }
.cfg__n { font-size: 11px; color: var(--accent); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.cfg__label { display: block; margin: 16px 0 8px; font-size: 13px; color: var(--muted); }
.cfg__label b { color: var(--ink); font-weight: 500; }
.cfg__note { margin: 10px 0 0; font-size: 13px; color: var(--soft); line-height: 1.45; }
.cfg__note.is-warn { color: #f3c2a8; }
.cfg__foot { margin: 22px 0 0; font-size: 12.5px; color: var(--soft); line-height: 1.5; }

.types { display: grid; gap: 8px; }
.types button { display: grid; grid-template-columns: 44px 1fr; gap: 2px 14px; align-items: center; text-align: left; padding: 12px 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); transition: border-color 0.2s, background 0.2s; }
.types button:hover { border-color: var(--line-2); }
.types button[aria-pressed='true'] { border-color: var(--accent); background: rgba(217, 178, 124, 0.08); }
.types svg { grid-row: span 2; width: 44px; height: 36px; stroke: currentColor; fill: none; stroke-width: 1.3; color: var(--muted); }
.types button[aria-pressed='true'] svg { color: var(--accent); }
.types b { font-weight: 500; }
.types small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); border-radius: 999px; padding: 8px 15px; font-size: 14px; transition: border-color 0.2s, background 0.2s; }
.chips button small { display: block; font-size: 11.5px; color: var(--muted); }
.chips--sm button { padding: 6px 13px; }
.chips button:hover { border-color: var(--line-2); }
.chips button[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips button[aria-pressed='true'] small { color: #55524c; }
.chips button:disabled { opacity: 0.35; cursor: not-allowed; }
[data-sizes] button { border-radius: 10px; text-align: left; min-width: 74px; }

.seg { display: flex; padding: 3px; gap: 2px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.seg button { flex: 1; border: 0; background: none; padding: 7px 6px; border-radius: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.seg button[aria-pressed='true'], .seg button[aria-selected='true'] { background: rgba(255, 255, 255, 0.12); color: var(--ink); }

/* wall strip: one button per module, width to scale */
.wall { display: flex; gap: 3px; margin: 14px 0 10px; height: 92px; align-items: stretch; }
.wall button { position: relative; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); border-radius: 6px; padding: 0; min-width: 0; transition: border-color 0.2s, background 0.2s; }
.wall button:hover { border-color: rgba(255, 255, 255, 0.35); }
.wall button[aria-pressed='true'] { border-color: var(--accent); background: rgba(217, 178, 124, 0.1); box-shadow: 0 0 0 1px var(--accent) inset; }
.wall svg { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); }
.wall .op { fill: rgba(180, 205, 215, 0.25); stroke: rgba(255, 255, 255, 0.7); stroke-width: 1; vector-effect: non-scaling-stroke; }
.wall .dr { fill: rgba(255, 255, 255, 0.12); stroke: rgba(255, 255, 255, 0.7); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.mods button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px 8px; text-align: center; line-height: 1.2; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); font-size: 12.5px; }
.mods button small { font-size: 11px; color: var(--muted); }
.mods button svg { width: 26px; height: 30px; }
.mods button[aria-pressed='true'] { border-color: var(--accent); background: rgba(217, 178, 124, 0.08); }
.mods button:disabled { opacity: 0.3; cursor: not-allowed; }

.cfg__row { display: flex; gap: 16px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 38px; height: 38px; border-radius: 50%; border: 0; padding: 0; position: relative; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 2px 8px rgba(0, 0, 0, 0.3); }
.swatches button[aria-pressed='true']::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid var(--accent); }
.swatches .same { background: conic-gradient(var(--muted) 0 50%, transparent 0) !important; box-shadow: inset 0 0 0 1px var(--line-2); }

/* summary */
.sum { padding: 16px 26px 18px; border-top: 1px solid var(--line); background: rgba(12, 14, 13, 0.82); }
.sum__top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.sum__name { margin: 0; font-size: 13px; color: var(--muted); }
.sum__price { margin: 2px 0 0; font-size: 28px; font-weight: 400; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sum__price small { font-size: 12px; color: var(--muted); letter-spacing: 0; }
.sum__links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 12px; font-size: 13px; }
.sum__links a, .sum__links button { color: var(--ink); background: none; border: 0; padding: 0; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.sum__links a:hover, .sum__links button:hover { text-decoration-color: var(--accent); }
.sum__demo { color: var(--soft); font-size: 12px; flex-basis: 100%; }
.btn { border: 0; border-radius: 999px; padding: 13px 22px; font-weight: 500; font-size: 15px; white-space: nowrap; transition: transform 0.15s, background 0.2s; }
.btn:active { transform: scale(0.98); }
.btn--accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 22px rgba(217, 178, 124, 0.25); }
.btn--accent:hover { background: #e4c08d; }
.btn--ghost { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-2); }

/* price lines */
.lines { display: grid; grid-template-columns: 1fr auto; gap: 7px 16px; margin: 0; font-size: 14px; }
.lines dt { color: var(--muted); }
.lines dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.lines .total { color: var(--ink); font-weight: 500; padding-top: 8px; border-top: 1px solid var(--line); }

/* for makers */
.makers { width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-2); border-radius: 18px; background: #151716; color: var(--ink); box-shadow: var(--shadow); }
.makers::backdrop { background: rgba(5, 6, 6, 0.6); backdrop-filter: blur(6px); }
.makers__body { padding: 30px; }
.makers h2 { margin: 0; font-weight: 400; font-size: 26px; letter-spacing: -0.02em; line-height: 1.15; }
.makers__lead { margin: 10px 0 0; color: var(--muted); font-size: 14.5px; }
.makers__list { margin: 18px 0 0; padding: 0; list-style: none; counter-reset: mk; display: grid; gap: 10px; }
.makers__list li { counter-increment: mk; display: grid; grid-template-columns: 28px 1fr; font-size: 15px; }
.makers__list li::before { content: counter(mk, decimal-leading-zero); color: var(--accent); font-size: 11px; letter-spacing: 0.08em; padding-top: 4px; }
.makers__foot { margin: 20px 0 18px; font-size: 13px; color: var(--soft); }
.makers__foot a { color: var(--ink); }

/* quote dialog */
.quote { width: min(860px, calc(100vw - 32px)); max-height: calc(100svh - 32px); padding: 0; border: 1px solid var(--line-2); border-radius: 18px; background: #151716; color: var(--ink); box-shadow: var(--shadow); overflow: auto; }
.quote::backdrop { background: rgba(5, 6, 6, 0.6); backdrop-filter: blur(6px); }
.quote__form { display: grid; grid-template-columns: 1fr 1.15fr; margin: 0; }
.quote__shot { width: 100%; height: 100%; min-height: 240px; object-fit: cover; background: #222; }
.quote__body { padding: 28px; }
.quote h2 { margin: 0; font-weight: 400; font-size: 26px; letter-spacing: -0.02em; }
.quote__lead { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.quote__spec { margin: 14px 0 0; font-size: 13px; color: var(--ink); padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.quote__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.quote__fields label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.quote__fields input, .quote__fields textarea { width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); color: var(--ink); font-size: 15px; }
.quote__fields input:focus, .quote__fields textarea:focus { outline: none; border-color: var(--accent); }
.quote__wide { grid-column: 1 / -1; }
.quote__sent { margin: 14px 0 0; padding: 12px; border-radius: 10px; background: rgba(217, 178, 124, 0.1); border: 1px solid rgba(217, 178, 124, 0.4); font-size: 14px; }
.quote__actions { display: flex; gap: 10px; margin-top: 18px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 14px; transition: 0.25s; pointer-events: none; z-index: 30; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* phones and narrow tablets: the view on top, settings below, the price bar stays in reach */
@media (max-width: 900px) {
  :root { --hdr: 52px; }
  .hdr { padding: 0 14px; gap: 10px; }
  .hdr__demo { display: none; }
  .hdr__makers { padding: 5px 10px; font-size: 12px; white-space: nowrap; }
  .hdr__brand { font-size: 14px; gap: 8px; }
  .hdr__mark { width: 18px; height: 18px; }
  .lang button { padding: 5px 8px; }
  .app { display: block; height: auto; }
  .stage { height: 62svh; min-height: 380px; margin-top: var(--hdr); }
  .stage__copy { top: 16px; left: 16px; right: 16px; }
  .stage__title { font-size: 30px; }
  .stage__lead { display: none; }
  .stage__facts { left: 16px; bottom: 14px; right: 110px; }
  .stage__facts span { padding: 6px 11px; font-size: 12px; }
  .stage__reset { bottom: 14px; right: 12px; padding: 6px 11px; font-size: 12px; }
  .stage__canvas { touch-action: pan-y; }
  .cfg { margin: 0; border-left: 0; background: #121413; }
  .cfg__scroll { overflow: visible; padding: 0 16px 16px; }
  .sum { position: sticky; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
  .sum__price { font-size: 23px; }
  .btn { padding: 12px 18px; font-size: 14px; }
  .sum__links { font-size: 12.5px; margin-top: 8px; }
  .sum__demo { display: none; }
  .sum__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
  .quote__form { grid-template-columns: 1fr; }
  .quote__shot { min-height: 0; height: 180px; }
  .quote__body { padding: 20px; }
  .quote__fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
