/* Holz & Fuge — workshop drawing: birch ply ground, graphite line, blueprint blue for everything measured. */
@font-face { font-family: "Archivo"; src: url("fonts/archivo-latin-vf.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  --birch: #F1E8D8;
  --sheet: #FFFFFF;
  --graphite: #1F2226;
  --blue: #1D4ED8;
  --blue-dark: #1A3FA8;
  --oak: #B5803F;
  --muted: #5A5F66;
  --line: rgba(31, 34, 38, .18);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1160px;
  --pad: clamp(1.25rem, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--birch); color: var(--graphite); font: 400 1.0625rem/1.55 var(--font); }
h1, h2, h3, p, ul, ol, dl, dd, fieldset, legend { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; text-underline-offset: .2em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--graphite); color: #fff; padding: .6rem 1rem; z-index: 20; }
.skip:focus { left: .5rem; }

h1, h2 { font-weight: 800; line-height: 1; letter-spacing: -.03em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 7vw, 5.6rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3.1rem); }
h3 { font-size: 1.125rem; font-weight: 700; line-height: 1.25; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: .5rem 1.3rem; border: 2px solid var(--graphite); border-radius: 0; font: 700 1rem/1.2 var(--font); text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.btn-solid { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-solid:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-line { background: transparent; color: var(--graphite); }
.btn-line:hover { background: var(--graphite); color: #fff; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 2rem; padding: .75rem var(--pad); background: var(--birch); border-bottom: 2px solid var(--graphite); }
.brand { display: inline-flex; align-items: center; gap: .6rem; margin-right: auto; font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; text-decoration: none; }
.top nav { display: flex; gap: 1.6rem; }
.top nav a { font-weight: 600; text-decoration: none; }
.top nav a:hover, .tel:hover { color: var(--blue); }
.tel { font-weight: 700; font-variant-numeric: tabular-nums; text-decoration: none; }

/* ---------- configurator ---------- */
.config { padding: clamp(2rem, 5vw, 4rem) var(--pad) clamp(3rem, 6vw, 5rem); max-width: calc(var(--wrap) + 12rem); margin-inline: auto; }
.config-head { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem clamp(2rem, 5vw, 4rem); align-items: end; margin-bottom: clamp(1.8rem, 4vw, 3rem); }
.config-head p { max-width: 30em; font-size: 1.125rem; }
.config-grid { display: grid; grid-template-columns: minmax(17rem, 22rem) minmax(0, 1fr); gap: clamp(1.25rem, 3vw, 2.5rem); align-items: start; }

.panel { display: grid; gap: 1.35rem; padding: 1.5rem; background: var(--sheet); border: 2px solid var(--graphite); }
.slider { display: grid; grid-template-columns: 1fr auto; gap: .35rem .5rem; align-items: baseline; }
.slider label, legend { font-weight: 700; }
.slider output { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--blue); }
.slider input { grid-column: 1 / -1; width: 100%; height: 1.6rem; margin: 0; accent-color: var(--blue); cursor: pointer; }
.woods { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.woods legend { grid-column: 1 / -1; margin-bottom: .55rem; }
.woods label { position: relative; display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem; border: 2px solid var(--line); font-size: .9688rem; font-weight: 600; cursor: pointer; }
.woods label:hover { border-color: var(--graphite); }
.woods input { position: absolute; opacity: 0; }
.woods label:has(input:checked) { border-color: var(--blue); background: #EEF3FF; }
.woods label:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 3px; }
.swatch { flex: none; width: 1.5rem; height: 1.5rem; border: 1px solid rgba(0, 0, 0, .35); }
.swatch[data-wood="eiche"] { background: #C9A26B; }
.swatch[data-wood="nussbaum"] { background: #7A5238; }
.swatch[data-wood="esche"] { background: #E3CFA4; }
.swatch[data-wood="birke"] { background: #EBDDBF; }
.check { display: flex; align-items: center; gap: .6rem; font-weight: 700; cursor: pointer; }
.check input { width: 1.3rem; height: 1.3rem; margin: 0; accent-color: var(--blue); }
.hint { padding-top: 1rem; border-top: 1px solid var(--line); font-size: .9375rem; color: var(--muted); min-height: 5.5em; }

.stage { border: 2px solid var(--graphite); background: var(--sheet); }
#drawing, .presets svg { display: block; width: 100%; height: auto; background-color: #F7FAFF; background-image: linear-gradient(rgba(29, 78, 216, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(29, 78, 216, .09) 1px, transparent 1px); background-size: 20px 20px; }
.floor { stroke: var(--graphite); stroke-width: 2; }
.face { opacity: .55; }
.face.side { opacity: .8; }
.figure { fill: #9DB4E8; opacity: .75; }
.dims path { fill: none; stroke: var(--blue); stroke-width: 1.5; }
.dims .depth { stroke-dasharray: 4 3; }
.dims text { fill: var(--blue); font: 700 15px var(--font); font-variant-numeric: tabular-nums; }
/* Preset cards render the same 640-unit drawing at about half size. */
.presets .dims text { font-size: 26px; }

.quote { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem clamp(1.5rem, 4vw, 3rem); align-items: start; padding: 1.4rem 1.5rem 1.5rem; border-top: 2px solid var(--graphite); }
.quote-total span { display: block; font-size: .9375rem; color: var(--muted); }
.quote-total strong { display: block; font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.quote dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1.5rem; }
.quote dl div { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.quote dt { color: var(--muted); }
.quote dd { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.quote-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .7rem; }
.copied { grid-column: 1 / -1; font-size: .9375rem; font-weight: 600; color: var(--blue-dark); }
.copied:empty { display: none; }

/* ---------- sections ---------- */
.works, .steps, .shop, .contact { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-lede { max-width: 38em; margin-top: 1rem; }

.works { background: var(--sheet); border-block: 2px solid var(--graphite); }
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.25rem, 3vw, 2.2rem); margin-top: 2.4rem; }
.presets li { display: grid; grid-template-rows: auto auto 1fr auto; gap: .6rem; }
.presets svg { border: 2px solid var(--graphite); margin-bottom: .5rem; }
.presets p { font-size: .9688rem; color: var(--muted); }
.presets .btn { justify-self: start; margin-top: .5rem; min-height: 2.5rem; }

.steps ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1.25rem, 3vw, 2.2rem); margin-top: 2.4rem; counter-reset: step; }
.steps li { counter-increment: step; padding-top: 1rem; border-top: 2px solid var(--graphite); }
.steps li::before { content: counter(step); display: block; font-size: 3.2rem; font-weight: 800; line-height: 1; letter-spacing: -.04em; color: var(--oak); margin-bottom: .6rem; }
.steps p, .services p { margin-top: .4rem; font-size: .9688rem; color: var(--muted); }

.shop { background: var(--graphite); color: #F1E8D8; }
.shop-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 5rem); }
.shop-grid > div p { margin-top: 1.2rem; max-width: 26em; }
.services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem 2.2rem; }
.services li { padding-top: .9rem; border-top: 2px solid rgba(241, 232, 216, .35); }
.services p { color: #C9C1B2; }
.shop :focus-visible { outline-color: #9DB4E8; }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.contact-grid p { margin: 1.2rem 0 1.8rem; max-width: 30em; }
.contact-data div { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: .9rem 0; border-top: 2px solid var(--graphite); }
.contact-data div:last-child { border-bottom: 2px solid var(--graphite); }
.contact-data dt { font-weight: 700; }
.contact-data dd { font-variant-numeric: tabular-nums; }

/* ---------- footer & dialogs ---------- */
.foot { padding-block: 2rem; border-top: 2px solid var(--graphite); font-size: .9688rem; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem 2rem; }
.foot-row a { margin-left: 1.2rem; }
.linklike { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.linklike:hover, .foot a:hover { color: var(--blue); }
.demo-note { margin-top: 1.4rem; font-size: .8438rem; color: var(--muted); }

dialog { width: min(34rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: clamp(1.25rem, 4vw, 2rem); border: 2px solid var(--graphite); background: var(--sheet); color: var(--graphite); overflow: auto; }
dialog::backdrop { background: rgba(31, 34, 38, .65); }
dialog h2 { font-size: 1.9rem; }
dialog p { margin-top: 1rem; }
dialog > .btn, #request-done .btn { margin-top: 1.5rem; }
.summary { padding: .9rem 1rem; background: #EEF3FF; border-left: 4px solid var(--blue); font-weight: 600; }
.field { display: grid; gap: .35rem; margin-top: 1.1rem; }
.field label { font-weight: 700; font-size: .9375rem; }
.opt { font-weight: 400; color: var(--muted); }
.field input, .field textarea { width: 100%; min-height: 2.9rem; padding: .55rem .75rem; border: 2px solid #7D838B; border-radius: 0; background: #fff; color: var(--graphite); font: 400 1rem/1.3 var(--font); }
.field textarea { resize: vertical; }
.field input:hover, .field textarea:hover { border-color: var(--graphite); }
.field [aria-invalid="true"] { border-color: #B42318; background: #FEF3F2; }
.err { margin: 0; font-size: .875rem; font-weight: 600; color: #B42318; }
dialog .err { margin-top: 0; }
.err:empty { display: none; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.5rem; }
.fineprint { font-size: .875rem; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .config-head, .config-grid, .shop-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .presets { grid-template-columns: minmax(0, 1fr); max-width: 34rem; }
  .steps ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hint { min-height: 0; }
}
@media (max-width: 720px) {
  .top nav { display: none; }
  /* Narrow screens: keep the drawing pinned above the sliders so a change is visible while dragging. */
  .stage { display: contents; }
  #drawing { order: -1; position: sticky; top: 3.4rem; z-index: 5; border: 2px solid var(--graphite); }
  .quote { border: 2px solid var(--graphite); background: var(--sheet); }
  .dims text { font-size: 24px; }
  .quote { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .steps ol, .services, .quote dl { grid-template-columns: minmax(0, 1fr); }
  .quote-actions .btn { flex: 1 1 100%; }
  .foot-row a { margin-left: 0; display: block; margin-top: .4rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
