/* pepperle.de — statische Unterseiten (Kategorien, Impressum, Datenschutz).
   Bewusst getrennt von style.css: die Startseite ist eine feststehende Bühne
   ohne Scrollen, diese Seiten sind normale, scrollbare Dokumente.
   Die Hintergrundfarben stehen gemeinsam mit style.css in base.css. */

:root {
  --ink: #eef3f8;
  --ink-dim: rgba(238, 243, 248, 0.62);
  --ink-faint: rgba(238, 243, 248, 0.4);
  --red: #ea4f43;
  --line: rgba(238, 243, 248, 0.14);
  --panel: linear-gradient(160deg, #073c68 0%, #042a4c 100%);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg-deep);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: 'Instrument Sans', Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Derselbe Hintergrund wie auf der Bühne (style.css): Verlauf, weiches Licht
   und Vignette, feststehend hinter dem scrollenden Dokument. Bewusst ein
   Pseudo-Element statt background-attachment: fixed — das ruckelt auf iOS. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    var(--bg-vignette),
    var(--bg-glow),
    var(--bg-grad);
}

a { color: var(--red); text-decoration: none; }
a:hover { color: #f5837a; }

button { -webkit-appearance: none; appearance: none; font: inherit; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
  background: var(--red);
  color: #fff;
}
.skip:focus { left: 12px; top: 12px; color: #fff; }

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

.pg-head {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px clamp(20px, 4vw, 56px);
  background: rgba(2, 25, 47, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.pg-logo {
  display: block;
  width: min(46vw, 210px);
  flex: none;
}
.pg-logo svg { display: block; width: 100%; height: auto; overflow: visible; }

.pg-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pg-lang,
.pg-contact {
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(238, 243, 248, 0.28);
  background: rgba(238, 243, 248, 0.04);
  color: rgba(238, 243, 248, 0.8);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.pg-lang:hover,
.pg-contact:hover {
  border-color: rgba(234, 79, 67, 0.9);
  color: #fff;
}
.pg-contact {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.pg-contact:hover { background: #f5645a; border-color: #f5645a; color: #fff; }

/* ---------- Kategorienavigation ---------- */

.pg-cats {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 20px clamp(20px, 4vw, 56px) 0;
}

.pg-more {
  display: none;
  cursor: pointer;
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(238, 243, 248, 0.28);
  background: rgba(238, 243, 248, 0.04);
  color: rgba(238, 243, 248, 0.78);
  transition: border-color 0.18s, color 0.18s;
}
.pg-more:hover { border-color: rgba(234, 79, 67, 0.85); color: #fff; }

.pg-cats a {
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(238, 243, 248, 0.2);
  color: rgba(238, 243, 248, 0.72);
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.pg-cats a:hover {
  border-color: rgba(234, 79, 67, 0.8);
  color: #fff;
}
.pg-cats a.current {
  border-color: rgba(234, 79, 67, 0.9);
  background: rgba(234, 79, 67, 0.16);
  color: #fff;
}

/* ---------- Inhalt ---------- */

main {
  max-width: 1560px;
  margin: 0 auto;
  padding: clamp(34px, 5vw, 62px) clamp(20px, 4vw, 56px) 0;
}

.pg-crumb {
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 14px;
}
.pg-crumb a { color: var(--ink-dim); }
.pg-crumb a:hover { color: var(--red); }

h1 {
  margin: 0 0 18px;
  font-size: clamp(30px, 5.2vw, 50px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
  text-wrap: balance;
}

.pg-intro {
  max-width: 62ch;
  margin: 0 0 22px;
}
.pg-intro p {
  margin: 0 0 14px;
  color: rgba(238, 243, 248, 0.86);
  text-wrap: pretty;
}

.pg-count {
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

/* ---------- Bildraster ----------
   Dichtes Raster mit Fließ-Layout (grid-auto-flow: dense) statt starrer Spalten:
   die vorderen Plätze der Alle-Seite (.work-feat) bekommen doppelte Breite/Höhe,
   der Rest füllt sich dicht darum. Jede Kachel blendet beim Scrollen ins Bild
   sanft ein (siehe .work-reveal, ausgelöst per IntersectionObserver in page.js). */

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  grid-auto-rows: 176px;
  grid-auto-flow: dense;
  gap: 22px;
}

.work-feat { grid-column: span 2; grid-row: span 2; }

.work {
  height: 100%;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1), transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
.work.work-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .work { opacity: 1; transform: none; transition: none; }
}

.work-btn {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: zoom-in;
  text-align: left;
}

.work-btn picture {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: rgba(2, 26, 50, 0.5);
  box-shadow: 0 46px 92px rgba(0, 9, 20, 0.68), 0 16px 32px rgba(0, 9, 20, 0.48);
}
.work-feat .work-btn picture {
  box-shadow: 0 90px 160px rgba(0, 9, 20, 0.85), 0 34px 66px rgba(0, 9, 20, 0.6);
}

.work-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-reduced-motion: reduce) {
  .work-btn img { transition: none; }
}
.work-btn:hover img { transform: scale(1.055); }

.work-cap {
  display: block;
  margin-top: 9px;
  font-size: 13.5px;
  color: var(--ink-dim);
  transition: color 0.18s;
}
.work-btn:hover .work-cap { color: var(--ink); }

/* Rang-Abzeichen auf der Alle-Seite für die meistgeklickten Werke */
.work-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  background: rgba(1, 17, 33, 0.66);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(238, 243, 248, 0.82);
}
.work-badge b { color: var(--red); font-weight: 400; }

.grid-more {
  display: flex;
  justify-content: center;
  padding: clamp(36px, 5vw, 64px) 0 0;
}
.grid-more button {
  cursor: pointer;
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid rgba(238, 243, 248, 0.28);
  background: rgba(238, 243, 248, 0.04);
  color: rgba(238, 243, 248, 0.78);
  transition: border-color 0.18s, color 0.18s;
}
.grid-more button:hover { border-color: rgba(234, 79, 67, 0.85); color: #fff; }

/* ---------- Fuß ---------- */

.pg-foot {
  max-width: 1560px;
  margin: 54px auto 0;
  padding: 26px clamp(20px, 4vw, 56px) 54px;
  border-top: 1px solid var(--line);
}

.pg-foot-name {
  margin: 0 0 18px;
  font-size: 15px;
  color: rgba(238, 243, 248, 0.8);
}

.pg-foot-nav,
.pg-foot-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.pg-foot-nav a {
  font-size: 14px;
  color: var(--ink-dim);
}
.pg-foot-nav a:hover { color: var(--red); }

.pg-foot-legal {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.pg-foot-legal a {
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.pg-foot-legal a:hover { color: var(--red); }

/* ---------- Lightbox (Verhalten wie auf der Startseite) ---------- */

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(1, 12, 25, 0.93);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
  animation: lbFade 0.24s ease;
}
#lightbox[hidden] { display: none; }

@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lbZoom { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: scale(1); } }

.lb-inner {
  max-width: min(94vw, 1500px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: lbZoom 0.3s cubic-bezier(0.2, 0.9, 0.25, 1);
}
@media (prefers-reduced-motion: reduce) {
  #lightbox, .lb-inner { animation: none; }
}

.lb-inner img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  display: block;
  box-shadow: 0 60px 140px rgba(0, 8, 18, 0.8);
}

.lb-title {
  margin: 0;
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(238, 243, 248, 0.72);
  text-align: center;
}

.lb-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(238, 243, 248, 0.3);
  background: rgba(238, 243, 248, 0.06);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.lb-close:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- Kontaktformular (gleiche Optik wie auf der Startseite,
   aber "position: fixed" statt "absolute" — diese Seiten scrollen) ---------- */

#contactModal {
  position: fixed;
  inset: 0;
  z-index: 61;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(1, 17, 33, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: lbFade 0.35s ease both;
}
#contactModal[hidden] { display: none; }
.contact-card {
  position: relative;
  width: min(92vw, 520px);
  box-sizing: border-box;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 60px 140px rgba(0, 8, 18, 0.7);
  padding: 34px 34px 30px;
}
.contact-card h2 { margin: 0 0 6px; font-size: 26px; font-weight: 500; letter-spacing: -0.01em; }
.form-note {
  margin: 0 0 24px;
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.contact-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: 0;
  cursor: pointer;
  color: rgba(238, 243, 248, 0.55);
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 16px;
  line-height: 1;
  padding: 8px;
}
.contact-close:hover { color: #fff; }
#contactForm { display: flex; flex-direction: column; gap: 14px; }
#contactForm input,
#contactForm textarea {
  background: rgba(1, 17, 33, 0.45);
  border: 1px solid rgba(238, 243, 248, 0.18);
  color: var(--ink);
  padding: 13px 14px;
  font-family: 'Instrument Sans', Helvetica, Arial, sans-serif;
  font-size: 15px;
  outline: none;
  border-radius: 0;
}
#contactForm textarea { resize: none; }
#contactForm input:focus,
#contactForm textarea:focus { border-color: rgba(234, 79, 67, 0.8); }
#contactForm button {
  margin-top: 4px;
  cursor: pointer;
  align-self: flex-start;
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 13px 24px;
  border: 1px solid rgba(234, 79, 67, 0.85);
  border-radius: 999px;
  background: rgba(234, 79, 67, 0.9);
  color: #fff;
  transition: background 0.3s ease;
}
#contactForm button:hover { background: var(--red); }
.thanks {
  margin: 0;
  padding: 26px 0 8px;
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--red);
}
.thanks[hidden] { display: none; }
#contactForm[hidden] { display: none; }

/* ---------- Kategorien-Blatt (mobil) ----------
   Öffnet sich über den "Weitere Kategorien"-Knopf und zeigt alle Kategorien
   als Liste — Pendant zur Startseite, hier ebenfalls "position: fixed". */

#sheetModal {
  position: fixed;
  inset: 0;
  z-index: 62;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8vh 22px;
  background: rgba(1, 17, 33, 0.8);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  animation: lbFade 0.3s ease both;
}
#sheetModal[hidden] { display: none; }
.sheet-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  max-height: 84vh;
  overflow-y: auto;
}
.sheet-inner a {
  display: block;
  box-sizing: border-box;
  width: 100%;
  text-align: center;
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 16px 18px;
  border-radius: 999px;
  border: 1px solid rgba(238, 243, 248, 0.28);
  color: rgba(238, 243, 248, 0.78);
}
.sheet-inner a.current {
  border-color: rgba(234, 79, 67, 0.9);
  background: rgba(234, 79, 67, 0.16);
  color: #fff;
}

/* ---------- Rechtsseiten ---------- */

.legal-body {
  max-width: 68ch;
}
.legal-body h2 {
  margin: 34px 0 10px;
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 400;
}
.legal-body h3 {
  margin: 22px 0 6px;
  font-size: 17px;
  font-weight: 600;
}
.legal-body p {
  margin: 0 0 12px;
  color: rgba(238, 243, 248, 0.86);
  text-wrap: pretty;
}

/* ---------- 404 ---------- */

.pg-404 { padding-top: 40px; }
.pg-404 .pg-foot-nav { margin: 22px 0; }
.pg-back {
  display: inline-block;
  margin-top: 12px;
  font-family: 'IBM Plex Mono', Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
}
.pg-back:hover { background: #f5645a; color: #fff; }

/* ---------- Schmale Displays ---------- */

@media (max-width: 760px) {
  body { font-size: 16px; }
  .pg-head { gap: 12px; }
  .pg-logo { width: min(52vw, 175px); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: 128px; gap: 14px; }
  .lb-close { top: 12px; right: 12px; }

  /* Kategorienavigation: nur "Alle" + aktuelle Kategorie zeigen, der Rest
     zieht in das Blatt, das "Weitere Kategorien" öffnet (siehe js/page.js). */
  .pg-cats a:not([href="alle.html"]):not(.current) { display: none; }
  .pg-more { display: inline-block; }
}
