/* ============================================================
   Bau-Dokumentation Verlauf — style.css
   ============================================================ */

:root {
  --ink:          #121315;
  --ink-2:        #1B1D20;
  --concrete:     #C9C5BD;
  --concrete-dim: #8E8B85;
  --paper:        #ECE7DD;
  --signal:       #2F6FED;
  --line:         rgba(201,197,189,0.14);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--ink); color: var(--concrete); font-family: 'IBM Plex Sans', sans-serif; overflow-x: hidden; }
::selection { background: var(--signal); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.mono { font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.04em; }

/* ---------- LOADING 1 ---------- */
#loading1 {
  position: fixed; inset: 0; z-index: 999;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s ease;
}
#loading1.hidden { opacity: 0; pointer-events: none; }
.l1-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.l1-bar-wrap { width: 200px; height: 2px; background: var(--line); }
.l1-bar { height: 100%; width: 0%; background: var(--signal); transition: width .3s ease; }
.l1-text { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--concrete-dim); }

/* ---------- LOADING 2 ---------- */
#loading2 {
  position: fixed; inset: 0; z-index: 998;
  background: var(--ink);
  display: none; align-items: center; justify-content: center;
  transition: opacity .5s ease;
}
#loading2.active { display: flex; }
#loading2.hidden { opacity: 0; pointer-events: none; }
.l2-inner { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.l2-svg { width: 120px; height: 80px; }
.l2-svg .brick {
  fill: none; stroke: var(--signal); stroke-width: 1.5;
  opacity: 0; animation: brickAppear .4s ease forwards;
}
.l2-svg .brick:nth-child(1)  { animation-delay: 0.00s; }
.l2-svg .brick:nth-child(2)  { animation-delay: 0.10s; }
.l2-svg .brick:nth-child(3)  { animation-delay: 0.20s; }
.l2-svg .brick:nth-child(4)  { animation-delay: 0.35s; }
.l2-svg .brick:nth-child(5)  { animation-delay: 0.45s; }
.l2-svg .brick:nth-child(6)  { animation-delay: 0.60s; }
.l2-svg .brick:nth-child(7)  { animation-delay: 0.70s; }
.l2-svg .brick:nth-child(8)  { animation-delay: 0.80s; }
.l2-svg .brick:nth-child(9)  { animation-delay: 0.95s; }
.l2-svg .brick:nth-child(10) { animation-delay: 1.05s; }
.l2-svg .brick:nth-child(11) { animation-delay: 1.20s; }
.l2-svg .brick:nth-child(12) { animation-delay: 1.30s; }
.l2-svg .brick:nth-child(13) { animation-delay: 1.40s; }
@keyframes brickAppear {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.l2-svg { animation: brickLoop 2.2s ease-in-out infinite; }
@keyframes brickLoop {
  0%,45%,60%,100% { opacity: 1; }
  50%,55% { opacity: 0; }
}
.l2-text { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--concrete); }
.l2-progress-wrap { width: 200px; height: 2px; background: var(--line); }
.l2-progress-fill { height: 100%; width: 0%; background: var(--signal); transition: width .2s ease; }
.l2-percent { font-size: 11px; color: var(--concrete-dim); letter-spacing: .08em; }

/* ---------- HEADER ---------- */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 48px;
  background: transparent;
  transition: background .35s ease, padding .35s ease;
}
header.scrolled {
  background: rgba(18,19,21,0.3);
  backdrop-filter: blur(8px);
  padding: 16px 48px;
}
header.scrolled .logo { color: #fff; }
header.scrolled nav a { color: #fff; }
.logo { font-family: 'Big Shoulders Display', sans-serif; font-weight: 900; font-size: 20px; color: #fff; }
.logo span { color: var(--signal); }
nav ul { display: flex; gap: 36px; list-style: none; }
nav a {
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em; color: #fff; opacity: 0.92;
  transition: opacity .25s; padding-bottom: 4px;
  border-bottom: 1.5px solid transparent;
}
nav a:hover { opacity: 1; border-bottom-color: var(--signal); }

/* ---------- HERO ---------- */
.hero {
  min-height: 100vh; position: relative;
  display: flex; align-items: flex-end;
  overflow: hidden; padding-bottom: 64px;
}
.hero img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: saturate(.85) contrast(1.05) brightness(.5);
}
.hero .scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(18,19,21,.3) 0%, rgba(18,19,21,.18) 28%, rgba(18,19,21,.72) 68%, rgba(18,19,21,.97) 100%),
    linear-gradient(90deg, rgba(18,19,21,.78) 0%, rgba(18,19,21,.35) 38%, rgba(18,19,21,0) 62%);
}
.hero-content { position: relative; z-index: 2; padding: 0 48px; width: 100%; }
.eyebrow {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--signal); margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--signal); display: inline-block; }
h1.headline {
  font-family: 'Big Shoulders Display', sans-serif; text-transform: uppercase;
  font-size: clamp(28px, 4vw, 58px); line-height: 1.08;
  color: var(--paper); font-weight: 700; max-width: 760px;
}
.hero-sub { font-size: 18px; color: var(--concrete); max-width: 600px; margin-top: 24px; line-height: 1.75; }
.hero-controls { display: flex; align-items: center; margin-top: 48px; }
.hero-ctrl-btn {
  display: flex; align-items: center; gap: 15px;
  background: transparent; border: 1.5px solid var(--concrete-dim);
  color: var(--paper); font-size: 15px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .12em; padding: 14px 26px;
  transition: all .25s;
}
.hero-ctrl-btn:hover { color: var(--ink); background: var(--paper); border-color: var(--paper); }
.hero-ctrl-btn svg { width: 22px; height: 22px; flex-shrink: 0; }

/* ---------- STORY SCROLL ---------- */
.story-wrap { position: relative; }
.story-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.story-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; will-change: opacity, transform;
}
.story-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(18,19,21,.15) 0%, rgba(18,19,21,.05) 45%, rgba(18,19,21,.92) 100%);
  z-index: 1; pointer-events: none;
}

/* Neustart */
.story-restart {
  position: absolute; right: 48px; bottom: 32px; z-index: 4;
  display: flex; align-items: center; gap: 9px;
  background: rgba(18,19,21,.6); border: 1px solid var(--line);
  padding: 9px 16px; transition: border-color .25s;
}
.story-restart:hover { border-color: var(--signal); }
.story-restart svg { width: 15px; height: 15px; color: var(--signal); flex-shrink: 0; }
.story-restart span {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  text-transform: uppercase; letter-spacing: .07em; color: var(--paper);
}

/* Caption — 2 texts only */
.story-caption { position: absolute; left: 48px; bottom: 64px; z-index: 3; max-width: 600px; }
.story-caption .idx {
  font-family: 'IBM Plex Mono', monospace; font-size: 15px; font-weight: 500;
  color: var(--signal); margin-bottom: 12px; transition: opacity .25s;
  text-transform: uppercase; letter-spacing: .1em;
}
.story-caption h3 {
  font-family: 'Big Shoulders Display', sans-serif;
  font-size: clamp(48px, 8vw, 108px); text-transform: uppercase;
  color: var(--paper); line-height: .92; transition: opacity .25s;
  font-weight: 900;
}
.story-caption.fade .idx,
.story-caption.fade h3 { opacity: 0; }

/* Progress bar */
.story-progress {
  position: absolute; right: 48px; top: 50%; transform: translateY(-50%);
  width: 2px; height: 220px; background: var(--line); z-index: 3;
}
.story-progress-fill {
  position: absolute; bottom: 0; left: 0; width: 100%;
  background: var(--signal); height: 0%; transition: height .05s linear;
}
.story-progress-label {
  position: absolute; right: 48px; top: calc(50% - 130px); transform: translateY(-100%);
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--concrete-dim);
}

/* ---------- INDICATOR (Uhr / datum) ---------- */
.indicator-wrap {
  position: absolute; top: 120px; right: 48px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  width: 96px; transition: opacity .4s;
}
.indicator-bg {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 96px; height: 96px; border-radius: 50%;
  background: rgba(18,19,21,1);
  border: 1.5px solid var(--concrete-dim);
  pointer-events: none;
}
/* Clock markers 12 / 3 / 6 / 9 */
.indicator-ticks { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 96px; height: 96px; }
.indicator-ticks span {
  position: absolute; font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; color: var(--paper);
}
.tick-12 { top: 4px;   left: 50%; transform: translateX(-50%); }
.tick-3  { right: 4px; top: 50%;  transform: translateY(-50%); }
.tick-6  { bottom: 4px; left: 50%; transform: translateX(-50%); }
.tick-9  { left: 4px;  top: 50%;  transform: translateY(-50%); }

/* Needle */
.indicator-needle {
  position: absolute;
  top: 48px; left: 50%;
  width: 2.5px; height: 36px; background: var(--signal);
  transform-origin: 50% 0%;
  transform: translate(-50%, 0%) rotate(0deg);
  transition: transform .15s linear;
}
.indicator-center {
  position: absolute; top: 45px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px; border-radius: 50%; background: var(--paper);
}
.indicator-label {
  margin-top: 100px;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--paper); text-align: center;
}

/* ---------- SECTION HEAD ---------- */
.section-head {
  padding: 120px 48px 48px;
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; flex-wrap: wrap;
}
.section-head .tag { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--signal); margin-bottom: 14px; }
.section-head h2 {
  font-family: 'Big Shoulders Display', sans-serif;
  font-size: clamp(32px, 4vw, 56px); font-weight: 700;
  color: var(--paper); text-transform: uppercase;
}
.section-head p { max-width: 360px; font-size: 14px; color: var(--concrete-dim); line-height: 1.6; }

/* ---------- VORHER / NACHHER ---------- */
.compare-section { padding: 0 120px 160px; }
.compare {
  position: relative; width: 100%; aspect-ratio: 16/8;
  overflow: hidden; user-select: none; cursor: ew-resize;
  border: 1px solid var(--line); background: var(--ink-2);
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare .before { clip-path: inset(0 50% 0 0); filter: grayscale(.4) brightness(.85); }
.compare-handle {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; background: var(--signal); transform: translateX(-50%); pointer-events: none;
}
.compare-handle::after {
  content: "⇆"; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px; background: var(--signal); color: var(--ink);
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.compare-label {
  position: absolute; top: 20px; font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 6px 12px;
  background: rgba(18,19,21,0.7); color: var(--paper);
}
.compare-label.left { left: 20px; }
.compare-label.right { right: 20px; }

/* ---------- VIDEO ---------- */
.video-promo {
  padding: 0 48px 56px;
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 20px;
}
.video-promo .tag { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--signal); margin-bottom: 14px; display: block; }
.video-promo h2 {
  font-family: 'Big Shoulders Display', sans-serif;
  font-size: clamp(26px, 3.2vw, 42px); font-weight: 700;
  color: var(--paper); text-transform: uppercase;
}
.video-play-btn {
  display: flex; align-items: center; gap: 14px;
  background: var(--signal); border: none; color: var(--ink);
  font-size: 14px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; padding: 14px 26px; transition: opacity .25s;
  margin-top: 4px;
}
.video-play-btn:hover { opacity: .82; }
.video-play-btn svg { width: 16px; height: 16px; }

/* ---------- FOOTER ---------- */
footer { border-top: 1px solid var(--line); padding: 80px 48px; }
footer .cta h3 {
  font-family: 'Big Shoulders Display', sans-serif;
  font-size: clamp(22px, 2.8vw, 34px); color: var(--paper);
  text-transform: uppercase; max-width: 720px; line-height: 1.2;
}
footer .cta .foot-sub { font-size: 16px; color: var(--concrete); max-width: 580px; margin-top: 18px; line-height: 1.75; }

/* ---------- BAUPHASEN SECTION ---------- */
.bauphasen-section {
  border-top: 1px solid var(--line);
  padding: 80px 48px 100px;
}
.bauphasen-head { margin-bottom: 48px; }
.bauphasen-head .tag { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--signal); margin-bottom: 14px; }
.bauphasen-head h2 {
  font-family: 'Big Shoulders Display', sans-serif;
  font-size: clamp(32px, 4vw, 52px); font-weight: 700;
  color: var(--paper); text-transform: uppercase;
}
.bauphasen-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 28px;
}
.bp-card {
  position: relative;
  aspect-ratio: 16/10;
  border: 1px solid var(--line);
  background: var(--ink-2);
  cursor: pointer;
  transition: border-color .25s, background .25s;
  text-decoration: none; display: flex;
  flex-direction: column; justify-content: flex-end;
  padding: 16px 18px;
  overflow: hidden;
}
.bp-card:hover { border-color: var(--signal); background: rgba(47,111,237,0.06); }
.bp-card .bp-datum {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--signal); margin-bottom: 6px;
}
.bp-card .bp-name {
  font-family: 'Big Shoulders Display', sans-serif;
  font-size: 18px; text-transform: uppercase;
  color: var(--paper); line-height: 1.1;
}
.bp-card .bp-arrow {
  position: absolute; top: 14px; right: 16px;
  color: var(--concrete-dim); font-size: 16px;
  transition: color .25s, transform .25s;
}
.bp-card:hover .bp-arrow { color: var(--signal); transform: translateX(3px); }

/* ---------- VIDEO MODAL ---------- */
.video-modal {
  position: fixed; inset: 0; background: rgba(8,9,10,.88);
  z-index: 200; display: none; align-items: center; justify-content: center; padding: 24px;
}
.video-modal.open { display: flex; }
.video-modal-box {
  position: relative; width: 50%; max-width: 900px;
  background: #000; border: 1px solid var(--line);
  transition: width .3s ease, max-width .3s ease;
}
.video-modal-box.maximized { width: 92vw; max-width: 92vw; }
.video-modal-box video { width: 100%; display: block; aspect-ratio: 16/9; background: #000; }
.video-modal-controls { position: absolute; top: -46px; right: 0; display: flex; gap: 10px; }
.video-modal-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: 1px solid var(--line);
  color: var(--paper); display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.video-modal-btn:hover { background: rgba(255,255,255,.2); }
.video-modal-btn svg { width: 16px; height: 16px; }

/* ---------- BACK TO TOP ---------- */
.back-to-top {
  position: fixed; right: 32px; bottom: 32px; z-index: 90;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--signal); border: none;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity .3s, transform .3s;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top svg { width: 20px; height: 20px; color: var(--ink); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1200px) {
  .bauphasen-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  header { padding: 18px 20px; }
  nav { display: none; }
  .hero { padding-bottom: 48px; }
  .hero-content { padding: 0 20px; }
  .hero-controls { margin-top: 32px; }
  .story-caption { left: 20px; right: 20px; bottom: 48px; max-width: none; }
  .story-progress, .story-progress-label, .indicator-wrap { display: none; }
  .section-head { padding: 80px 20px 32px; }
  .compare-section { padding: 0 20px 100px; }
  .video-promo { padding: 0 20px 32px; }
  .video-modal-box, .video-modal-box.maximized { width: 92vw; max-width: 92vw; }
  footer { padding: 60px 20px; }
  .bauphasen-section { padding: 60px 20px 80px; }
  .bauphasen-grid { grid-template-columns: repeat(2, 1fr); }
  .back-to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}
@media (max-width: 480px) {
  .bauphasen-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
