/* Portfolio v2 — Editorial, monochrom, klar navigierbar */
:root {
  --ink: #111111;
  --muted: #6b6b6b;
  --faint: #a3a3a3;
  --line: #e8e8e8;
  --surface: #f5f5f4;
  --bg: #ffffff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  font-size: 16px;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: #fff; }

/* ---------- Kopf / Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 76rem; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 1.5rem;
}
.brand { font-family: 'Space Grotesk', sans-serif; font-size: 1.05rem; font-weight: 700; letter-spacing: -0.03em; }
.nav-links { display: flex; gap: 1.8rem; font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; }
.nav-links a { color: var(--muted); padding: 0.3rem 0; border-bottom: 1.5px solid transparent; transition: color .2s, border-color .2s; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); border-color: var(--ink); }
@media (max-width: 640px) {
  .nav-inner { padding: 0.8rem 1.1rem; }
  .nav-links { gap: 0.4rem; font-size: 0.7rem; letter-spacing: 0.08em; }
  .nav-links a { padding: 0.6rem 0.5rem; } /* Touch-Ziel >= 44px */
}



/* ---------- Start: Hero ---------- */
.hero { max-width: 76rem; margin: 0 auto; padding: 5.5rem 1.5rem 3.5rem; }
.hero-kicker { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; color: var(--faint); margin-bottom: 1.2rem; }
.hero h1 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(2.6rem, 7.5vw, 4.6rem); font-weight: 700; line-height: 1.05; margin-bottom: 1.3rem; }
.hero p { font-size: 1.06rem; color: var(--muted); max-width: 40rem; line-height: 1.65; }
@media (max-width: 640px) { .hero { padding: 3.2rem 1.1rem 2.4rem; } }

/* ---------- Projekte-Liste ---------- */
.work { max-width: 76rem; margin: 0 auto; padding: 1rem 1.5rem 5rem; }
.work-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid var(--ink); padding-bottom: 0.7rem;
}
.work-head h2 { font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.work-count { font-size: 0.74rem; color: var(--faint); font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
.card {
  display: grid; grid-template-columns: 4.5rem 1fr;
  gap: 1.5rem; align-items: start;
  padding: 2.2rem 0.2rem;
  border-bottom: 1px solid var(--line);
  transition: background .25s, transform .3s cubic-bezier(.22,.61,.36,1);
}
.card:hover { background: #fafaf9; transform: translateX(0.4rem); }
.card-num {
  font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; font-weight: 500;
  color: var(--faint); font-variant-numeric: tabular-nums; padding-top: 0.15rem;
  transition: color .25s;
}
.card:hover .card-num { color: var(--ink); }
.card-img { width: 100%; aspect-ratio: 16/9; background: var(--surface); overflow: hidden; margin-bottom: 1rem; display: flex; align-items: center; justify-content: center; }
.card-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transition: transform .5s cubic-bezier(.22,.61,.36,1), filter .5s; }
.card:hover .card-img img { transform: scale(1.05); filter: brightness(1.04); }
.card-title { font-family: 'Space Grotesk', sans-serif; font-size: clamp(1.25rem, 3vw, 1.7rem); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.3rem; }
.card-sub { font-size: 0.92rem; color: var(--muted); margin-bottom: 0.9rem; max-width: 42rem; }
.card-link { font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); display: inline-flex; align-items: center; gap: 0.5rem; transition: color .2s, gap .25s; }
.card:hover .card-link { color: var(--ink); gap: 0.85rem; }
.card:hover .card-link span { animation: nudge .45s ease infinite alternate; }
@keyframes nudge { from { transform: translateX(0); } to { transform: translateX(0.25rem); } }
@media (min-width: 820px) {
  .card { grid-template-columns: 4.5rem minmax(0, 30rem) 1fr; gap: 3rem; align-items: center; }
  .card-img { margin-bottom: 0; }
  .card:hover { box-shadow: 0 12px 32px -18px rgba(17,17,17,0.28); }
}

/* ---------- Projektseite ---------- */
.proj-wrap { max-width: 76rem; margin: 0 auto; padding: 0 1.5rem; }
.breadcrumb { display: flex; gap: 0.6rem; align-items: center; padding: 2.2rem 0 0; font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: var(--faint); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .sep { color: var(--line); }
.breadcrumb .current { color: var(--ink); }
.proj-header { padding: 2.8rem 0 3rem; max-width: 46rem; }
.proj-cat { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; color: var(--faint); margin-bottom: 1rem; }
.proj-header h1 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(2rem, 5.5vw, 3.4rem); font-weight: 700; line-height: 1.1; margin-bottom: 1.1rem; }
.proj-intro { font-size: 1.06rem; color: var(--muted); line-height: 1.65; max-width: 38rem; }

.fig { margin-bottom: 3.5rem; }
.fig.wide { max-width: none; margin-left: -1.5rem; margin-right: -1.5rem; }
.fig-box { background: var(--surface); overflow: hidden; }
.fig-box img { width: 100%; height: auto; }
.figcaption { font-size: 0.7rem; color: var(--faint); margin-top: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; display: flex; justify-content: space-between; }

.article { max-width: 44rem; margin: 0 auto; padding: 4.5rem 0 3rem; }
@media (min-width: 820px) { .hero { padding-bottom: 4.5rem; } }
.section { margin-bottom: 3.5rem; }
.h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem; font-weight: 700; text-transform: uppercase;
  margin-bottom: 1.3rem; display: flex; align-items: baseline; gap: 0.8rem;
}
.h2 .idx { color: var(--faint); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.body-text { color: #3a3a3a; line-height: 1.75; font-size: 1rem; margin-bottom: 1.1rem; }
.plain-list { list-style: none; margin-top: 1.2rem; border-top: 1px solid var(--line); counter-reset: items; }
.plain-list li { padding: 0.65rem 0; border-bottom: 1px solid var(--line); color: #3a3a3a; font-size: 0.95rem; display: flex; gap: 0.9rem; counter-increment: items; }
.plain-list li::before { content: ""; width: 0.35rem; height: 0.35rem; border-radius: 50%; background: var(--faint); flex: 0 0 auto; margin-top: 0.55rem; }

.pdf-wrap { text-align: center; margin: 0 0 4rem; }
.pdf-btn { display: inline-block; background: var(--ink); color: #fff; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; padding: 1rem 2.4rem; transition: background .2s; }
.pdf-btn:hover { background: #3a3a3a; }

/* ---------- Blättern (vor/zurück) ---------- */
.pager { border-top: 2px solid var(--ink); display: grid; grid-template-columns: 1fr 1fr; }
.pager a { padding: 2rem 1.5rem 2.6rem; transition: background .2s; display: block; }
.pager a:hover { background: #fafaf9; }
.pager a.next { text-align: right; border-left: 1px solid var(--line); }
.pager .dir { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; color: var(--faint); margin-bottom: 0.5rem; }
.pager .ptitle { font-family: 'Space Grotesk', sans-serif; font-size: 1.05rem; font-weight: 700; }
.pager a:hover .ptitle { text-decoration: underline; text-underline-offset: 3px; }
.pager .all { grid-column: 1 / -1; text-align: center; border-top: 1px solid var(--line); padding: 1.3rem; font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.pager .all:hover { color: var(--ink); }

/* ---------- Über mich (Stil der alten Portfolio-Seite) ---------- */
.about-head { display: flex; align-items: center; gap: 2rem; padding: 3.5rem 0 3rem; }
.about-pic {
  width: 7rem; height: 7rem; object-fit: cover; border-radius: 50%;
  background: var(--surface); flex-shrink: 0;
}
.about-head h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.2rem, 5.5vw, 3.4rem); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.1;
}
.about-sub { font-size: 1.15rem; color: var(--muted); font-weight: 400; margin-top: 0.3rem; }
.cv-grid {
  display: grid; grid-template-columns: 1fr; gap: 3rem;
  border-top: 1px solid var(--line); padding: 3rem 0 1rem;
}
.cv-block { margin-bottom: 3.2rem; }
.cv-side-h2, .cv-main-h2 {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); border-bottom: 1px solid var(--line);
  padding-bottom: 0.6rem; margin-bottom: 1.6rem;
}
.cv-list { list-style: none; }
.cv-list li { padding: 0.32rem 0; color: #3a3a3a; font-size: 0.95rem; }
.cv-list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cv-entry { margin-bottom: 2.2rem; }
.cv-entry:last-child { margin-bottom: 0; }
.cv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1.2rem; }
.cv-role { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; flex: 1 1 auto; min-width: 0; }
.cv-period {
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.cv-org { color: #3a3a3a; font-weight: 500; font-size: 0.95rem; margin-top: 0.15rem; }
.cv-points { list-style: none; margin-top: 0.4rem; }
.cv-points li {
  padding: 0.25rem 0 0.25rem 1.3rem; position: relative;
  color: #3a3a3a; font-size: 0.92rem; line-height: 1.6;
}
.cv-points li::before { content: "-"; position: absolute; left: 0; color: var(--faint); }
.cv-contact-btn { display: inline-block; margin-top: 0.9rem; }
@media (min-width: 820px) {
  .cv-grid { grid-template-columns: minmax(0, 17rem) 1fr; gap: 5rem; }
  .cv-side { align-self: start; }
  .cv-side .cv-block { margin-bottom: 3.6rem; }
  .about-action { text-align: left; }
}
@media (max-width: 640px) {
  .about-head { gap: 1.2rem; padding: 2.4rem 0 2.2rem; }
  .about-pic { width: 5rem; height: 5rem; }
}

/* ---------- Fuß ---------- */
footer { border-top: 1px solid var(--line); }
.foot-inner {
  max-width: 76rem; margin: 0 auto; padding: 2.2rem 1.5rem 2.8rem;
  font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
.foot-inner a:hover { color: var(--ink); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.fade { animation: fadeUp .6s ease-out both; }
.fade.d1 { animation-delay: .1s; }
.fade.d2 { animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) { .fade { animation: none; } html { scroll-behavior: auto; } }

/* ---------- Admin (unverändert übernommen) ---------- */
.admin-body { background: #f6f6f7; color: #111; }
.admin-wrap { max-width: 56rem; margin: 0 auto; padding: 2rem 1.25rem 6rem; }
.admin-wrap h1 { font-size: 1.6rem; margin-bottom: .3rem; }
.admin-hint { color: #777; font-size: .85rem; margin-bottom: 2rem; }
.admin-group { background: #fff; border: 1px solid #e4e4e7; border-radius: 10px; padding: 1.4rem; margin-bottom: 1.4rem; }
.admin-group > .group-label { font-weight: 700; font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1rem; cursor: pointer; user-select: none; }
.admin-group > .group-label::before { content: "▾ "; color: #999; }
.admin-group.collapsed > .group-label::before { content: "▸ "; }
.admin-group.collapsed > .group-body { display: none; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #555; margin-bottom: .35rem; }
.field input[type=text], .field textarea { width: 100%; border: 1px solid #d4d4d8; border-radius: 6px; padding: .55rem .7rem; font: inherit; font-size: .92rem; background: #fff; }
.field textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: 2px solid #111; outline-offset: 1px; }
.item-box { border: 1px dashed #c8c8ce; border-radius: 6px; padding: .7rem .8rem; margin-bottom: .7rem; background: #fafafa; position: relative; }
.item-box textarea { min-height: 64px; border: none; background: transparent; width: 100%; font: inherit; font-size: .92rem; resize: vertical; }
.item-del { position: absolute; top: 4px; right: 6px; border: none; background: none; color: #bbb; font-size: 1rem; cursor: pointer; }
.item-del:hover { color: #c00; }
.add-btn { border: 1px dashed #a1a1aa; background: none; padding: .45rem .9rem; border-radius: 6px; font-size: .8rem; cursor: pointer; color: #555; }
.add-btn:hover { border-color: #111; color: #111; }
.img-slot { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; flex-wrap: wrap; }
.img-slot img.preview { width: 150px; height: 110px; object-fit: cover; background: #eee; border: 1px solid #ddd; border-radius: 6px; }
.img-slot .img-meta { flex: 1; min-width: 200px; }
.img-slot .img-path { font-size: .75rem; color: #999; word-break: break-all; margin-bottom: .5rem; }
.upload-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.upload-row input[type=file] { font-size: .8rem; }
.upload-btn { background: #111; color: #fff; border: none; border-radius: 6px; padding: .45rem .9rem; font-size: .8rem; cursor: pointer; }
.upload-btn:hover { background: #333; }
.upload-btn:disabled { background: #999; }
.save-bar { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-top: 1px solid #e4e4e7; padding: .8rem 1.25rem; display: flex; justify-content: center; gap: 1rem; z-index: 99; }
.save-btn { background: #111; color: #fff; border: none; border-radius: 8px; padding: .7rem 2.4rem; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.save-btn:hover { background: #333; }
.save-btn:disabled { background: #999; cursor: wait; }
.admin-msg { font-size: .85rem; align-self: center; }
.admin-msg.ok { color: #0a7d38; }
.admin-msg.err { color: #c00; }
.login-wrap { max-width: 22rem; margin: 18vh auto; padding: 0 1.25rem; text-align: center; }
.login-wrap input { width: 100%; border: 1px solid #ccc; border-radius: 6px; padding: .7rem .9rem; font: inherit; margin: 1rem 0; text-align: center; }
.login-wrap button { background: #000; color: #fff; border: none; border-radius: 6px; padding: .7rem 2rem; font: inherit; cursor: pointer; }
.error { color: #c00; font-size: .85rem; margin-top: .5rem; }
.admin-logout { font-size: .8rem; color: #888; }
.admin-logout:hover { color: #111; }

/* ---------- Lightbox (Original-Ansicht) ---------- */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(17,17,17,0.94);
  display: flex; align-items: center; justify-content: center;
  padding: 2.5rem; cursor: zoom-out;
  animation: lbIn .25s ease both;
}
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox-overlay figure { max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; }
.lightbox-overlay img { max-width: 92vw; max-height: 84vh; width: auto; height: auto; object-fit: contain; margin: 0 auto; }
.lightbox-overlay figcaption {
  margin-top: 1rem; text-align: center; color: #cfcfcf;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em;
}
.lb-close {
  position: absolute; top: 1.2rem; right: 1.6rem;
  background: none; border: none; color: #fff; font-size: 2.2rem;
  cursor: pointer; line-height: 1; padding: 0.5rem;
}
.lb-close:hover { color: #bbb; }
.fig-box .lightbox { display: block; cursor: zoom-in; }
.lb-full { display: inline-block; margin-left: 1.2rem; color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.lb-full:hover { color: #bbb; }

/* Hochkant-Bilder: nebeneinander */
.fig-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-bottom: 3.5rem; }
.fig-row .fig { margin-bottom: 0; }
.fig-row .fig:only-child { grid-column: 1 / -1; max-width: 55%; margin: 0 auto; }
@media (max-width: 760px) { .fig-row { grid-template-columns: 1fr; gap: 2.5rem; } }

/* ---------- Mobil-Optimierung ---------- */
@media (max-width: 640px) {
  /* Hero kompakter */
  .hero { padding: 2.6rem 1.25rem 2.4rem; }
  .hero h1 { margin-bottom: 1rem; }
  /* Projekt-Karten einspaltig: Bild oben, nummer darueber, grosszuegiger */
  .card { grid-template-columns: 1fr; gap: 1rem; padding: 1.8rem 0 2rem; }
  .card-num { font-size: 1.1rem; padding-top: 0; }
  .card-img { margin-bottom: 0.4rem; }
  .card-title { margin-top: 0.4rem; }
  /* Projektseite: mehr Luft, Bilder nahezu vollbreit */
  .breadcrumb { padding: 1.6rem 0 0; font-size: 0.7rem; flex-wrap: wrap; }
  .breadcrumb a, .breadcrumb span { padding: 0.35rem 0; }
  .proj-header { padding: 2rem 0 2.2rem; }
  .proj-intro { font-size: 1rem; }
  .fig { margin-bottom: 2.4rem; }
  .figcaption { font-size: 0.68rem; gap: 1rem; }
  .article { padding: 0.5rem 0 2rem; }
  .section { margin-bottom: 2.6rem; }
  .body-text { font-size: 1rem; line-height: 1.7; }
  /* Lebenslauf: Kopf untereinander liest sich besser */
  .about-head { flex-direction: column; align-items: flex-start; gap: 1.1rem; padding: 2.4rem 0 2rem; }
  .cv-grid { gap: 2.2rem; padding: 2.2rem 0 0.5rem; }
  .cv-block { margin-bottom: 2.6rem; }
  .cv-row { gap: 0.6rem; }
  .cv-period { font-size: 0.72rem; }
  /* Pager unten groesser greifbar */
  .pager a { padding: 1.5rem 1.25rem 1.9rem; }
  /* Footer */
  .foot-inner { flex-direction: column; gap: 0.7rem; padding: 1.8rem 1.25rem 2.2rem; }
  .foot-inner a { padding: 0.4rem 0; display: inline-block; }
}
/* Hover-Effekte nur auf Geraeten mit Maus */
@media (hover: none) {
  .card { transform: none !important; }
  .card:hover .card-link span { animation: none; }
}
a { -webkit-tap-highlight-color: rgba(17,17,17,0.06); }
