/* ==========================================================================
   Planbau Ribic
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #f3f1ec;
  --paper-2: #ebe8e1;
  --ink: #151515;
  --ink-2: #3a3a38;
  --muted: #6f6d68;
  --rule: #d8d4cb;
  --accent: #2b7476;
  --dark: #121212;
  --dark-2: #1c1c1b;
  --dark-rule: #2e2e2c;

  --f-head: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1320px;
  --gutter: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
main section[id] { scroll-margin-top: 60px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--f-head); font-weight: 600; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 100; }
.skip:focus { left: 16px; top: 16px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* --- Buttons & Links ---------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px;
  background: var(--ink); color: var(--paper);
  font-family: var(--f-head); font-weight: 500; font-size: 15px; letter-spacing: .01em;
  text-decoration: none; border-radius: 0;
  position: relative; overflow: hidden; isolation: isolate;
  transition: color .4s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); z-index: -1;
}
.btn:hover::before { transform: scaleX(1); transform-origin: left; }
.btn-small { padding: 10px 18px; font-size: 14px; }
.btn-light { background: var(--paper); color: var(--ink); margin-top: 18px; }
.btn-light:hover { color: var(--paper); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-head); font-weight: 500; font-size: 15px;
  text-decoration: none; padding: 6px 0;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size .5s var(--ease);
}
.link-arrow::after { content: "→"; transition: transform .4s var(--ease); }
.link-arrow:hover { background-size: 0 1px; background-position: 100% 100%; }
.link-arrow:hover::after { transform: translateX(4px); }

/* --- Header ------------------------------------------------------------- */

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .4s, border-color .4s, transform .5s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled { background: rgba(243, 241, 236, .97); border-color: var(--rule); }
.site-header.is-hidden { transform: translateY(-100%); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: auto; height: 50px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; font-family: var(--f-head); }
.brand-text strong { font-size: 21px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #347f81; }
.brand-text small { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

.nav { display: flex; align-items: center; gap: 40px; }
.nav ul { display: flex; gap: 30px; list-style: none; margin: 0; padding: 0; }
.nav ul a { font-size: 15px; text-decoration: none; position: relative; padding: 4px 0; }
.nav ul a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease); }
.nav ul a:hover::after, .nav ul a.is-current::after { transform: scaleX(1); transform-origin: left; }

.menu-toggle { display: none; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; position: relative; }
.menu-toggle span { position: absolute; left: 10px; right: 10px; height: 1.5px; background: var(--ink); transition: transform .4s var(--ease), top .4s var(--ease); }
.menu-toggle span:first-child { top: 17px; }
.menu-toggle span:last-child { top: 26px; }
.menu-toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

.mobile-nav { background: var(--paper); border-top: 1px solid var(--rule); height: calc(100vh - 76px); height: calc(100dvh - 76px); }
.mobile-nav ul { list-style: none; margin: 0; padding: 24px var(--gutter); }
.mobile-nav li { border-bottom: 1px solid var(--rule); }
.mobile-nav a { display: block; padding: 18px 0; font-family: var(--f-head); font-size: 28px; text-decoration: none; letter-spacing: -.01em; }

@media (max-width: 960px) {
  .nav { display: none; }
  .menu-toggle { display: block; }
  .site-header.menu-open { background: var(--paper); }
}

/* --- Typo-Helfer -------------------------------------------------------- */

.eyebrow, .section-num, .label {
  font-family: var(--f-head); font-size: 13px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.h2 { font-size: clamp(36px, 5.2vw, 72px); line-height: 1.02; letter-spacing: -0.035em; }
.lead { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.55; color: var(--ink-2); max-width: 36em; }
.muted { color: var(--muted); margin-top: 20px; max-width: 36em; }

.section { padding: clamp(96px, 13vw, 180px) 0; }
.section-head { margin-bottom: clamp(48px, 7vw, 96px); }
.section-head .section-num { margin-bottom: 24px; }
.section-head.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; }
@media (max-width: 860px) { .section-head.two-col { grid-template-columns: 1fr; } }

/* --- Reveal ------------------------------------------------------------- */

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }

.no-js .reveal { opacity: 1; transform: none; }

.reveal.split { opacity: 1; transform: none; }
.split .line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.split .line > span { display: block; transform: translateY(108%); transition: transform 1.3s cubic-bezier(.45, .05, .2, 1); transition-delay: calc(var(--d, 0s) + .1s); }
.split .line:nth-child(2) > span { transition-delay: calc(var(--d, 0s) + .22s); }
.split .line:nth-child(3) > span { transition-delay: calc(var(--d, 0s) + .34s); }
.split.is-in .line > span { transform: none; }

/* Abschnittsnummer mit Linie */
.section-num { display: flex; align-items: center; gap: 14px; }
.section-num::before { content: ""; width: 42px; height: 1px; background: currentColor; transform-origin: left; transform: scaleX(0); transition: transform 1s var(--ease) .2s; }
.section-num.is-in::before, .build .section-num::before { transform: scaleX(1); }

/* --- Hero --------------------------------------------------------------- */
/* Proportionen nach dem Goldenen Schnitt: Text 38,2 %, Plan 61,8 %,
   Schriftgrade 68 / 26 / 13 px (je ÷ φ²), Abstände 26 / 42 / 68 px */

/* Beim Scrollen führt die Sonne über den Tag, die Seite scrollt dabei normal weiter */
.hero { position: relative; overflow-x: clip; }
.hero-pin { position: relative; min-height: 100vh; min-height: 100svh; padding-top: 120px; padding-bottom: 26px; overflow: hidden; }
@media (max-width: 960px), (max-height: 640px) {
  .hero { height: auto; }
  .hero-pin { position: relative; min-height: 0; }
}

/* --- Informationsstrahl ------------------------------------------------- */

.rail {
  --rail-fg: var(--ink); --rail-bg: var(--paper); --rail-line: rgba(21, 21, 21, .16);
  position: fixed; left: 26px; top: 50%; height: 52vh; transform: translateY(-50%); z-index: 40;
  color: var(--rail-fg); opacity: 0; pointer-events: none; transition: opacity .6s ease;
}
.rail.is-on { opacity: 1; pointer-events: auto; }
.rail.on-dark { --rail-fg: var(--paper); --rail-bg: var(--dark-2); --rail-line: rgba(243, 241, 236, .18); }
.rail-track { position: absolute; left: 4px; top: 0; bottom: 0; width: 1px; background: var(--rail-line); }
.rail-fill { position: absolute; inset: 0; background: var(--accent); transform-origin: top; transform: scaleY(var(--fill, 0)); transition: transform .25s linear; }
.rail ol { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.rail li { position: absolute; left: 0; transform: translateY(-50%); }
.rail a { display: flex; align-items: center; gap: 16px; text-decoration: none; padding: 7px 0; color: inherit; }
.rail-dot { flex: none; width: 9px; height: 9px; border: 1px solid var(--rail-line); border-radius: 50%; background: var(--rail-bg); transition: background .35s, border-color .35s, transform .45s var(--ease), box-shadow .45s var(--ease); }
.rail li.is-past .rail-dot { background: var(--accent); border-color: var(--accent); }
.rail li.is-current .rail-dot { background: var(--accent); border-color: var(--accent); transform: scale(1.25); box-shadow: 0 0 0 5px rgba(43, 116, 118, .16); }

/* Beschriftung: senkrecht neben der Linie wie ein Planrücken – überdeckt keinen Inhalt */
.rail a { position: relative; }
.rail-t {
  position: absolute; left: 24px; top: 50%; transform: translate(-6px, -50%) rotate(180deg);
  writing-mode: vertical-rl; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  font-family: var(--f-head); font-size: 15px; font-weight: 500; letter-spacing: .02em;
  opacity: 0; pointer-events: none; transition: opacity .4s ease, transform .5s var(--ease);
}
.rail-t b { font-size: 11px; font-weight: 500; letter-spacing: .16em; color: var(--accent); }
.rail li.is-current .rail-t { opacity: 1; transform: translate(0, -50%) rotate(180deg); }
.rail a:hover .rail-t, .rail a:focus-visible .rail-t { opacity: .75; transform: translate(0, -50%) rotate(180deg); }
.rail li:not(.is-current) .rail-t { font-size: 13px; }
.rail-pct { position: absolute; left: -4px; top: calc(100% + 16px); white-space: nowrap; font-family: var(--f-head); font-size: 11px; letter-spacing: .08em; font-variant-numeric: tabular-nums; opacity: .7; }
@media (max-width: 1240px) { .rail { display: none; } }

/* Handy & Tablet: kompaktes Schild unten mit Fortschritt, öffnet das Menü */
.rail-m {
  position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 45;
  display: none; align-items: center; gap: 10px; max-width: calc(100% - 32px);
  padding: 10px 14px 12px 12px; border: 1px solid var(--rule); background: rgba(243, 241, 236, .97);
  box-shadow: 0 14px 34px -18px rgba(0, 0, 0, .45); cursor: pointer; text-align: left;
  font-family: var(--f-head); color: var(--ink);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .4s ease, transform .5s var(--ease), background .35s, color .35s, border-color .35s;
}
.rail-m.is-on { opacity: 1; transform: none; pointer-events: auto; }
.rail-m.on-dark { background: rgba(28, 28, 27, .97); color: var(--paper); border-color: var(--dark-rule); }
.rail-m-n { font-size: 11px; letter-spacing: .14em; color: var(--accent); font-weight: 500; }
.rail-m-t { font-size: 15px; font-weight: 500; letter-spacing: -.005em; white-space: nowrap; }
.rail-m-bar { position: absolute; left: 12px; right: 14px; bottom: 6px; height: 2px; background: var(--rule); }
.rail-m.on-dark .rail-m-bar { background: var(--dark-rule); }
.rail-m-bar i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(var(--fill, 0)); }
.rail-m svg { width: 14px; height: 14px; margin-left: 4px; fill: none; stroke: currentColor; stroke-width: 1.4; opacity: .6; }
@media (max-width: 1240px) { .rail-m { display: inline-flex; } }
.menu-open ~ .rail-m, body.lb-lock .rail-m { opacity: 0; pointer-events: none; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 68px 68px;
  opacity: .3;
  -webkit-mask-image: radial-gradient(ellipse at 61.8% 45%, #000 15%, transparent 68%);
          mask-image: radial-gradient(ellipse at 61.8% 45%, #000 15%, transparent 68%);
}
.hero-grid { position: relative; min-height: max(560px, calc(100vh - 250px)); min-height: max(560px, calc(100svh - 250px)); display: flex; align-items: center; }
.hero-copy { position: relative; z-index: 2; width: 38.2%; min-width: 440px; }
.hero-copy .eyebrow { margin-bottom: 26px; }
.hero-title { font-size: clamp(42px, 4.4vw, 68px); line-height: 1; letter-spacing: -0.045em; font-weight: 600; }
.hero-title em { font-style: normal; color: var(--accent); }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .line > span { display: block; transform: translateY(105%); transition: transform 1.618s cubic-bezier(.45, .05, .2, 1); }
.hero-title .line:nth-child(2) > span { transition-delay: .162s; }
.is-loaded .hero-title .line > span { transform: none; }
.no-js .hero-title .line > span { transform: none; }
.hero-lead { margin-top: 26px; font-size: clamp(18px, 1.46vw, 21px); color: var(--ink-2); max-width: 26em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 26px; margin-top: 42px; }

.hero-3d {
  position: absolute; top: 0; bottom: 118px; left: 24%; right: 0; z-index: 1;
  opacity: 0; transition: opacity 1.6s ease;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22%);
          mask-image: linear-gradient(90deg, transparent 0, #000 22%);
}
.hero-3d.is-ready { opacity: 1; }
.hero-3d canvas { display: block; width: 100% !important; height: 100% !important; }

.hero-meta {
  position: relative; z-index: 2; display: grid; grid-template-columns: 1fr auto auto; align-items: end; gap: 42px;
  margin-top: 8px; font-family: var(--f-head); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  pointer-events: none;
}
.hm-hint { opacity: .85; }
.sun { display: flex; align-items: flex-end; gap: 14px; }
.sun svg { width: 74px; height: 39px; overflow: visible; }
.sun-arc { fill: none; stroke: var(--rule); stroke-width: 1.4; stroke-dasharray: 2 4; }
.sun-base { fill: none; stroke: var(--muted); stroke-width: 1; }
.sun-dot { fill: var(--accent); }
.sun > div { display: flex; flex-direction: column; gap: 2px; }
.hm-k { font-size: 10.5px; }
.sun-time { font-size: 24px; letter-spacing: -.02em; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; text-transform: none; }
@media (pointer: coarse) { .hm-hint { display: none; } }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); margin-top: 26px; position: relative; z-index: 2; background: var(--paper); }
.fact { padding: 22px 24px 8px 0; display: flex; flex-direction: column; gap: 4px; }
.fact + .fact { padding-left: 24px; border-left: 1px solid var(--rule); }
.fact-k { font-family: var(--f-head); font-weight: 600; font-size: 19px; letter-spacing: -.01em; }
.fact-v { color: var(--muted); font-size: 14.5px; }

@media (max-width: 1100px) {
  .hero-copy { width: 50%; min-width: 0; }
  .hero-3d { left: 14%; }
}
@media (max-width: 960px) {
  .hero-pin { padding-top: 104px; }
  .hero-grid { display: block; min-height: 0; }
  .hero-copy { width: auto; }
  .hero-3d { position: relative; left: auto; right: auto; top: auto; bottom: auto; height: 78vw; max-height: 520px; margin: 8px calc(var(--gutter) * -1) 0; -webkit-mask-image: none; mask-image: none; }
  .hero-meta { grid-template-columns: 1fr auto; gap: 16px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .fact:nth-child(3) { padding-left: 0; border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 520px) {
  .hm-loc { font-size: 10px; }
  .facts { grid-template-columns: 1fr; }
  .fact, .fact + .fact { padding-left: 0; border-left: 0; }
  .fact + .fact { border-top: 1px solid var(--rule); }
}

/* --- Intro -------------------------------------------------------------- */

.intro-grid { display: grid; grid-template-columns: 1fr 3fr; gap: 48px; }
.statement { font-family: var(--f-head); font-size: clamp(26px, 3.3vw, 46px); line-height: 1.18; letter-spacing: -0.025em; font-weight: 500; }
.statement .w { opacity: .14; transition: opacity .5s ease; }
.statement .w.on { opacity: 1; }
@media (max-width: 860px) { .intro-grid { grid-template-columns: 1fr; gap: 24px; } }

/* --- Leistungen --------------------------------------------------------- */

.services { padding-top: 0; }
.service-list { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.service { padding: 32px 28px 40px 0; position: relative; }
.service + .service { padding-left: 28px; border-left: 1px solid var(--rule); }
.service-idx { font-family: var(--f-head); font-size: 13px; color: var(--muted); letter-spacing: .1em; }
.service-icon { width: 52px; height: 52px; margin: 40px 0 36px; fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: square; }
.service-icon path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.service:hover .service-icon path { animation: redraw 1.4s var(--ease); }
@keyframes redraw { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
.service h3 { font-size: 24px; margin-bottom: 14px; }
.service p { color: var(--ink-2); font-size: 15.5px; }
.service::after { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .7s var(--ease); }
.service + .service::after { left: 0; }
.service:hover::after { transform: scaleX(1); }
@media (max-width: 860px) {
  .service-list { grid-template-columns: 1fr; }
  .service, .service + .service { padding-left: 0; border-left: 0; }
  .service + .service { border-top: 1px solid var(--rule); }
  .service-icon { margin: 24px 0; }
}

/* --- Bauablauf (3D-Modell, läuft mit dem Scrollen) --------------------- */

.build { background: var(--paper-2); position: relative; }
.build-sticky { position: relative; padding: clamp(72px, 8vw, 110px) 0; display: flex; align-items: center; overflow: hidden; }
/* Fortschrittsanzeige am Rand: macht das Scrollen sichtbar */
.build-rail { position: absolute; right: calc(var(--gutter) * .5); top: 50%; height: 38vh; width: 1px; background: var(--rule); transform: translateY(-50%); }
.build-rail::after { content: ""; position: absolute; left: 0; top: 0; width: 1px; height: 100%; background: var(--accent); transform-origin: top; transform: scaleY(var(--p, 0)); }
.build-rail span { position: absolute; left: -3px; width: 7px; height: 1px; background: var(--muted); }
.build-rail span:nth-child(1) { top: 0; } .build-rail span:nth-child(2) { top: 25%; } .build-rail span:nth-child(3) { top: 50%; } .build-rail span:nth-child(4) { top: 75%; } .build-rail span:nth-child(5) { top: 100%; }
.build-hint { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); font-family: var(--f-head); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 10px; opacity: calc(1 - var(--p, 0) * 6); }
.build-hint::after { content: ""; width: 1px; height: 26px; background: currentColor; transform-origin: top; transform: scaleY(calc(1 - var(--p, 0) * 6)); }
.build-sticky::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 68px 68px; opacity: .35;
  -webkit-mask-image: radial-gradient(ellipse at 62% 50%, #000 10%, transparent 65%);
          mask-image: radial-gradient(ellipse at 62% 50%, #000 10%, transparent 65%);
}
.build-grid { display: grid; grid-template-columns: 1fr 1.618fr; gap: 42px; align-items: center; position: relative; }
.build .section-num { margin-bottom: 26px; }
.build .h2 { margin-bottom: 42px; }
.phases { list-style: none; margin: 0; padding: 0; }
.phase { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 16px 0; border-top: 1px solid var(--rule); opacity: .38; transition: opacity .6s ease; cursor: pointer; }
.phase:hover { opacity: .75; }
.phase:last-child { border-bottom: 1px solid var(--rule); }
.phase.is-active { opacity: 1; }
.phase-n { font-family: var(--f-head); font-size: 13px; letter-spacing: .1em; padding-top: 5px; color: var(--muted); }
.phase.is-active .phase-n { color: var(--accent); }
.phase h3 { font-size: 20px; font-weight: 500; }
.phase p { font-size: 14.5px; color: var(--muted); max-height: 0; overflow: hidden; transition: max-height .7s var(--ease), margin .7s var(--ease); }
.phase.is-active p { max-height: 4em; margin-top: 4px; }
.build-progress { height: 2px; background: var(--rule); margin-top: 26px; }
.build-progress span { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }

.build-stage { position: relative; }
.build-3d { width: 100%; height: min(70vh, 640px); opacity: 0; transition: opacity 1.2s ease; }
.build-3d.is-ready { opacity: 1; }
.build-3d canvas { display: block; width: 100% !important; height: 100% !important; }
.build-meta { position: absolute; right: 0; bottom: 4%; text-align: right; font-family: var(--f-head); }
.bm-label { display: block; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.bm-value { font-size: 42px; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

@media (max-width: 960px) {
  .build-sticky { padding: 64px 0 40px; }
  .build-rail { display: none; }
  .build-grid { grid-template-columns: 1fr; gap: 0; }
  .build .h2 { margin-bottom: 16px; font-size: 34px; }
  .build .section-num { margin-bottom: 12px; }
  .phase { padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .phase:not(.is-active) { display: none; }
  .phase h3 { font-size: 17px; }
  .build-progress { margin-top: 14px; }
  .build-3d { height: 48vh; height: 48svh; }
  .bm-value { font-size: 28px; }
}

/* --- HOAI --------------------------------------------------------------- */

.lph { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); position: relative; counter-reset: lph; }
.lph-item { padding: 30px 28px 36px 0; border-top: 1px solid var(--rule); position: relative; opacity: 0; transform: translateY(20px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.lph-item.is-in { opacity: 1; transform: none; }
.no-js .lph-item { opacity: 1; transform: none; }
.lph-item::before { content: ""; position: absolute; top: -1px; left: 0; width: 100%; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 1.1s var(--ease); transition-delay: calc(var(--d, 0s) + .2s); }
.lph-item.is-in::before { transform: scaleX(1); }
.lph-item::after { content: ""; position: absolute; top: -4px; left: 0; width: 7px; height: 7px; background: var(--accent); }
.lph-n { font-family: var(--f-head); font-size: 13px; letter-spacing: .12em; color: var(--accent); font-weight: 500; }
.lph-item h3 { font-size: 22px; margin: 18px 0 10px; }
.lph-item p { color: var(--ink-2); font-size: 15.5px; max-width: 24em; }
@media (max-width: 960px) { .lph { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .lph { grid-template-columns: 1fr; } .lph-item { padding-right: 0; } }

/* --- Dark Section ------------------------------------------------------- */

.dark { background: var(--dark); color: var(--paper); }
.dark .section-num { color: #8d8b85; }
.dark .lead { color: #d4d1ca; }
.dark .muted { color: #8d8b85; }
.types { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--dark-rule); }
.types li { display: grid; grid-template-columns: 80px 1fr; align-items: baseline; padding: 24px 0; border-bottom: 1px solid var(--dark-rule); font-family: var(--f-head); font-size: clamp(22px, 3vw, 40px); letter-spacing: -0.025em; font-weight: 500; position: relative; transition: padding .6s var(--ease), color .4s; }
.types li span { font-size: 13px; letter-spacing: .12em; color: #8d8b85; font-weight: 400; }
.types li::before { content: ""; position: absolute; inset: 0; background: var(--dark-2); transform: scaleY(0); transform-origin: bottom; transition: transform .6s var(--ease); z-index: -1; }
.types li { z-index: 0; }
.types li:hover { padding-left: 20px; }
.types li:hover::before { transform: scaleY(1); }
@media (max-width: 600px) { .types li { grid-template-columns: 44px 1fr; padding: 18px 0; } }

.type-thumb { display: none; }
.type-preview {
  position: fixed; left: 0; top: 0; z-index: 60; width: 340px; aspect-ratio: 4 / 3; pointer-events: none;
  background: var(--paper); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55);
  opacity: 0; clip-path: inset(50% 0 50% 0); transition: opacity .35s ease, clip-path .6s var(--ease);
}
.type-preview.is-on { opacity: 1; clip-path: inset(0 0 0 0); }
.type-preview img { width: 100%; height: 100%; object-fit: cover; }
@media (pointer: coarse) {
  .types li { grid-template-columns: 44px 1fr 84px; align-items: center; gap: 0 12px; }
  .types li:hover { padding-left: 0; }
  .type-thumb { display: block; width: 84px; height: 63px; object-fit: cover; }
}

/* --- Projekte ----------------------------------------------------------- */

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.filter { background: none; border: 1px solid var(--rule); padding: 9px 18px; font-family: var(--f-head); font-size: 14px; cursor: pointer; transition: background .3s, color .3s, border-color .3s; }
.filter:hover { border-color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filter sup { font-size: 10px; margin-left: 3px; color: var(--muted); }
.filter[aria-pressed="true"] sup { color: #a9a7a0; }

.filters[hidden] { display: none; }
.projects-empty { border: 1px dashed var(--rule); padding: clamp(48px, 8vw, 96px) 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.projects-empty img { width: 64px; height: auto; opacity: .85; }
.projects-empty h3 { font-size: clamp(22px, 2.4vw, 30px); }
.projects-empty p { color: var(--muted); max-width: 30em; }
.project-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(20px, 2.4vw, 36px); }
.project { grid-column: span var(--span, 4); cursor: pointer; background: none; border: 0; padding: 0; text-align: left; display: flex; flex-direction: column; }
.project.is-hidden { display: none; }
.project-grid.flash .project:not(.is-hidden) { animation: cardIn .8s var(--ease) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.project-media { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: var(--paper-2); }
.project.wide .project-media { aspect-ratio: auto; flex: 1; min-height: 260px; }
.project.wide .project-media img { position: absolute; inset: 0; }
.project.tall .project-media { aspect-ratio: 4 / 5; }
.project.full .project-media { aspect-ratio: 21 / 9; flex: none; }
.project-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 1.4s var(--ease), filter .6s; filter: saturate(.85); }
.project:hover .project-media img { transform: scale(1.02); filter: saturate(1); }
.project-media::after { content: ""; position: absolute; inset: 0; background: var(--paper); transform-origin: top; transition: transform 1.2s var(--ease); transition-delay: var(--d, 0s); }
.project.is-in .project-media::after { transform: scaleY(0); }
.no-js .project-media::after { display: none; }
.project-count { position: absolute; left: 14px; bottom: 14px; background: rgba(21,21,21,.78); color: var(--paper); font-family: var(--f-head); font-size: 12px; letter-spacing: .08em; padding: 6px 10px; backdrop-filter: blur(6px); }
.project-open { position: absolute; right: 14px; bottom: 14px; width: 42px; height: 42px; background: var(--paper); display: grid; place-items: center; transform: translateY(10px); opacity: 0; transition: .5s var(--ease); }
.project-open svg { width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 1.5; }
.project:hover .project-open, .project:focus-visible .project-open { opacity: 1; transform: none; }
.project-body { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding-top: 18px; border-top: 1px solid transparent; }
.project-title { font-family: var(--f-head); font-size: 21px; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
.project-sub { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.project-cat { font-family: var(--f-head); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); white-space: nowrap; padding-top: 5px; }

@media (max-width: 1100px) {
  .project { grid-column: span 6; }
  .project.wide .project-media, .project.tall .project-media, .project.full .project-media { aspect-ratio: 4 / 3; flex: none; min-height: 0; }
}
@media (max-width: 600px) {
  .project { grid-column: span 12; }
}

/* --- Büro --------------------------------------------------------------- */

.office { background: var(--paper-2); }
.office-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.office .section-num { margin-bottom: 24px; }
.office .h2 { margin-bottom: 32px; }
.creds { margin: 0; border-top: 1px solid var(--ink); }
.creds > div { display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.creds dt { font-family: var(--f-head); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.creds dd { margin: 0; font-size: 16.5px; }
@media (max-width: 860px) {
  .office-grid { grid-template-columns: 1fr; }
  .creds > div { grid-template-columns: 1fr; gap: 4px; }
}

/* --- Kontakt ------------------------------------------------------------ */

.contact { background: var(--ink); color: var(--paper); position: relative; overflow: hidden; }
.contact > .wrap { position: relative; z-index: 1; }

/* Statik-Hintergrund: zeichnet sich mit dem Scrollen (--p kommt aus main.js) */
.statik {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 5%, #000 55%);
          mask-image: linear-gradient(90deg, transparent 5%, #000 55%);
}
.statik path { fill: none; stroke: rgba(243, 241, 236, .028); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--p, 0)); }
.statik .st-strong { stroke: rgba(124, 196, 194, .05); stroke-width: 1.2; }
.statik .st-dash { stroke-dasharray: 1; }
.statik pattern line { stroke: rgba(243, 241, 236, .018); stroke-width: 1; }
.statik .st-fill { fill: url(#st-hatch); opacity: calc(var(--p, 0) * 1.2 - .2); }
.statik circle { fill: rgba(124, 196, 194, .06); opacity: var(--p, 0); }
.statik text { font-family: var(--f-head); font-size: 13px; fill: rgba(243, 241, 236, .03); letter-spacing: .02em; opacity: calc(var(--p, 0) * 1.6 - .4); }
.statik .st-h { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; fill: rgba(124, 196, 194, .065); }
.statik .st-c { text-anchor: middle; }
@media (max-width: 860px) { .statik { opacity: .5; -webkit-mask-image: none; mask-image: none; } }
.contact .section-num, .contact .label { color: #8d8b85; }
.contact-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; margin-bottom: clamp(56px, 8vw, 110px); }
.contact-title { font-size: clamp(42px, 7.4vw, 116px); line-height: .98; letter-spacing: -0.045em; margin-top: 28px; }
.contact-logo { width: clamp(120px, 14vw, 200px); height: auto; opacity: .92; }
@media (max-width: 700px) { .contact-head { flex-direction: column-reverse; align-items: flex-start; } .contact-logo { width: 110px; } }
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--dark-rule); }
.contact-block { padding: 28px 28px 0 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.contact-block + .contact-block { padding-left: 28px; border-left: 1px solid var(--dark-rule); }
.contact-block .label { margin-bottom: 14px; }
.contact address { font-style: normal; font-size: 18px; line-height: 1.6; margin-bottom: 14px; }
.big-link { font-family: var(--f-head); font-size: clamp(19px, 1.8vw, 24px); text-decoration: none; letter-spacing: -.01em; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--ease); padding-bottom: 2px; }
.big-link:hover { background-size: 100% 1px; }
.small { color: #8d8b85; font-size: 14px; margin-top: 6px; }
@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-block, .contact-block + .contact-block { padding: 28px 0; border-left: 0; }
  .contact-block + .contact-block { border-top: 1px solid var(--dark-rule); }
}

/* --- Footer ------------------------------------------------------------- */

.site-footer { background: var(--ink); color: #8d8b85; font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-top: 28px; padding-bottom: 28px; border-top: 1px solid var(--dark-rule); }
.site-footer nav { display: flex; gap: 24px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--paper); }

/* --- Lightbox ----------------------------------------------------------- */

.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(14,14,14,.97); color: var(--paper); display: grid; grid-template-rows: auto 1fr auto; opacity: 0; transition: opacity .4s ease; }
.lightbox.is-open { opacity: 1; }
.lightbox[hidden] { display: none; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 18px var(--gutter); }
.lb-info { display: flex; gap: 20px; align-items: baseline; font-family: var(--f-head); }
.lb-title { font-size: 18px; font-weight: 500; }
.lb-count { font-size: 13px; color: #8d8b85; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.lb-close { width: 44px; height: 44px; background: none; border: 0; position: relative; cursor: pointer; }
.lb-close span { position: absolute; left: 10px; right: 10px; top: 21px; height: 1.5px; background: var(--paper); }
.lb-close span:first-child { transform: rotate(45deg); }
.lb-close span:last-child { transform: rotate(-45deg); }
.lb-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 76px; }
.lb-figure { margin: 0; height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; min-height: 0; }
.lb-figure img { max-height: 100%; max-width: 100%; object-fit: contain; transition: opacity .35s ease, transform .5s var(--ease); }
.lb-figure img.is-loading { opacity: 0; transform: scale(.985); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border: 1px solid #3a3a38; background: none; cursor: pointer; display: grid; place-items: center; transition: border-color .3s, background .3s; }
.lb-nav:hover { border-color: var(--paper); background: rgba(255,255,255,.05); }
.lb-nav svg { width: 18px; height: 18px; fill: none; stroke: var(--paper); stroke-width: 1.4; }
.lb-prev { left: 14px; }
.lb-nav[hidden], .lb-thumbs[hidden] { display: none; }
.lb-next { right: 14px; }
.lb-thumbs { display: flex; gap: 8px; padding: 16px var(--gutter) 22px; overflow-x: auto; justify-content: center; scrollbar-width: thin; }
.lb-thumbs button { flex: 0 0 auto; width: 72px; height: 54px; padding: 0; border: 0; background: none; cursor: pointer; opacity: .4; transition: opacity .3s; outline-offset: 2px; }
.lb-thumbs button.is-current { opacity: 1; outline: 1px solid var(--paper); }
.lb-thumbs button:hover { opacity: .85; }
.lb-thumbs img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 700px) {
  .lb-stage { padding: 0 8px; }
  .lb-nav { top: auto; bottom: -64px; transform: none; width: 44px; height: 44px; }
  .lb-thumbs { justify-content: flex-start; padding-left: 70px; padding-right: 70px; }
  .lb-prev { left: 12px; } .lb-next { right: 12px; }
}

body.lb-lock { overflow: hidden; }

/* --- Unterseiten -------------------------------------------------------- */

.legal { padding: 160px 0 120px; }
.legal .wrap { max-width: 860px; }
.legal h1 { font-size: clamp(40px, 6vw, 72px); letter-spacing: -.04em; line-height: 1; margin-bottom: 56px; }
.legal h2 { font-size: 22px; margin: 48px 0 14px; letter-spacing: -.01em; }
.legal p, .legal li { color: var(--ink-2); margin-bottom: 12px; }
.legal a { color: var(--accent); }

/* --- Bewegung reduzieren ------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .reveal, .lph-item { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero-title .line > span { transform: none !important; transition: none !important; }
  .project-media::after { display: none; }
  .statement .w { opacity: 1; }
  .split .line > span { transform: none !important; transition: none !important; }
}
