/* ------------------------------------------------------------------
   WGWM – neues Design (projekt-wgwm.html)
   Werte aus „Styleguide – Typografie / Farben / Layout“ (Entwurf 1920 × 9553 px).
   --u = 1 px des Entwurfs. Skaliert mit der Bildschirmbreite, ab 1920 px fest.
   Alle Klassen beginnen mit "wn-", damit nichts mit styles.css kollidiert.
------------------------------------------------------------------- */
/* Schrift Milker kommt aus assets/fonts/milker.css (eingebettet, funktioniert auch per file://) */

.wn {
  /* Farben, --u und --display kommen jetzt aus :root in styles.css */
  --edge: var(--gutter); /* Rasterkante (58 px im Entwurf) – dieselbe wie Navi und alle anderen Seiten */
}

/* ------------------------------------------------------------------
   Gemeinsame Bausteine
------------------------------------------------------------------- */
.wn-case { color: var(--plum); }
.wn-case img { width: 100%; height: 100%; object-fit: cover; }

.wn-display {
  font-family: var(--display); word-spacing: var(--display-ws); font-weight: 400; letter-spacing: 0;
  text-transform: uppercase;
}
.wn-display--md { font-size: max(28px, 76 * var(--u));     line-height: 1.05; } /* 76 / ZH 80 */
.wn-display--lg { font-size: max(32px, 94.76 * var(--u));  line-height: 1.15; } /* 94,76 / ZH 109,07 */
.wn-display--xl { font-size: max(40px, 106.49 * var(--u)); line-height: 1; }

.wn-label { margin: 0; font-size: max(13px, 15 * var(--u)); font-weight: 700; line-height: 1.4; }
.wn-label--lav { color: var(--lavender); }

.wn-bleed { margin: 0; }

/* Einblenden von unten (wgwm.js setzt .wn-js und .is-in) */
.wn-js [data-wn-reveal] {
  opacity: 0; transform: translateY(40px);
  transition: opacity .9s ease, transform 1.1s cubic-bezier(.2, .7, .2, 1);
}
.wn-js [data-wn-reveal].is-in { opacity: 1; transform: none; }

/* ------------------------------------------------------------------
   Hero
------------------------------------------------------------------- */
.wn-hero { position: relative; aspect-ratio: 1920 / 1105; overflow: hidden; background: #111; }
.wn-hero__img { position: absolute; inset: 0; }
.wn-hero::after { /* schwarzer Verlauf von unten, hinter dem Titel */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.55) 22%, rgba(0,0,0,0) 55%);
}
.wn-hero__text {
  position: absolute; z-index: 1; left: var(--edge); right: var(--edge); bottom: max(20px, 30 * var(--u));
  color: var(--lime);
}
.wn-hero__eyebrow { margin: 0 0 max(8px, 15 * var(--u)); font-size: max(15px, 20 * var(--u)); font-weight: 300; }
.wn-hero__title { font-family: var(--display); word-spacing: var(--display-ws); font-weight: 400; font-size: max(72px, 175.68 * var(--u)); line-height: 1; letter-spacing: 0; margin-left: -0.02em; } /* Vorbreite der Buchstaben ausgleichen */
.wn-hero__facts { margin: max(10px, 15 * var(--u)) 0 0; font-size: max(12px, 15 * var(--u)); font-weight: 300; }
.wn-hero__facts span { margin-inline: 1em; }

/* WGWM: Hero füllt genau den ersten Bildschirm – Navi, Bild, Titel und Fakten sind sofort sichtbar */
.wn-hero--full { aspect-ratio: auto; height: 100vh; height: 100svh; min-height: 480px; }

/* ------------------------------------------------------------------
   Herausforderung – Lavendel-Fläche
------------------------------------------------------------------- */
.wn-challenge {
  background: var(--lavender);
  padding: max(56px, 112 * var(--u)) var(--edge) max(112px, 340 * var(--u)); /* unten mehr Luft (vorher 240) */
}
.wn-challenge .wn-display { margin: max(14px, 28 * var(--u)) 0 max(20px, 40 * var(--u)); }
.wn-challenge__text { max-width: 45em; font-size: max(15px, 20 * var(--u)); line-height: 1.35; }
.wn-challenge__text p { margin: 0 0 1.35em; }
.wn-challenge__text p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------
   Lösung – Headline beginnt auf dem Foto und läuft auf Weiß weiter
------------------------------------------------------------------- */
.wn-bleed--solution { position: relative; aspect-ratio: 1920 / 1170; overflow: hidden; }
/* Parallax (wgwm.js): Bild 6 % höher als der Rahmen, mittig ausgerichtet */
.wn-case .wn-bleed--solution img { position: absolute; left: 0; top: -3%; height: 106%; will-change: transform; }
/* dunkler Verlauf von unten, damit die Headline auf dem Foto lesbar ist */
.wn-bleed--solution::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.45) 22%, rgba(0,0,0,0) 50%);
}
.wn-solution {
  position: relative; z-index: 1;
  margin-top: calc(-163 * var(--u));
  padding-inline: var(--edge);
  color: var(--lavender);
  will-change: transform;
}
.wn-solution .wn-display { margin-top: max(6px, 20 * var(--u)); }
.wn-solution__sub { max-width: 45em; margin: max(6px, 10 * var(--u)) 0 0; font-size: max(15px, 20 * var(--u)); font-weight: 400; line-height: 1.35; }

/* ------------------------------------------------------------------
   Aufbau der Kapitel – drei Seiten, Anmerkungen, gemalte Pfeile in Lavendel
   Positionen in Entwurfs-Pixeln relativ zur Oberkante der ersten Anmerkung
------------------------------------------------------------------- */
.wn-chapters { position: relative; height: calc(720 * var(--u)); margin-top: calc(230 * var(--u)); }
.wn-chapters > * { position: absolute; margin: 0; }
.wn-note { font-size: max(14px, 16 * var(--u)); font-weight: 300; line-height: 1.25; }
.wn-case .wn-page { width: calc(570 * var(--u)); aspect-ratio: 1400 / 1182; top: calc(115 * var(--u)); border-radius: calc(8 * var(--u)); overflow: hidden; background: #f4f2f0; box-shadow: 0 2px 14px rgba(0,0,0,.06); }
/* Kapitel-Loop: alle Fotos liegen übereinander, das aktuelle (.is-on) blendet sanft ein */
.wn-case .wn-page img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s cubic-bezier(.16,1,.3,1); }
.wn-case .wn-page img.is-on { opacity: 1; }
.wn-page--1 { left: calc(60 * var(--u)); }
.wn-page--2 { left: calc(675 * var(--u)); }
.wn-page--3 { left: calc(1290 * var(--u)); }
.wn-note--top   { left: calc(958 * var(--u));  top: 0;                     width: calc(230 * var(--u)); }
.wn-note--left  { left: calc(330 * var(--u));  top: calc(640 * var(--u));  width: calc(220 * var(--u)); }
.wn-note--right { left: calc(1408 * var(--u)); top: calc(630 * var(--u));  width: calc(370 * var(--u)); }
.wn-arrow { color: var(--lavender); z-index: 1; }
.wn-arrow path { stroke-width: 3; }
.wn-arrow--top   { left: calc(878 * var(--u));  top: calc(22 * var(--u));  width: calc(52 * var(--u)); }
.wn-arrow--left  { left: calc(425 * var(--u));  top: calc(552 * var(--u)); width: calc(34 * var(--u)); }
.wn-arrow--right { left: calc(1322 * var(--u)); top: calc(590 * var(--u)); width: calc(54 * var(--u)); }

/* Aufbau der Kapitel wächst auch über 1920 px weiter mit der Bildschirmbreite (wie auf dem MacBook) */
.wn-chapters { --u: calc(100vw / 1920); width: auto; margin-inline: 0; }
/* Kapitel-Loop als harter Schnitt statt Überblendung; etwas kräftigerer Schatten */
.wn-case .wn-chapters .wn-page { box-shadow: 0 4px 24px rgba(0,0,0,.14); }
.wn-case .wn-chapters .wn-page img { transition: none; }
.wn-note--left { width: max-content; }
/* Obere Anmerkung: Unterkante sitzt mit festem Abstand über den Seiten, egal wie viele Zeilen sie hat */
.wn-note--top { top: calc(115 * var(--u) - max(24px, 45 * var(--u))); transform: translateY(-100%); }

/* WGWM-Prozess: mehr Abstand nach oben */
.wn-process--wgwm { margin-top: calc(680 * var(--u)); }

/* ------------------------------------------------------------------
   Bildpaare (10 px Abstand) und rote Collage mit Statement
------------------------------------------------------------------- */
.wn-pair { display: grid; column-gap: max(6px, 10 * var(--u)); }
.wn-pair--a { grid-template-columns: 759fr 1151fr; margin-top: calc(300 * var(--u)); }
.wn-pair--a img { height: calc(742 * var(--u)); }
.wn-pair--b { grid-template-columns: 1157fr 753fr; margin-top: calc(420 * var(--u)); }
.wn-pair--b img { height: calc(859 * var(--u)); }

.wn-bleed--red { aspect-ratio: 1920 / 1078; margin-top: max(6px, 10 * var(--u)); } /* gleicher Abstand wie im Bildpaar darüber */
.wn-statement {
  margin: max(16px, 30 * var(--u)) 0 0; padding-inline: var(--edge);
  max-width: calc(1400 * var(--u) + var(--edge));
  font-size: max(20px, 50 * var(--u)); font-weight: 200; line-height: 1.26; letter-spacing: -0.03em;
}

/* ------------------------------------------------------------------
   Prozess – Pflaumen-Fläche mit Pinselkante, Schritte seitlich scrollbar
------------------------------------------------------------------- */
.wn-process {
  position: relative;
  margin-top: calc(330 * var(--u));
  padding: max(48px, 130 * var(--u)) 0 max(40px, 75 * var(--u));
  background: var(--plum-dark);
  color: var(--lavender);
}
.wn-process::before { /* gemalte Oberkante, läuft über die volle Breite */
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(100% - 64 * var(--u)); /* unterer Rand der Grafik ist leer */
  aspect-ratio: 1920 / 207;
  background: url(assets/pinsel/pinsel-pflaume.svg) center bottom / 100% 100% no-repeat;
}
.wn-process__title { padding-inline: var(--edge); margin-bottom: max(32px, 220 * var(--u)); }

.wn-steps {
  display: flex;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; /* nur seitlich scrollbar */
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding-inline: var(--edge); scroll-padding-inline: var(--edge);
  scrollbar-width: none;
  cursor: grab;
}
.wn-steps::-webkit-scrollbar { display: none; }
.wn-steps::after { content: ""; flex: 0 0 calc(300 * var(--u)); } /* damit auch der letzte Schritt links einrasten kann */
.wn-steps.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; user-select: none; }
.wn-steps:focus-visible { outline: 2px solid var(--lime); outline-offset: -2px; }

/* Breite ergibt sich aus Text + Bild; der Abstand rechts lässt den nächsten Schritt nur anschneiden */
.wn-step {
  flex: 0 0 auto;
  display: grid; grid-template-columns: calc(500 * var(--u)) auto; column-gap: calc(87 * var(--u));
  align-items: end; justify-content: start;
  margin-right: calc(150 * var(--u));
  scroll-snap-align: start;
  opacity: .3;
  transition: opacity .5s ease;
}
.wn-step.is-active { opacity: 1; }
.wn-step__text p:not(.wn-label) { margin: 0; font-size: max(14px, 16 * var(--u)); font-weight: 300; line-height: 1.25; }
.wn-step__title { margin: max(10px, 22 * var(--u)) 0 max(14px, 28 * var(--u)); font-size: max(32px, 65 * var(--u)); font-weight: 300; letter-spacing: -0.03em; line-height: 1; }
.wn-step__media { display: flex; gap: max(6px, 10 * var(--u)); }
.wn-step__media img { width: calc(900 * var(--u)); height: auto; pointer-events: none; }
/* Erste Layouts: zwei Layouts überlappend – orange vorne links unten, pink dahinter rechts oben */
.wn-step__media--stack { position: relative; width: calc(1170 * var(--u)); aspect-ratio: 1167 / 707; }
.wn-case .wn-step__media--stack img { position: absolute; height: auto; border-radius: calc(8 * var(--u)); }
.wn-case .wn-step__media--stack img:first-child { left: 0; bottom: 0; width: 55.9%; z-index: 1; }
.wn-case .wn-step__media--stack img:last-child  { right: 0; top: 0; width: 67.9%; }

/* Steuerung unter den Schritten: Chevrons links und rechts direkt neben den Punkten */
.wn-steps-wrap { position: relative; }
.wn-steps-controls {
  display: flex; justify-content: center; align-items: center; gap: max(14px, 26 * var(--u));
  margin-top: max(44px, 130 * var(--u)); /* etwas tiefer als vorher (86) */
}
.wn-steps-controls .wn-dots { margin-top: 0; }
.wn-steps-nav {
  appearance: none; border: 0; background: none; padding: 6px; margin: -6px; cursor: pointer;
  color: var(--lavender); line-height: 0;
  transition: opacity .25s ease, transform .25s ease;
}
.wn-steps-nav svg { width: max(9px, 13 * var(--u)); height: auto; fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.wn-steps-nav:hover { transform: scale(1.15); }
.wn-steps-nav:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 4px; }
.wn-steps-nav[disabled] { opacity: .25; cursor: default; transform: none; }

/* Angepinnt (wgwm.js, nur Desktop): der Abschnitt wird so hoch wie der seitliche Weg, der Inhalt klebt
   bildschirmfüllend oben und senkrechtes Scrollen schiebt die Schritte seitlich. Passt der Inhalt nicht
   in die Höhe, verkleinert wgwm.js --u im Inneren. */
.wn-process__inner { position: relative; }
.wn-process.is-pinned { padding: 0; }
.wn-process.is-pinned .wn-process__pin {
  position: sticky; top: 0; height: 100vh; height: 100svh; box-sizing: border-box;
  display: flex; flex-direction: column; justify-content: center;
  padding: max(100px, 130 * var(--u)) 0 max(24px, 40 * var(--u)); /* oben Platz für Logo und Navi */
  overflow: hidden;
}
.wn-process.is-pinned .wn-process__title { margin-bottom: max(24px, 80 * var(--u)); }
.wn-process.is-pinned .wn-steps { overflow-x: hidden; scroll-snap-type: none; scroll-behavior: auto; cursor: default; }
.wn-process.is-pinned .wn-steps-controls { margin-top: max(32px, 90 * var(--u)); } /* vorher 50 */

.wn-dots { display: flex; justify-content: center; gap: max(10px, 14 * var(--u)); margin-top: max(28px, 86 * var(--u)); }
.wn-dots button {
  appearance: none; border: 0; padding: 0; cursor: pointer;
  width: max(10px, 18 * var(--u)); aspect-ratio: 1; border-radius: 50%;
  background: var(--lavender); opacity: .45;
  transition: opacity .25s ease, transform .25s ease;
}
.wn-dots button[aria-selected="true"] { opacity: 1; }
.wn-dots button:hover { transform: scale(1.15); }

/* Weitere Projekte: Headline in Milker/Pflaume, gemalte Pfeile; Kacheln + Footer wie bisher */
.wn-case .more { margin-top: clamp(80px, 9vw, 180px); color: var(--ink); }
.wn-case .more__title { color: var(--plum); font-size: max(28px, 76 * var(--u)); line-height: 1.05; margin-bottom: max(20px, 40 * var(--u)); }
.wn .more__controls svg.wn-scribble-arrow { width: clamp(56px, 4.4vw, 84px); color: var(--plum); }
.wn .more__controls .wn-scribble-arrow path { stroke-width: 3.5; }
.wn .more__controls .wn-scribble-arrow path.thin { stroke-width: 2; }
.wn .more__controls [data-dir="1"] .wn-scribble-arrow { transform: scaleX(-1); }

/* ------------------------------------------------------------------
   Mobil – im Style Guide nicht definiert, aus dem Desktop-Entwurf abgeleitet
------------------------------------------------------------------- */
@media (max-width: 800px) {
  .wn { --edge: var(--gutter); }

  .wn-hero { aspect-ratio: auto; height: min(100svh, 720px); min-height: 480px; }
  .wn-hero__text { left: var(--gutter); }
  .wn-hero__eyebrow { margin-left: 2px; }
  .wn-hero__facts span { margin-inline: 0.5em; }

  .wn-display br { display: none; }

  .wn-bleed--solution { aspect-ratio: 4 / 3; }
  .wn-solution { margin-top: -52px; }

  .wn-chapters { width: auto; height: auto; margin-top: 72px; display: flex; flex-direction: column; gap: 12px; padding-inline: var(--gutter); }
  .wn-chapters > * { position: static; width: 100% !important; }
  .wn-chapters > .wn-page { position: relative; }
  .wn-note--top { transform: none; }
  .wn-arrow { display: none; }
  .wn-page { border-radius: 6px; }
  .wn-page--1 { order: 1; } .wn-note--left  { order: 2; margin-bottom: 20px; }
  .wn-page--2 { order: 3; } .wn-note--top   { order: 4; margin-bottom: 20px; }
  .wn-page--3 { order: 5; } .wn-note--right { order: 6; }

  .wn-pair { grid-template-columns: 1fr !important; row-gap: 6px; }
  .wn-pair img { height: auto !important; }
  .wn-pair--a { margin-top: 72px; }
  .wn-pair--b { margin-top: 72px; }
  .wn-bleed--red { aspect-ratio: 4 / 3; margin-top: 6px; }

  .wn-process { margin-top: calc(72px + 100vw * 140 / 1920); }
  .wn-process--wgwm { margin-top: calc(150px + 100vw * 140 / 1920); }
  .wn-step { flex-basis: 86vw; grid-template-columns: 1fr; row-gap: 20px; margin-right: 0; padding-right: 16px; }
  .wn-step__media { order: -1; }
  .wn-step__media img { width: 100%; min-width: 0; }
  .wn-step__media--stack { width: 100%; }
  .wn-steps::after { flex-basis: 8vw; }
}
