/* Rainer Rudolf Benoit — Oeffentliche Seite (ADR-0008 Gestaltung, ADR-0009 Navigation)
   Mobile first. Nur lokale Schriften. Bewegung nur ueber transform/opacity. */

@font-face { font-family: Geist; src: url(../fonts/geist-sans-light.woff2) format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: Geist; src: url(../fonts/geist-sans-regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Geist; src: url(../fonts/geist-sans-medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Geist; src: url(../fonts/geist-sans-semibold.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(../fonts/geist-mono-regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --bg: #ffffff; --fg: #111111; --mute: #6f6f6f; --line: #e4e4e4; --soft: #f4f4f2;
  --sans: Geist, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --rail: 0px; --top: 56px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-in: cubic-bezier(.5, 0, .75, 0);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] { --bg: #0c0c0c; --fg: #f1f1ef; --mute: #8d8d8a; --line: #242424; --soft: #161616; color-scheme: dark; }
}
:root[data-theme='dark'] { --bg: #0c0c0c; --fg: #f1f1ef; --mute: #8d8d8a; --line: #242424; --soft: #161616; color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 16px/1.55 var(--sans); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .3s, color .3s;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 8px; top: -60px; z-index: 100; background: var(--fg); color: var(--bg); padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 8px; }

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

.rail {
  position: fixed; inset: 0 0 auto 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.rail-name { text-decoration: none; font-weight: 500; font-size: 15px; letter-spacing: .01em; text-transform: uppercase; white-space: nowrap; }
.rail-count { display: none; }
/* Menueknopf: zwei Haarlinien, die sich beim Oeffnen zum Kreuz drehen */
.menu-btn { position: relative; width: 44px; height: 44px; margin-right: -10px; }
.menu-btn span { position: absolute; left: 11px; right: 11px; height: 1.5px; background: var(--fg); transition: transform .4s var(--ease); }
.menu-btn span:first-child { top: 18px; }
.menu-btn span:last-child { top: 25px; }
.menu-btn:hover span:last-child { transform: scaleX(.6); transform-origin: right; }
.menu-btn[aria-expanded='true'] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-btn[aria-expanded='true'] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

main { padding-top: var(--top); min-height: 70vh; }

@media (min-width: 1024px) {
  :root { --rail: 72px; --top: 0px; }
  .rail {
    inset: 0 auto 0 0; width: var(--rail); height: 100dvh; flex-direction: column; padding: 18px 0 22px;
    border-bottom: 0; border-right: 1px solid var(--line); background: var(--bg); backdrop-filter: none;
  }
  .rail-name { order: 2; flex: 1; display: flex; align-items: center; justify-content: center; }
  .rail-name-text { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 13px; letter-spacing: .32em; }
  .menu-btn { order: 1; margin: 0; }
  .rail-count { order: 3; display: block; font: 12px/1 var(--mono); color: var(--mute); }
  main, .foot { margin-left: var(--rail); }
}

/* ---------------------------------------------------------------- Pill (Mobil, Daumen) */

.pill {
  position: fixed; z-index: 25; left: 50%; bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 8px 0 16px; border-radius: 999px;
  background: var(--fg); color: var(--bg); box-shadow: 0 10px 30px -10px rgba(0,0,0,.45);
  font-size: 14px; font-weight: 500; letter-spacing: .02em;
  transition: transform .4s var(--ease), opacity .3s;
}
.pill:active { transform: translateX(-50%) scale(.96); }
.pill-n { font: 12px/1 var(--mono); min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: 999px; background: color-mix(in srgb, var(--bg) 16%, transparent); }
html.drawer-open .pill, html.lb-open .pill { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(20px); }
@media (min-width: 1024px) { .pill { display: none; } }

/* ---------------------------------------------------------------- Drawer (Off-Canvas) */

.drawer { position: fixed; inset: 0 0 0 auto; z-index: 50; width: min(460px, 92vw); pointer-events: none; }
.drawer[hidden] { display: none; }
.veil { position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.38); opacity: 0; transition: opacity .35s; }
.veil[hidden] { display: none; }
html.drawer-open .veil { opacity: 1; }
html.drawer-open { overflow: hidden; }

.drawer-panel {
  position: absolute; inset: 0; pointer-events: auto; background: var(--bg);
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  padding: max(14px, env(safe-area-inset-top)) 24px max(20px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  border-left: 1px solid var(--line);
  transform: translateX(101%); transition: transform .38s var(--ease-in);
}
html.drawer-open .drawer-panel { transform: none; transition: transform .55s var(--ease); }
.drawer.dragging .drawer-panel { transition: none; }

.drawer-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.drawer-name { text-decoration: none; font-weight: 500; font-size: 13px; text-transform: uppercase; letter-spacing: .2em; }
.drawer-close, .lb-close { position: relative; width: 44px; height: 44px; margin-right: -10px; }
.drawer-close span, .lb-close span { position: absolute; left: 12px; right: 12px; top: 50%; height: 1.5px; background: currentColor; }
.drawer-close span:first-child, .lb-close span:first-child { transform: rotate(45deg); }
.drawer-close span:last-child, .lb-close span:last-child { transform: rotate(-45deg); }

.drawer-pages { order: 1; list-style: none; margin: 28px 0 0; padding: 0; }
.drawer-pages a {
  display: block; text-decoration: none; font-size: clamp(26px, 7.5vw, 34px); line-height: 1.15; font-weight: 500; letter-spacing: -.035em;
  padding: 2px 0; transition: color .2s, transform .3s var(--ease);
}
.drawer-pages a:hover { transform: translateX(-6px); }
.drawer-pages a[aria-current] { color: var(--mute); }
html.drawer-open .drawer-pages li { animation: rise .6s var(--ease) both; animation-delay: calc(.18s + var(--i) * .045s); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.wheel-wrap { order: 2; margin-top: clamp(40px, 9vh, 88px); }
.eyebrow { margin: 0 0 2px; font: 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--mute); }

/* Dreh-Walze: echte Scroll-Liste mit Einrasten, gedreht wird per rotateX (wie bei Partenheimer) */
.wheel { position: relative; height: 240px; perspective: 600px; }
.wheel-track {
  list-style: none; margin: 0; padding: 96px 0; height: 100%; overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; scrollbar-width: none; transform-style: preserve-3d;
  -webkit-mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent);
          mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent);
}
.wheel-track::-webkit-scrollbar { display: none; }
.wheel-track li { height: 48px; scroll-snap-align: center; }
.wheel-track a {
  height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px;
  text-decoration: none; font-size: 24px; font-weight: 500; letter-spacing: -.03em; transform-origin: 50% 50% -60px; will-change: transform;
}
.wheel-track a .w-n { font: 12px/1 var(--mono); color: var(--mute); letter-spacing: 0; }
/* Nur zwei zarte Linien rahmen die Auswahl, ausgeblendet zu den Raendern */
.wheel::before, .wheel::after { content: ''; position: absolute; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, var(--line), var(--line) 70%, transparent); opacity: .7; pointer-events: none; }
.wheel::before { top: 96px; } .wheel::after { bottom: 96px; }
/* Leichter Textlink statt Block */
.wheel-go { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 6px; padding-left: 4px; text-decoration: none; font-size: 15px; letter-spacing: .01em; }
.wheel-go [data-wheel-go-n] { font: 12px var(--mono); color: var(--mute); }
.wheel-go .arr { transition: transform .3s var(--ease); }
.wheel-go:hover .arr, .wheel-go:active .arr { transform: translateX(4px); }

.drawer-foot { order: 3; margin-top: auto; padding-top: 32px; display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; }
.langs { display: inline-flex; align-items: center; margin-left: -10px; }
.langs > * { min-width: 36px; height: 40px; display: grid; place-items: center; font-size: 12px; letter-spacing: .1em; text-decoration: none; color: var(--mute); transition: color .2s; }
.langs a:hover, .langs [aria-current] { color: var(--fg); }
/* Ein Umschalter: Sonne im hellen, Mond im dunklen Modus, Wechsel mit kleiner Drehung */
.mode { position: relative; width: 40px; height: 40px; color: var(--fg); }
.mode svg { position: absolute; left: 11.5px; top: 11.5px; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s var(--ease), opacity .3s; }
.mode .i-moon { opacity: 0; transform: rotate(-90deg) scale(.6); }
.mode.is-dark .i-sun { opacity: 0; transform: rotate(90deg) scale(.6); }
.mode.is-dark .i-moon { opacity: 1; transform: none; }
.legal { width: 100%; margin: 4px 0 0; font-size: 12px; color: var(--mute); display: flex; gap: 14px; }
.legal a { text-decoration: none; }
.legal a:hover { color: var(--fg); }

/* Mobil kommt der Drawer von rechts (Daumen, Knopf oben rechts), am Desktop von links
   neben der Rail, wo auch der Menueknopf sitzt. Die Wischrichtung in site.js folgt derselben Grenze. */
@media (min-width: 1024px) {
  .drawer { inset: 0 auto 0 var(--rail); }
  .drawer-panel { padding-left: 40px; padding-right: 40px; border-left: 0; border-right: 1px solid var(--line); transform: translateX(-101%); }
  .drawer-pages a:hover { transform: translateX(6px); }
}

/* ---------------------------------------------------------------- Raster */

.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-flow: dense; gap: 1px;
  padding-bottom: 1px;
}
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1500px) { .grid { grid-template-columns: repeat(5, 1fr); } }

.tile { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--bg); box-shadow: 0 0 0 1px var(--line); }
.tile[hidden] { display: none; }
.tile.is-wide { grid-column: span 2; aspect-ratio: 2 / 1; }
.tile.is-big { grid-column: span 2; grid-row: span 2; }
.tile a { display: block; height: 100%; outline-offset: -3px; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease), opacity .6s; }
.tile.enter { animation: tile-in .55s var(--ease) both; animation-delay: calc(min(var(--d, 0), 12) * 28ms); }
@keyframes tile-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
.tile-cap {
  position: absolute; left: 0; bottom: 0; padding: 8px 12px; background: var(--bg); color: var(--fg);
  font: 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  transform: translateY(101%); transition: transform .4s var(--ease);
}
@media (hover: hover) {
  .tile a:hover img { transform: scale(1.035); }
  .tile a:hover .tile-cap, .tile a:focus-visible .tile-cap { transform: none; }
}
.empty { padding: 20vh 24px; text-align: center; color: var(--mute); }

/* ---------------------------------------------------------------- Seitenkopf, Text */

.page-head { padding: clamp(36px, 8vw, 96px) clamp(20px, 5vw, 64px) clamp(20px, 4vw, 40px); border-bottom: 1px solid var(--line); }
.display { margin: 0; font-size: clamp(30px, 5.2vw, 64px); line-height: 1; font-weight: 500; letter-spacing: -.045em; text-wrap: balance; }
.page-head .prose { margin-top: 18px; }
.prose { max-width: 64ch; font-size: 17px; }
.prose h2 { font-size: 13px; font-family: var(--mono); font-weight: 400; text-transform: uppercase; letter-spacing: .14em; color: var(--mute); margin: 2.4em 0 .8em; }
.prose h3 { font-size: 20px; font-weight: 500; margin: 1.8em 0 .5em; letter-spacing: -.02em; }
.prose p { margin: 0 0 1em; }
.prose ul { list-style: none; padding: 0; margin: 0 0 1em; border-top: 1px solid var(--line); }
.prose li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.prose a, .link { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose em { color: var(--mute); }

.text-page { padding-bottom: 12vh; }
.text-page > .prose { padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 64px) 0; }
.text-hero { margin: 0; border-bottom: 1px solid var(--line); }
.text-hero img { width: 100%; max-height: 78vh; object-fit: cover; }
.nf { padding: 14vh clamp(20px, 5vw, 64px); }
.nf-code { font: 12px var(--mono); color: var(--mute); letter-spacing: .3em; margin: 0 0 18px; }

/* ---------------------------------------------------------------- Uebersicht (Bauhaus-Komposition) */

.overview { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.ov { background: var(--bg); }
.ov a { position: relative; display: block; height: 100%; text-decoration: none; overflow: hidden; }
.ov-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.ov-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.ov a:hover img { transform: scale(1.04); }
.ov-meta { position: absolute; left: 0; bottom: 0; display: flex; align-items: baseline; gap: 14px; padding: 14px 18px; background: var(--bg); }
.ov-no { font: 12px var(--mono); color: var(--mute); }
.ov-name { font-size: clamp(20px, 2.2vw, 30px); font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.ov-count { font: 11px var(--mono); color: var(--mute); text-transform: uppercase; letter-spacing: .08em; }
@media (min-width: 900px) {
  .overview { grid-template-columns: repeat(6, 1fr); grid-auto-rows: clamp(220px, 26vw, 440px); grid-auto-flow: dense; }
  .ov { grid-column: span 2; }
  .ov-img { aspect-ratio: auto; height: 100%; }
  .ov-1 { grid-column: span 4; grid-row: span 2; }
  .ov-4, .ov-5 { grid-column: span 3; }
}

/* ---------------------------------------------------------------- Profil */

.profile { display: grid; border-bottom: 1px solid var(--line); }
.profile-img { margin: 0; background: var(--soft); border-bottom: 1px solid var(--line); }
.profile-img img { width: 100%; max-height: 82vh; object-fit: cover; }
.profile-placeholder { display: block; width: 100%; aspect-ratio: 4 / 5; max-height: 70vh; background: var(--soft); }
.profile-text { padding: clamp(32px, 6vw, 80px) clamp(20px, 5vw, 64px) 12vh; }
.profile-text .prose { margin-top: 28px; }
@media (min-width: 1024px) {
  .profile { grid-template-columns: 5fr 7fr; }
  .profile-img { border-bottom: 0; border-right: 1px solid var(--line); }
  .profile-img img, .profile-placeholder { position: sticky; top: 0; height: 100dvh; max-height: none; }
}

/* ---------------------------------------------------------------- Fuss */

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px;
  padding: 22px clamp(20px, 5vw, 64px) calc(90px + env(safe-area-inset-bottom));
  font: 11px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--mute);
}
.foot-links { display: flex; gap: 18px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--fg); }
@media (min-width: 1024px) { .foot { padding-bottom: 26px; } }

/* ---------------------------------------------------------------- Lightbox */

.lb {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--bg); color: var(--fg); overflow: hidden;
}
.lb::backdrop { background: var(--bg); }
.lb[open] { display: flex; flex-direction: column; animation: lb-in .35s var(--ease); }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb-track {
  flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  overscroll-behavior: contain; scrollbar-width: none; touch-action: pan-x pinch-zoom;
}
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) 12px 0; }
.lb-slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: transparent; }
.lb.dragging .lb-track { transition: none; }
.lb-bar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 64px; padding: 0 max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px, env(safe-area-inset-left));
}
.lb-cap { margin: 0; display: flex; gap: 14px; align-items: baseline; min-width: 0; }
.lb-n { font: 12px var(--mono); color: var(--mute); white-space: nowrap; }
.lb-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-btns { display: flex; align-items: center; }
.lb-prev, .lb-next { width: 44px; height: 44px; font-size: 18px; display: none; }
@media (hover: hover) and (pointer: fine) { .lb-prev, .lb-next { display: grid; place-items: center; } }
.lb-close { margin-right: -10px; }
html.lb-open { overflow: hidden; }

/* ---------------------------------------------------------------- Ruhige Bewegung */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .15s !important; }
}
