/* ============================================================
   fresh & korrekt — Portfolio
   Farben und Schriften zentral hier oben anpassen.
   ============================================================ */

:root {
  --bg: #F4F3EE;            /* Off-White Hintergrund */
  --dark: #111111;          /* Sidebar, Buttons, Text */
  --text-muted: #6F6F6A;    /* Beschreibungen, graue Texte (WCAG-AA-konform, 4,55:1) */
  --card-bg: #EEEEEA;       /* Hintergrund der Projekt-Kacheln */
  --sidebar-text: #C9C9C4;  /* heller Text auf dunkler Sidebar */
  --neon-yellow: #E8F000;   /* das x im Logo */
  --neon-green: #5CE39B;    /* "Hit me up"-Fläche */
  --card-radius: 20px;

  --sidebar-width: 300px;
  --caption-width: 300px;
}

/* ---------- Schriften ----------
   DSGVO: Fonts lokal hosten! Die .woff2-Dateien von
   https://gwfh.mranftl.com (google-webfonts-helper) herunterladen,
   in den Ordner fonts/ legen — Dateinamen ggf. anpassen.
--------------------------------- */

@font-face {
  font-family: 'DM Sans';
  src: url('fonts/dm-sans-v17-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('fonts/dm-sans-v17-latin-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('fonts/dm-sans-v17-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Basis ---------- */

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--dark);
  font-size: 16px;
  line-height: 1.6;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--dark);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Nur für Screenreader sichtbar (visuell versteckt, aber vorlesbar) */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* „Zum Inhalt springen" — erscheint nur bei Tastatur-Navigation */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--dark);
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

/* Nutzer:innen mit „Bewegung reduzieren" bekommen keine Animationen */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ---------- Sidebar ---------- */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  background: var(--dark);
  color: var(--sidebar-text);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 10;
}

.logo {
  color: #FFFFFF;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.06em;
  margin-bottom: 48px;
}

.logo-x { color: var(--neon-yellow); }

.intro { font-size: 16px; line-height: 1.75; }

.intro strong {
  color: #FFFFFF;
  font-weight: 500;
  display: block;
}

.what-i-do-title {
  color: #FFFFFF;
  font-weight: 500;
  line-height: 1.75;
}

.what-i-do ul { list-style: none; }

.what-i-do li { font-size: 16px; line-height: 1.75; }

/* ---------- Badge (dreht sich per JS) ---------- */

.badge {
  position: fixed;
  top: 32px;
  right: 40px;
  width: 72px;
  height: 72px;
  z-index: 20;
  will-change: transform;
}

/* ---------- Projekte ---------- */

.projects {
  margin-left: var(--sidebar-width);
  padding: 90px 40px 24px;   /* 40px Abstand zum schwarzen Balken, unten schließt die letzte Kachel mit den Impressum-Links ab */
  display: flex;
  flex-direction: column;
  gap: 30px;                 /* vertikaler Abstand zwischen den Kacheln */
  /* Kachel maximal 667px breit (Figma-Maß): 667 + 40 + Beschreibungsspalte + 2×40 Rand */
  max-width: calc(667px + 40px + var(--caption-width) + 80px);
}

.project {
  display: grid;
  grid-template-columns: 1fr var(--caption-width);
  gap: 40px;                 /* Abstand Kachel -> Trennlinie */
  align-items: start;
}

/* ---------- Kacheln ----------
   Jede Kachel hat das Seitenverhältnis 667:512 aus dem Figma-Entwurf.
   Ein Bild OHNE Klasse liegt automatisch mittig in der Kachel —
   Größe direkt im HTML per style="width: ...%".
   Bilder MIT class="sheet" werden über left/top/width in Prozent frei
   platziert (Werte unten je Projekt). Reihenfolge im HTML = Stapel-
   reihenfolge: das letzte Bild liegt oben.
------------------------------- */

.tile {
  position: relative;
  aspect-ratio: 667 / 512;
  background: var(--card-bg);
  border-radius: var(--card-radius);
  overflow: hidden;
}

.tile img {
  position: absolute;
  inset: 0;        /* zusammen mit margin: auto -> zentriert */
  margin: auto;
  width: 60%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 6px 22px rgba(17, 17, 17, 0.16);
  transition: opacity 0.15s ease;
}

.tile .sheet {
  inset: auto;
  margin: 0;
}

/* respekt*land: zwei Flyer-Seiten versetzt übereinander */
.tile-respektland .sheet  { width: 82.5%; }
.tile-respektland .vorne  { left: 4.6%;  top: 7.9%; }
.tile-respektland .hinten { left: 12.9%; top: 16.1%; }

/* Kaffeeschleuder: Desktop + Smartphone nebeneinander */
.tile-kaffeeschleuder .desktop { width: 62.5%; left: 7.1%;  top: 21.8%; }
.tile-kaffeeschleuder .phone   { width: 19.8%; left: 73.1%; top: 22%; }

/* Mahagoni Booklet: drei Programmseiten, die mittlere obenauf */
.tile-booklet .sheet   { width: 36.7%; }
.tile-booklet .seite-1 { left: 4.8%;  top: 5.2%; }
.tile-booklet .seite-3 { left: 58.5%; top: 22.8%; }
.tile-booklet .seite-2 { left: 31.6%; top: 26.9%; }

/* LOCI: zwei Flyer-Seiten versetzt übereinander */
.tile-loci .sheet  { width: 76.8%; }
.tile-loci .vorne  { left: 7.9%;  top: 10.4%; }
.tile-loci .hinten { left: 15.3%; top: 18.9%; }

/* eisblüte: iPad + Handy, gleiche Höhe, als Gruppe mittig zentriert */
.tile-eisbluete .tile-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4%;
}
.tile-eisbluete .sheet {
  position: static;
  width: auto;
  height: 56%;
  margin: 0;
}

/* ---------- Verlinkte Projekte (Klick auf Bild ODER Beschriftung) ---------- */
.tile-link {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: inherit;   /* fängt Klicks auf der ganzen Kachel ab */
}
.caption-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.ext-arrow { color: var(--text-muted); font-size: 0.9em; }

/* dezenter Hinweis beim Überfahren, dass die Kachel klickbar ist */
.project-linked:hover .caption h2 { text-decoration: underline; text-underline-offset: 3px; }
.project-linked:hover .tile img { opacity: 0.93; }

.caption {
  border-left: 1px solid #D8D7D0;
  padding-left: 32px;
  position: sticky;
  top: 90px; /* Beschriftung wandert beim Scrollen mit, solange ihr Projekt sichtbar ist */
}

.caption h2 {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

.caption p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 24ch;
}

/* ---------- Kontakt-Buttons in der Seitenleiste ---------- */

.contact-buttons {
  display: flex;
  gap: 8px;
  margin-top: 28px;
}

.btn {
  background: var(--neon-green);
  color: var(--dark);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 999px;
  transition: transform 0.15s ease;
}

.btn:hover { transform: scale(1.05); }

/* ---------- Impressum/Datenschutz, scrollen unten mit ---------- */

.legal {
  position: fixed;
  right: 40px;
  bottom: 24px;
  z-index: 20;
  display: flex;
  gap: 16px;
}

.legal a {
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}

.legal a:hover { text-decoration: underline; }

/* ---------- Schmale Desktop-Fenster / Tablet quer ---------- */

@media (max-width: 1200px) and (min-width: 861px) {
  :root { --caption-width: 200px; }

  .projects { padding: 84px 40px 24px; }

  .caption { padding-left: 24px; }

  /* Badge kleiner und höher, damit es über der ersten Beschreibung
     endet und keinen Text verdeckt */
  .badge {
    width: 52px;
    height: 52px;
    top: 14px;
    right: 24px;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 860px) {

  /* Sidebar wird zum Header */
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 28px 24px;
    gap: 28px;
  }

  .logo { margin-bottom: 24px; }

  .projects {
    margin-left: 0;
    padding: 48px 24px 72px;   /* unten Platz, damit die letzte Kachel vor den Impressum-Links endet */
    gap: 30px;
  }

  /* Beschriftung rutscht unters Bild, zweizeilig wie auf Desktop */
  .project {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .caption {
    border-left: none;
    padding-left: 0;
    position: static;
  }

  .badge {
    width: 52px;
    height: 52px;
    top: 20px;
    right: 20px;
  }

  /* Impressum/Datenschutz mittig statt rechtsbündig */
  .legal {
    left: 0;
    right: 0;
    bottom: 16px;
    justify-content: center;
  }
}

/* ---------- Unterseiten (Impressum / Datenschutz) ---------- */

.legal-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 64px 24px 120px;
}

.legal-page .logo { color: var(--dark); }
.legal-page .logo a { text-decoration: none; }

.legal-page h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 48px 0 24px;
}

.legal-page h2 {
  font-size: 18px;
  font-weight: 500;
  margin: 32px 0 8px;
}

.legal-page h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 24px 0 6px;
}

.legal-page h4 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
  margin: 16px 0 4px;
}

.legal-page p { margin-bottom: 12px; }

.legal-page ul {
  margin: 0 0 12px;
  padding-left: 22px;
}

.legal-page li { margin-bottom: 6px; }
