/* Schriften liegen lokal in assets/fonts (SIL Open Font License) – keine Verbindung zu Google beim Besuch */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(assets/fonts/instrument-serif-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(assets/fonts/instrument-serif-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(assets/fonts/instrument-serif-italic-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(assets/fonts/instrument-serif-italic-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url(assets/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url(assets/fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #f2f0eb;
  --ink: #141414;
  --muted: #7a776f;
  --line: #d9d6ce;
  --accent: #e4572e;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Inter", system-ui, sans-serif;
  --gutter: clamp(16px, 3vw, 40px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--bg); }

.grain {
  position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .12 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Header */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--gutter);
  mix-blend-mode: difference; color: #f2f0eb;
}
.logo { font-family: var(--serif); font-size: 22px; letter-spacing: .02em; }
.site-header nav { display: flex; gap: 28px; }
.site-header nav a, .filters button, .edge, .scroll-hint, .lb-meta, .close { font-size: 12px; letter-spacing: .04em; }
.site-header nav a:hover { opacity: .55; }

.year-counter {
  position: fixed; right: var(--gutter); bottom: 20px; z-index: 20;
  font-family: var(--serif); font-size: clamp(40px, 6vw, 88px); line-height: 1; color: var(--ink);
  mix-blend-mode: difference; color: #f2f0eb; font-variant-numeric: tabular-nums;
}

/* Hero */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; position: relative; padding: 0 var(--gutter);
}
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(56px, 12vw, 190px); line-height: .92; letter-spacing: -.02em;
}
.hero h1 em { font-style: italic; }
.hero-sub { margin-top: 32px; max-width: 34ch; color: var(--muted); }
.edge { position: absolute; top: 50%; }
.edge-left { left: var(--gutter); }
.edge-right { right: var(--gutter); }
.scroll-hint { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: var(--muted); }
.scroll-hint:hover { color: var(--accent); }

/* 3D-Galerie */
section.gallery { padding: 0; height: calc(100vh + var(--n, 9) * 90vh); position: relative; }
.gallery-stick { position: sticky; top: 0; height: 100svh; overflow: hidden; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
/* Weichzeichner links und rechts: nur das aktive Bild in der Mitte bleibt scharf */
.g-blur {
  position: absolute; inset: 0; pointer-events: none;
  backdrop-filter: blur(var(--b)); -webkit-backdrop-filter: blur(var(--b));
  --m: linear-gradient(to right,
    #000 0%, #000 calc(var(--z, 28%) - var(--e)), transparent calc(var(--z, 28%) - var(--s)),
    transparent calc(100% - var(--z, 28%) + var(--s)), #000 calc(100% - var(--z, 28%) + var(--e)), #000 100%);
  -webkit-mask-image: var(--m); mask-image: var(--m);
}
.g-blur:nth-of-type(3) { background: rgba(242, 240, 235, .22); }
.g-top { position: absolute; top: max(72px, calc(var(--st, 100px) - 52px)); left: var(--gutter); right: var(--gutter); display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; letter-spacing: .05em; color: var(--ink); pointer-events: none; }
.g-info { position: absolute; left: 0; right: 0; top: calc(var(--sb, 78%) + 22px); text-align: center; pointer-events: none; display: grid; gap: 6px; justify-items: center; transition: opacity .35s, transform .35s; }
.g-info.swap { opacity: 0; transform: translateY(8px); }
.g-info h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 5vw, 72px); line-height: 1; padding: 0 var(--gutter); }
.g-kind, .g-hint { font-size: 12px; letter-spacing: .04em; color: var(--muted); }
body.no-gallery .gallery { display: none; }
/* Die Liste ist nur der Ersatz, falls die 3D-Galerie nicht läuft */
.work { display: none; }
body.no-gallery .work { display: block; }
.year-counter { transition: opacity .4s; pointer-events: none; }   /* nie Klicks abfangen, auch wenn unsichtbar */

/* Arbeiten */
section { padding: 100px var(--gutter); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4vw, 56px); line-height: 1; }
.filters { display: flex; gap: 20px; }
.filters button { color: var(--muted); padding: 4px 0; border-bottom: 1px solid transparent; }
.filters button:hover { color: var(--ink); }
.filters button.active { color: var(--ink); border-color: var(--accent); }

.list { list-style: none; border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 1fr 220px 80px; align-items: baseline; gap: 24px;
  padding: 22px 0; border-bottom: 1px solid var(--line); cursor: pointer;
  transition: opacity .3s, padding .3s;
}
.row .title { font-family: var(--serif); font-size: clamp(30px, 4.6vw, 68px); line-height: 1.05; transition: transform .35s cubic-bezier(.2,.7,.2,1), color .2s; }
.row .kind, .row .yr { color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.row .yr { text-align: right; font-variant-numeric: tabular-nums; }
.list:hover .row { opacity: .3; }
.list .row:hover { opacity: 1; }
.row:hover .title { transform: translateX(14px); color: var(--accent); }
.row .thumb-inline { display: none; }
.row.hide { display: none; }

/* schwebende Vorschau */
.preview {
  position: fixed; top: 0; left: 0; z-index: 30; width: 300px; aspect-ratio: 4 / 5; pointer-events: none;
  opacity: 0; transform: translate(-50%, -50%) scale(.92); transition: opacity .25s, scale .25s;
  overflow: hidden; background: var(--line);
}
.preview.on { opacity: 1; }
.preview img, .preview video, .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { display: grid; place-items: end start; padding: 14px; color: rgba(255,255,255,.85); font-family: var(--serif); font-size: 22px; }

/* Über */
.about { border-top: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px; margin-top: 48px; }
.lead { font-family: var(--serif); font-size: clamp(26px, 3.2vw, 46px); line-height: 1.15; }
.about-side > p { margin-bottom: 36px; max-width: 42ch; }
.skills div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.skills dt { color: var(--muted); }

/* Kontakt */
.contact { border-top: 1px solid var(--line); padding-bottom: 140px; }
.mail { display: inline-block; margin-top: 32px; font-family: var(--serif); font-style: italic; font-size: clamp(32px, 7vw, 110px); line-height: 1.05; word-break: break-word; border-bottom: 1px solid var(--ink); transition: color .2s, border-color .2s; }
.mail:hover { color: var(--accent); border-color: var(--accent); }

.site-footer { position: relative; z-index: 25; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px var(--gutter) 28px; color: var(--muted); font-size: 13px; }
/* größere Klickfläche, ohne dass sich das Layout verschiebt */
.site-footer a { display: inline-block; padding: 12px 3px; margin: -12px -3px; }
.site-footer a:hover { color: var(--ink); }

/* Lightbox */
dialog { border: 0; background: var(--bg); color: var(--ink); width: min(1100px, 92vw); max-height: 92vh; max-height: calc(100dvh - 24px); margin: auto; overflow: auto; }
/* offen als Spalte: Bild bleibt fix, nur der Text darunter scrollt, falls der Platz nicht reicht.
   So liegen Schließen-Knopf und Videoanfang immer im sichtbaren Bereich (iPhone: Browserleisten oben/unten). */
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: rgba(20,20,20,.6); backdrop-filter: blur(4px); }
.close { position: absolute; top: 10px; right: 12px; z-index: 2; color: #fff; padding: 11px 16px; border-radius: 999px;
  background: rgba(20, 20, 20, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.close:hover { background: rgba(20, 20, 20, .8); }
.lb-media { flex: 0 0 auto; aspect-ratio: 16 / 9; background: #141414; max-height: 62vh; max-height: 62dvh; }
.lb-media.portrait { aspect-ratio: 9 / 16; height: min(58vh, 720px); height: min(58dvh, 720px); max-height: none; width: auto; margin: 0 auto; }
.lb-media iframe, .lb-media video { width: 100%; height: 100%; border: 0; display: block; }
/* YouTube erst nach Klick: bis dahin läuft nur der stumme Loop, abgedunkelt, mit Hinweis */
.yt-gate { position: relative; width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.lb-media .yt-gate video { position: absolute; inset: 0; object-fit: cover; filter: brightness(.3) blur(3px); transform: scale(1.04); }
.yt-gate-box { position: relative; text-align: center; color: #f2f0eb; padding: 0 24px; }
.yt-load { font: inherit; font-size: 14px; letter-spacing: .04em; color: #f2f0eb; border: 1px solid #f2f0eb; border-radius: 999px; padding: 12px 26px; transition: background .2s, border-color .2s; }
.yt-load:hover, .yt-load:focus-visible { background: var(--accent); border-color: var(--accent); }
.yt-gate-box p { margin: 14px auto 0; max-width: 42ch; font-size: 12px; line-height: 1.5; opacity: .8; }
.lb-media .ph { place-items: center; text-align: center; font-size: 18px; padding: 20px; }
.lb-text { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 24px 28px 32px; display: grid; gap: 8px; align-content: start; max-width: 70ch; }
.lb-meta { color: var(--muted); }
.lb-text h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 4vw, 48px); line-height: 1.05; }

/* Einblenden */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s, transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* Handy */
@media (max-width: 760px) {
  body:has(dialog[open]) { overflow: hidden; }   /* Seite hinter dem Overlay bleibt stehen */
  /* Kopfzeile auf dem Handy: weicher Hintergrund, damit sie nicht in den Text hineinläuft */
  .site-header { mix-blend-mode: normal; color: var(--ink); padding-bottom: 26px;
    background: linear-gradient(to bottom, var(--bg) 62%, rgba(242, 240, 235, 0)); }
  .site-header nav { gap: 16px; }
  .edge { display: none; }
  section { padding: 72px var(--gutter); }
  .row { grid-template-columns: 1fr auto; gap: 6px 16px; padding: 18px 0; }
  .row .title { grid-column: 1 / -1; }
  .row .thumb-inline { display: block; grid-column: 1 / -1; aspect-ratio: 16/10; overflow: hidden; margin-bottom: 8px; }
  .list:hover .row { opacity: 1; }
  .row:hover .title { transform: none; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .year-counter { font-size: 40px; bottom: 12px; }
  .preview { display: none; }
}
@media (hover: none) { .preview { display: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Timecode im Startbereich */
.timecode { font-size: 12px; letter-spacing: .12em; color: var(--muted); margin-bottom: 28px; display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.timecode .rec { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1.6s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .timecode .rec { animation: none; } }

/* Kontaktbögen */
.sheets { border-top: 1px solid var(--line); }
.sheet-note { font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.sheet { margin-top: 56px; }
.sheet h3 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(24px, 3vw, 36px); margin-bottom: 20px; }
.frames { display: grid; gap: 22px 14px; }
.frames.foto { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.frames.grafik { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.fr { position: relative; display: block; text-align: left; padding: 0; }
.fr-img { display: block; background: #1a1918; border: 6px solid #1a1918; overflow: hidden; transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.foto .fr-img { aspect-ratio: 3 / 2; }
.grafik .fr-img { aspect-ratio: 4 / 5; }
.fr-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fr-no { display: block; margin-top: 6px; font-size: 11px; letter-spacing: .08em; color: var(--accent); }
.frames:hover .fr { opacity: .4; }
.frames .fr:hover { opacity: 1; }
.fr:hover .fr-img { transform: scale(1.03); }
/* Lieblingsbild: Kreis wie mit dem Fettstift */
.fr.pick::after {
  content: ""; position: absolute; left: -10px; right: -10px; top: -10px; bottom: 12px; pointer-events: none;
  border: 2px solid var(--accent); border-radius: 52% 48% 55% 45% / 48% 55% 45% 52%; transform: rotate(-2deg);
}
.lb-media img { object-fit: contain; background: #141414; }

/* Skills als Randaufdruck */
.skills { counter-reset: s; }
.skills div { counter-increment: s; grid-template-columns: 130px 1fr; }
.skills dt { color: var(--accent); font-size: 12px; letter-spacing: .08em; }
.skills dt::before { content: counter(s, decimal-leading-zero) " ▸ "; }

/* Impressum und Datenschutz */
.legal { max-width: 760px; margin: 0 auto; padding: 150px var(--gutter) 80px; }
.legal h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 7vw, 84px); line-height: 1; margin-bottom: 56px; }
.legal section { padding: 0; margin-bottom: 40px; }
.legal h2 { font-size: clamp(22px, 2.6vw, 30px); margin-bottom: 12px; }
.legal p, .legal li { font-size: 15px; line-height: 1.65; max-width: 68ch; margin-bottom: 12px; }
.legal ul { padding-left: 1.2em; margin-bottom: 12px; }
.legal a { border-bottom: 1px solid var(--line); transition: color .2s, border-color .2s; }
.legal a:hover { color: var(--accent); border-color: var(--accent); }
/* noch auszufüllende Stellen – vor der Veröffentlichung entfernen */
mark.todo { background: #ffe08a; color: #141414; padding: 1px 6px; border-radius: 3px; }
.legal-page .site-footer { padding-top: 40px; }
.yt-gate-box p a { border-bottom: 1px solid currentColor; }
