:root {
    --ink: #141414;
    --mute: #6f6f6f;
    --line: #e3e3e3;
    --note: #2d5c9e;
    --gutter: clamp(20px, 2.6vw, 40px);
    --header: 56px;
    --column: 380px; /* the picture keeps 70% or more of the first screen */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    color: var(--ink);
    background: #fff;
    font: 14px/1.45 "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}
h1, h2, p, ul { margin: 0; }
button { font: inherit; color: inherit; }
a { color: inherit; }

/* ---- header ---- */
.top {
    position: sticky;
    top: 0;
    z-index: 5;
    height: var(--header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--gutter);
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.wordmark {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
}
.top__meta { color: var(--mute); font-size: 13px; }

/* ---- layout ---- */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--column);
    min-height: calc(100vh - var(--header));
}
@media (min-width: 1440px) { :root { --column: 400px; } }
@media (max-width: 1100px) { :root { --column: 340px; } }

.picture {
    position: sticky;
    top: var(--header);
    height: calc(100vh - var(--header));
    background: #ececec;
}
.stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.stage__layer {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
}
.stage__layer canvas,
.stage__layer svg,
.stage__layer img {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
    width: 100%;
    height: 100%;
}
.stage__layer[hidden] { display: none; }
.stage__layer svg, .stage__layer canvas[aria-hidden] { pointer-events: none; }
.is-editing .stage__layer svg { pointer-events: auto; cursor: crosshair; }

.picture__note {
    position: absolute;
    left: var(--gutter);
    bottom: 20px;
    margin: 0;
    background: #fff;
}

/* Buiten | Binnen, on the picture */
.scene-switch {
    position: absolute;
    right: var(--gutter);
    top: 20px;
    display: flex;
    background: #fff;
    border: 1px solid var(--ink);
}
.scene-switch button {
    height: 36px;
    padding: 0 16px;
    border: 0;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
}
.scene-switch button + button { border-left: 1px solid var(--ink); }
.scene-switch button.is-on { background: var(--ink); color: #fff; }
.is-editing .scene-switch { display: none; }

/* a labelled row of text choices (spots, hanglampen) */
.choice-row {
    display: grid;
    grid-template-columns: 96px 1fr;
    align-items: baseline;
    gap: 8px;
}
.choice-row .types { margin-bottom: 4px; }
.choice-row--after { margin-top: 14px; }

/* ---- options column ---- */
.options {
    padding: 36px var(--gutter) 48px;
    border-left: 1px solid var(--line);
}
.options h1 {
    font-size: 26px;
    font-weight: 500;
    letter-spacing: -0.015em;
    line-height: 1.15;
}
.options__lead { color: var(--mute); margin-top: 6px; }

.group, .summary {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.group__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 14px;
}
.group__head h2 { font-size: 14px; font-weight: 600; }
.group__value { color: var(--mute); text-align: right; }

/* top view: an architectural plan in ink, follows the sliders */
.plan {
    display: block;
    width: 100%;
    max-width: 360px;
    height: auto;
    margin: 16px 0 0;
    color: var(--ink);
    font-size: 11px;
}
.plan text { fill: var(--ink); font-family: inherit; }
.plan .mute { fill: var(--mute); }
.plan .house { stroke: currentColor; stroke-width: 6; }
.plan .wall { stroke: currentColor; stroke-width: 1.5; fill: none; }
.plan .door { stroke: currentColor; stroke-width: 0.75; fill: none; }
.plan .dim { stroke: currentColor; stroke-width: 0.75; fill: none; }

/* ranges */
.range {
    display: grid;
    grid-template-columns: 64px 1fr 52px;
    align-items: center;
    gap: 14px;
    padding: 8px 0;
}
.range output { text-align: right; font-variant-numeric: tabular-nums; }
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 24px;
    margin: 0;
    background: transparent;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -6.5px;
    background: var(--ink);
    border: 0;
    border-radius: 0;
}
input[type="range"]::-moz-range-track { height: 1px; background: var(--ink); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; background: var(--ink); border: 0; border-radius: 0; }
input[type="range"]:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

/* material types */
.types {
    display: flex;
    flex-wrap: wrap;
    gap: 0 18px;
    margin-bottom: 14px;
}
.type {
    padding: 4px 0 6px;
    border: 0;
    border-bottom: 1px solid transparent;
    background: none;
    color: var(--mute);
    cursor: pointer;
}
.type.is-on { color: var(--ink); border-bottom-color: var(--ink); }
.type:hover { color: var(--ink); }

/* swatches: the material itself */
.swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.swatch {
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid var(--line);
    background: none;
    cursor: pointer;
    display: block;
}
.swatch canvas { display: block; width: 100%; height: 100%; }
.swatch.is-on { outline: 1.5px solid var(--ink); outline-offset: 2px; }
.swatch:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 2px; }

.hex {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    color: var(--mute);
    font-size: 13px;
}
.hex input {
    width: 92px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 0;
    font: inherit;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.hex input:focus { outline: none; border-color: var(--ink); }

/* extras */
.extra {
    display: grid;
    grid-template-columns: 18px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}
.extra:last-child { border-bottom: 0; }
.extra input { margin: 0; width: 15px; height: 15px; accent-color: var(--ink); }
.extra__price { color: var(--mute); font-variant-numeric: tabular-nums; }

/* summary */
.summary__lines { list-style: none; padding: 0; }
.summary__lines li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 5px 0;
    color: var(--mute);
    font-variant-numeric: tabular-nums;
}
.summary__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--ink);
}
.summary__total strong { font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.btn {
    display: block;
    width: 100%;
    height: 48px;
    margin-top: 18px;
    border: 0;
    border-radius: 0;
    background: var(--ink);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.btn:hover { background: #000; }
.btn:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }
.summary__note { margin-top: 10px; color: var(--mute); font-size: 12px; }
.demo-note {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--ink);
}

/* prototype annotations: an annotation blue outside the brand palette */
.placeholder-note {
    margin: 14px 0 0;
    padding: 8px 12px 8px 14px;
    border-left: 2px solid var(--note);
    color: var(--note);
    font-size: 13px;
    line-height: 1.45;
}
.placeholder-note::before { content: "Notitie bij het prototype: "; font-weight: 600; }

/* footer */
.foot {
    padding: 18px var(--gutter);
    border-top: 1px solid var(--line);
    color: var(--mute);
    font-size: 13px;
}

/* phone bar */
.bar { display: none; }

/* ---- mask editor ---- */
.editor {
    position: absolute;
    left: 16px;
    top: 16px;
    width: 300px;
    max-height: calc(100% - 32px);
    overflow: auto;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    font-size: 13px;
}
.editor button {
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
}
.editor button.is-on { border-color: var(--c, var(--ink)); background: var(--c, var(--ink)); color: #fff; }
.editor button:disabled { opacity: 0.4; cursor: default; }
.editor__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.editor__list { list-style: none; margin: 0; padding: 0; }
.editor__list li { padding: 7px 0; border-top: 1px solid var(--line); }
.editor__name { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-weight: 600; }
.editor__name i { width: 10px; height: 10px; background: var(--c); }
.editor__name small { font-weight: 400; color: var(--mute); }
.editor__polys { display: flex; flex-wrap: wrap; gap: 4px; }
.editor__polys small { opacity: 0.7; }
.editor__row { display: flex; gap: 6px; margin: 10px 0 0; }
.editor__sel { margin: 10px 0 0; }
.editor__hint { margin: 8px 0 0; color: var(--mute); font-size: 12px; }
.is-editing .options, .is-editing .foot, .is-editing .bar { display: none; }
.is-editing .layout { grid-template-columns: 1fr; }
.is-editing .picture__note { display: none; }

/* ---- phone and small tablet ---- */
@media (max-width: 900px) {
    :root { --gutter: 16px; }
    .top { position: static; }
    .top__meta { display: none; }
    .layout { display: block; min-height: 0; }
    .picture {
        position: sticky;
        top: 0;
        z-index: 2;
        height: 54vh;
        min-height: 300px;
    }
    .picture__note { left: 12px; right: 12px; bottom: 12px; font-size: 12px; padding: 6px 10px 6px 12px; }
    .options {
        padding: 24px var(--gutter) 96px;
        border-left: 0;
        background: #fff; /* scrolls under the sticky picture, which stays in view while choosing */
    }
    .options h1 { font-size: 22px; }
    .summary .btn { display: none; }
    .foot { padding-bottom: 96px; }
    .bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 6;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 10px var(--gutter);
        background: #fff;
        border-top: 1px solid var(--line);
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
    .bar .btn { width: auto; margin: 0; padding: 0 22px; height: 44px; }
    .bar__total { display: flex; flex-direction: column; line-height: 1.2; }
    .bar__total small { color: var(--mute); font-size: 11px; }
    .bar__total strong { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
    .editor { width: calc(100% - 24px); left: 12px; top: 12px; max-height: 45%; }
    .is-editing .picture { height: 100vh; }
}
