/* Maserung Tischlerei: Grundlagen, Formular, Motor, danach Gestaltung. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; background: var(--c-bg); color: var(--c-ink); font: 400 var(--fs)/var(--lh) var(--font-body); overflow-wrap: break-word; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--c-main); text-underline-offset: .18em; text-decoration-thickness: 1px; transition: color .15s ease; }
a:hover { color: var(--c-main-hover); text-decoration-thickness: 2px; }
a[href], button:not(:disabled), summary, select, label[for], .swatch, .options label, input[type="checkbox"], input[type="radio"] { cursor: pointer; }
:focus-visible { outline: 2px solid var(--c-main); outline-offset: 2px; }
h1, h2, h3 { margin: 0 0 .45em; font-weight: var(--hw); line-height: 1.12; letter-spacing: -.012em; text-wrap: balance; }
h1 { font-size: calc(clamp(34px, 1.6rem + 2.6vw, 60px) * var(--hs)); line-height: 1.05; letter-spacing: -.022em; }
h2 { font-size: calc(clamp(27px, 1.35rem + 1.4vw, 40px) * var(--hs)); }
h3 { font-size: calc(clamp(19px, 1.05rem + .4vw, 23px) * var(--hs)); line-height: 1.25; }
p, ul, ol, dl, figure, table { margin: 0 0 1em; }
p { text-wrap: pretty; }
address { font-style: normal; }
[hidden] { display: none !important; }
.icon { width: 20px; height: 20px; flex: none; fill: currentColor; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--c-main); color: var(--c-on-main); font-weight: 600; }
.skip-link:focus { top: 12px; }
main:focus { outline: none; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.lead { font-size: calc(var(--fs) * 1.13); color: var(--c-muted); max-width: 54ch; }
.muted { color: var(--c-muted); }
.req { margin-left: 2px; color: var(--c-warn); font-weight: 700; }
.concept-note { padding: 8px 0; border-bottom: 1px solid var(--c-line); color: var(--c-muted); font-size: 14px; line-height: 1.45; }
.concept-note p { margin-block: 0; }
.concept-note a { color: inherit; }
.announce { background: var(--c-tint); }
.announce p { margin-block: 0; padding: 10px 0; font-weight: 600; }
.announce--vac { background: var(--c-main); color: var(--c-on-main); }
.announce--vac a { color: inherit; }

/* ---------- Formular ---------- */
.book { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.form { padding: 32px; border: 1px solid var(--c-line); background: var(--c-surface); }
.form h2 { font-size: calc(27px * var(--hs)); }
.form__hint { color: var(--c-muted); font-size: 15.5px; }
.field { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.field > label, .field legend { display: block; margin-bottom: 6px; padding: 0; font-size: 16px; font-weight: 700; }
.field .opt { font-weight: 400; color: var(--c-muted); }
.field input:not([type="radio"]):not([type="checkbox"]), .field select, .field textarea { display: block; width: 100%; min-height: 50px; padding: 11px 14px; border: 1px solid var(--c-field); border-radius: 0; background: var(--c-surface); color: var(--c-ink); font: 400 16.5px/1.4 var(--font-body); }
.field textarea { min-height: 96px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--c-ink); }
.field [aria-invalid="true"]:not(.options) { border-color: var(--c-warn) !important; border-width: 2px !important; }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--joint); }
.options label { display: flex; gap: 10px; align-items: flex-start; min-height: 50px; padding: 12px 14px; border: 1px solid var(--c-field); }
.options label:hover { border-color: var(--c-ink); }
.options input { width: 20px; height: 20px; flex: none; margin: 2px 0 0; accent-color: var(--c-main); }
.options label:has(input:checked) { padding: 11px 13px; border: 2px solid var(--c-main); background: var(--c-tint); }
.options[aria-invalid="true"] label { border-color: var(--c-warn); }
.field__hint { margin: 6px 0 0; color: var(--c-muted); font-size: 14.5px; }
.field__error { margin: 6px 0 0; color: var(--c-warn); font-size: 14.5px; font-weight: 600; }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; margin: 4px 0 18px; font-size: 15.5px; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--c-main); }
.form .btn[type="submit"] { width: 100%; }
.form-status { margin: 14px 0 0; color: var(--c-muted); font-size: 15.5px; }
.contact-list { display: grid; grid-template-columns: 40% minmax(0, 1fr); margin: 0 0 24px; }
.contact-list dt, .contact-list dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--c-line); line-height: 24px; }
.contact-list dt { padding-right: 16px; font-weight: 700; }
.contact-list a { display: inline-block; padding-block: 10px; margin-block: -10px; }
.hours { width: 100%; border-collapse: collapse; }
.hours th, .hours td { padding: 10px 0; border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: top; }
.hours th { width: 40%; padding-right: 16px; }
.vac-note { margin: 10px 0 0; padding: 8px 12px; background: var(--c-tint); font-weight: 600; }
.dialog { width: min(100% - 32px, 580px); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--c-line); background: var(--c-surface); color: var(--c-ink); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(12, 13, 18, .6); }
.dialog__body { padding: 28px; }
.dialog__text { max-height: 240px; overflow: auto; margin: 0 0 18px; padding: 14px; border: 1px solid var(--c-line); background: var(--c-alt); font: 400 15px/1.5 var(--font-body); white-space: pre-wrap; }
.dialog .actions { margin-top: 0; }
.dialog__close { margin-top: 12px; }

/* ---------- Motor ---------- */
.page-loader { position: fixed; inset: 0 0 auto; z-index: 100; pointer-events: none; }
.page-loader__bar { position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--c-main); transform-origin: left; animation: bb-load 8s cubic-bezier(.1, .7, .1, 1) forwards; }
.page-loader__pill { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--c-ink); color: var(--c-bg); font: 600 14px/1 var(--font-body); transform: translateX(-50%); box-shadow: var(--shadow); }
.page-loader__spin { width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: bb-spin .8s linear infinite; }
html.is-loading main { opacity: .6; transition: opacity .2s .1s; }
@keyframes bb-load { from { transform: scaleX(0); } to { transform: scaleX(.92); } }
@keyframes bb-spin { to { transform: rotate(360deg); } }
@keyframes bb-fade { from { opacity: 0; } to { opacity: 1; } }
.preview-bar { position: sticky; top: 0; z-index: 60; display: flex; justify-content: center; gap: 14px; padding: 8px 16px; background: var(--c-ink); color: var(--c-bg); font: 600 14px/1.4 var(--font-body); }
.preview-bar a { color: inherit; }
.section--block .media img { aspect-ratio: 4 / 3; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .quickbar, .announce, .concept-note { display: none !important; }
  body { padding: 0; background: #fff; color: #000; }
}


/* Maserung: helles Holz und Nussbaum, Vollkorn. Thema "Werkstattschild": alles mittig gesetzt, doppelte Linien, Schild-Kopf. */
@font-face { font-family: "Vollkorn"; font-weight: 400 900; font-display: swap; src: url("/assets/fonts/vk-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Vollkorn"; font-weight: 400 900; font-display: swap; src: url("/assets/fonts/vk-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
:root {
  --c-main: #4a2f1f; --c-main-hover: #331f13; --c-accent: #4a2f1f; --c-on-main: #fbf6ee;
  --c-ink: #24170f; --c-muted: #5c4a3c; --c-bg: #efe4d2; --c-surface: #fbf6ee; --c-alt: #e5d6bd; --c-line: #c3ac8b; --c-field: #7c6650; --c-tint: #eadbc0; --c-warn: #a3200f;
  --c-wood: #c9a06a; --c-walnut: #3a2518;
  --font-head: "Vollkorn", Georgia, serif; --font-body: "Vollkorn", Georgia, serif;
  --fs: 18.5px; --hs: 1; --hw: 700; --lh: 1.55; --wrap: 1080px; --radius: 4px; --space: 1; --joint: 8px;
  --shadow: 0 2px 8px rgba(36, 23, 15, .08); --sec-y: calc(80px * var(--space)); --gutter: 24px; --header-h: 128px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-main: #e0bb86; --c-main-hover: #edd0a4; --c-accent: #e0bb86; --c-on-main: #1d130c;
    --c-ink: #f3e9da; --c-muted: #c3b09a; --c-bg: #1d130c; --c-surface: #2a1d13; --c-alt: #241810; --c-line: #4d3a29; --c-field: #977f66; --c-tint: #3a2a1b; --c-warn: #ff8f7d;
    --c-walnut: #120b07; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --c-main: #e0bb86; --c-main-hover: #edd0a4; --c-accent: #e0bb86; --c-on-main: #1d130c;
  --c-ink: #f3e9da; --c-muted: #c3b09a; --c-bg: #1d130c; --c-surface: #2a1d13; --c-alt: #241810; --c-line: #4d3a29; --c-field: #977f66; --c-tint: #3a2a1b; --c-warn: #ff8f7d;
  --c-walnut: #120b07; color-scheme: dark;
}
h1 { font-size: calc(clamp(40px, 1.8rem + 3.6vw, 76px) * var(--hs)); line-height: 1.04; }
h2 { font-size: calc(clamp(28px, 1.4rem + 1.5vw, 42px) * var(--hs)); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 24px 0 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 26px; border: 3px double var(--c-on-main); border-radius: var(--radius); outline-offset: 2px; background: var(--c-main); color: var(--c-on-main); font: 700 18px/1.2 var(--font-body); text-align: center; text-decoration: none; transition: background-color .15s ease; }
.btn:hover { background: var(--c-main-hover); color: var(--c-on-main); text-decoration: none; }
.btn:active { background: var(--c-ink); }
.btn--ghost { border: 1px solid var(--c-ink); background: transparent; color: var(--c-ink); }
.btn--ghost:hover { background: var(--c-surface); color: var(--c-ink); }

/* Kopf als Schild: Name mittig, Menü darunter */
.site-header { position: relative; background: var(--c-surface); border-bottom: 6px double var(--c-walnut); }
.site-header__inner { display: grid; justify-items: center; gap: 4px; padding-block: 14px 8px; }
.brand { display: flex; align-items: center; min-height: 48px; color: var(--c-ink); font-size: 34px; font-weight: 800; text-decoration: none; }
.brand:hover { color: var(--c-ink); }
.site-nav__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin: 0; padding: 0; list-style: none; }
.site-nav a { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--c-ink); text-decoration: none; border-bottom: 2px solid transparent; }
.site-nav a[aria-current="page"] { border-bottom-color: var(--c-ink); font-weight: 700; }
.header-tools { position: absolute; top: 18px; right: var(--gutter); display: flex; gap: 6px; }
.tool { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 8px; border: 1px solid var(--c-line); border-radius: var(--radius); background: transparent; color: var(--c-ink); font: 700 15px/1 var(--font-body); text-decoration: none; }
.tool svg { width: 20px; height: 20px; }
.theme-toggle .i-sun, .theme-toggle[aria-pressed="true"] .i-moon { display: none; }
.theme-toggle[aria-pressed="true"] .i-sun { display: block; }

.section { padding-block: var(--sec-y); }
.section--alt { background: var(--c-alt); }
.section--tight { padding-block: calc(var(--sec-y) * .6); }
.head { max-width: 640px; margin: 0 auto 32px; text-align: center; }
.head p { margin: 0; color: var(--c-muted); }
.hero { padding-block: 56px 0; text-align: center; }
.hero .lead { margin: 0 auto; }
.hero__frame { margin: 40px auto 0; padding: 12px; background: var(--c-walnut); border-radius: var(--radius); }
.hero__frame img { width: 100%; height: clamp(240px, 52vh, 520px); object-fit: cover; }
.credit { margin: 4px 0 0; font-size: 15px; color: var(--c-muted); text-align: center; }
.credit a { display: inline-block; min-width: 44px; padding-block: 11px; color: inherit; }

/* Maßzettel: Regler links, Zeichnung rechts */
.config { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0; border: 6px double var(--c-walnut); background: var(--c-surface); }
.config__in, .config__out { min-width: 0; padding: 28px; }
.config__in { border-right: 1px solid var(--c-line); }
.config label { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; }
.config output { font-variant-numeric: tabular-nums; }
.config input[type="range"] { width: 100%; height: 44px; margin: 0 0 10px; accent-color: var(--c-main); cursor: pointer; }
.config select { display: block; width: 100%; min-height: 48px; margin: 6px 0 16px; padding: 8px 12px; border: 1px solid var(--c-field); border-radius: var(--radius); background: var(--c-surface); color: var(--c-ink); font: 400 18px/1.3 var(--font-body); }
.config__out { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; text-align: center; }
.config svg { width: 100%; height: 380px; }
.config svg .body { fill: var(--wood, #c9a06a); stroke: var(--c-ink); }
.config svg .gap { fill: var(--c-surface); stroke: var(--c-ink); }
.config svg .board { fill: var(--wood, #c9a06a); stroke: var(--c-ink); }
.config svg .floor { stroke: var(--c-ink); }
.config__out p { margin: 0; color: var(--c-muted); }
.config__out .btn { align-self: center; }

.way { max-width: 640px; margin: 0 auto; padding: 0; list-style: none; text-align: center; }
.way li { padding: 24px 0; border-top: 1px solid var(--c-line); }
.way li:last-child { border-bottom: 1px solid var(--c-line); }
.way h3 { margin-bottom: 4px; }
.way p { margin: 0; color: var(--c-muted); }

.page-head { padding-block: 40px 8px; text-align: center; }
.page-head .lead { margin: 0 auto; }
.breadcrumb { display: none; }
.narrow, .prose { max-width: 720px; }
.prose h2 { margin-top: 1.6em; font-size: calc(26px * var(--hs)); }
.prose a { overflow-wrap: anywhere; }
.prose #bildnachweis ~ ul a { display: inline-block; min-width: 44px; padding-block: 10px; }
.check { min-height: 44px; }

.site-footer { margin-top: var(--sec-y); padding: 52px 0 28px; background: var(--c-walnut); text-align: center; }
.site-footer, .site-footer h2, .site-footer p, .site-footer address, .site-footer a, .site-footer a:hover, .hours-list li { color: #f3e9da; }
.site-footer h2 { font-size: 30px; }
.site-footer ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 24px; margin: 0 0 12px; padding: 0; list-style: none; }
.site-footer a { display: inline-block; min-width: 44px; padding-block: 10px; line-height: 24px; }
.site-footer__bottom { margin-top: 20px; padding-top: 16px; border-top: 1px solid #6d5442; font-size: 16px; }
.site-footer :focus-visible { outline-color: #f3e9da; }
.quickbar { display: none; }

@media (max-width: 860px) {
  :root { --sec-y: calc(52px * var(--space)); }
  .config, .book { grid-template-columns: minmax(0, 1fr); }
  .config__in { order: 2; border-right: 0; border-top: 1px solid var(--c-line); }
  .config svg { height: 280px; }
}
@media (max-width: 640px) {
  :root { --fs: 17.5px; --gutter: 16px; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .site-header__inner { padding-top: 66px; }
  .header-tools { top: 12px; right: 0; left: 0; justify-content: center; }
  .brand { font-size: 28px; }
  .actions .btn { flex: 1 1 100%; }
  h1, h2 { hyphens: auto; -webkit-hyphens: auto; }
  .hero { padding-top: 32px; }
  .hero__frame { padding: 8px; }
  .config__in, .config__out { padding: 16px; }
  .options, .field-row { grid-template-columns: minmax(0, 1fr); }
  .form { padding: 22px 16px; }
  .dialog__body { padding: 22px 18px; }
  .quickbar { display: block; position: fixed; inset: auto 0 0; z-index: 25; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--c-walnut); }
  .quickbar ul { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin: 0; padding: 0; list-style: none; }
  .quickbar a { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1px solid #f3e9da; border-radius: var(--radius); color: #f3e9da; font-weight: 700; text-decoration: none; }
  .quickbar li:last-child a { background: #f3e9da; color: #24170f; }
}
@media (max-width: 380px) {
  .contact-list { grid-template-columns: minmax(0, 1fr); }
  .contact-list dt { border-bottom: 0; padding-bottom: 0; }
}

/* Sanfte Sprünge zu Ankern und Seitenübergang: Hobelzug von rechts (vom Inhaber gewünscht; aus bei reduzierter Bewegung) */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  @view-transition { navigation: auto; }
}
.site-header { view-transition-name: kopf; }
.quickbar { view-transition-name: leiste; }
::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: normal; }
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: seitenwechsel .4s cubic-bezier(.3, 0, .2, 1) both; }
@keyframes seitenwechsel { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0); } }

/* Möbelseiten: Zeichnung als Blatt, Verweise mittig */
.sheet { margin: 0 auto 48px; padding: 12px; background: var(--c-walnut); border-radius: var(--radius); }
.sheet img { width: 100%; height: auto; }
.qa { margin-top: 48px; }
.pieces { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin: 0; padding: 0; list-style: none; }
.pieces li { flex: 0 1 300px; min-width: 0; }
.pieces a { display: block; padding: 8px; border: 3px double var(--c-walnut); background: var(--c-surface); color: var(--c-ink); text-align: center; text-decoration: none; }
.pieces img { width: 100%; height: auto; }
.pieces span { display: block; padding: 10px 4px 4px; font-size: 22px; font-weight: 700; }
.pieces a:hover span { text-decoration: underline; color: var(--c-main); }
