:root {
  --dark-bg: #262322;
  --dark-2: #1b1918;
  --dark-ink: #f0ede8;
  --dark-dim: #a39e97;
  --light-bg: #d9d6cf;
  --light-ink: #211e1c;
  --light-dim: #5d5952;
  --line-light: #6b675f;
  --red: #f4503f;
  --accent: #f4503f;
  --font-head: "Archivo", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-head);
  background: var(--dark-bg);
  color: var(--dark-ink);
  transition: background-color 0.6s ease, color 0.6s ease;
  overflow-x: clip; /* nicht "hidden": das würde position:sticky brechen */
}
body[data-theme="light"] {
  background: var(--light-bg);
  color: var(--light-ink);
}

::selection { background: rgba(244, 80, 63, 0.35); }

.dot { color: var(--red); font-style: normal; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px clamp(16px, 3vw, 32px);
}
.nav__logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: inherit;
}
.nav__logo span { font-weight: 500; opacity: 0.75; }
.nav__links { display: flex; gap: clamp(14px, 3vw, 28px); align-items: center; }
.nav__links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-decoration: none;
  color: inherit;
  opacity: 0.75;
  transition: opacity 0.2s;
}
.nav__links a:hover { opacity: 1; }
.nav__cta {
  border: 1px solid currentColor;
  padding: 7px 14px;
  border-radius: 4px;
  opacity: 1 !important;
}

/* ---------- Film-Ruler ---------- */
.ruler {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 10px;
  height: 34px;
  background: #191716;
  border-radius: 8px;
  z-index: 55;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}
.ruler__ticks {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}
.ruler__ticks i {
  display: block;
  width: 2px;
  height: 12px;
  background: #4d4844;
  border-radius: 1px;
}
.ruler__ticks i:nth-child(5n + 1) { height: 18px; }
.ruler__playhead {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 4px;
  height: 20px;
  margin-top: -10px;
  border-radius: 2px;
  background: var(--red);
  box-shadow: 0 0 8px rgba(244, 80, 63, 0.8);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  position: relative;
  padding: 96px clamp(16px, 4vw, 48px) 80px;
  display: flex;
  flex-direction: column;
}
.hero__title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.hero__sub {
  margin-top: 14px;
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  color: var(--dark-dim);
  max-width: 52ch;
}
.hero__stage {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 320px;
}
#hero-net { width: min(70vh, 90vw, 720px); height: auto; overflow: visible; }
.hero__more {
  position: absolute;
  left: clamp(16px, 4vw, 48px);
  bottom: 64px;
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  color: inherit;
  background: none;
  border: 1px solid #4d4844;
  border-radius: 6px;
  padding: 14px 22px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.hero__more:hover { border-color: var(--dark-ink); background: rgba(255, 255, 255, 0.04); }
.hero__more span { display: inline-block; margin-left: 6px; }

/* ---------- Szenen (sticky) ---------- */
.scene { position: relative; }
.scene--system { height: 380vh; }
.scene--projects { height: 560vh; }
.scene--chapter { height: 200vh; }
.scene--stats { height: 260vh; }

.scene__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 90px clamp(16px, 4vw, 48px) 64px;
}

.scene__head h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
}
.scene__head p {
  margin-top: 12px;
  max-width: 54ch;
  font-size: clamp(0.92rem, 1.3vw, 1.05rem);
  opacity: 0.75;
}

/* ---------- Szene 2: System ---------- */
.system-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 0;
}
#system-net {
  width: min(110vh, 94vw, 920px);
  max-height: 100%;
  height: auto;
  overflow: visible;
}
.sys-label {
  font-family: var(--font-mono);
  font-size: 13px;
  fill: var(--light-ink);
}
.sys-box { fill: var(--light-bg); stroke: var(--line-light); stroke-width: 1.2; }
.sys-wire { stroke: var(--line-light); stroke-width: 1.2; fill: none; }

/* ---------- Szene 3: Projekte ---------- */
.projects { flex: 1; position: relative; min-height: 0; }
.project {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 1.3fr;
  gap: clamp(20px, 4vw, 60px);
  align-items: center;
  padding-right: clamp(40px, 6vw, 90px);
  opacity: 0;
  pointer-events: none;
}
.project__idx {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
}
.project h3 {
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 8px 0 12px;
}
.project p {
  font-size: clamp(0.88rem, 1.2vw, 1rem);
  opacity: 0.75;
  max-width: 42ch;
}
.project .tags { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.project .tags span {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  border: 1px solid rgba(240, 237, 232, 0.25);
  border-radius: 999px;
  padding: 4px 10px;
  opacity: 0.85;
}
.project__shot {
  border-radius: 14px;
  border: 1px solid #3a3633;
  background: var(--dark-2);
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
.project__shot svg { display: block; width: 100%; height: auto; }

.proj-index {
  position: absolute;
  right: clamp(14px, 2.4vw, 30px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}
.proj-index span { opacity: 0.35; transition: opacity 0.3s, color 0.3s; cursor: default; }
.proj-index span.on { opacity: 1; color: var(--accent); }

/* ---------- Szene 4: Kapitel ---------- */
.chapter {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 5vw, 80px);
  align-items: center;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
  min-height: 0;
}
.chapter__idx {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
}
.accent-text { color: var(--accent); }
.chapter__text h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 8px 0 12px;
}
.chapter__progress {
  height: 3px;
  border-radius: 2px;
  background: rgba(240, 237, 232, 0.12);
  margin-bottom: 18px;
  overflow: hidden;
}
.chapter__progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
}
.chapter__text p { opacity: 0.75; font-size: 0.95rem; max-width: 44ch; }
.chapter__text ul { list-style: none; margin-top: 16px; }
.chapter__text li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.8;
  padding: 5px 0;
}
.chapter__text li::before { content: "— "; color: var(--accent); }
.chapter__demo {
  aspect-ratio: 4 / 3;
  max-height: 62vh;
  border-radius: 14px;
  background: var(--dark-2);
  border: 1px solid #3a3633;
  display: grid;
  place-items: center;
  padding: 8%;
}
.chapter__demo svg { width: 100%; height: 100%; overflow: visible; }

/* ---------- Szene 5: Wirkung ---------- */
.stats-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(30px, 6vh, 70px);
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
}
.stat-lines { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat-line { display: flex; flex-direction: column; gap: 6px; }
.stat-line__num {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--red);
}
.stat-line > span:last-child { font-size: 0.85rem; opacity: 0.7; }

.savings__bar {
  background: #191716;
  color: #f0ede8;
  border-radius: 10px;
  padding: 14px 16px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.25);
}
.savings__label, .savings__total {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  white-space: nowrap;
}
.savings__segments {
  height: 14px;
  border-radius: 7px;
  background: #2e2b29;
  overflow: hidden;
  display: flex;
}
.savings__segments i { display: block; height: 100%; transform-origin: left center; }

/* ---------- Szene 6: CTA ---------- */
.cta {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 130px clamp(16px, 4vw, 48px) 40px;
  overflow: hidden;
}
#cta-net {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.3;
}
.cta__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 640px;
}
.cta__inner h2 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.cta__inner p { max-width: 46ch; opacity: 0.75; }
.cta__btn {
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: #fff;
  background: var(--red);
  padding: 16px 34px;
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 8px 30px rgba(244, 80, 63, 0.35);
}
.cta__btn:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(244, 80, 63, 0.5); }
.cta__btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- Kontaktformular ---------- */
.kontakt {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.kontakt__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.feld { display: flex; flex-direction: column; gap: 6px; }
.feld__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
}
.feld input,
.feld textarea {
  font-family: var(--font-head);
  font-size: 0.95rem;
  color: var(--dark-ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(240, 237, 232, 0.16);
  border-radius: 8px;
  padding: 12px 14px;
  width: 100%;
  transition: border-color 0.2s, background 0.2s;
  resize: vertical;
}
.feld input:focus,
.feld textarea:focus {
  outline: none;
  border-color: var(--red);
  background: rgba(255, 255, 255, 0.06);
}
.feld input[aria-invalid="true"],
.feld textarea[aria-invalid="true"] { border-color: var(--red); }

/* Spam-Falle unsichtbar, aber nicht display:none (Bots erkennen das) */
.kontakt__falle {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.kontakt__einwilligung {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.8rem;
  line-height: 1.5;
  opacity: 0.8;
  cursor: pointer;
}
.kontakt__einwilligung input {
  margin-top: 3px;
  accent-color: var(--red);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.kontakt__einwilligung a { color: inherit; }

.kontakt .cta__btn { align-self: flex-start; border: none; cursor: pointer; font-family: var(--font-head); }

.kontakt__status {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.55;
  min-height: 1.2em;
  margin: 0;
}
.kontakt__status--ok { color: #8fd14f; }
.kontakt__status--fehler { color: var(--red); }

.footer {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding-top: 80px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.6;
  padding-bottom: 46px;
}
.footer a { color: inherit; text-decoration: none; margin-left: 18px; }

/* ---------- Reduced Motion / Mobile ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scene--system, .scene--projects, .scene--chapter, .scene--stats { height: auto; }
  .scene__sticky { position: static; height: auto; }
  .project { position: static; opacity: 1 !important; }
  .projects { display: grid; gap: 60px; }
}

@media (max-width: 760px) {
  .project { grid-template-columns: 1fr; padding-right: 0; align-content: center; gap: 18px; }
  .proj-index { display: none; }
  .chapter { grid-template-columns: 1fr; gap: 18px; }
  .chapter__demo { max-height: 38vh; }
  .stat-lines { grid-template-columns: 1fr; }
}
