/* ============ Case Study Pages ============
   Eigenständige Seiten (projects/*.html) im Look der Landing Page:
   Creme-Hintergrund, Instrument Serif Headlines, Mono-Labels, Pill-Nav. */

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

:root {
  --paper: #f4f4f1;
  --card: #ffffff;
  --ink: #111;
  --body: #444;
  --muted: #777;
  --faint: #8a8778;
  --line: #ececea;
  --marker: #ffd233;
  --accent: #1a7cf7;   /* Mono-Labels / Kicker */
  --tile: #f6f6f7;     /* Hintergrund der Bild-Tiles (auch in den MP4s eingebrannt) */
}

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--marker); color: #111; }

/* ============ Navigation (wie Landing) ============ */
.case-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 24px;
  pointer-events: none;
}

.case-nav > * { pointer-events: auto; }

.nav-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #e5e3dc;
  background: #fff;
  color: #1a1a1a;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid #e5e3dc;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-pill a {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  padding: 9px 14px;
  border-radius: 999px;
  color: #1a1a1a;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}

.nav-pill a:hover { background: #f2f0ea; }
.nav-pill a.active { background: #f2f0ea; }

/* Icons und Mail-Knopf wie in landing.css (seit v44 dieselbe Nav auf allen Seiten) */
.nav-ico { width: 16px; height: 16px; flex-shrink: 0; color: #333; }
.nav-mail {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffd233;
  color: #1a1a1a;
  text-decoration: none;
  border: 1px solid #f0c010;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.15s;
}
.nav-mail:hover { transform: scale(1.08) rotate(-6deg); }
/* Am Desktop nur eine Klammer ums Markup, damit Logo · Pille · Mail in einer Reihe stehen */
.nav-right { display: contents; }

/* ============ Hero ============ */
.case-hero {
  max-width: 1060px;
  margin: 0 auto;
  padding: 56px 32px 40px;
  text-align: center;
}

.case-kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 22px;
}

/* Tag-Pillen im Hero: kleine Version der Landing-Skill-Pillen.
   Farben kommen aus css/palette.css (gemeinsam mit js/pills.js). */
.case-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #16161c;
  background: var(--c, #eee);
  box-shadow: 0 2px 8px rgba(20, 20, 30, 0.10);
}

.tag-pill.p-yellow { --c: var(--pill-yellow); }
.tag-pill.p-blue   { --c: var(--pill-blue); }
.tag-pill.p-orange { --c: var(--pill-orange); }
.tag-pill.p-purple { --c: var(--pill-purple); }
.tag-pill.p-green  { --c: var(--pill-green); }
.tag-pill.p-paper  { --c: var(--pill-paper); }
.tag-pill.p-lime   { --c: var(--pill-lime); }
.tag-pill.p-pink   { --c: var(--pill-pink); }
.tag-pill.p-sky    { --c: var(--pill-sky); }

.case-hero h1 {
  font-family: "Trovical", Georgia, serif;
  font-weight: 400;
  font-size: clamp(42px, 6.2vw, 80px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 22px;
}

.case-hero h1 em { font-style: italic; }

.hl {
  background: var(--marker);
  border-radius: 0.35em;
  padding: 0.02em 0.18em 0.06em;
}

.case-intro {
  max-width: 640px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
}

/* Zweispaltiger Lead unter der Headline: Intro links, Meta rechts */
.case-lead {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: clamp(30px, 5vw, 70px);
  max-width: 900px;
  margin: 42px auto 0;
  text-align: left;
}

.lead-label {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.lead-intro p {
  font-size: 15.5px;
  line-height: 1.68;
  color: var(--body);
  margin-bottom: 12px;
}

.lead-intro p strong { color: #111; }

.lead-meta {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.lead-meta .lead-label { margin-bottom: 7px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  background: #f4f4f1;
  border: 1px solid #e8e8e3;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
}

/* Tools als Produkt-Icons statt Textpillen. Herkunft der Dateien:
   assets/tools/README.txt */
.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.tools img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 6px;
  transition: transform 0.15s ease;
}

.tools a:hover img,
.tools img:hover { transform: scale(1.12); }

/* Meta-Zeile: Rolle / Zeitraum / Team / Deliverables */
.case-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.meta-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
  border: 1px solid #e2e2de;
  background: #fafaf8;
  border-radius: 16px;
  padding: 12px 18px;
  min-width: 150px;
}

.meta-chip .k {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.meta-chip .v { font-size: 13.5px; font-weight: 500; color: #222; }

/* ============ Inhalt: weiße Karte wie "Selected Work" ============ */
.case-body {
  position: relative;
  background: var(--card);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -14px 44px rgba(20, 20, 30, 0.10);
  padding: 64px 0 40px;
  margin-top: 34px;
}

.cs-wrap { max-width: 1060px; margin: 0 auto; padding: 0 32px; }
.cs-narrow { max-width: 720px; margin-left: auto; margin-right: auto; }

/* Section-Header mit Mono-Nummer */
.cs-section { padding: 34px 0 6px; }

.cs-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
}

.cs-section h2 {
  font-family: "Trovical", Georgia, serif;
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.15;
  margin-bottom: 18px;
}

.cs-section h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 28px 0 10px;
}

.cs-section p {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--body);
  margin-bottom: 14px;
  max-width: 720px;
}

.cs-section p strong { color: #111; }

.cs-section ul {
  margin: 0 0 16px 0;
  padding-left: 20px;
  max-width: 720px;
}

.cs-section li {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--body);
  margin-bottom: 6px;
}

/* ============ Zahlen / Ergebnisse ============ */
.stat-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 26px 0 12px;
}

.stat {
  border-radius: 20px;
  background: var(--tile);
  padding: 22px 24px 20px;
}

.stat .n {
  font-family: "Trovical", Georgia, serif;
  font-size: 40px;
  line-height: 1;
  color: #111;
}

.stat .l {
  display: block;
  margin-top: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  line-height: 1.5;
}

/* ============ Bilder & Videos ============ */
figure.fig { margin: 26px 0 34px; }

.fig-frame {
  border-radius: 24px;
  background: var(--tile);
  overflow: hidden;
}

.fig-frame img,
.fig-frame video {
  display: block;
  width: 100%;
  height: auto;
}

/* Transparente Produkt-Visuals (Intrexx) bekommen Innenabstand */
.fig-pad .fig-frame { padding: clamp(20px, 4vw, 48px); }

/* Fotos randlos */
.fig-photo .fig-frame { background: var(--tile); }

/* Hochformat-Fotos: zentriert und schmaler statt seitenfüllend */
.fig-narrow { max-width: 640px; margin-left: auto; margin-right: auto; }

/* Interaktive Embeds (iframes der HTML-Visuals):
   Höhe wird per postMessage aus dem iframe gesetzt */
.ix-embed {
  display: block;
  width: 100%;
  height: 480px;
  border: 0;
  background: transparent;
}

/* Standbild + Button gehören zur Handy-Ansicht und sind am Desktop aus.
   Zwei Klassen tief, damit die Regel `.fig-frame img { display: block }` nicht gewinnt. */
.fig-embed .emb-still,
.fig-embed .emb-open { display: none; }

@media (max-width: 700px) {
  /* Die Embeds sind innen auf 640px gebaut und lassen sich nicht quetschen.
     Auf dem Handy steht deshalb das ruhige Standbild im Lesefluss; wer will,
     öffnet das echte Embed über den Button als Vollbild-Ebene (.emb-sheet). */
  .fig-embed .ix-embed,
  .fig-embed .embed-badge { display: none; }
  .fig-embed .emb-still { display: block; width: 100%; height: auto; }
  .fig-embed .emb-open {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 14px;
    border: 0;
    cursor: pointer;
    background: #111;
    color: #fff;
    border-radius: 14px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .fig-embed .emb-open:active { background: var(--accent); }
}

/* ---- Vollbild-Ebene für ein interaktives Embed (nur Handy) ---- */
.emb-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  flex-direction: column;
  background: #fff;
}
.emb-sheet.is-open { display: flex; }
body.emb-sheet-open { overflow: hidden; }

.emb-sheet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 12px 14px;
  border-bottom: 1px solid #ececeb;
}
.emb-sheet-bar strong {
  font-size: 13px;
  font-weight: 600;
  color: #111;
}
.emb-sheet-bar button {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: #f2f2f0;
  color: #555;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.emb-sheet-body {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--tile);
}
.emb-sheet-body iframe {
  display: block;
  width: 640px;
  min-width: 640px;
  height: 100%;
  min-height: 480px;
  border: 0;
  background: transparent;
}
.emb-sheet-hint {
  flex-shrink: 0;
  padding: 10px 14px;
  border-top: 1px solid #ececeb;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: #9a9a94;
  text-align: center;
}

/* Badge auf interaktiven Embeds: "hier darfst du klicken" */
.fig-embed .fig-frame { position: relative; }

.embed-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #111;
  color: #fff;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 14px;
  border-radius: 999px;
  pointer-events: none;
  box-shadow: 0 3px 10px rgba(20, 20, 30, 0.18);
  animation: badgeNudge 2.6s ease-in-out infinite;
}

.embed-badge svg { flex-shrink: 0; }

.fig-embed .fig-frame:hover .embed-badge {
  background: var(--accent);
  animation: none;
}

@keyframes badgeNudge {
  0%, 100% { transform: none; }
  50% { transform: scale(1.06) rotate(-1.5deg); }
}

@media (prefers-reduced-motion: reduce) {
  .embed-badge { animation: none; }
}

figcaption {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: #9a9a94;
  margin-top: 12px;
  padding: 0 4px;
  text-align: center;
}

.fig-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: stretch;
}

.fig-row figure { display: flex; flex-direction: column; }
.fig-row .fig-frame { flex: 1; display: flex; align-items: center; justify-content: center; }
.fig-row .fig-frame img, .fig-row .fig-frame video { width: 100%; height: auto; }
.fig-row.fig-row-photos .fig-frame img { height: 100%; object-fit: cover; }

.fig-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ============ Zitat / Insight ============ */
/* Spezifischer als .cs-section p, sonst gewinnt dort die Fließtextgröße 15,5px */
.cs-quote,
.cs-section p.cs-quote {
  max-width: 820px;
  margin: 38px auto;
  text-align: center;
  font-family: "Trovical", Georgia, serif;
  font-size: clamp(28px, 3.4vw, 40px); /* gleiche Größe wie .cs-section h2 */
  line-height: 1.2;
  color: #111;
}

/* ============ Footer: nächstes Projekt ============ */
.case-footer { padding: 40px 0 70px; }
.footer-legal { display: block; margin-top: 14px; font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: 0.05em; color: #8a8a85; }
.footer-legal a { color: inherit; text-decoration: none; }
.footer-legal a:hover { color: #111; }

.next-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fafaf8;
  padding: 26px 30px;
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s;
}

.next-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(20, 20, 30, 0.08);
}

.next-card .k {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  display: block;
  margin-bottom: 6px;
}

.next-card .t {
  font-family: "Trovical", Georgia, serif;
  font-size: 28px;
  color: #111;
}

.next-card .arrow { font-size: 26px; color: #111; }

.footer-back {
  display: block;
  text-align: center;
  margin-top: 34px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--faint);
  text-decoration: underline dotted rgba(20,20,30,0.4);
  text-underline-offset: 0.25em;
}

.footer-back:hover { color: #111; }

/* ============ Responsive ============ */
@media (max-width: 760px) {
  .case-hero { padding: 40px 20px 30px; }
  .case-lead { grid-template-columns: 1fr; gap: 26px; }
  .cs-wrap { padding: 0 20px; }
  .fig-row, .fig-row-3 { grid-template-columns: 1fr; }
  .case-nav .nav-pill a { padding: 9px 11px; font-size: 12.5px; }
  .next-card .t { font-size: 22px; }
}

/* Grundzustand: Kein Burger. Er erscheint erst unter 620px. */
.case-nav .nav-burger { display: none; }

/* ---- Handy: Burger-Menü ----
   Seit v44 hat die Pille nur noch drei Einträge (Work · About · CV) plus den
   Mail-Knopf; die Karte unter der Leiste bleibt, damit es sich wie auf der
   Landing bedient. Ursprünglich: mit fünf Einträgen passte die Pille bei 375px
   nicht mehr neben das Logo — nachgemessen 362px nötig, 327px vorhanden. Sie wird deshalb zur
   aufklappbaren Karte unter der Leiste, genau wie auf der Landing Page
   (dort in landing.css / js/peel.js). Auf/Zu macht js/nav.js.

   Zweizeiliger Umbruch war die Lösung in v35 und ist wieder raus: Er ist zwar
   vollständig sichtbar, macht die Leiste aber doppelt so hoch und sieht auf
   den Case Studies wie ein Versehen aus. */
@media (max-width: 620px) {
  .case-nav {
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
  }
  .case-nav .nav-right { display: flex; align-items: center; gap: 10px; }

  .case-nav .nav-burger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid #e5e3dc;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    cursor: pointer;
  }
  .case-nav .nav-burger span {
    display: block;
    width: 17px;
    height: 1.7px;
    border-radius: 2px;
    background: #1a1a1a;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .case-nav .nav-burger span + span { margin-top: 4.5px; }
  /* Offen: aus den drei Strichen wird ein Kreuz */
  .case-nav.is-open .nav-burger span:nth-child(1) { transform: translateY(6.2px) rotate(45deg); }
  .case-nav.is-open .nav-burger span:nth-child(2) { opacity: 0; }
  .case-nav.is-open .nav-burger span:nth-child(3) { transform: translateY(-6.2px) rotate(-45deg); }

  /* Die Pille wird zur Karte unter der Leiste */
  .case-nav .nav-pill {
    position: absolute;
    top: 62px;
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    border-radius: 20px;
    box-shadow: 0 12px 34px rgba(20, 20, 30, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  }
  .case-nav.is-open .nav-pill {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .case-nav .nav-pill a {
    padding: 13px 14px;
    border-radius: 14px;
    font-size: 15px;
  }
}
