/* ==========================================================================
   Lobeck Type Paintings – Stylesheet
   Richtung "Weißer Raum": viel Weiß, ruhiges Raster, eine Grotesk,
   Zitate als einzige zweite Stimme in einer Serif-Kursive.
   Alle Stellschrauben stehen in :root.
   ========================================================================== */

/* Schriften von Ralf (Bureau Fonts, AMD-Lizenz), als WOFF2-Subsets in assets/fonts/ */
@font-face { font-family: "Konkret Grotesk"; src: url("../fonts/KonkretGrotesk-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Konkret Grotesk"; src: url("../fonts/KonkretGrotesk-Medium.woff2") format("woff2");  font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Konkret Grotesk"; src: url("../fonts/KonkretGrotesk-Bold.woff2") format("woff2");    font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Konkret Grotesk"; src: url("../fonts/KonkretGrotesk-Italic.woff2") format("woff2");  font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Rotwang"; src: url("../fonts/Rotwang-Italic.woff2") format("woff2");       font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Rotwang"; src: url("../fonts/Rotwang-MediumItalic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Rotwang"; src: url("../fonts/Rotwang-Regular.woff2") format("woff2");      font-weight: 400; font-style: normal; font-display: swap; }

:root {
  /* Typografie nach Ralfs Vorgabe (Print: 11/18 pt Fließtext, 18/36 pt Überschriften, Laufweite +25):
     11 pt -> 15 px, 12 pt -> 16 px, 18 pt -> 24 px; Zeilenabstand 18 pt -> 24 px; +25 -> 0.025em */
  --font-sans: "Konkret Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Rotwang", Georgia, "Times New Roman", serif;
  --tracking-text: 0.025em;
  --heading-size: 24px;
  --heading-weight: 500;

  --bg: #ffffff;
  --ink: #161616;
  --muted: #7a7a7a;
  --faint: #b5b5b5;
  --line: #e8e8e8;

  --page-max: 1480px;
  --gutter: clamp(20px, 4vw, 60px);

  --text: 15px;
  --leading: 24px;
  --small: 13px;
  --label: 12px;
  --tracking: 0.09em;

  /* Kopfbild (Panel: Website -> Kopfbild). Werte werden vom Header-Snippet als Inline-Style gesetzt. */
  --hero-ratio: 0.3;        /* Höhe geteilt durch Breite des Bildes */
  --hero-offset: 65;        /* Prozent der Bildhöhe, ab der Menü und Inhalt beginnen */
  --hero-min: 0px;          /* optional: Mindestbreite des Bildes auf schmalen Screens (dann rechts beschnitten); 0 = volle Breite */
  --hero-max: 100000px;     /* optionale Maximalbreite des Bildes */

  --fade-in: 0.35s;         /* Seitenwechsel: Einblenden der Seitenteile (Kopf, Menü, Texte, Kacheln) */
  --fade-out: 0.3s;         /* Seitenwechsel: Ausblenden vor dem Laden der nächsten Seite (auch in site.js: fadeOut) */
  --fade-image: 0.45s;      /* Bilder blenden einzeln ein, sobald sie geladen sind */

  --grid-col-gap: clamp(24px, 4vw, 72px);
  --grid-row-gap: clamp(40px, 5vw, 76px);
  --cell-ratio: 4 / 5;

  /* Hover im Raster: die anderen Werke treten zurück (Spotlight), das angefahrene bleibt.
     --hover-dim = Deckkraft der übrigen Werke (1 = aus), --hover-scale = leichte Vergrößerung (1 = aus). */
  --hover-dim: 0.45;
  --hover-scale: 1;
  --hover-speed: 0.45s;
  --hover-return: 0.35s;   /* Wartezeit, bevor die anderen Werke wieder einblenden (überbrückt die Lücken im Raster) */
}

/* --------------------------------------------------------------- Basis */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text);
  line-height: var(--leading);
  letter-spacing: var(--tracking-text);
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Seitenwechsel (nur mit JavaScript, Klasse "js" am <html>):
   Einblenden per CSS-Animation je Seitenteil, damit Kopf und Menü erscheinen, während der Rest noch lädt;
   im Werkraster blendet jede Kachel ein, sobald sie im Dokument ist, jedes Bild, sobald es geladen ist.
   Ausblenden: site.js setzt beim Klick "is-leaving" auf <body> und lädt danach die nächste Seite. */
@keyframes lobeck-fade-in { from { opacity: 0; } to { opacity: 1; } }
html.js .site-hero,
html.js .site-header,
html.js .filter,
html.js .empty,
html.js .work,
html.js .about,
html.js .contact,
html.js .text-page,
html.js .work-card,
html.js .site-footer { animation: lobeck-fade-in var(--fade-in) ease both; }
html.js .work-figure,
html.js .work-image,
html.js .about-portrait,
html.js .site-hero a { opacity: 0; transition: opacity var(--fade-image) ease; }
html.js .work-figure.is-loaded,
html.js .work-image.is-loaded,
html.js .about-portrait.is-loaded,
html.js .site-hero a.is-loaded { opacity: 1; }
html.js body.is-leaving { opacity: 0; transition: opacity var(--fade-out) ease; }
@media (prefers-reduced-motion: reduce) {
  html.js .site-hero, html.js .site-header, html.js .filter, html.js .empty, html.js .work, html.js .about,
  html.js .contact, html.js .text-page, html.js .work-card, html.js .site-footer { animation: none; }
  html.js .work-figure, html.js .work-image, html.js .about-portrait, html.js .site-hero a { opacity: 1; transition: none; }
  html.js body.is-leaving { opacity: 1; transition: none; }
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--ink); }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--ink); color: #fff; padding: 8px 12px; font-size: var(--small);
}
.skip:focus { left: 8px; z-index: 10; }

.label,
.site-nav a,
.filter a,
.footer-nav a,
.footer-copy,
.work-nav a, .work-nav span,
.work-categories a,
.work-status,
.brand {
  font-size: var(--label);
  letter-spacing: var(--tracking);
  text-transform: uppercase;
  line-height: 1.4;
}

/* --------------------------------------------------------------- Kopfbild */
.site-hero {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  z-index: 0;
  line-height: 0;
}
.site-hero a { display: block; }
.site-hero img {
  display: block;
  width: min(max(100%, var(--hero-min)), var(--hero-max));
  max-width: none;
  height: auto;
}
.site-header, .site-main, .site-footer { position: relative; z-index: 1; }
body.has-hero .site-header {
  padding-top: calc(min(max(100%, var(--hero-min)), var(--hero-max)) * var(--hero-ratio) * var(--hero-offset) / 100);
}
/* Menü und Marke bleiben über dem Aquarell lesbar: weicher weißer Schein, auf Weiß unsichtbar */
body.has-hero .site-header a { text-shadow: 0 0 4px #fff, 0 0 10px #fff, 0 0 18px #fff; }

/* --------------------------------------------------------------- Kopf */
.site-header {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  padding: 30px var(--gutter) 48px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.brand { display: inline-flex; gap: 0.9em; white-space: nowrap; }
.brand-name { font-weight: 600; }
.brand-sub { color: var(--muted); font-weight: 400; }
.site-nav { display: flex; gap: clamp(20px, 3vw, 40px); }
.site-nav a, .filter a, .footer-nav a { color: var(--muted); transition: color .15s; }
.site-nav a:hover, .filter a:hover, .footer-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"], .filter a[aria-current="page"] { color: var(--ink); }

/* --------------------------------------------------------------- Layout */
.site-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.site-footer {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  padding: 120px var(--gutter) 40px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  color: var(--muted);
}
.footer-nav { display: flex; gap: 28px; }
.page-heading {
  font-size: var(--heading-size);
  font-weight: var(--heading-weight);
  line-height: 1.5;
  letter-spacing: var(--tracking-text);
  margin-bottom: 40px;
}
.empty { color: var(--muted); }

/* --------------------------------------------------------------- Filter */
.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px clamp(20px, 2.6vw, 36px);
  margin-bottom: clamp(40px, 5vw, 72px);
}
.filter-count {
  margin-left: 0.5em;
  color: var(--faint);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.filter a[aria-current="page"] .filter-count { color: var(--muted); }

/* --------------------------------------------------------------- Raster */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--grid-col-gap);
  row-gap: var(--grid-row-gap);
}
@media (max-width: 1099px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 559px) { .grid { grid-template-columns: minmax(0, 1fr); --grid-row-gap: 56px; } }

.work-card a { display: block; }
.work-figure {
  aspect-ratio: var(--cell-ratio);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.work-figure img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity var(--hover-speed) ease, transform var(--hover-speed) ease;
}
@media (hover: hover) {
  /* Spotlight: sobald ein Werk angefahren wird, blenden alle anderen zurück.
     Das Zurückblenden wartet --hover-return, damit die Lücken zwischen den Werken kein Flackern erzeugen;
     das Abblenden und das Aufhellen des angefahrenen Werks passieren sofort. */
  .work-figure img,
  .work-caption {
    transition: opacity var(--hover-speed) ease var(--hover-return), transform var(--hover-speed) ease;
  }
  .grid:has(.work-card a:hover) .work-card a:not(:hover) .work-figure img,
  .grid:has(.work-card a:hover) .work-card a:not(:hover) .work-caption {
    opacity: var(--hover-dim);
    transition-delay: 0s;
  }
  .work-card a:hover .work-figure img,
  .work-card a:hover .work-caption { transition-delay: 0s; }
  .work-card a:hover .work-figure img { transform: scale(var(--hover-scale)); }
  .work-card a:hover .work-meta { color: var(--ink); }
  .work-meta { transition: color var(--hover-speed) ease; }
}
.work-placeholder { width: 60%; aspect-ratio: 1; border: 1px solid var(--line); }
.work-caption {
  margin-top: 14px;
  font-size: var(--small);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  line-height: 1.45;
}
.work-title { min-width: 0; }
.work-meta { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.work-sold { margin-left: 0.8em; }
.work-sold::before { content: "·"; margin-right: 0.8em; }

/* --------------------------------------------------------------- Werk */
.work {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  column-gap: clamp(40px, 5vw, 88px);
  align-items: start;
}
@media (max-width: 899px) {
  .work { grid-template-columns: minmax(0, 1fr); row-gap: 40px; }
}
.work-media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}
.work-image.is-main { grid-column: 1 / -1; }
.work-image.is-main img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 88vh;
}
.work-image.is-detail img { width: 100%; height: auto; }
@media (max-width: 559px) {
  .work-media { grid-template-columns: minmax(0, 1fr); }
  .work-image.is-detail { grid-column: 1 / -1; }
}
.work-image figcaption { margin-top: 10px; font-size: var(--small); color: var(--muted); }
.work-video video { width: 100%; height: auto; background: #000; }
.work-info { position: sticky; top: 32px; }
.work-mobile-head { display: none; }
@media (max-width: 899px) {
  .work-info { position: static; }
  .work-mobile-head { display: block; margin-bottom: 8px; }
  .work-mobile-head .work-heading { margin-bottom: 6px; }
  .work-heading--desktop { display: none; }
  .work-info .work-specs { display: none; }
}
.work-heading { font-size: var(--heading-size); font-weight: var(--heading-weight); line-height: 1.5; margin-bottom: 18px; }
.work-specs { color: var(--muted); font-size: 14px; }
.work-specs span { display: block; }
.work-status { margin-top: 16px; color: var(--ink); }
.work-categories { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.work-categories a { color: var(--muted); }
.work-categories a:hover { color: var(--ink); }
.work-text {
  margin-top: 36px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.5;
  max-width: 34ch;
}
.work-text p + p { margin-top: 0.7em; }
.work-nav {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.work-nav a { color: var(--muted); }
.work-nav a:hover { color: var(--ink); }
.work-nav .is-disabled { color: var(--faint); }
.work-nav-up { text-align: center; }

/* --------------------------------------------------------------- About */
.about-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  column-gap: clamp(40px, 6vw, 96px);
  align-items: start;
  margin-bottom: clamp(64px, 8vw, 120px);
}
@media (max-width: 799px) { .about-intro { grid-template-columns: minmax(0, 1fr); row-gap: 40px; } }
.about-intro--text-only { grid-template-columns: minmax(0, 1fr); }
.about-portrait img { max-width: 360px; width: 100%; }
.statement {
  font-family: var(--font-sans);
  font-size: var(--text);
  line-height: var(--leading);
  max-width: 44ch;
}
.statement p + p { margin-top: 1.6em; }
.about-statement .statement p:first-child {
  font-size: var(--heading-size);
  font-weight: var(--heading-weight);
  line-height: 1.5;
  margin-bottom: 0.75em;
}
.statement-secondary {
  margin-top: 4em;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 16px;
}
.statement-secondary p:first-child { font-weight: 500; }
.cv { margin-bottom: clamp(48px, 6vw, 80px); }
.cv .label { color: var(--muted); margin-bottom: 20px; font-weight: 400; }
.cv-list { max-width: 900px; }
.cv-year {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  column-gap: 24px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.cv-year:last-child { border-bottom: 1px solid var(--line); }
.cv-year dt { color: var(--muted); font-variant-numeric: tabular-nums; }
.cv-year dd p + p { margin-top: 4px; }
.cv-plain p { padding: 6px 0; }

/* --------------------------------------------------------------- Kontakt / Text */
.contact-details { display: grid; gap: 28px; max-width: 520px; }
.contact-intro { margin-bottom: 40px; max-width: 44ch; }
.contact-intro p + p { margin-top: 1.6em; }
.contact-links { display: flex; flex-direction: column; gap: 6px; }
.contact-links a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); }
.contact-links a:hover { text-decoration-color: var(--ink); }
.prose { max-width: 66ch; }
.prose p { margin-bottom: 1em; }
.prose h2 { font-size: var(--text); font-weight: 600; margin: 2em 0 0.6em; }
.prose h3 { font-size: var(--text); font-weight: 500; margin: 1.6em 0 0.5em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); }
.prose ul { list-style: disc; padding-left: 1.2em; margin-bottom: 1em; }

/* --------------------------------------------------------------- Preview-Schutz */
.template-gate { justify-content: center; align-items: center; }
.gate { width: min(420px, 90vw); text-align: center; }
.gate .brand { justify-content: center; margin-bottom: 40px; }
.gate label { display: block; margin-bottom: 20px; color: var(--muted); }
.gate-row { display: flex; gap: 8px; }
.gate input {
  flex: 1; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 0; background: #fff; color: var(--ink);
}
.gate input:focus { outline: none; border-color: var(--ink); }
.gate button {
  font: inherit; font-size: var(--label); letter-spacing: var(--tracking); text-transform: uppercase;
  padding: 10px 18px; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer;
}
.gate-error { margin-top: 14px; color: #b3261e; font-size: var(--small); }

/* --------------------------------------------------------------- Feinheiten */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
::selection { background: var(--ink); color: #fff; }
