/* ===========================================================================
   IndustrieWert — homepage v1.1 (BRIEF.md v1.1)
   Six acts, six different devices, one peak. Photography leads every act.
   Everything degrades to a static, fully readable page without JS.
   =========================================================================== */

/* ======================================================= 1 · HERO · shutter */
.hero { padding-block: clamp(2.5rem, 1rem + 5vw, 6rem) var(--pad-section); overflow: hidden; }
.hero__inner {
  display: grid; gap: var(--s-8); align-items: center;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
}
.hero__copy { display: flex; flex-direction: column; gap: var(--s-4); }
.hero__title { margin-block: var(--s-2); }
.hero__lede { max-width: 44ch; }
.hero__cta { margin-top: var(--s-3); gap: var(--s-3); }
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; gap: var(--s-6); }
  .seq { order: -1; }
}

.seq { display: flex; flex-direction: column; gap: var(--s-3); }
.seq__stage {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--c-industrial-800); border: var(--bw-hair) solid var(--c-rule);
}

/* Frames stack. Only the active one is shown. With JS, the incoming frame wipes
   in as a horizontal shutter over the outgoing one (clip-path, never width). */
.seq__frame { position: absolute; inset: 0; margin: 0; display: none; }
.seq__frame.is-active { display: block; }
.seq__frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

.js-motion .seq__frame { display: block; clip-path: inset(0 100% 0 0); z-index: 1; }
.js-motion .seq__frame.was-active { clip-path: inset(0); z-index: 0; }
.js-motion .seq__frame.is-active {
  clip-path: inset(0); z-index: 2;
  transition: clip-path var(--t-reveal) var(--ease-mech);
}
/* Slow drift on the active still: transform only, 2 %, reads as breath not zoom. */
.js-motion .seq__frame.is-active img { animation: seq-drift 9s var(--ease-panel) both; }
@keyframes seq-drift { from { transform: scale(1) translate3d(0,0,0); } to { transform: scale(1.03) translate3d(-1%, -0.5%, 0); } }

/* Maßlinie over the image, drawn when the frame lands. */
.seq__dim { position: absolute; left: 0; right: 0; bottom: 21%; width: 100%; height: auto; }
.seq__dim line { stroke: var(--c-accent); stroke-width: 2; }
.js-motion .seq__dim-line { stroke-dasharray: 976; stroke-dashoffset: 976; }
.js-motion .seq__frame.is-active .seq__dim-line {
  stroke-dashoffset: 0; transition: stroke-dashoffset var(--t-reveal) var(--ease-mech) 180ms;
}

/* The one true figure. A scrim only where the text sits, never full-frame. */
.seq__figure {
  position: absolute; left: var(--s-4); bottom: calc(21% + var(--s-5));
  font-size: clamp(2.6rem, 1.4rem + 4vw, 4.75rem); font-weight: 700; line-height: 1;
  letter-spacing: -0.03em; color: var(--c-accent);
  text-shadow: 0 1px 2px rgb(0 0 0 / .55), 0 0 24px rgb(0 0 0 / .35);
  margin: 0;
}
.js-motion .seq__figure { opacity: 0; transform: translateY(8px); }
.js-motion .seq__frame.is-active .seq__figure {
  opacity: 1; transform: none;
  transition: opacity var(--t-slow) var(--ease-mech) 260ms, transform var(--t-slow) var(--ease-mech) 260ms;
}

.seq__cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-3); align-items: baseline;
  background: var(--c-surface); border-top: var(--bw-hair) solid var(--c-rule);
  padding: var(--s-3) var(--s-4); min-height: 56px;
}
.seq__fam { color: var(--c-ink-faint); }
.seq__name { font-weight: 600; font-size: var(--fs-body-s); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; color: var(--c-ink); }
.seq__name:hover { text-decoration: underline; text-decoration-color: var(--c-accent); }
.seq__price { font-weight: 600; white-space: nowrap; }
@media (max-width: 560px) {
  .seq__cap { grid-template-columns: 1fr auto; }
  .seq__fam { grid-column: 1 / -1; }
}

/* Controls exist only when JS can drive them. */
.seq__ctl { display: none; align-items: center; gap: var(--s-3); }
.js-motion .seq__ctl, .seq.is-manual .seq__ctl { display: flex; }
.seq__btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--c-surface); border: var(--bw-hair) solid var(--c-rule); border-radius: var(--r-1);
  cursor: pointer; color: var(--c-ink); font-size: 1.1rem;
  transition: border-color var(--t-fast) var(--ease-mech);
}
.seq__btn:hover { border-color: var(--c-industrial-900); }
.seq__dots { list-style: none; display: flex; gap: var(--s-2); flex: 1; }
.seq__dots li { flex: 1; }
.seq__dot {
  display: block; width: 100%; height: 44px; padding: 20px 0;
  background: none; border: 0; cursor: pointer;
}
.seq__dot-bar { display: block; height: 3px; background: var(--c-grey-200); position: relative; overflow: hidden; border-radius: 2px; }
.seq__dot-bar::after {
  content: ""; position: absolute; inset: 0; background: var(--c-industrial-900);
  transform: scaleX(0); transform-origin: left;
}
.seq__dot.is-on .seq__dot-bar::after {
  animation: seq-hold var(--hold, 4600ms) linear forwards;
}
.seq.is-paused .seq__dot.is-on .seq__dot-bar::after { animation-play-state: paused; }
.seq__dot:hover .seq__dot-bar { background: var(--c-grey-300); }
@keyframes seq-hold { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ================================================ 2 · FAMILIEN · count-in */
.fam { display: grid; gap: var(--gutter); grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1080px) { .fam { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .fam { grid-template-columns: 1fr; } }

.fam__panel {
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--c-surface); border: var(--bw-hair) solid var(--c-rule);
  transition: border-color var(--t-base) var(--ease-mech), transform var(--t-base) var(--ease-mech);
}
.fam__panel:hover { border-color: var(--c-industrial-900); transform: translateY(-2px); }
.fam__media { aspect-ratio: 4 / 3; background: var(--c-surface-alt); overflow: hidden; }
.fam__media img { width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.4s var(--ease-panel); }
.fam__panel:hover .fam__media img { transform: scale(1.05) translate3d(-1%, -1%, 0); }
.fam__body { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); flex: 1; }
.fam__count { font-size: clamp(2rem, 1.4rem + 1.6vw, 2.75rem); font-weight: 700; line-height: 1; color: var(--c-ink); }
.fam__label { margin-top: calc(var(--s-1) * -1); }
.fam__cats { list-style: none; margin-top: auto; padding-top: var(--s-3);
  border-top: var(--bw-hair) solid var(--c-grey-100); display: flex; flex-direction: column; gap: 5px; }
.fam__cats li { display: flex; justify-content: space-between; gap: var(--s-3);
  font-size: var(--fs-caption); color: var(--c-ink-muted); }
.fam__cat-n { color: var(--c-ink-faint); }

/* ============================================= 3 · AUSGEWÄHLTE · gallery */
.sel__more { margin-top: var(--s-7); text-align: center; }

.card__media { position: relative; }
.card__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity var(--t-base) var(--ease-mech);
}
.card__img.is-active { opacity: 1; }
.card__media img:first-of-type { position: absolute; }
.card__dots {
  position: absolute; right: var(--s-3); bottom: var(--s-3); z-index: 1;
  display: flex; gap: 4px;
}
.card__dots i {
  display: block; width: 14px; height: 3px; background: rgb(255 255 255 / .55);
  border-radius: 2px; transition: background var(--t-fast);
}
.card__dots i.is-on { background: var(--c-accent); }

/* ========================================= 4 · TECHNIK · PEAK · pinned scrub */
.tech { position: relative; color: #fff; }
.tech__pin { padding-block: var(--pad-section); }
.tech__inner { display: flex; flex-direction: column; gap: var(--s-7); }

.tech__head { display: flex; flex-direction: column; gap: var(--s-3); }
.tech__index {
  list-style: none; display: flex; gap: var(--s-5); flex-wrap: wrap;
  margin-top: var(--s-2); padding-top: var(--s-3);
  border-top: var(--bw-hair) solid rgb(255 255 255 / .14);
}
.tech__ix {
  font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase;
  font-weight: 600; color: var(--c-grey-500); position: relative; padding-bottom: 6px;
  transition: color var(--t-base) var(--ease-mech);
}
.tech__ix::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--bw-emph);
  background: var(--c-accent); transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-base) var(--ease-mech);
}
.tech__ix.is-on { color: #fff; }
.tech__ix.is-on::after { transform: scaleX(1); }

.tech__stage { position: relative; display: flex; flex-direction: column; gap: var(--s-8); }
.tech__stop {
  display: grid; gap: var(--s-6); align-items: center;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
}
.tech__stop:nth-child(even) .tech__media { order: 2; }
@media (max-width: 860px) {
  .tech__stop { grid-template-columns: 1fr; gap: var(--s-4); }
  .tech__stop:nth-child(even) .tech__media { order: 0; }
}

.tech__visual { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.tech__media {
  position: relative; width: 100%; aspect-ratio: 5 / 3; max-height: min(56vh, 540px);
  border: var(--bw-hair) solid rgb(255 255 255 / .18); background: rgb(255 255 255 / .025);
  overflow: hidden;
}
.tech__cap { color: var(--c-grey-500); }
.tech__dim { position: absolute; left: 0; right: 0; bottom: var(--s-3); width: 100%; height: auto; }
.tech__dim line { stroke: var(--c-accent); stroke-width: 2; }

/* --- Prinzipdarstellung: hand-authored engineering elevations ----------------
   Three stroke weights and one wash. Every stroke carries pathLength="1", so one
   dash rule below draws any of them, whatever its real length. */
.sch { position: absolute; inset: var(--s-4) var(--s-4) var(--s-6); width: calc(100% - 2 * var(--s-4)); height: calc(100% - var(--s-4) - var(--s-6)); display: block; }
.sch .k   { fill: none; stroke: var(--c-accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sch .h   { fill: none; stroke: var(--c-accent); stroke-width: 4.2; stroke-linecap: round; }
.sch .g   { fill: none; stroke: rgb(255 255 255 / .40); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.sch .gk  { fill: none; stroke: rgb(189 235 66 / .34); stroke-width: 1.3; }
.sch .cyl { fill: none; stroke: rgb(255 255 255 / .55); stroke-width: 12; stroke-linecap: butt; }
.sch .t   { fill: none; stroke: rgb(255 255 255 / .32); stroke-width: 3; stroke-dasharray: 4 7; }
.sch .guard { fill: none; stroke: rgb(189 235 66 / .45); stroke-width: 1.2; stroke-dasharray: 8 6; }
.sch .w   { fill: rgb(189 235 66 / .07); stroke: none; }
.sch .s   { fill: rgb(0 0 0 / .5); stroke: none; }

.tech__body { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.tech__figure {
  font-size: clamp(3rem, 1.8rem + 4.6vw, 6rem); font-weight: 700; line-height: 1;
  color: var(--c-accent); letter-spacing: -0.035em;
}
.tech__ident { display: flex; align-items: center; gap: var(--s-3); }
.tech__thumb { flex: 0 0 auto; width: 72px; height: 54px; object-fit: cover;
  border: var(--bw-hair) solid rgb(255 255 255 / .22); background: var(--c-surface-deep-2); }
.tech__line { max-width: 50ch; }
.tech__link {
  align-self: flex-start; margin-top: var(--s-2); color: var(--c-accent);
  display: inline-flex; align-items: center; min-height: 44px;   /* thumb-sized */
  font-size: var(--fs-body-s); font-weight: 600; text-decoration: none;
  border-bottom: var(--bw-emph) solid transparent;
  transition: border-color var(--t-fast) var(--ease-mech);
}
.tech__link:hover { border-bottom-color: var(--c-accent); }

/* --- The pin. Only when JS confirms it can drive --sh / --dl. --------------
   Section height = (stops + 1) viewports, so each stop owns one full viewport
   of wheel travel and the act holds the most scroll room on the page. */
.js-motion .tech { height: calc((var(--stops) + 1) * 100vh); }
.js-motion .tech__pin {
  position: sticky; top: var(--h-header-compact);
  height: calc(100vh - var(--h-header-compact)); box-sizing: border-box;
  padding-block: clamp(1.5rem, 1rem + 2vw, 3rem); display: flex; align-items: center;
}
.js-motion .tech__inner { gap: var(--s-6); width: 100%; }
/* Stops share one grid cell instead of being absolutely positioned, so the
   stage is always exactly as tall as its tallest stop: no void, no clipping. */
.js-motion .tech__stage { display: grid; }
.js-motion .tech__stop {
  grid-area: 1 / 1; opacity: 0; pointer-events: none;
  transition: opacity var(--t-base) var(--ease-mech);
}
.js-motion .tech__stop.is-on { opacity: 1; pointer-events: auto; }

/* Scroll position IS the drawing: --sh drafts the elevation in three passes
   (structure, body, detail), then --dl extends the Maßlinie. */
.js-motion .sch [pathLength] { stroke-dasharray: 1; }
.js-motion .sch__a [pathLength] { stroke-dashoffset: clamp(0, 1 - var(--sh, 0) / 0.45, 1); }
.js-motion .sch__b [pathLength] { stroke-dashoffset: clamp(0, 1 - (var(--sh, 0) - 0.2) / 0.5, 1); }
.js-motion .sch__c [pathLength] { stroke-dashoffset: clamp(0, 1 - (var(--sh, 0) - 0.42) / 0.5, 1); }
.js-motion .sch__f, .js-motion .sch .t, .js-motion .sch .guard { opacity: clamp(0, (var(--sh, 0) - 0.62) * 2.8, 1); }
.js-motion .tech__dim-line {
  stroke-dasharray: 984px;
  stroke-dashoffset: calc(984px * (1 - var(--dl, 0)));
}
.js-motion .tech__dim { opacity: clamp(0, var(--sh, 0) * 1.4, 1); }

/* Single-column pin (≤ 860 px). Budget for one viewport of 100vh − header:
   head ≈ 100 · drawing ≤ 30vh · caption + gaps ≈ 60 · body ≈ 280. Measured at
   716 × 863 the old values overflowed the pin by ~100 px and clipped the link. */
@media (max-width: 860px) {
  .js-motion .tech__pin { overflow: hidden; padding-block: var(--s-4); }
  .js-motion .tech__inner { gap: var(--s-4); }
  .tech__head .section-head__meta { display: none; }   /* eyebrow yields to the drawing */
  .tech__head { gap: var(--s-2); }
  .tech__index { margin-top: 0; gap: var(--s-4); }
  .tech__media { max-height: 30vh; }
  .tech__body { gap: var(--s-2); }
  .tech__figure { font-size: clamp(2.2rem, 1.4rem + 4vw, 3.4rem); }
  .tech__line { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .tech__link { min-height: 44px; margin-top: 0; }
}

/* ===================================== 5 · GRUNDLAGE · authored silence */
.quiet { padding-block: calc(var(--pad-section) * 1.15); }
.why { list-style: none; display: grid; gap: var(--gutter); grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1080px) { .why { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .why { grid-template-columns: 1fr; } }
.why__item { padding-top: var(--s-4); border-top: var(--bw-emph) solid var(--c-accent); }
.why__item h3 { margin-bottom: var(--s-2); }

/* ================================================= 6 · ANGEBOT · the close */
.rfq { min-height: calc(100vh - var(--h-header-compact)); display: grid; align-content: center; }
.rfq__inner { display: grid; gap: var(--s-8); grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 900px) { .rfq__inner { grid-template-columns: 1fr; gap: var(--s-6); } .rfq { min-height: 0; } }
.rfq__lede { margin-block: var(--s-4); max-width: 46ch; }
.rfq__facts { list-style: none; display: flex; flex-direction: column; gap: var(--s-3); margin-top: var(--s-5); }
.rfq__facts li { display: flex; flex-direction: column; gap: 2px;
  padding-top: var(--s-3); border-top: var(--bw-hair) solid rgb(255 255 255 / .12); }
.rfq__facts li span:last-child { font-size: var(--fs-body-s); color: var(--c-grey-300); }

.rfq__form { display: grid; gap: var(--s-4); grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .rfq__form { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: var(--fs-label); letter-spacing: var(--ls-label);
  text-transform: uppercase; font-weight: 600; color: var(--c-grey-300); }
.field input, .field textarea {
  background: var(--c-surface-deep-2); color: #fff;
  border: var(--bw-hair) solid rgb(255 255 255 / .22); border-radius: var(--r-1);
  padding: 12px var(--s-3); min-height: 46px;
  transition: border-color var(--t-fast) var(--ease-mech);
}
.field textarea { min-height: auto; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible {
  outline: var(--bw-emph) solid var(--c-accent); outline-offset: 1px; border-color: transparent;
}
.rfq__legal { color: var(--c-grey-500); }
.rfq__legal a { color: var(--c-grey-300); }

/* ================================================= reduced motion, all acts */
@media (prefers-reduced-motion: reduce) {
  .js-motion .seq__frame.is-active img { animation: none; }
  .seq__dot.is-on .seq__dot-bar::after { animation: none; transform: scaleX(1); }
  .fam__media img, .fam__panel:hover .fam__media img { transition: none; transform: none; }
}
