/* Nils Karsten – site.css
   Einziges Stylesheet. Farben, Schriften und Abstände als Variablen in :root. */

/* ---------- Schriften (lokal, OFL-1.1, Lizenzen in /fonts) ---------- */
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader.woff") format("woff"); font-weight: 300 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-italic.woff") format("woff"); font-weight: 300 500; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --paper: #F4F2ED;
  --paper-2: #ECE9E1;
  --ink: #141414;
  --mute: #55524B;
  --line: #D6D2C8;
  --dark: #141414;
  --on-dark: #F4F2ED;
  --on-dark-mute: #A9A397;
  --accent: #B8321C;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --name: "Courier New", Courier, monospace;  /* Schriftzug wie auf der alten Seite */

  --gutter: clamp(16px, 3.5vw, 56px);
  --max: 1600px;
  --gap: clamp(24px, 3vw, 48px);
  --section: clamp(56px, 7vw, 104px);
  --shadow: 0 1px 2px rgba(20,20,20,.08), 0 18px 40px -24px rgba(20,20,20,.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 18px; line-height: 1.55; font-optical-sizing: auto; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
em { font-style: italic; }
h1, h2, h3 { margin: 0; font-weight: 300; }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.section-gap { margin-top: var(--section); }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 50; }
.skip-link:focus { left: 8px; }

/* ---------- Typografie ---------- */
.display { font-size: clamp(44px, 7vw, 104px); line-height: 1; letter-spacing: -.02em; font-weight: 300; }
.h1 { font-size: clamp(40px, 6vw, 88px); line-height: 1.02; letter-spacing: -.02em; font-weight: 300; }
.h2 { font-size: clamp(28px, 3.2vw, 44px); line-height: 1.1; font-weight: 300; margin-bottom: 32px; }
.h-label, .crumb { margin: 0 0 12px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); font-weight: 400; }
.crumb a { color: var(--mute); }
.crumb a:hover { color: var(--accent); }
.lede { max-width: 46ch; margin-top: 24px; color: #3D3A34; }
.lede p { margin: 0 0 .8em; }
.more { display: inline-block; margin-top: clamp(28px, 4vw, 48px); font-family: var(--mono); font-size: 13px; border-bottom: 1px solid currentColor; padding-bottom: 2px; }

.prose { max-width: 38em; font-size: 19px; line-height: 1.7; }
.prose p { margin: 0 0 1.1em; }
.prose a { border-bottom: 1px solid var(--line); }
.prose a:hover { border-color: currentColor; }
.prose strong { font-weight: 500; }
.prose img { margin: 2em 0; box-shadow: var(--shadow); }
.prose .signature { margin-top: 2em; font-style: italic; }
.prose h2 { font-size: 24px; font-weight: 400; margin: 2em 0 .6em; }
.prose .epigraph { font-style: italic; color: var(--mute); margin-bottom: 2em; }
.prose--dark { color: #D8D4CA; }
.prose--dark a { border-color: #55524B; }

.button { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border: 1px solid var(--ink); font-family: var(--mono); font-size: 13px; }
.button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.button:hover { background: var(--ink); color: var(--paper); }
.button--light { border-color: var(--on-dark); color: var(--on-dark); }
.button--light:hover { background: var(--on-dark); color: var(--ink); }

/* ---------- Header ---------- */
/* Kopfzeile bleibt oben stehen; ab etwas Scrolltiefe feine Linie (Klasse per site.js) */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid transparent; transition: border-color .25s ease; }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 32px; min-height: 76px; }
.brand { font-family: var(--name); font-weight: 400; font-size: 26px; line-height: 1.2; letter-spacing: 0; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand-h { margin: 0; font: inherit; }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 20px; font-family: var(--mono); font-size: 13px; }
.nav-group { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.nav-sep { color: var(--mute); }
.nav a { padding: 6px 0; }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.nav-toggle { display: none; width: 48px; height: 48px; margin-right: -12px; border: 0; background: none; color: inherit; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.nav-toggle .i-close { display: none; }

@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; position: relative; z-index: 31; }
  .nav { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 0; padding: 96px var(--gutter) 40px; background: var(--dark); font-family: var(--serif); font-size: clamp(32px, 8vw, 44px); font-weight: 300; line-height: 1.2; visibility: hidden; opacity: 0; transition: opacity .25s ease, visibility 0s linear .25s; overflow-y: auto; }
  .nav a { color: var(--on-dark); padding: 2px 0; }
  .nav-group { flex-direction: column; flex-wrap: nowrap; gap: 0; }
  .nav-sep { display: block; height: 1px; margin: 20px 0; background: #3A3833; font-size: 0; overflow: hidden; }
  .nav a:hover { color: #E8826E; }
  .menu-open .nav { visibility: visible; opacity: 1; transition: opacity .25s ease; }
  .menu-open .nav-toggle { color: var(--on-dark); }
  .menu-open .nav-toggle .i-open { display: none; }
  .menu-open .nav-toggle .i-close { display: block; }
  .menu-open .brand { position: relative; z-index: 31; color: var(--on-dark); }
  .menu-open { overflow: hidden; }
}

/* ---------- Seitenkopf ---------- */
.page-head { padding-top: clamp(32px, 6vw, 88px); padding-bottom: clamp(40px, 5vw, 72px); }
.page-head--tight { padding-bottom: clamp(24px, 3vw, 40px); }
.page-head--split { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }

/* ---------- Werke & Wandbeschriftung ---------- */
.work { margin: 0; }
.work-link { display: block; cursor: zoom-in; }
.work-frame { display: block; }
.work-frame img { width: 100%; height: auto; box-shadow: var(--shadow); }
.work--cell .work-frame { aspect-ratio: 4 / 5; display: flex; align-items: flex-end; justify-content: center; }
/* Feld füllen ohne Verzerrung: breite Bilder über die Breite, hohe über die Höhe (Klasse aus Hugo, Bildmaße bekannt) */
.work-frame.fit-w img { width: 100%; height: auto; }
.work-frame.fit-h img { width: auto; height: 100%; }
/* Ausstellungs-/Atelierfotos: Feld gefüllt (beschnitten), Lightbox zeigt das ganze Bild */
.work-frame.fit-cover { overflow: hidden; }
.work-frame.fit-cover img { width: 100%; height: 100%; object-fit: cover; box-shadow: none; }
/* beschnittene Ansichten (Startseite, Installations, Studio): Schatten am Rahmen, da overflow:hidden den
   Bildschatten abschneidet. Startbilder der Werkgruppen (Links auf Seiten) bleiben wie bisher. */
.work-link:not(.work-link--page) > .work-frame.fit-cover { box-shadow: var(--shadow); }
.label { margin-top: 16px; display: flex; flex-direction: column; gap: 2px; font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--mute); }
.work--cell .label { padding-top: 12px; border-top: 1px solid var(--line); min-height: 1px; }
.work-link--page { cursor: pointer; }
.work--plain .work-frame img { box-shadow: none; }
.label-title { font-family: var(--serif); font-size: 17px; color: var(--ink); }
.label-meta { display: block; }

/* ---------- Raster ---------- */
.grid { display: grid; gap: clamp(40px, 4vw, 64px) var(--gap); }
.grid--works, .grid--cards, .grid--3, .grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--1 { grid-template-columns: minmax(0, 560px); justify-content: center; }
@media (max-width: 1100px) { .grid--works, .grid--cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Dreierreihen (Startseite, Werkgruppen-Startbilder) bleiben bis 600 px dreispaltig – kein einzelnes Bild in Zeile 2 (iPad) */
@media (max-width: 1100px) { .grid--3, .grid--6 { gap: 40px 24px; } }
@media (max-width: 600px) { .grid--works, .grid--cards, .grid--3, .grid--6, .grid--2 { grid-template-columns: minmax(0, 1fr); } }

.card { display: block; }
.card-frame { aspect-ratio: 4 / 5; display: flex; align-items: flex-end; justify-content: center; }
.card-frame img { box-shadow: var(--shadow); transition: transform .4s ease; }
.card:hover .card-frame img { transform: translateY(-4px); }
.card-label { display: flex; flex-direction: column; gap: 2px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--mute); }
.card-title { font-family: var(--serif); font-size: clamp(24px, 2.4vw, 32px); line-height: 1.15; color: var(--ink); font-weight: 300; }
.card:hover .card-title { color: var(--accent); }

/* Werkgruppen-Seite: Startbilder, darunter je Serie drei Beispiele (kleiner, 4er-Raster) */
.samples-list { margin-top: clamp(64px, 8vw, 120px); display: flex; flex-direction: column; gap: clamp(56px, 7vw, 104px); }
.samples-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding-top: 16px; margin-bottom: clamp(20px, 2.5vw, 32px); border-top: 1px solid var(--ink); }
.samples-head .h2 { margin: 0; }
.more--inline { margin-top: 0; }
.grid--samples { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid--samples { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid--samples { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; } .grid--samples .work:nth-child(3) { display: none; } }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0; margin-bottom: clamp(32px, 4vw, 56px); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--ink); font-family: var(--mono); font-size: 13px; }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); }
@media (max-width: 600px) { .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .tabs a { flex: 0 0 auto; } }

/* ---------- Startseite ---------- */
.hang { display: grid; grid-template-columns: repeat(2, minmax(0, 520px)); justify-content: center; gap: clamp(40px, 7vw, 120px); padding-top: clamp(24px, 5vw, 72px); padding-bottom: 100px; }
@media (max-width: 700px) { .hang { grid-template-columns: minmax(0, 1fr); } }

/* Statement so breit wie die Hängung darüber (2 × 520 px + Abstand) */
.statement { max-width: calc(1160px + 2 * var(--gutter)); padding-bottom: var(--section); }
.statement-text { margin: 0; font-size: 30px; text-align: center; font-weight: 300; line-height: 1.42; letter-spacing: -.005em; text-wrap: pretty; }
.statement-text em { font-weight: 400; }

.bleed { margin: 0; position: relative; overflow: hidden; height: clamp(380px, 62vw, 900px); }
/* Bild 40 % höher als der Ausschnitt – Spielraum für die Parallaxe (site.js) */
.bleed img { position: absolute; left: 0; top: -20%; width: 100%; height: 140%; object-fit: cover; will-change: transform; }
.bleed-label { z-index: 1; }
.bleed-label { position: absolute; left: var(--gutter); bottom: clamp(16px, 3vw, 40px); max-width: calc(100% - 2 * var(--gutter)); background: var(--paper); padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; font-family: var(--mono); font-size: 12px; color: var(--mute); }

.block { padding-block: var(--section); }
.block--tint { background: var(--paper-2); }
.block-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 40px; margin-bottom: clamp(32px, 5vw, 72px); }
.block-text { margin: 0; max-width: 40ch; font-family: var(--mono); font-size: 13px; color: var(--mute); }

.shows { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.shows .work--cell .work-frame { aspect-ratio: 4 / 3; }
@media (max-width: 1000px) { .shows { grid-template-columns: minmax(0, 1fr); } }

.dark { background: var(--dark); color: var(--on-dark); }
.dark a:hover { color: #E8826E; }
.dark .h-label { color: var(--on-dark-mute); }
.book { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(32px, 6vw, 96px); padding-block: clamp(64px, 8vw, 120px); }
.book-img { flex: 1 1 420px; max-width: 760px; min-width: 0; }
.book-text { flex: 1 1 300px; max-width: 520px; }
.book-text .h1 { margin-bottom: 20px; }
.book-text p { color: #D8D4CA; }
.book-text .button { margin-top: 16px; }
.book-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 20px; margin: 24px 0; font-family: var(--mono); font-size: 13px; }
.book-facts dt { color: var(--mute); }
.dark .book-facts dt { color: var(--on-dark-mute); }
.book-facts dd { margin: 0; }
.book--paper .book-text p { color: #3D3A34; }
.book-home { border-top: 1px solid var(--line); }
.book-subtitle { margin: -8px 0 8px; font-size: 22px; font-style: italic; }

/* ---------- Ausstellungen / CV ---------- */
.cv { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); padding-bottom: var(--section); }
.cv-nav { position: sticky; top: 100px; align-self: start; display: flex; flex-direction: column; border-top: 1px solid var(--ink); font-family: var(--mono); font-size: 13px; }
.cv-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
.cv-nav a.is-active { -webkit-text-stroke: .35px currentColor; } /* leicht fett ohne Breitensprung (Plex Mono liegt nur in 400 vor) */
.cv-section + .cv-section { margin-top: 64px; }
.cv-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.cv-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cv-year { font-family: var(--mono); font-size: 13px; padding-top: 4px; }
.cv-entry em { font-weight: 400; }
.cv-venue { color: var(--mute); }
@media (max-width: 760px) { .cv { grid-template-columns: minmax(0, 1fr); } .cv-nav { position: static; } }

/* ---------- Footer ---------- */
/* Abstand Inhalt → Fußzeile mind. 64 px (Linie nie direkt unter einer Bildunterschrift) */
.site-footer { margin-top: clamp(64px, 8vw, 120px); padding-block: clamp(64px, 8vw, 120px) 32px; border-top: 1px solid var(--line); }
.footer-index { display: flex; flex-wrap: wrap; gap: 4px clamp(20px, 3vw, 44px); font-size: clamp(30px, 4vw, 56px); font-weight: 300; line-height: 1.15; letter-spacing: -.01em; }
.footer-meta { margin-top: clamp(48px, 6vw, 88px); padding-top: 20px; border-top: 1px solid var(--ink); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; font-family: var(--mono); font-size: 12px; color: var(--mute); }
.footer-meta a { color: var(--mute); }
.footer-meta a:hover { color: var(--accent); }
.is-home .site-footer { border-top: 0; }

/* ---------- Lightbox ---------- */
.lightbox { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #E7E3DA; color: var(--ink); }
.lightbox::backdrop { background: rgba(20,20,20,.6); }
.lightbox[open] { display: flex; flex-direction: column; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px clamp(8px, 2vw, 24px) 0 var(--gutter); font-family: var(--mono); font-size: 12px; color: var(--mute); }
.lb-stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; gap: 8px; padding: 0 clamp(4px, 2vw, 24px) clamp(16px, 3vw, 32px); }
.lb-figure { flex: 1 1 auto; min-width: 0; height: 100%; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.lb-figure img:not([src]) { visibility: hidden; }
.lb-figure img { cursor: zoom-out; max-width: 100%; max-height: calc(100% - 64px); width: auto; height: auto; object-fit: contain; box-shadow: var(--shadow); }
.lb-caption { text-align: center; font-family: var(--mono); font-size: 12px; color: var(--mute); display: flex; flex-direction: column; gap: 2px; min-height: 40px; }
.lb-caption em { font-family: var(--serif); font-size: 18px; color: var(--ink); }
.lb-btn { flex: 0 0 auto; width: 48px; height: 48px; border: 0; background: none; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.lb-btn:hover { color: var(--accent); }
.lb-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; }
@media (max-width: 600px) { .lb-prev, .lb-next { display: none; } }
.lb-single .lb-prev, .lb-single .lb-next { visibility: hidden; }

/* ---------- Nach-oben-Button (ab 1,5 Bildschirmhöhen, Klasse per site.js) ---------- */
.to-top { position: fixed; right: var(--gutter); bottom: clamp(16px, 3vw, 40px); z-index: 15; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid rgba(244,242,237,.22); background: var(--ink); color: var(--paper); cursor: pointer; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s, background-color .2s ease; }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; transition: opacity .25s ease, transform .25s ease, background-color .2s ease; }
.to-top:hover { background: var(--mute); color: var(--paper); }
.to-top svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.menu-open .to-top { display: none; }
@media print { .to-top { display: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
