/* Studio Daniel Haffmans – Variante 2 „Index“ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --black: #000;
  --white: #fff;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --pad: clamp(16px, 2.6vw, 40px);
  --micro: 11px;
  --s: 15px;
  --m: clamp(17px, 1.15vw, 19px);
  --l: clamp(26px, 3.2vw, 52px);
  --xl: clamp(34px, 5vw, 84px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --col: clamp(44px, 9vw, 140px);
}

@view-transition { navigation: auto; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; interpolate-size: allow-keywords; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0; overflow-x: clip; background: var(--white); color: var(--black);
  font-family: var(--font); font-size: var(--m); line-height: 1.4;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
h1, h2, h3 { margin: 0; font-weight: 700; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--pad); top: 8px; background: var(--white); padding: 4px 8px; z-index: 30; }

/* Micrographics */
.micro {
  font-size: var(--micro); line-height: 1.3; letter-spacing: .04em;
  text-transform: uppercase; font-variant-numeric: tabular-nums;
}

/* ---------- Header ---------- */
.head {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 14px var(--pad);
  background: var(--white); color: var(--black);
}
.wordmark {
  view-transition-name: wordmark;
  font-size: 15px; font-weight: 700; letter-spacing: .01em; text-transform: uppercase; white-space: nowrap;
}
.meta { display: flex; gap: 2.2em; justify-content: center; }
.nav { display: flex; gap: 22px; justify-content: flex-end; }
.nav a { position: relative; }
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease);
}
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav .off { opacity: .4; }

/* Wordmark appears only once the big name has left the screen */
.js .head .wordmark { opacity: 0; transition: opacity .3s ease; }
.js.scrolled .head .wordmark { opacity: 1; }
@supports (animation-timeline: scroll()) {
  .js .head .wordmark { transition: none; animation: wm linear both; animation-timeline: scroll(root); animation-range: 30vh 60vh; }
  @keyframes wm { from { opacity: 0; } to { opacity: 1; } }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 var(--pad) var(--pad);
}
.hero .row { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 1.2vw; }
.name {
  view-transition-name: name;
  display: block; font-weight: 700; line-height: .78; letter-spacing: -.045em;
  text-transform: uppercase; white-space: nowrap; font-size: 13.6vw;
  margin-left: -.04em;
}
.name span { display: block; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .name { animation: shrink linear both; animation-timeline: scroll(root); animation-range: 0 90vh; transform-origin: 0 100%; }
    @keyframes shrink { to { transform: scale(.92); opacity: 0; filter: blur(2px); } }
  }
}

/* ---------- Statement ---------- */
.statement { padding: clamp(96px, 14vw, 220px) var(--pad) clamp(72px, 10vw, 160px); }
.statement h2 { font-size: var(--xl); line-height: 1; letter-spacing: -.03em; text-wrap: balance; max-width: 14ch; }
.statement p { font-size: var(--l); line-height: 1.12; letter-spacing: -.015em; max-width: 24ch; margin-top: .9em; text-wrap: balance; }

/* ---------- Index ---------- */
.block { padding: 0 var(--pad); margin-bottom: clamp(96px, 12vw, 200px); scroll-margin-top: 56px; }
.block-head { display: flex; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--black); }

.item { border-bottom: 1px solid var(--black); }
.item summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: var(--col) 1fr auto; align-items: baseline;
  padding: .32em 0 .28em; font-size: var(--l); font-weight: 700; letter-spacing: -.02em; line-height: 1.05;
}
.item summary::-webkit-details-marker { display: none; }
.item .no { font-size: var(--micro); font-weight: 400; letter-spacing: .04em; align-self: center; }
.item .pm { width: .5em; height: .5em; position: relative; align-self: center; }
.item .pm::before, .item .pm::after {
  content: ""; position: absolute; left: 0; top: 50%; width: 100%; height: 2px; margin-top: -1px; background: currentColor;
  transition: transform .4s var(--ease);
}
.item .pm::after { transform: rotate(90deg); }
.item[open] .pm::after { transform: rotate(0); }
.item summary:hover .label { transform: translateX(.18em); }
.item .label { transition: transform .4s var(--ease); }

.item::details-content { block-size: 0; overflow: hidden; transition: block-size .5s var(--ease), content-visibility .5s allow-discrete; }
.item[open]::details-content { block-size: auto; }
.item .text { display: grid; grid-template-columns: var(--col) minmax(0, 46ch); padding: .4em 0 1.6em; }
.item .text p { grid-column: 2; }

/* Timeline */
.line {
  display: grid; grid-template-columns: var(--col) minmax(9em, 16ch) 1fr; align-items: baseline;
  border-bottom: 1px solid var(--black); padding: .7em 0;
}
.line .y { font-variant-numeric: tabular-nums; }
.line .w { font-weight: 700; }
.vita-text { display: grid; grid-template-columns: var(--col) minmax(0, 52ch); padding: 1.4em 0 0; }
.vita-text > * { grid-column: 2; }
.more { display: inline-block; margin-top: 1.2em; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.more:hover { border-color: transparent; }

/* ---------- Contact (inverted) ---------- */
.contact { background: var(--black); color: var(--white); padding: clamp(24px, 3vw, 40px) var(--pad) var(--pad); min-height: 90svh; display: flex; flex-direction: column; }
.contact .block-head { border-color: var(--white); }
.contact .big { font-size: var(--xl); font-weight: 700; letter-spacing: -.03em; line-height: 1.02; margin-top: auto; padding-top: 18vh; }
.contact .big a { display: inline-block; border-bottom: 2px solid currentColor; }
.contact .big a:hover { border-color: transparent; }
.contact .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: clamp(48px, 7vw, 112px); padding-top: 12px; border-top: 1px solid var(--white); }
.contact .cols a:hover { opacity: .6; }

/* ---------- Reveal (CSS scroll-driven, JS fallback) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal { animation: up cubic-bezier(.2, .7, .1, 1) both; animation-timeline: view(); animation-range: entry 10% cover 30%; }
    @keyframes up { from { opacity: 0; transform: translateY(48px); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }
  }
  @supports not (animation-timeline: view()) {
    .js .reveal { opacity: 0; transform: translateY(48px); filter: blur(8px); transition: opacity 1.4s var(--ease), transform 1.4s var(--ease), filter 1.4s var(--ease); }
    .js .reveal.in { filter: none; }
    .js .reveal.in { opacity: 1; transform: none; }
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .head { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .wordmark { font-size: 12px; line-height: 1.1; white-space: normal; max-width: 9.5em; }
  .meta { display: none; }
  .hero .row .hide-s { display: none; }
  .item .text, .vita-text { grid-template-columns: var(--col) minmax(0, 1fr); }
  .line { grid-template-columns: var(--col) 1fr; }
  .line .y { grid-column: 2; font-size: var(--micro); letter-spacing: .04em; }
  .line .w { grid-column: 2; }
  .line .no { grid-row: 1 / span 3; }
  .line .d { grid-column: 2; }
  .contact .cols { grid-template-columns: 1fr; }
  .hero { min-height: 78svh; }
  .contact .big { font-size: 8.4vw; }
  .contact .big a { overflow-wrap: anywhere; }
}
@media (max-width: 520px) {
  .nav { gap: 14px; }
  .nav .hide-xs { display: none; }
}

/* ---------- v11 additions ---------- */
.block .intro { font-size: var(--l); line-height: 1.12; letter-spacing: -.015em; max-width: 26ch; margin: 1.2em 0 1.4em; text-wrap: balance; }
.item .text .micro { margin-bottom: .8em; }
.item .text .more { grid-column: 2; justify-self: start; }

/* Subpages */
.page { padding-top: 120px; }
.page-title { padding: 0 var(--pad); margin-bottom: clamp(64px, 9vw, 140px); }
.page-title h1 { font-size: clamp(56px, 11vw, 200px); line-height: .85; letter-spacing: -.045em; text-transform: uppercase; margin-top: .25em; }
.prose { display: grid; grid-template-columns: var(--col) minmax(0, 60ch); }
.prose > * { grid-column: 2; }
.prose p { font-size: clamp(18px, 1.5vw, 22px); line-height: 1.45; }
.prose.legal p { font-size: var(--m); }
.prose h2 { font-size: var(--m); margin: 2em 0 .5em; }
.draft { border: 1px solid var(--black); padding: 8px 12px; justify-self: start; }
.page .contact { margin-top: clamp(64px, 8vw, 120px); }
.nav a[aria-current]::after { transform: scaleX(1); }
@media (max-width: 820px) { .prose { grid-template-columns: var(--col) minmax(0, 1fr); } }
@media (max-width: 520px) { .prose { grid-template-columns: 0 minmax(0, 1fr); } }

/* ---------- Name aus Punkten (index-punkte.html) ---------- */
.name { position: relative; }
.name.has-dots span { color: transparent; }
.name .dots { position: absolute; left: 0; top: 0; pointer-events: none; }
.hero:has(.has-dots) { cursor: crosshair; user-select: none; -webkit-user-select: none; }

/* ---------- v14: Vita als Text auf der Startseite ---------- */
.vita-prose { margin-top: 1.6em; }
.vita-prose p { font-size: var(--l); line-height: 1.16; letter-spacing: -.015em; max-width: 40ch; text-wrap: pretty; }
@media (max-width: 820px) { .vita-prose p { font-size: clamp(20px, 5.4vw, 26px); } }

/* ---------- Fließtext über die volle Seitenbreite ---------- */
.statement p, .block .intro, .vita-prose p { max-width: none; text-wrap: pretty; }
.vita-prose { display: block; }
.item .text { grid-template-columns: var(--col) minmax(0, 1fr); }
.item .text p { max-width: none; }

/* ---------- v17: ohne Nummern, Sprachumschalter ---------- */
.item summary { grid-template-columns: 1fr auto; }
.item .text { display: block; padding-left: 0; }
.item .text p { max-width: none; }
.item .text p + p { margin-top: .6em; }
.lang { display: inline-flex; gap: 8px; }
.lang a { opacity: .4; }
.lang a[aria-current] { opacity: 1; }
.lang a:hover { opacity: 1; }
.nav .lang a::after { display: none; }

/* ---------- ohne Ortsangabe/Uhr im Kopf ---------- */
.head { grid-template-columns: minmax(0, 1fr) auto; }

/* ---------- Kontaktbereich in Grau #C8C9C7 ---------- */
:root { --grey: #C8C9C7; }
.contact { background: var(--grey); color: var(--black); }
.contact .block-head { border-color: var(--black); }
.contact .cols { border-top-color: var(--black); }

/* ---------- großer Name in Grau ---------- */
:root { --name-grey: #A7A8A6; }
.name { color: var(--name-grey); }

/* ---------- v25: Einstieg mit Headline statt Name ---------- */
.hero { min-height: calc(100svh - 56px); padding-top: 72px; }
.headline {
  font-weight: 700; color: var(--name-grey);
  line-height: .84; letter-spacing: -.04em; margin: 0 0 0 -.03em;
  text-wrap: balance; position: relative; font-size: 12vw;
}
.headline span { white-space: nowrap; }
.headline.has-dots span { color: transparent; }
.headline .dots { position: absolute; left: 0; top: 0; pointer-events: none; }
.hero:has(.has-dots) { cursor: crosshair; user-select: none; -webkit-user-select: none; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .headline { animation: shrink linear both; animation-timeline: scroll(root); animation-range: 0 90vh; transform-origin: 0 100%; }
  }
}
.js .head .wordmark, .js.scrolled .head .wordmark { opacity: 1; animation: none; }
.statement { padding-top: clamp(64px, 8vw, 120px); }

/* Leistungen: offen untereinander, Linie nur zwischen den Feldern */
.field { padding: 1.2em 0 1.3em; border-bottom: 1px solid var(--black); }
.field:last-of-type { border-bottom: 0; }
.field h3 { font-size: var(--l); letter-spacing: -.02em; line-height: 1.05; margin-bottom: .35em; }
.field .text p { margin: 0; max-width: none; text-wrap: pretty; }
.field .text p + p { margin-top: .5em; }
.field .text p { font-size: clamp(18px, 1.4vw, 22px); line-height: 1.4; }

/* ---------- v27: Headline schwarz in Statement-Größe ---------- */
.hero { min-height: 0; display: block; padding: clamp(140px, 24vh, 280px) var(--pad) 0; }
.headline {
  color: var(--black); font-size: var(--xl); line-height: 1; letter-spacing: -.03em;
  max-width: 14ch; margin: 0; animation: none !important;
}
.hero .lead { font-size: var(--l); line-height: 1.12; letter-spacing: -.015em; margin-top: .9em; max-width: none; text-wrap: pretty; }
.hero + .block { margin-top: clamp(96px, 12vw, 200px); }

/* ---------- Kontakt: weiße Schrift auf Grau, E-Mail ohne Unterstrich ---------- */
.contact { color: var(--white); }
.contact .block-head { border-color: var(--white); }
.contact .cols { border-top-color: var(--white); }
.contact .big a { border-bottom: 0; }
.contact .big a:hover { opacity: .7; }

/* ---------- Kontaktfläche einen Ticken dunkler ---------- */
:root { --grey: #B8B9B7; }

/* ---------- Headline und Kontaktzeile exakt gleich groß ---------- */
:root { --big: var(--xl); }
@media (max-width: 820px) { :root { --big: 8.4vw; } }
.headline, .contact .big { font-size: var(--big) !important; line-height: 1.02; letter-spacing: -.03em; }

/* ---------- Headline mit festem Umbruch ---------- */
.headline { max-width: none; text-wrap: wrap; }

/* ---------- Wortmarke immer einzeilig ---------- */
.wordmark { white-space: nowrap !important; max-width: none !important; }
@media (max-width: 560px) {
  .head { grid-template-columns: 1fr; row-gap: 8px; }
  .wordmark { font-size: 14px !important; }
  .nav { justify-content: flex-start; }
}

/* ---------- Header weiter vom oberen Rand ---------- */
.head { padding-top: clamp(22px, 2.6vw, 40px); padding-bottom: clamp(14px, 1.6vw, 22px); }

/* ---------- feinere Trennlinien zwischen den Leistungen ---------- */
.field { border-bottom: .5px solid rgba(0, 0, 0, .28); }
.field:last-of-type { border-bottom: 0; }

/* ---------- Mobil: Burger-Menü ---------- */
.mnav { display: none; }
@media (max-width: 760px) {
  .head { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0; align-items: center; }
  .head .nav { display: none; }
  .burger { display: block; position: relative; width: 26px; height: 14px; cursor: pointer; z-index: 31; }
  .burger s { position: absolute; left: 0; width: 100%; height: 2px; background: var(--black); transition: transform .35s var(--ease), top .35s var(--ease); }
  .burger s:nth-child(1) { top: 0; }
  .burger s:nth-child(2) { top: 12px; }
  .menu-open .burger s:nth-child(1) { top: 6px; transform: rotate(45deg); }
  .menu-open .burger s:nth-child(2) { top: 6px; transform: rotate(-45deg); }

  .mnav {
    display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 19;
    background: var(--white); padding: 110px var(--pad) calc(var(--pad) + env(safe-area-inset-bottom));
    opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s;
  }
  .menu-open .mnav { opacity: 1; visibility: visible; }
  .menu-open { overflow: hidden; }
  .mnav-main { display: flex; flex-direction: column; gap: .25em; font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
  .mnav-legal { display: flex; flex-direction: column; gap: .5em; margin-top: 2.2em; font-size: 15px; }
  .mnav-lang { margin-top: auto; padding-top: 24px; border-top: .5px solid rgba(0,0,0,.28); font-size: 15px; }
  .mnav-lang .lang { gap: 16px; }
}
@media (min-width: 761px) { .burger { display: none; } }

/* ---------- Burger mit drei Strichen ---------- */
@media (max-width: 760px) {
  .burger { height: 16px; }
  .burger s:nth-child(1) { top: 0; }
  .burger s:nth-child(2) { top: 7px; transition: opacity .2s ease; }
  .burger s:nth-child(3) { top: 14px; }
  .menu-open .burger s:nth-child(1) { top: 7px; transform: rotate(45deg); }
  .menu-open .burger s:nth-child(2) { opacity: 0; transform: none; top: 7px; }
  .menu-open .burger s:nth-child(3) { top: 7px; transform: rotate(-45deg); }
}

/* ---------- Kontakt kompakter ---------- */
.contact { min-height: 0; }
.contact .big { margin-top: clamp(28px, 3.5vw, 56px); padding-top: 0; }

/* ---------- Headline etwas größer als die Kontaktzeile ---------- */
.headline { font-size: calc(var(--big) * 1.3) !important; }
@media (min-width: 821px) { .headline { font-size: calc(var(--big) * 1.5) !important; } }
@media (max-width: 560px) { .headline { font-size: calc(var(--big) * 1.2) !important; } }

/* ---------- mehr Abstand unten (iPhone-Rundungen) ---------- */
.contact { padding-bottom: calc(clamp(40px, 5vw, 72px) + env(safe-area-inset-bottom)); }

/* ---------- iOS: Überscrollen unten grau statt weiß ---------- */
html { background: var(--grey); overscroll-behavior-y: none; }
body { background: var(--white); min-height: 100svh; }

/* ---------- Startbildschirm: Headline allein im ersten Screen ---------- */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding-top: 96px; padding-bottom: 14vh;
}
.hero + .block { margin-top: 0; }

/* ---------- Kein Einblenden mehr: Elemente stehen sofort, Bewegung kommt aus dem Nachziehen ---------- */
.reveal, .js .reveal, .js .reveal.in {
  animation: none !important; opacity: 1 !important; filter: none !important;
  transform: translate3d(0, var(--lag, 0px), 0) !important; transition: none !important;
  will-change: transform;
}

/* ---------- Hauptabschnitte je ein Bildschirm, klar voneinander getrennt ---------- */
main > .block {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  margin: 0; padding-top: clamp(96px, 12vh, 160px); padding-bottom: clamp(96px, 12vh, 160px);
}

/* Über mich passt auf dem Desktop in einen Bildschirm */
.vita-prose p { font-size: clamp(20px, 2.5vw, 42px); line-height: 1.18; }
main > .block { padding-top: clamp(80px, 10vh, 140px); padding-bottom: clamp(64px, 9vh, 130px); }

/* ---------- Leistungen auf hellem Grau (Pantone Cool Gray 3 C, #C8C9C7) ---------- */
#leistungen, #services { background: #C8C9C7; }

/* ---------- Statt Nachziehen: Blöcke schließen nacheinander auf ---------- */
.js.stagger .reveal, .js.stagger .reveal.in {
  opacity: 0 !important; transform: translate3d(0, 56px, 0) !important; filter: none !important;
  transition: opacity .8s ease var(--d, 0s), transform 1.1s cubic-bezier(.2, .7, .1, 1) var(--d, 0s) !important;
  will-change: transform, opacity;
}
.js.stagger .reveal.in.in { opacity: 1 !important; transform: none !important; }

/* Leistungen wieder auf Weiß */
#leistungen, #services { background: transparent; }
.js.stagger .reveal.instant { transition: none !important; }

/* ---------- Mobil: Abschnitte wieder enger ---------- */
@media (max-width: 760px) {
  main > .block { min-height: 0; padding-top: 72px; padding-bottom: 56px; }
  .contact { margin-top: 24px; }
}

/* ---------- Abschnitte deutlich enger (etwa halbiert) ---------- */
main > .block { min-height: 0; padding-top: clamp(56px, 7vh, 96px); padding-bottom: clamp(40px, 5vh, 72px); }
@media (max-width: 760px) { main > .block { padding-top: 40px; padding-bottom: 28px; } }
