/* ===== Einstellungen ===== */
:root {
  --rand: 40px;       /* Abstand aller Elemente zum Rand */
  --menu-spalte: 320px; /* Bild beginnt hier: 40 px Rand + Menü + 80 px Abstand (iPad & Desktop) */
  --hintergrund: #1a1a1a;   /* 90 % Schwarz */
  --text: #fff;
  /* Figma-Rahmen im dunklen Modus: weiße Linie, Anfasser invertiert zum hellen Modus */
  --figma: #fff;            /* Linie */
  --anfasser-fuellung: #000;
  --anfasser-rand: #fff;
  --marker: #3541eb;  /* Farbe des Hover-Markers */
  --flaeche: #000;          /* Inhaltsfläche im Rahmen (z. B. Kontakt) */
  --flaeche-text: #fff;
}

/* Heller Modus: Hintergrund 10 % Schwarz, alles andere dunkel */
html[data-modus="hell"] {
  --hintergrund: #e6e6e6;   /* 10 % Schwarz */
  --text: #000;
  --figma: #000;
  --anfasser-fuellung: #fff;
  --anfasser-rand: #000;
  --flaeche: #fff;
  --flaeche-text: #000;
}

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

html, body { margin: 0; }

body {
  background: var(--hintergrund);
  color: var(--text);
  font-family: "Zalando Sans SemiExpanded", "Helvetica Neue", Arial, sans-serif;
}

/* ===== Startbereich: alles mit 40 px Abstand zum Rand ===== */
.hero {
  position: relative;
  height: 100vh;
}

/* Menü links, untereinander, vertikal mittig zur Bildhöhe */
.menu {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: calc(var(--rand) - 20px);   /* Wort beginnt bei 40 px (20 px Innenabstand ausgeglichen) */
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;            /* + 2 × 10 px Innenabstand = 40 px zwischen den Wörtern */
  font-size: 1.75rem;
  font-weight: 900;     /* Black */
  line-height: 1.15;
}

.menu a {
  position: relative;
  padding: 10px 20px;   /* Luft im Hover-Rechteck */
  color: inherit;
  text-decoration: none;
}

/* Kleine Links unten links: Sprache, Impressum, Datenschutz */
.meta {
  position: absolute;
  z-index: 2;
  bottom: var(--rand);
  left: calc(var(--rand) - 8px);   /* Wort beginnt bei 40 px (8 px Innenabstand ausgeglichen) */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  font-size: 0.875rem;
  font-weight: 400;     /* Regular */
  line-height: 1.3;
}

.meta a,
.meta__lang,
.meta__mode {
  position: relative;
  padding: 3px 8px;
  color: inherit;
  text-decoration: none;
  font: inherit;
  background-color: transparent;
  border: 0;
  cursor: pointer;
}

/* Hell/Dunkel-Icon über „Sprache“ */
.meta__mode {
  display: flex;
  margin-bottom: 4px;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.icon--mond { fill: currentColor; stroke: none; }

/* Dunkel (Standard): Sonne zeigen. Hell: Mond zeigen. */
.icon--mond { display: none; }
html[data-modus="hell"] .icon--sonne { display: none; }
html[data-modus="hell"] .icon--mond  { display: block; }

body { transition: background-color 0.3s ease, color 0.3s ease; }

/* Bild rechts: füllt die Fläche neben dem Menü – Breite variabel,
   40 px Abstand oben, rechts und unten */
.hero__image {
  position: absolute;
  top: var(--rand);
  right: var(--rand);
  bottom: var(--rand);
  left: var(--menu-spalte);
  margin: 0;
  outline: 1px solid var(--figma);   /* Auswahllinie wie in Figma */
}

/* Anfasser zum Skalieren: kleine weiße Quadrate mit blauem Rand, mittig auf den Ecken */
.handle {
  position: absolute;
  z-index: 1;
  width: 8px;
  height: 8px;
  background: var(--anfasser-fuellung);
  border: 1px solid var(--anfasser-rand);
}

.handle--tl { top: -4px;    left: -4px; }
.handle--tr { top: -4px;    right: -4px; }
.handle--bl { bottom: -4px; left: -4px; }
.handle--br { bottom: -4px; right: -4px; }

/* Seiten im Rahmen: liegen übereinander, immer nur eine sichtbar */
.seite {
  position: absolute;
  inset: 0;
}

.seite[hidden] { display: none; }

/* Inhaltsseiten: hell = weiße Fläche, dunkel = schwarze Fläche */
.seite--inhalt {
  background: var(--flaeche);
  color: var(--flaeche-text);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow: auto;
}

/* ===== Kontaktseite ===== */
.kontakt {
  display: flex;
  align-items: center;
  padding: clamp(24px, 5vw, 80px);
}

.kontakt__inhalt {
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}

.kontakt__foto {
  position: relative;
  flex-shrink: 0;
  width: clamp(180px, 24vw, 420px);
  aspect-ratio: 1 / 1;
  --anfasser-fuellung: var(--flaeche);
  --anfasser-rand: var(--flaeche-text);
}

/* Der eigentliche Figma-Rahmen: liegt mittig und kann von 0 auf volle Größe wachsen */
.kontakt__rahmen {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  outline: 1px solid var(--flaeche-text);   /* Figma-Rahmen in Kontrastfarbe zur Fläche */
}

.kontakt__rahmen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kontakt__name {
  margin: 0 0 24px;
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  font-weight: 900;     /* Black */
  line-height: 1;
}

.kontakt__liste,
.social {
  margin: 0;
  padding: 0;
  list-style: none;
}

.kontakt__liste li + li { margin-top: 10px; }

.kontakt__liste a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-size: 1.125rem;
}

/* Mail & Telefon: gleicher blauer Marker wie im Menü, baut sich beim Hovern auf */
.kontakt__liste span {
  padding: 2px 4px;
  margin-left: -4px;
  background-image: linear-gradient(to right, transparent, var(--marker));
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 0 1.2em;
  transition: background-size 0.35s cubic-bezier(.3, .7, .2, 1);
}

.kontakt__liste a:hover span,
.kontakt__liste a:focus-visible span { background-size: 100% 1.2em; }

.kontakt__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

/* Social Icons (App-Icons): schwarz-weiß, beim Hovern in Farbe */
.social {
  display: flex;
  gap: 16px;
  margin-top: 28px;
}

.social a { display: block; }

.social img {
  display: block;
  width: 44px;
  height: 44px;
  filter: grayscale(1);
  transition: filter 0.25s ease;
}

.social a:hover img,
.social a:focus-visible img {
  filter: none;
}

@media (max-width: 767px) {
  .kontakt__inhalt { flex-direction: column; align-items: flex-start; }
}

/* Diashow: Bilder liegen übereinander und blenden weich ineinander */
.dia {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.dia.is-visible { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .dia { transition: none; }
}

/* ===== Hover: Markerbalken in Blau, baut sich von links nach rechts im Wort auf =====
   --ueberstand: wie weit der Balken links und rechts über das Wort hinausragt */
.menu a,
.meta a,
.meta__lang,
.meta__mode {
  --innen: 8px;          /* Innenabstand links/rechts des Elements */
  --ueberstand: 3px;
  --balken: 1.15em;      /* Höhe des Rechtecks: volle Zeilenhöhe des Wortes */
  background-image: linear-gradient(to right, transparent, var(--marker));   /* links 0 %, rechts 100 % Deckkraft */
  background-repeat: no-repeat;
  background-position: left calc(var(--innen) - var(--ueberstand)) center;
  background-size: 0 var(--balken);
  transition: background-size 0.35s cubic-bezier(.3, .7, .2, 1);
}

.menu a {
  --innen: 20px;
  --ueberstand: 6px;
}

.menu a:hover, .menu a:focus-visible, .menu a.is-active,
.meta a:hover, .meta a:focus-visible, .meta a.is-active,
.meta__lang:hover, .meta__lang:focus-visible,
.meta__mode:hover, .meta__mode:focus-visible {
  background-size: calc(100% - 2 * (var(--innen) - var(--ueberstand))) var(--balken);
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .menu a, .meta a, .meta__lang, .meta__mode { transition: none; }
}

/* ===== Handy (unter 768 px): alles untereinander, Bild füllt die Breite ===== */
@media (max-width: 767px) {
  .hero {
    display: flex;
    flex-direction: column;
    gap: var(--rand);
    height: 100svh;
    padding: var(--rand);
  }

  .menu {
    position: static;
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
    margin-left: -20px;
    font-size: clamp(1rem, 4vw, 1.5rem);
  }

  /* Bild nimmt die volle Breite und den restlichen Platz in der Höhe – kein festes Format */
  .hero__image {
    position: relative;
    inset: auto;
    flex: 1;
    min-height: 0;
    width: 100%;
    height: auto;
  }

  .meta {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-left: -8px;
  }
}

@media (max-width: 600px) {
  :root { --rand: 20px; }
}
