/* Passnaht. Seitenstil. Die Engine (scrollcraft.css) bleibt unberührt.
   Welt: eine grüne Schneidematte auf der Werkbank, von oben. Birke als Material,
   Zinnober nur für Schnitt, Anriss-Spur und Knopf.
   Radien: Knöpfe und Teilwahl 10px, Papier 3px, sonst eckig. */

:root {
  --sc-canvas: #1E2B26;
  --sc-surface: #273630;
  --sc-ink: #EFEBE1;
  --sc-ink-soft: #BAC4B6;
  --sc-accent: #E0603F;
  --sc-accent-ink: #1A1410;
  --sc-font-display: "Young Serif", Georgia, serif;
  --sc-font-text: "Readex Pro", system-ui, sans-serif;
  --sc-shadow-color: 160 30% 6%;

  --birke: #D9BF92;
  --birke-kante: #B8955E;
  --papier: #F0EADC;
  --papier-tinte: #2A2620;
  --papier-leise: #5C5345;
  --fuge: #121B17;
  --r-knopf: 10px;
  --r-papier: 3px;
  --kopf-h: 64px;
}

html { scrollbar-color: #4A5D53 var(--sc-canvas); }
::selection { background: var(--sc-accent); color: var(--sc-accent-ink); }
:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 3px; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
input, button { caret-color: var(--sc-accent); }

/* Light text on the dark mat: a touch more leading, tracking and weight. */
body { font-weight: 400; letter-spacing: 0.005em; }
.sc-body { line-height: 1.66; color: var(--sc-ink-soft); }
.sc-display { font-weight: 400; letter-spacing: -0.01em; line-height: 1.04; text-wrap: balance; }

/* ------------------------------------------------------------------ Matte */
.matte {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgb(239 235 225 / 0.085) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(239 235 225 / 0.085) 1px, transparent 1px),
    linear-gradient(to right, rgb(239 235 225 / 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(239 235 225 / 0.04) 1px, transparent 1px);
  background-size: 140px 140px, 140px 140px, 28px 28px, 28px 28px;
  background-position: -1px -1px;
}
main { position: relative; z-index: 1; }

/* ------------------------------------------------------------------- Kopf */
.kopf {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: var(--kopf-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-inline: var(--sc-gutter);
  background: linear-gradient(to bottom, rgb(24 35 31 / 0.92), rgb(24 35 31 / 0.6) 70%, transparent);
}
.wortmarke {
  font-family: var(--sc-font-display); font-size: 1.45rem; text-decoration: none;
  letter-spacing: -0.01em; color: var(--sc-ink);
}
.teilreihe { display: flex; align-items: flex-start; }
.teilreihe a {
  position: relative; display: grid; justify-items: center; gap: 2px;
  text-decoration: none; color: var(--sc-ink-soft);
  margin-left: -9px;
  transition: color 160ms var(--sc-ease-out);
}
.teilreihe a:first-child { margin-left: 0; }
.teilreihe svg { display: block; width: 72px; height: 34px; overflow: visible; }
.teilreihe path {
  fill: transparent; stroke: currentColor; stroke-width: 1.3;
  stroke-dasharray: 3 2.4; transition: fill 220ms var(--sc-ease-out), stroke 220ms var(--sc-ease-out);
}
.teilreihe span { font-size: 0.75rem; letter-spacing: 0.02em; }
.teilreihe a[aria-current="true"] { color: var(--sc-ink); }
.teilreihe a[aria-current="true"] path { fill: var(--birke); stroke: var(--birke-kante); stroke-dasharray: none; }
@media (hover: hover) and (pointer: fine) {
  .teilreihe a:hover { color: var(--sc-ink); }
  .teilreihe a:hover path { stroke-dasharray: none; }
}

/* ------------------------------------------------------------------ Knopf */
.knopf {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0.7rem 1.35rem;
  border-radius: var(--r-knopf); border: 0;
  background: var(--sc-accent); color: var(--sc-accent-ink);
  font: 500 1rem/1.2 var(--sc-font-text); letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow: 0 2px 0 #9E3F27, 0 8px 18px -8px hsl(var(--sc-shadow-color) / 0.8);
  transition: transform 140ms var(--sc-ease-out), box-shadow 140ms var(--sc-ease-out), opacity 160ms;
}
/* Holzfaser im Knopf und ein langsamer Lichtstrich, damit er keine flache Fläche ist. */
.knopf::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(100deg, rgb(255 255 255 / 0.07) 0 1px, transparent 1px 7px);
}
.knopf::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgb(255 240 220 / 0.28) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: strich 1.4s var(--sc-ease-out) 1.2s 1 both;
}
@keyframes strich { from { transform: translateX(-120%); } to { transform: translateX(120%); } }
@media (hover: hover) and (pointer: fine) { .knopf:hover::after { animation: strich 0.9s var(--sc-ease-out) 1 both; } .knopf:disabled:hover::after { animation: none; } }
.knopf:active { transform: translateY(1px); box-shadow: 0 1px 0 #9E3F27, 0 4px 10px -6px hsl(var(--sc-shadow-color) / 0.8); }
@media (hover: hover) and (pointer: fine) { .knopf:hover { transform: translateY(-2px); } }
.knopf:disabled { opacity: 0.45; cursor: default; transform: none; }
.knopf:disabled::after { animation: none; }
.knopf--leise {
  background: transparent; color: var(--sc-ink);
  box-shadow: inset 0 0 0 1.5px rgb(239 235 225 / 0.55);
}
.knopf--leise::after { animation: none; }

/* --------------------------------------------------------------- Bühnen */

.platz { position: absolute; z-index: 2; }
.platte { display: block; width: 100%; height: 100%; overflow: visible; }
.saege { position: absolute; left: 0; top: 0; width: 10px; height: 10px; overflow: visible; z-index: 6; pointer-events: none; }
.staub { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }

/* 1 · Anriss */
.matte-nah {
  position: absolute; inset: -10% 0 -10% 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(transparent calc(100% - 46px), rgb(239 235 225 / 0.07) calc(100% - 46px), rgb(239 235 225 / 0.07) calc(100% - 45px), transparent calc(100% - 45px)),
    repeating-linear-gradient(to right, rgb(239 235 225 / 0.22) 0 1px, transparent 1px 28px) left calc(100% - 20px) / 100% 14px no-repeat,
    repeating-linear-gradient(to right, rgb(239 235 225 / 0.3) 0 1px, transparent 1px 140px) left calc(100% - 20px) / 100% 24px no-repeat,
    linear-gradient(32deg, transparent calc(50% - 0.5px), rgb(239 235 225 / 0.07) calc(50% - 0.5px), rgb(239 235 225 / 0.07) calc(50% + 0.5px), transparent calc(50% + 0.5px));
}
.buehne--anriss { --b: min(56vw, calc((100svh - 190px) * 1.5)); }
.buehne--schnitt { --b: min(56vw, calc((100svh - 190px) * 1.5)); }
.buehne--eigen { --b: min(52vw, calc((100svh - 210px) * 1.5)); }
.platz--anriss, .platz--schnitt {
  width: var(--b); aspect-ratio: 3 / 2;
  right: var(--sc-gutter); top: calc(50% + var(--kopf-h) / 2.6); translate: 0 -50%;
}
.anriss__text {
  position: absolute; z-index: 7; left: var(--sc-gutter); bottom: clamp(2.5rem, 11vh, 7rem);
  width: min(29rem, calc(100vw - var(--b) - var(--sc-gutter) * 2.6));
}
.anriss__text h1 { font-size: clamp(2.5rem, 1.2rem + 3.4vw, 4.6rem); line-height: 1.02; }
.anriss__text .sc-body { margin-top: 1.1rem; }
.anriss__text .knopf { margin-top: 1.6rem; }

/* 3 · Schnitt */
.schnitt__text {
  position: absolute; z-index: 7; left: var(--sc-gutter); top: 50%; translate: 0 -50%;
  width: min(25rem, calc(100vw - var(--b) - var(--sc-gutter) * 2.6));
  display: grid;
}
.schnitt__text > div { grid-area: 1 / 1; }
.schnitt__text .sc-body { margin-top: 0.9rem; }

/* 2 · Holz */
.holz { position: relative; }
.holz__raster {
  display: grid; grid-template-columns: 0.95fr 1.25fr 0.6fr; gap: clamp(1.5rem, 3vw, 3.5rem);
  align-items: start;
}
.holz__gross { margin: 0; grid-row: 1 / span 2; }
.holz__gross img, .holz__klein img { display: block; width: 100%; height: auto; border-radius: 2px; box-shadow: 0 18px 40px -22px hsl(var(--sc-shadow-color) / 0.9); }
.holz__text { padding-top: clamp(1rem, 6vw, 5rem); }
.holz__text .sc-display { font-size: var(--sc-t-2xl); }
.holz__klein { margin: clamp(4rem, 14vw, 12rem) 0 0; }
.holz__klein figcaption { margin-top: 0.8rem; font-size: 0.9rem; color: var(--sc-ink-soft); line-height: 1.5; }
.vorzeile { margin: 0; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--birke); }
.liste { margin: 1.8rem 0 0; display: grid; gap: 0; }
.liste div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: 0.7rem 0; border-top: 1px solid rgb(239 235 225 / 0.16); }
.liste div:last-child { border-bottom: 1px solid rgb(239 235 225 / 0.16); }
.liste dt { color: var(--birke); font-size: 0.92rem; }
.liste dd { margin: 0; color: var(--sc-ink); font-size: 0.98rem; }

/* 4 · Figuren */
.buehne--figuren { display: flex; align-items: center; }
.leiste {
  height: 100%; align-items: center; gap: clamp(2rem, 4vw, 4.5rem);
  padding-inline: var(--sc-gutter); padding-top: var(--kopf-h);
}
.leiste > * { flex: none; }
.leiste__kopf { width: min(27rem, 80vw); }
.leiste__kopf .sc-body { margin-top: 1rem; }
.leiste__schluss { width: min(21rem, 78vw); padding-right: var(--sc-gutter); }
.leiste__schluss .sc-lede { margin: 0 0 0.7rem; font-family: var(--sc-font-display); font-size: var(--sc-t-xl); line-height: 1.15; color: var(--sc-ink); }
.figur { width: clamp(15rem, 21vw, 19.5rem); }
.figur__bild { aspect-ratio: 1; }
.figur__bild svg { display: block; width: 100%; height: 100%; overflow: visible; }
.figur h3 { margin: 1.2rem 0 0.35rem; font: 400 1.35rem/1.2 var(--sc-font-display); color: var(--sc-ink); }
.figur p { margin: 0; color: var(--sc-ink-soft); font-size: 0.95rem; line-height: 1.55; max-width: 30ch; }

/* 5 · Ablauf: der Werkstattzettel */
.ablauf { padding-top: clamp(3rem, 6vw, 6rem); }
.ablauf__wrap { display: flex; justify-content: flex-end; }
.zettel {
  position: relative; width: min(46rem, 100%); margin-right: clamp(0rem, 6vw, 7rem);
  padding: clamp(1.6rem, 4vw, 3.4rem);
  background:
    repeating-linear-gradient(to bottom, transparent 0 31px, rgb(42 38 32 / 0.07) 31px 32px),
    linear-gradient(170deg, #F4EFE3, var(--papier) 60%, #E7DFCD);
  color: var(--papier-tinte);
  border-radius: var(--r-papier);
  rotate: -1.2deg;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.5) inset, 14px 22px 36px -18px hsl(var(--sc-shadow-color) / 0.95);
}
.zettel::before { /* Klebestreifen */
  content: ""; position: absolute; top: -14px; left: 12%; width: 110px; height: 28px; rotate: 4deg;
  background: rgb(232 222 196 / 0.75); box-shadow: 0 1px 3px rgb(0 0 0 / 0.15);
}
.zettel h2 { color: var(--papier-tinte); }
.zettel__schritte { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem 2.4rem; }
.zettel__schritte h3 { margin: 0 0 0.35rem; font: 600 1rem/1.3 var(--sc-font-text); color: var(--papier-tinte); }
.zettel__schritte h3::before { content: ""; display: inline-block; width: 0.7em; height: 2px; margin: 0 0.5em 0.28em 0; background: var(--sc-accent); vertical-align: middle; }
.zettel__schritte p { margin: 0; color: var(--papier-leise); font-size: 0.95rem; line-height: 1.55; }
.zettel__preise { margin-top: 2.2rem; width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.98rem; }
.zettel__preise caption { text-align: left; font: 400 1.2rem/1.2 var(--sc-font-display); margin-bottom: 0.6rem; }
.zettel__preise th { text-align: left; font-weight: 500; font-size: 0.82rem; color: var(--papier-leise); padding: 0.4rem 0; border-bottom: 1.5px solid var(--papier-tinte); }
.zettel__preise td { padding: 0.55rem 0; border-bottom: 1px dashed rgb(42 38 32 / 0.3); }
.zettel__preise td:last-child, .zettel__preise th:last-child { text-align: right; }
.zettel__fuss { margin: 1rem 0 0; font-size: 0.82rem; color: var(--papier-leise); }

/* 6 · Dein Bild */
.eigen__text {
  position: absolute; z-index: 7; left: var(--sc-gutter); top: calc(50% + var(--kopf-h) / 3); translate: 0 -50%;
  width: min(26rem, calc(100vw - var(--b) - var(--sc-gutter) * 2.6));
}
.eigen__text .sc-body { margin-top: 0.9rem; }
.eigen__schutz {
  display: flex; gap: 0.7rem; align-items: flex-start; margin: 1.2rem 0 0;
  font-size: 0.92rem; line-height: 1.5; color: var(--sc-ink);
}
.eigen__schutz svg { flex: none; width: 1.3rem; height: 1.3rem; margin-top: 0.1rem; color: var(--birke); }
.teilwahl { display: flex; align-items: center; gap: 0.5rem; margin: 1.3rem 0 0; padding: 0; border: 0; }
.teilwahl legend { float: left; margin-right: 0.6rem; font-size: 0.9rem; color: var(--sc-ink-soft); }
.teilwahl label { position: relative; cursor: pointer; }
.teilwahl input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.teilwahl span {
  display: inline-grid; place-items: center; min-width: 3.2rem; min-height: 40px; padding: 0 0.7rem;
  border-radius: var(--r-knopf); box-shadow: inset 0 0 0 1.5px rgb(239 235 225 / 0.35);
  font-variant-numeric: tabular-nums; font-size: 0.95rem;
  transition: background 160ms var(--sc-ease-out), color 160ms var(--sc-ease-out);
}
.teilwahl input:checked + span { background: var(--birke); color: var(--papier-tinte); box-shadow: none; }
.teilwahl input:focus-visible + span { outline: 2px solid var(--sc-accent); outline-offset: 3px; }
.eigen__knoepfe { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.2rem; }
.eigen__status { min-height: 1.5em; margin: 0.9rem 0 0; font-size: 0.9rem; color: var(--sc-ink); }
.platz--eigen {
  width: var(--b); aspect-ratio: 3 / 2;
  right: var(--sc-gutter); top: calc(50% + var(--kopf-h) / 3); translate: 0 -50%;
}
.foto-wahl {
  position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 0.7rem;
  cursor: pointer; text-align: center;
}
.foto-wahl input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.foto-wahl small { font-size: 0.85rem; color: var(--papier-tinte); background: rgb(240 234 220 / 0.82); padding: 0.2rem 0.6rem; border-radius: 4px; }
.foto-wahl input:focus-visible + .knopf { outline: 2px solid var(--sc-ink); outline-offset: 3px; }
.platz--eigen.hat-foto .foto-wahl { display: none; }
.fuss {
  position: absolute; z-index: 7; left: var(--sc-gutter); right: var(--sc-gutter); bottom: 1rem;
  display: flex; gap: 1.2rem; align-items: baseline; font-size: 0.8rem; color: var(--sc-ink-soft);
}
.fuss__marke { font-family: var(--sc-font-display); font-size: 1rem; color: var(--sc-ink); }

/* -------------------------------------------------------------- Handy */
@media (max-width: 760px) {
  :root { --kopf-h: 58px; }
  .wortmarke { font-size: 1.2rem; }
  .teilreihe svg { width: 40px; height: 24px; }
  .teilreihe a { margin-left: -6px; }
  .teilreihe span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

  .platz--anriss, .platz--schnitt, .platz--eigen {
    aspect-ratio: 4 / 5; right: auto; left: 50%; translate: -50% 0; top: calc(var(--kopf-h) + 10px);
  }
  .platz--anriss { width: min(90vw, calc(min(54svh, 100svh - 330px) * 0.8)); }
  .platz--schnitt { width: min(80vw, calc(min(54svh, 100svh - 320px) * 0.8)); top: calc(var(--kopf-h) + 22px); }
  .anriss__text, .schnitt__text {
    left: var(--sc-gutter); right: var(--sc-gutter); width: auto; top: auto; translate: none;
    bottom: max(1.2rem, env(safe-area-inset-bottom));
  }
  .anriss__text h1 { font-size: clamp(1.9rem, 8.4vw, 2.5rem); }
  .anriss__text .sc-body, .schnitt__text .sc-body { font-size: 0.95rem; margin-top: 0.6rem; }
  .anriss__text .knopf { margin-top: 1rem; }
  .schnitt__text .sc-display { font-size: clamp(1.6rem, 7vw, 2.1rem); }

  .holz__raster { grid-template-columns: 1fr 0.8fr; }
  .holz__gross { grid-row: auto; grid-column: 1 / -1; }
  .holz__text { grid-column: 1 / -1; padding-top: 0; }
  .holz__klein { grid-column: 2; margin-top: -1rem; }
  .liste div { grid-template-columns: 5rem 1fr; }

  .zettel { rotate: -0.6deg; margin-right: 0; }
  .zettel__schritte { grid-template-columns: 1fr; }

  .buehne--eigen { display: flex; flex-direction: column; padding: calc(var(--kopf-h) + 8px) var(--sc-gutter) 0.8rem; gap: 0.8rem; }
  .platz--eigen { position: relative; left: auto; top: auto; translate: none; align-self: center; width: min(78vw, calc((100svh - 400px) * 0.8)); flex: none; }
  .eigen__text { position: relative; left: auto; top: auto; translate: none; width: auto; order: 2; }
  .eigen__text .sc-display { font-size: clamp(1.7rem, 7.5vw, 2.2rem); }
  .eigen__text .sc-body { display: none; }
  .eigen__schutz { margin-top: 0.6rem; font-size: 0.85rem; }
  .teilwahl { margin-top: 0.7rem; }
  .eigen__knoepfe { margin-top: 0.7rem; }
  .eigen__knoepfe .knopf { min-height: 42px; padding: 0.55rem 1rem; font-size: 0.92rem; }
  .eigen__status { margin-top: 0.4rem; font-size: 0.82rem; }
  .fuss { position: relative; left: auto; right: auto; bottom: auto; order: 3; flex-direction: column; gap: 0.1rem; margin-top: auto; font-size: 0.75rem; }
  .fuss__marke { display: none; }
}
@media (max-width: 760px) and (max-height: 700px) {
  .anriss__text .sc-body { display: none; }
  .foto-wahl small { display: none; }
  .eigen__knoepfe { flex-wrap: nowrap; gap: 0.5rem; }
  .eigen__knoepfe .knopf { padding: 0.5rem 0.8rem; font-size: 0.86rem; }
  .eigen__text .sc-display { font-size: 1.6rem; }
  .teilwahl span { min-height: 36px; }
  .eigen__schutz span { font-size: 0.8rem; }
}

/* ------------------------------------------------------- Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .knopf::after { animation: none; }
  .knopf, .teilreihe path { transition-duration: 1ms; }
}
