/* ==========================================================================
   Dielenwerk — styles.css
   One idea, pushed: the page is laid like a floor. Sections are "courses"
   (Reihen) offset by half a plank, the way a running-bond floor is laid, and
   the joints between them are drawn as ink hairlines. Orange field, ink,
   paper; the only other colours on the page are the floors themselves,
   which are data, not brand.

   Sections in file order (same names as data-sid in index.html):
   TOKENS · FONTS · BASE · BUTTONS · DEMO-NOTE · KOPF · HERO · COURSE ·
   VERGLEICH (rooms, options, plan) · AUSWAHL (summary) · BOEDEN · ABLAUF ·
   ANFRAGE · STUDIO-CTA · FUSS · MOTION
   ========================================================================== */

/* ======== TOKENS — change a colour here and it changes everywhere ======== */
:root {
  --field: #EC7442;      /* the orange ground: ink on it measures 5.2:1 */
  --ink: #1A120D;
  --paper: #F6EEE2;
  --paper-2: #EADCC6;    /* an empty room on the plan, input wells */
  --rust: #8A2E12;       /* warnings and errors, readable on paper */
  --serif: 'Bodoni Moda', 'Bodoni Moda Fallback', Georgia, serif;
  --sans: 'Albert Sans', 'Albert Sans Fallback', Arial, sans-serif;
  --wrap: 1320px;
  --gut: clamp(16px, 4vw, 48px);
}

/* ======== FONTS — self-hosted OFL faces + metric-matched fallbacks ========
   The fallback numbers were measured (fontTools, same German sample string
   against Arial and Georgia), so a late font swap cannot move a line. */
@font-face {
  font-family: 'Albert Sans';
  src: url('fonts/albertsans-var-latin.woff2?v=d33f7bf3') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Bodoni Moda';
  src: url('fonts/bodonimoda-var-latin.woff2?v=0492c861') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'Bodoni Moda';
  src: url('fonts/bodonimoda-italic-var-latin.woff2?v=3d674016') format('woff2');
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Albert Sans Fallback';
  src: local('Arial');
  size-adjust: 102.4%;
  ascent-override: 92.8%;
  descent-override: 24.4%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Bodoni Moda Fallback';
  src: local('Georgia');
  size-adjust: 103.9%;
  ascent-override: 108.3%;
  descent-override: 38.5%;
  line-gap-override: 0%;
}

/* ======== BASE ======== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--field);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  font-variant-numeric: tabular-nums;   /* ranges stack column-true in the comparison */
  overflow-x: clip;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.05; margin: 0; }
p { margin: 0; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
em { font-style: italic; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: absolute; left: 12px; top: -80px; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 12px 18px; font-weight: 600;
}
.skip:focus { top: 12px; }
.h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); letter-spacing: -.01em; }
.h2 em { font-weight: 400; }

/* ======== BUTTONS — square-edged like a plank end, never pill-round ======== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 0 22px;
  border: 2px solid var(--ink); border-radius: 2px;
  font: 600 1rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover:not(:disabled) { background: #3a2a20; }
.btn--field { background: var(--field); color: var(--ink); }
.btn--paper { background: var(--paper); color: var(--ink); }
.btn--line { background: transparent; color: var(--paper); border-color: var(--paper); }
.lnk {
  min-height: 44px; padding: 0 6px; border: 0; background: none; cursor: pointer;
  font: 600 .9rem var(--sans); color: var(--ink); text-decoration: underline; text-underline-offset: .2em;
}
.lnk:disabled { opacity: .4; cursor: not-allowed; text-decoration: none; }

/* ======== DEMO-NOTE — a thin ink strip, the first course of the floor ======== */
.demo-note {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--ink); color: var(--paper);
  padding: 8px var(--gut); font-size: .88rem; line-height: 1.4;
}
.demo-note[hidden] { display: none; }
.demo-note p { max-width: 90ch; }
.demo-note__x {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 0; color: inherit; cursor: pointer;
}
.demo-note__x svg { width: 14px; height: 14px; }
.demo-note :focus-visible { outline-color: var(--paper); }

/* ======== KOPF — wordmark, section links, language pill ======== */
.head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: var(--wrap); margin: 0 auto; padding: 14px var(--gut);
  border-bottom: 2px solid var(--ink);
}
.mark { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.mark em { font: italic 600 1.7rem/1 var(--serif); letter-spacing: -.01em; }
/* Fixed box = the measured advance of "Dielenwerk" in the italic (fontTools, 5.08em
   minus tracking). The italic is not preloaded, so without this the tagline next
   to it jumps 4 px when the font arrives. */
.mark em { display: inline-block; width: 5em; white-space: nowrap; }
.mark span { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
/* Three fixed cells wide enough for the longest translation ("Comparaison"): a language
   swap changes the words, never the boxes, so nothing in the header moves. */
.head__nav { display: grid; grid-template-columns: repeat(3, 7em); margin-left: auto; font-weight: 600; }
.head__nav a { text-decoration: none; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.head__nav a:hover { text-decoration: underline; }
.head__lang {
  --wdm-lang-bg: var(--ink); --wdm-lang-fg: var(--paper);
  --wdm-lang-border: var(--ink); --wdm-lang-font: var(--sans);
  min-width: 3.4em; min-height: 30px;   /* holds the pill's box before i18n.js mounts it */
}
@media (max-width: 720px) {
  .head__nav { display: none; }   /* three anchors on a phone just crowd the wordmark */
  .mark span { display: none; }
}

/* ======== HERO — centred headline over a strip of four floors ========
   Not the left-anchored "kicker + headline + button" every sibling uses:
   the headline sits centred, the floor strip under it IS the argument. */
.hero { padding: clamp(40px, 7vw, 96px) 0 0; text-align: center; }
.hero__h1 {
  max-width: 17ch; margin: 0 auto; padding: 0 var(--gut);
  font-size: clamp(2.5rem, 6.4vw, 6rem); line-height: 1; letter-spacing: -.025em;
}
/* On a phone the German headline runs four lines and English three: reserving four
   keeps the strip below from jumping up when i18n.js swaps the language in. */
@media (max-width: 600px) { .hero__h1 { min-height: 4lh; } }
.hero__lead { max-width: 60ch; margin: 22px auto 0; padding: 0 var(--gut); font-size: clamp(1.02rem, 1.4vw, 1.2rem); }
.hero__floor { margin-top: clamp(32px, 5vw, 64px); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
/* Height pinned in CSS (never by the SVG's intrinsic ratio after load), so the
   strip reserves its space before paint: CLS 0. */
.hero__svg { display: block; width: 100%; height: min(30vw, 300px); }
.hero__names {
  display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0; list-style: none;
  font: italic 500 clamp(1rem, 2.2vw, 1.6rem)/1 var(--serif);
}
.hero__names li { padding: 12px 8px; border-left: 2px solid var(--ink); }
.hero__names li:first-child { border-left: 0; }

/* ======== COURSE — the running-bond layout system ========
   Every section is one course. A 10 px band on top draws the plank joints;
   course--b shifts them by half a plank and moves its content one column
   right, so the page reads as a laid floor, not a stack of boxes. */
.course {
  position: relative;
  max-width: var(--wrap); margin: 0 auto;
  padding: clamp(56px, 8vw, 112px) var(--gut);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
}
.course::before {
  content: ""; position: absolute; left: var(--gut); right: var(--gut); top: 0; height: 10px;
  border-bottom: 2px solid var(--ink);
  background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 2px), var(--ink) calc(25% - 2px) 25%);
}
.course--b::before { background-position: 12.5% 0; }
.course > * { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .course--a > * { grid-column: 1 / span 11; }
  .course--b > * { grid-column: 2 / span 11; }
}

/* ======== VERGLEICH — header, grid, room cards ======== */
.cmp:focus { outline: none; }
.cmp__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 32px; margin-bottom: 28px; }
.cmp__intro { max-width: 46ch; }
.cmp.course > .cmp__grid { grid-column: 1 / -1; }
.cmp__grid { display: grid; gap: 28px; align-items: start; }
@media (min-width: 1080px) { .cmp__grid { grid-template-columns: minmax(0, 1fr) 330px; } }
.rooms { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.cmp__full { margin-top: 10px; font-weight: 600; }
.cmp__full:empty { display: none; }
.cmp__noscript { margin-top: 12px; }

.room {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 2px;
  padding: clamp(16px, 2.2vw, 26px);
  display: grid; gap: 18px 24px;
  grid-template-areas: "top" "in" "plan" "opts";
}
@media (min-width: 760px) {
  .room { grid-template-columns: 220px minmax(0, 1fr); grid-template-areas: "top top" "in in" "plan opts"; }
}
.room__top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.room__h { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.room__h:focus { outline: none; }
.room__h:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.room__n { font: 600 .8rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; vertical-align: .45em; margin-right: 6px; }
.room__t { font-style: italic; }
.room__acts { display: flex; gap: 6px; }

/* Inputs: 2 columns on a phone, one line of six on a desktop card. */
.room__in { grid-area: in; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; align-items: end; }
@media (min-width: 760px) { .room__in { grid-template-columns: 1.4fr .8fr .8fr .6fr 1.5fr; } }
.f { display: grid; gap: 5px; min-width: 0; }
.f label, .fld label { font-size: .82rem; font-weight: 600; letter-spacing: .02em; }
.f input[type="text"], .f select, .fld input:not([type="checkbox"]), .fld select, .fld textarea {
  width: 100%; min-height: 46px; padding: 8px 10px;
  border: 1.5px solid var(--ink); border-radius: 2px; background: #FFFBF4; color: var(--ink);
  font: 500 1rem var(--sans);
}
.f input[aria-invalid="true"], .fld [aria-invalid="true"] { border-color: var(--rust); box-shadow: inset 0 0 0 1px var(--rust); }
.f--typ { grid-column: 1 / -1; }
@media (min-width: 760px) { .f--typ { grid-column: auto; } }
.f--alt { grid-column: 1 / -1; }
@media (min-width: 760px) { .f--alt { grid-column: auto; } }
.f__err { grid-column: 1 / -1; color: var(--rust); font-size: .88rem; font-weight: 600; }
.f__err:empty { display: none; }
.f--c { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-height: 32px; }
@media (min-width: 760px) { .f--c { grid-column: span 2; } }
.f--c input { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); flex: none; }
.f--c label { font-size: .95rem; font-weight: 500; }

/* ======== VERGLEICH — the plan: the room to scale, laid in its floor ======== */
.plan { grid-area: plan; margin: 0; display: grid; gap: 8px; align-content: start; }
.plan__svg { display: block; width: 100%; height: 150px; color: var(--ink); }
.plan__cap { font-size: .88rem; font-weight: 600; }
.plan__svg.is-laying { animation: lay-floor .7s cubic-bezier(.3, .7, .2, 1) both; }
@keyframes lay-floor { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ======== VERGLEICH — four floor options, side by side ======== */
.opts { grid-area: opts; border: 0; margin: 0; padding: 0; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 1180px) { .opts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 760px) and (max-width: 1079px) { .opts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.opts__lg { grid-column: 1 / -1; padding: 0; margin-bottom: 4px; font-size: .82rem; font-weight: 600; letter-spacing: .02em; float: left; width: 100%; }
.opt { display: block; cursor: pointer; min-width: 0; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt__card {
  height: 100%; display: grid; gap: 6px; align-content: start;
  padding: 0 0 10px; border: 1.5px solid var(--ink); border-radius: 2px; background: #FFFBF4;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
.opt:hover .opt__card { transform: translateY(-2px); }
.opt__sw { display: block; width: 100%; height: 54px; border-bottom: 1.5px solid var(--ink); }
.opt__name { padding: 0 10px; font: 500 1.25rem/1.1 var(--serif); }
.opt__name small { display: block; margin-top: 2px; font: 500 .74rem/1.3 var(--sans); }
.opt__range { padding: 0 10px; font-weight: 700; font-size: .98rem; line-height: 1.25; }
.opt__rows { padding: 0 10px; display: grid; font-size: .76rem; line-height: 1.35; }
.opt__warn { padding: 0 10px; color: var(--rust); font-size: .76rem; font-weight: 600; line-height: 1.3; }
.opt__warn:empty { display: none; }
.opt__pick {
  justify-self: start; margin: 4px 10px 0; padding: 5px 10px;
  border: 1.5px solid currentColor; border-radius: 2px;
  font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.opt.is-warn .opt__card { border-style: dashed; }
/* Picked: the card turns ink, the pick label turns the field orange. */
.opt input:checked + .opt__card { background: var(--ink); color: var(--paper); }
.opt input:checked + .opt__card .opt__warn { color: #FFB38F; }
.opt input:checked + .opt__card .opt__pick { background: var(--field); color: var(--ink); border-color: var(--field); }
.opt input:focus-visible + .opt__card { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ======== AUSWAHL — the summary, an ink board that stays in view ======== */
.sum {
  background: var(--ink); color: var(--paper); padding: 22px; border-radius: 2px;
  display: grid; gap: 14px;
}
@media (min-width: 1080px) { .sum { position: sticky; top: 16px; } }
.sum :focus-visible { outline-color: var(--paper); }
.sum__h { font-style: italic; font-size: 1.8rem; }
.sum__list { list-style: none; margin: 0; padding: 0; display: grid; }
.sum__list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid rgba(246, 238, 226, .28); }
.sum__room { grid-column: 1 / -1; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.sum__mat { font: italic 500 1.1rem var(--serif); }
.sum__eur { font-weight: 700; }
.sum__none { font-size: .95rem; }
.sum__total { display: grid; gap: 4px; }
.sum__total:empty { display: none; }
.sum__tl { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.sum__total strong { font: 500 clamp(1.7rem, 2.6vw, 2.2rem)/1.05 var(--serif); color: var(--field); }
.sum__cnt { font-size: .85rem; }
.sum__legal { font-size: .82rem; line-height: 1.45; border-left: 3px solid var(--field); padding-left: 10px; }
.sum .btn { justify-self: start; }

/* ======== BOEDEN — four planks, every other one offset by half a plank ======== */
.floors .h2 { margin-bottom: clamp(28px, 4vw, 48px); max-width: 20ch; }
/* clip, not hidden: the slide-in offset must never widen the page (no sideways scroll). */
.planks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; overflow-x: clip; overflow-clip-margin: 4px; }
.plank {
  display: grid; grid-template-columns: 1fr; background: var(--paper);
  border: 2px solid var(--ink); border-radius: 2px;
}
@media (min-width: 760px) {
  .plank { grid-template-columns: minmax(180px, 34%) 1fr; width: 87%; }
  .plank:nth-child(even) { margin-left: 12%; }
}
.plank__sw { display: block; width: 100%; height: 100%; min-height: 110px; border-bottom: 2px solid var(--ink); }
@media (min-width: 760px) { .plank__sw { border-bottom: 0; border-right: 2px solid var(--ink); } }
.plank h3 { padding: 18px 22px 0; font-size: 1.9rem; font-style: italic; }
.plank p { padding: 8px 22px 20px; max-width: 58ch; }
@media (min-width: 760px) {
  .plank { grid-template-rows: auto 1fr; }
  .plank__sw { grid-row: 1 / span 2; }
}

/* ======== ABLAUF — three steps along a skirting board ======== */
.steps .h2 { margin-bottom: 32px; }
.steps__list {
  list-style: none; margin: 0; padding: 18px 0 0; counter-reset: s;
  display: grid; gap: 22px; border-top: 10px solid var(--ink);
}
@media (min-width: 760px) { .steps__list { grid-template-columns: repeat(3, 1fr); gap: 0; } }
.steps__list li { counter-increment: s; display: grid; gap: 8px; align-content: start; padding-right: 24px; }
@media (min-width: 760px) { .steps__list li + li { border-left: 2px solid var(--ink); padding-left: 24px; } }
.steps__list li::before { content: counter(s) "."; font: 500 3rem/1 var(--serif); }
.steps__list strong { font: italic 600 1.35rem var(--serif); }

/* ======== ANFRAGE — the request form on a paper panel ======== */
.ask .h2 { max-width: 18ch; }
.ask__intro { margin: 16px 0 28px; max-width: 58ch; }
.ask__form {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 2px;
  padding: clamp(18px, 3vw, 36px); display: grid; gap: 16px 20px;
}
@media (min-width: 760px) { .ask__form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fld { display: grid; gap: 6px; align-content: start; min-width: 0; }
.fld--wide, .fld__hint, .ask__status, .btn--send { grid-column: 1 / -1; }
.fld textarea { resize: vertical; min-height: 96px; }
.fld__hint { font-size: .88rem; margin-top: -8px; }
.fld__err { color: var(--rust); font-size: .88rem; font-weight: 600; }
.fld__err:empty { display: none; }
.fld--check { grid-template-columns: auto 1fr; align-items: start; column-gap: 12px; }
.fld--check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--ink); }
.fld--check label { font-size: .95rem; font-weight: 500; letter-spacing: 0; }
.fld--check .fld__err { grid-column: 2; }
.btn--send { justify-self: start; min-width: 220px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ask__status { font-size: 1rem; }
.ask__status:empty { display: none; }
.ask__status:focus { outline: none; }
.ask__status.is-ok { background: var(--ink); color: var(--paper); padding: 16px 18px; }
.ask__status.is-ok small { display: block; margin-top: 6px; opacity: .85; }
.ask__status.is-err { color: var(--rust); font-weight: 600; border-left: 3px solid var(--rust); padding-left: 10px; }

/* ======== STUDIO-CTA — outside the fiction, so it leaves the floor: ink band ======== */
.studio { background: var(--ink); color: var(--paper); padding: clamp(40px, 6vw, 72px) var(--gut); text-align: center; }
.studio__line { font: italic 500 clamp(1.6rem, 3.4vw, 2.6rem)/1.1 var(--serif); }
.studio__links { margin-top: 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.studio :focus-visible { outline-color: var(--paper); }

/* ======== FUSS — sign-off and the studio credit ======== */
.foot { max-width: var(--wrap); margin: 0 auto; padding: 28px var(--gut) 12px; display: grid; gap: 6px; font-size: .9rem; }
.foot__name em { font: italic 600 1.2rem var(--serif); margin-right: 6px; }

/* ======== MOTION — planks click in, the carpet rolls out, sections slide into the course ======== */
.pk { animation: pk-in .5s cubic-bezier(.2, .8, .2, 1) var(--d) both; }
@keyframes pk-in { from { opacity: 0; transform: translate(-.05px, -.07px); } }
.roll { transform-box: fill-box; transform-origin: 50% 0; animation: roll-out 1.1s cubic-bezier(.5, 0, .2, 1) 1.2s both; }
@keyframes roll-out { from { transform: scaleY(0); } }
.reveal.is-armed { opacity: 0; transform: translateX(-36px); transition: opacity .6s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.plank:nth-child(even).reveal.is-armed { transform: translateX(36px); }
.reveal.is-armed.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pk, .roll, .plan__svg.is-laying { animation: none; }
  .reveal.is-armed { opacity: 1; transform: none; transition: none; }
  .btn, .opt__card { transition: none; }
  .opt:hover .opt__card { transform: none; }
}
