/* Englmair Rechtsanwalts GmbH
   Grunddesign aus dem Bestand (ce-ra.at): Schwarz, Weiß, Grau, Roboto. */

@font-face {
  font-family: "Roboto";
  src: url("../schrift/roboto-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --schwarz: #000;
  --weiss: #fff;
  --hell: #c9c9c9;
  --grau: #9a9a9a;
  --grau-dunkel: #5c5c5c;
  --linie: rgba(255, 255, 255, 0.16);
  --rand: clamp(20px, 5vw, 72px);
  --menue-breite: 150px;
  --weich: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  background: var(--schwarz);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--schwarz);
  color: var(--grau);
  font-family: "Roboto", Arial, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.8;
  overflow-x: clip;
}

h1, h2, h3, p, ul, ol, address { margin: 0; padding: 0; font-style: normal; }
ul, ol { list-style: none; }
a { color: var(--weiss); text-decoration: none; transition: color 0.4s, opacity 0.4s; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { color: #fcfcfc; background: #c1c1c1; }
:focus-visible { outline: 1px solid var(--weiss); outline-offset: 6px; }

.sprunglink {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 8px 16px; background: var(--weiss); color: var(--schwarz);
}
.sprunglink:focus { top: 16px; }

/* Unterstreichung, die sich beim Überfahren zeichnet */
.strich {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 3px;
  transition: background-size 0.6s var(--weich), opacity 0.4s;
}
.strich:hover, .strich:focus-visible, .strich--immer { background-size: 100% 1px; }
.strich--immer span { display: inline-block; transition: transform 0.5s var(--weich); }
.strich--immer:hover span { transform: translateX(6px); }

/* ---------- Vorhang beim Laden ---------- */

.vorhang {
  position: fixed; inset: 0; z-index: 50; background: var(--schwarz);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  pointer-events: none;
  animation: vorhang-weg 0.9s ease 1.5s forwards;
}
.vorhang img { width: min(60vw, 340px); height: auto; opacity: 0; animation: vorhang-logo 0.9s ease 0.15s forwards; }
.vorhang i { width: min(60vw, 340px); height: 1px; background: var(--weiss); transform: scaleX(0); transform-origin: left; animation: vorhang-linie 1.1s var(--weich) 0.4s forwards; }
@keyframes vorhang-logo { to { opacity: 1; } }
@keyframes vorhang-linie { to { transform: scaleX(1); } }
@keyframes vorhang-weg { to { opacity: 0; visibility: hidden; } }

/* ---------- Bühne: Porträt und Korn ---------- */

.buehne { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
#portraet {
  position: absolute; left: 0; top: 0;
  height: 100vh; height: 100svh; width: auto; max-width: none;
  transform-origin: 0 0;
  will-change: transform, opacity;
  -webkit-mask-image: linear-gradient(to bottom, #000 86%, transparent);
  mask-image: linear-gradient(to bottom, #000 86%, transparent);
}
.kein-js #portraet { opacity: 0.3; left: 4vw; }

.korn {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='k'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23k)'/%3E%3C/svg%3E");
}

/* ---------- Kopf ---------- */

.kopf {
  position: fixed; left: 0; right: 0; top: 0; z-index: 20;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 36px var(--rand) 0;
  pointer-events: none;
}
.kopf::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 150px; z-index: -1;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
}
.kopf > * { pointer-events: auto; }
.logo img { width: clamp(190px, 24vw, 340px); height: auto; }

/* Oben rechts nur noch der Rücklink im Impressum; die Navigation ist das Seitenmenü rechts */
.hauptmenue ul { display: flex; gap: 32px; padding-top: 14px; }
.hauptmenue a { font-size: 18px; color: rgba(255, 255, 255, 0.45); padding: 6px 0; }
.hauptmenue a:hover { color: var(--weiss); }

/* ---------- Seitenmenü ---------- */

.seitenmenue {
  position: fixed; right: 0; top: 50%; z-index: 19;
  transform: translateY(-50%);
  padding-right: 28px;
  display: flex; align-items: stretch; gap: 18px;
}
.seitenmenue ol { display: flex; flex-direction: column; gap: 6px; }
.seitenmenue a {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 8px 0;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}
.seitenmenue a::after { content: ""; width: 14px; height: 1px; background: currentColor; transition: width 0.6s var(--weich); }
.seitenmenue a:hover { color: rgba(255, 255, 255, 0.8); }
.seitenmenue a.aktiv { color: var(--weiss); }
.seitenmenue a.aktiv::after { width: 38px; }
.fortschritt { width: 1px; background: var(--linie); }
.fortschritt i { display: block; width: 100%; height: 100%; background: var(--weiss); transform: scaleY(0); transform-origin: top; }

/* ---------- Szenen ---------- */

main { position: relative; z-index: 2; }

.szene, .haft {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 150px calc(var(--menue-breite) + var(--rand)) 70px var(--rand);
}
.szene { position: relative; }

.inhalt { width: 100%; }
.szene--netzwerk .inhalt { margin-left: 45%; width: 55%; max-width: 660px; }
.szene--expertise .inhalt { margin-left: 39%; width: 61%; max-width: 760px; }
.szene--profil .inhalt { margin-left: 33%; width: 67%; max-width: 860px; }
.szene--kontakt .inhalt { margin-left: 33%; width: 67%; max-width: 860px; }

.marke-zeile {
  display: flex; align-items: center; gap: 14px; margin-bottom: 10px;
  font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--grau);
}
.marke-zeile span { color: var(--weiss); }
.marke-zeile span::after { content: ""; display: inline-block; vertical-align: middle; width: 34px; height: 1px; margin-left: 14px; background: var(--linie); }

.titel {
  color: var(--weiss);
  font-weight: 300;
  font-size: clamp(26px, 3.2vw, 46px);
  line-height: 1.2;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  white-space: nowrap;
}
.titel--gross { font-size: clamp(30px, 6.4vw, 96px); letter-spacing: 0.5em; margin-right: -0.5em; }
.titel .b { display: inline-block; }

.linie { display: block; height: 1px; width: 100%; margin: 20px 0 30px; background: var(--linie); transform-origin: left; }

.satz { color: var(--weiss); font-size: clamp(21px, 2vw, 29px); line-height: 1.45; font-weight: 300; }
.satz .w { display: inline-block; overflow: hidden; vertical-align: top; }
.satz .w > span { display: inline-block; }
.text { font-size: 17px; color: var(--hell); max-width: 36em; }

.rubrik { color: var(--weiss); font-weight: 400; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 12px; }

/* Start: Name, darunter der Hinweis zum Weiterscrollen */
.weiter { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 7vh; font-size: 12px; letter-spacing: 0.4em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); }
.weiter span { margin-right: -0.4em; }
.weiter i { width: 1px; height: 54px; background: var(--weiss); transform-origin: top; animation: puls 2.2s var(--weich) infinite; }
@keyframes puls {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

.szene--name { justify-content: flex-end; align-items: center; text-align: center; padding: 0 var(--rand) 40px; }
.name-block { text-shadow: 0 0 34px rgba(0, 0, 0, 0.95), 0 0 8px rgba(0, 0, 0, 0.8); }
.unterzeile { margin-top: 14px; color: var(--weiss); font-size: clamp(12px, 1.3vw, 18px); letter-spacing: 0.6em; margin-right: -0.6em; text-transform: uppercase; }
.leitsatz { margin-top: 26px; color: var(--hell); font-size: clamp(14px, 1.15vw, 17px); letter-spacing: 0.04em; }

/* Netzwerk */
.partner {
  position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 38px 0 34px; padding-top: 22px;
}
.partner::before { content: ""; position: absolute; left: 0; right: 0; top: 2px; height: 1px; background: var(--linie); transform-origin: left; }
.partner li {
  position: relative; font-size: 12px; line-height: 1.5; letter-spacing: 0.14em; text-transform: uppercase; color: var(--weiss);
  hyphens: manual;
}
.partner li::before { content: ""; position: absolute; left: 0; top: -22px; width: 5px; height: 5px; border-radius: 50%; background: var(--weiss); }

/* Expertise */
.szene--expertise { display: block; padding: 0; min-height: 0; height: 500vh; height: 500svh; }
.haft { position: sticky; top: 0; height: 100vh; height: 100svh; }
.schrittmarke { position: absolute; left: 0; width: 1px; height: 1px; }
.schrittmarke:nth-of-type(1) { top: 0; }
.schrittmarke:nth-of-type(2) { top: 100vh; top: 100svh; }
.schrittmarke:nth-of-type(3) { top: 200vh; top: 200svh; }
.schrittmarke:nth-of-type(4) { top: 300vh; top: 300svh; }
.schrittmarke:nth-of-type(5) { top: 400vh; top: 400svh; }

.tafeln { display: grid; min-height: 330px; }
.tafel { grid-area: 1 / 1; position: relative; padding-top: 34px; }
.ziffer {
  position: absolute; right: 0; top: -34px;
  font-size: clamp(110px, 13vw, 190px); font-weight: 100; line-height: 1; letter-spacing: -0.02em;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.22);
  pointer-events: none; user-select: none;
}
.tafel h3 {
  position: relative; max-width: 15em;
  color: var(--weiss); font-weight: 400; font-size: clamp(20px, 2vw, 28px); line-height: 1.25;
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 22px;
}
.punkte { position: relative; columns: 2; column-gap: 40px; }
.punkte li {
  break-inside: avoid; position: relative; padding: 0 0 9px 20px;
  font-size: 15.5px; line-height: 1.5; color: var(--hell);
}
.punkte li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 9px; height: 1px; background: var(--grau); }
.tafel-satz { position: relative; font-size: 19px; color: var(--hell); max-width: 26em; }

.schritte { display: flex; gap: 10px; margin-top: 26px; }
.schritte button {
  flex: 1; padding: 12px 0 0; border: 0; border-top: 1px solid var(--linie); background: none; cursor: pointer; text-align: left;
  font-size: 12px; letter-spacing: 0.2em; color: var(--grau-dunkel);
  position: relative; transition: color 0.4s;
}
.schritte button::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--weiss);
  transform: scaleX(0); transform-origin: left; transition: transform 0.7s var(--weich);
}
.schritte button:hover { color: var(--hell); }
.schritte button.aktiv { color: var(--weiss); }
.schritte button.aktiv::before { transform: scaleX(1); }
.kein-js .szene--expertise { height: auto; }
.kein-js .haft { position: static; height: auto; }
.kein-js .tafel { grid-area: auto; margin-bottom: 30px; }
.kein-js .schritte, .kein-js .schrittmarke { display: none; }

/* Profil */
.person { color: var(--weiss); font-size: 22px; font-weight: 400; line-height: 1.4; }
.person-kontakt { margin: 4px 0 28px; }
.person-kontakt span { margin: 0 8px; color: var(--grau-dunkel); }
.lebenslauf { display: grid; grid-template-columns: 1.15fr 1fr; gap: 26px 48px; }
.zeitleiste { border-left: 1px solid var(--linie); }
.zeitleiste li { position: relative; display: grid; grid-template-columns: 3.4em 1fr; gap: 14px; padding: 0 0 9px 18px; font-size: 15px; line-height: 1.5; }
.zeitleiste--breit li { grid-template-columns: 6.8em 1fr; }
.zeitleiste li::before { content: ""; position: absolute; left: -3px; top: 0.6em; width: 5px; height: 5px; border-radius: 50%; background: var(--weiss); }
.zeitleiste time { order: -1; color: var(--weiss); font-weight: 400; white-space: nowrap; }

/* Kontakt */
.szene--kontakt { padding-bottom: 110px; }
.kontakt-raster { display: grid; grid-template-columns: 1.25fr 1.1fr 1fr; gap: 30px 44px; margin-top: 44px; }
.kontakt-raster address, .kontakt-raster p { font-size: 17px; line-height: 1.7; color: var(--hell); }
.kontakt-raster address + p { margin-top: 16px; }
.gross-link { white-space: nowrap; }
.fuss { position: absolute; left: var(--rand); right: var(--rand); bottom: 22px; border-top: 1px solid var(--linie); padding-top: 16px; text-align: center; }
.fuss p { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: rgba(255, 255, 255, 0.4); }
.fuss a { color: rgba(255, 255, 255, 0.65); }
.fuss a:hover { color: var(--weiss); }

/* ---------- Einblenden (nur mit Skript) ---------- */

.js [data-ein] { opacity: 0; transform: translateY(22px); transition: opacity 0.5s ease, transform 0.5s ease; }
.js .da [data-ein] {
  opacity: 1; transform: none;
  transition: opacity 0.9s ease calc(0.25s + var(--i, 0) * 0.07s), transform 1.1s var(--weich) calc(0.25s + var(--i, 0) * 0.07s);
}
.js .titel .b { opacity: 0; transform: translateY(0.5em); filter: blur(6px); transition: opacity 0.4s ease, transform 0.4s ease, filter 0.4s ease; }
.js .da .titel .b {
  opacity: 1; transform: none; filter: none;
  transition: opacity 0.8s ease calc(var(--b) * 0.06s), transform 0.9s var(--weich) calc(var(--b) * 0.06s), filter 0.8s ease calc(var(--b) * 0.06s);
}

/* Auffahrt beim Laden: Während die Kamera von selbst nach außen fährt, kommt die Schrift
   gemächlich dazu – erst die Buchstaben, dann Zeile für Zeile. */
.js.auffahrt .szene--name.da .titel .b {
  transition-duration: 1.4s, 1.6s, 1.4s;
  transition-delay: calc(2.7s + var(--b) * 0.12s), calc(2.7s + var(--b) * 0.12s), calc(2.7s + var(--b) * 0.12s);
}
.js.auffahrt .szene--name.da [data-ein] {
  transition-duration: 1.4s, 1.6s;
  transition-delay: calc(4.3s + var(--i, 0) * 0.7s), calc(4.3s + var(--i, 0) * 0.7s);
}
.js .linie { transform: scaleX(0); transition: transform 0.5s ease; }
.js .da .linie { transform: scaleX(1); transition: transform 1.4s var(--weich) 0.3s; }

.js .satz .w > span { transform: translateY(110%); transition: transform 0.4s ease; }
.js .da .satz .w > span { transform: none; transition: transform 1s var(--weich) calc(0.35s + var(--w) * 0.035s); }

.js .partner::before { transform: scaleX(0); transition: transform 0.5s ease; }
.js .da .partner::before { transform: scaleX(1); transition: transform 1.6s var(--weich) 0.8s; }

/* Tafeln: am Desktop ist immer nur die aktive zu sehen */
.js .tafel { opacity: 0; pointer-events: none; transition: opacity 0.45s ease; }
.js .tafel h3, .js .tafel .tafel-satz, .js .punkte li { opacity: 0; transform: translateY(18px); transition: opacity 0.35s ease, transform 0.35s ease; }
.js .ziffer { opacity: 0; transform: translateX(40px); transition: opacity 0.4s ease, transform 0.4s ease; }
.js .da .tafel.aktiv { opacity: 1; pointer-events: auto; transition: opacity 0.5s ease 0.25s; }
.js .da .tafel.aktiv h3, .js .da .tafel.aktiv .tafel-satz, .js .da .tafel.aktiv .punkte li {
  opacity: 1; transform: none;
  transition: opacity 0.8s ease calc(0.35s + var(--p, 0) * 0.06s), transform 1s var(--weich) calc(0.35s + var(--p, 0) * 0.06s);
}
.js .da .tafel.aktiv .ziffer { opacity: 1; transform: none; transition: opacity 1.2s ease 0.3s, transform 1.4s var(--weich) 0.3s; }

/* ---------- Schmale Bildschirme ---------- */

@media (max-width: 899px) {
  .szene, .haft { padding: 120px 44px 70px var(--rand); }
  .szene--name { padding: 120px var(--rand) 32px; }
  .weiter { margin-top: 5vh; }
  .szene .inhalt { margin-left: 0; width: 100%; max-width: 620px; }
  .titel { letter-spacing: 0.3em; }
  .titel--gross { letter-spacing: 0.34em; margin-right: -0.34em; }
  .lebenslauf, .kontakt-raster { grid-template-columns: 1fr; }
  .partner { grid-template-columns: 1fr 1fr; row-gap: 34px; }
  .partner li:nth-child(n+3)::after { content: ""; position: absolute; left: 0; right: -12px; top: -20px; height: 1px; background: var(--linie); }
  .fuss { position: static; margin-top: 60px; }
  .szene--kontakt { padding-bottom: 30px; justify-content: flex-start; }

  /* Expertise: Tafeln untereinander statt angeheftet */
  .szene--expertise { height: auto; padding: 0; }
  .haft { position: static; height: auto; min-height: 0; }
  .schritte, .schrittmarke { display: none; }
  .tafeln { display: block; }
  .tafel { padding: 40px 0 26px; border-bottom: 1px solid var(--linie); }
  .tafel:last-child { border-bottom: 0; }
  .ziffer { top: 12px; font-size: 92px; }
  .punkte { columns: 1; }
  .js .da .tafel { opacity: 1; pointer-events: auto; }
  .js .da .tafel h3, .js .da .tafel .tafel-satz, .js .da .tafel .punkte li {
    opacity: 1; transform: none;
    transition: opacity 0.8s ease calc(0.2s + var(--p, 0) * 0.04s), transform 1s var(--weich) calc(0.2s + var(--p, 0) * 0.04s);
  }
  .js .da .tafel .ziffer { opacity: 1; transform: none; transition: opacity 1.2s ease 0.3s, transform 1.4s var(--weich) 0.3s; }

  .kopf { padding-top: 22px; align-items: center; }
  .kopf::before { height: 110px; }
  .hauptmenue ul { padding: 0; }
  .hauptmenue a { font-size: 14px; }

  /* Seitenmenü wird zur Punktleiste */
  .seitenmenue { padding-right: 10px; gap: 0; }
  .seitenmenue ol { gap: 2px; }
  .seitenmenue a { width: 28px; height: 28px; padding: 0; justify-content: center; }
  .seitenmenue a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .seitenmenue a::after { width: 5px; height: 5px; border-radius: 50%; transition: transform 0.5s var(--weich); }
  .seitenmenue a.aktiv::after { width: 5px; transform: scale(1.8); }
  .fortschritt { display: none; }
}

@media (max-height: 760px) and (min-width: 900px) {
  .szene, .haft { padding-top: 112px; padding-bottom: 40px; }
  .szene--expertise { padding: 0; }
  .marke-zeile { display: none; }
  .zeitleiste li { font-size: 14px; padding-bottom: 5px; }
  .person-kontakt { margin-bottom: 16px; }
  .linie { margin: 12px 0 18px; }
  .partner { margin: 24px 0 22px; }
  .tafeln { min-height: 280px; }
  .punkte li { font-size: 14.5px; padding-bottom: 6px; }
  .kontakt-raster { margin-top: 26px; }
  .szene--kontakt { padding-bottom: 90px; }
}

/* ---------- Weniger Bewegung ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .vorhang { display: none; }
  .weiter i { animation: none; }
  .js [data-ein], .js .titel .b, .js .satz .w > span, .js .tafel h3, .js .tafel .tafel-satz, .js .punkte li, .js .ziffer { transform: none !important; filter: none !important; }
  .js .da [data-ein], .js .da .titel .b { transition: opacity 0.6s ease !important; }
  .js .linie, .js .da .linie, .js .partner::before { transform: none; transition: none; }
}
