/* =========================================================================
   HyperVision by Erik – Design-System (base.css)
   Verbindlich: ../../DESIGN.md. Handy zuerst, Breakpoints 768 px und 1100 px
   (Galerie: 3 Spalten erst ab 1180 px).
   Bewegung: nichts zeitgesteuert. Alles Scroll-Gekoppelte läuft über --p
   (gesetzt von js/main.js). Erlaubt sind nur kurze Übergänge (≤ 200 ms)
   bei Klick-/Hover-Elementen.
   ========================================================================= */

/* Inter lokal als Fallback, falls die Systemschrift (SF Pro) fehlt */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/Inter-var-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;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  /* Farben (Kontrast gemessen, siehe DESIGN.md) */
  --bg: #07080b;
  --surface: #101217;
  --surface-2: #191c22;
  --surface-3: #23272f;            /* nur Hover-Zustand von Flächen */
  --line: rgba(255, 255, 255, .12);
  --line-strong: rgba(255, 255, 255, .24);
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #86868b;               /* nur ab 13 px */
  --cyan: #19d3ff;
  --magenta: #ff4fd0;               /* nur im Verlauf */
  --rec: #ff453a;                   /* nur REC-Punkt = Video/Abspielen */
  --on-cyan: #07080b;
  --grad: linear-gradient(90deg, #19d3ff, #ff4fd0);
  --nav-bg: rgba(7, 8, 11, .72);

  /* Schrift */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --max: 1180px;
  --max-wide: 1440px;
  --gutter: 20px;
  --nav-h: 52px;
  --section-pad: clamp(5.5rem, 12vw, 10.5rem);
  --gap: clamp(.75rem, 2vw, 1.25rem);

  /* Radien */
  --r-tile: 22px;
  --r-img: 14px;
  --r-pill: 999px;

  /* Kurze Klick-Übergänge (≤ 200 ms) */
  --t-fast: 150ms;
  --t-panel: 180ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (min-width: 768px) {
  :root { --gutter: 40px; }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;       /* 17 px */
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
/* hidden muss auch gegen display-Regeln wie .icon-btn gewinnen (Lightbox-Pfeile bei 1 Bild) */
[hidden] { display: none !important; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
canvas { display: block; max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

a { color: var(--cyan); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

::selection { background: rgba(25, 211, 255, .32); color: var(--text); }

/* Scroll sperren (Menü offen, Lightbox offen) */
html.hv-lock { overflow: hidden; }

/* ---------- Fokus ---------- */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 300;
  padding: .625rem 1rem;
  border-radius: var(--r-pill);
  background: var(--cyan);
  color: var(--on-cyan);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

/* ---------- Typografie ---------- */
.t-hero, .t-h1, .t-h2, .t-h3 { color: var(--text); text-wrap: balance; }

.t-hero {
  font-size: clamp(2.75rem, 1.357rem + 5.714vw, 6.5rem);   /* 44 → 104 px */
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.t-h1 {
  font-size: clamp(2.25rem, 1.414rem + 3.429vw, 4.5rem);   /* 36 → 72 px */
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.t-h2 {
  font-size: clamp(1.75rem, 1.286rem + 1.905vw, 3rem);     /* 28 → 48 px */
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.022em;
}
.t-h3 {
  font-size: clamp(1.3125rem, 1.15rem + .667vw, 1.75rem);  /* 21 → 28 px */
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.012em;
}
.t-lead {
  font-size: clamp(1.1875rem, 1.095rem + .381vw, 1.4375rem); /* 19 → 23 px */
  font-weight: 400;
  line-height: 1.42;
  color: var(--text-2);
  text-wrap: pretty;
}
.t-body { font-size: 1.0625rem; line-height: 1.5; }
.t-small { font-size: .875rem; line-height: 1.45; color: var(--text-2); }
.t-exif {
  font-family: var(--font-mono);
  font-size: .8125rem;          /* 13 px */
  line-height: 1.45;
  letter-spacing: .02em;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.measure { max-width: 68ch; }
.muted { color: var(--text-2); }
/* Wert nicht mitten drin umbrechen (z. B. «35–150 mm», Modellnamen) */
.nowrap { white-space: nowrap; }

/* Verlauf nur für EIN Wort pro Seite */
.grad-text {
  color: var(--cyan);
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
@media (forced-colors: active) {
  .grad-text { background: none; -webkit-text-fill-color: currentColor; color: CanvasText; }
}

/* Abstände zwischen Geschwistern */
.flow > * + * { margin-top: var(--flow, 1em); }

/* ---------- Layout ---------- */
.container {
  width: min(100% - var(--gutter) * 2, var(--max));
  margin-inline: auto;
}
.container-wide {
  width: min(100% - var(--gutter) * 2, var(--max-wide));
  margin-inline: auto;
}
.section { padding-block: var(--section-pad); }
.section + .section { border-top: 1px solid var(--line); }
.section.no-line, .section + .section.no-line { border-top: 0; }
.section-head { max-width: 68ch; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head > * + * { margin-top: .75rem; }

main { display: block; padding-top: var(--nav-h); }
main.under-nav { padding-top: 0; }   /* Vollbild-Hero unter der Navigation */

.grid { display: grid; gap: var(--gap); }
@media (min-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.cluster { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
}
/* Einzige Unschärfe-Fläche der Seite. Als Pseudo-Element, damit das
   Handy-Panel (position: fixed) nicht in der Leiste gefangen ist. */
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  white-space: nowrap;
}
.wordmark:hover { text-decoration: none; }
.wordmark-by { color: var(--text-2); font-weight: 400; }

.nav-menu ul { display: flex; margin: 0; padding: 0; list-style: none; }
.nav-menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-2);
  text-decoration: none;
  transition: color var(--t-fast) ease;
}
.nav-menu a:hover { color: var(--text); }
.nav-menu a[aria-current="page"] {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: .5rem;
  min-width: 44px;
  min-height: 44px;
  margin-right: -10px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text);
  font-size: .9375rem;
  font-weight: 500;
}
.nav-toggle svg { width: 18px; height: 18px; flex: none; }
.nav-toggle line {
  transition: transform var(--t-panel) var(--ease);
  transform-origin: 9px 9px;
}
.nav.is-open .nav-toggle .l1 { transform: rotate(45deg) translateY(3px); }
.nav.is-open .nav-toggle .l2 { transform: rotate(-45deg) translateY(-3px); }

/* Handy: Menü-Knopf + Vollbild-Panel (nur mit JavaScript) */
.js .nav-toggle { display: inline-flex; }
.js .nav-menu {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  z-index: 99;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.5rem var(--gutter) calc(2rem + env(safe-area-inset-bottom));
  background: var(--bg);
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--t-panel) ease, visibility 0s linear var(--t-panel);
}
.js .nav.is-open .nav-menu {
  visibility: visible;
  opacity: 1;
  transition: opacity var(--t-panel) ease;
}
.js .nav-menu ul { flex-direction: column; }
.js .nav-menu a {
  width: 100%;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.js .nav-menu a[aria-current="page"] { color: var(--cyan); }

/* Ohne JavaScript auf dem Handy: Links unter der Wortmarke, umbrechend */
html:not(.js) .nav { height: auto; }
html:not(.js) .nav-inner { flex-wrap: wrap; padding-block: 4px; gap: 0 1rem; }
html:not(.js) .nav-menu ul { flex-wrap: wrap; gap: 0 .25rem; }
/* auch ohne JavaScript mindestens 44 × 44 px («3D» wäre sonst nur 19 px breit) */
html:not(.js) .nav-menu a { min-width: 44px; justify-content: center; padding-inline: .5rem; font-size: .875rem; }
@media (max-width: 767.98px) {
  html:not(.js) .nav-menu li:first-child a { margin-left: -.5rem; }   /* Text bündig unter der Wortmarke */
}
html:not(.js) main { padding-top: 96px; }

@media (min-width: 768px) {
  .js .nav-toggle { display: none; }
  .js .nav-menu,
  html:not(.js) .nav-menu {
    position: static;
    inset: auto;
    overflow: visible;
    padding: 0;
    background: none;
    visibility: visible;
    opacity: 1;
    transition: none;
  }
  .js .nav-menu ul, html:not(.js) .nav-menu ul { flex-direction: row; gap: .25rem; }
  .js .nav-menu a, html:not(.js) .nav-menu a {
    width: auto;
    min-width: 44px;              /* «3D» ist sonst nur 43 px breit */
    min-height: 44px;
    justify-content: center;
    padding: 0 .75rem;
    border-bottom: 0;
    color: var(--text-2);
    font-size: .875rem;
    font-weight: 400;
    letter-spacing: 0;
  }
  .js .nav-menu a:hover { color: var(--text); }
  .js .nav-menu a[aria-current="page"] { color: var(--cyan); }
  .nav-menu li:last-child a { margin-right: -.75rem; }
  html:not(.js) .nav { height: var(--nav-h); }
  html:not(.js) .nav-inner { flex-wrap: nowrap; padding-block: 0; }
  html:not(.js) main { padding-top: var(--nav-h); }
  html:not(.js) main.under-nav { padding-top: 0; }
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding-block: 3rem calc(3rem + env(safe-area-inset-bottom));
  color: var(--text-2);
  font-size: .875rem;
}
.footer-inner { display: grid; gap: 1rem; }
.footer a { color: var(--text-2); }
.footer a:hover { color: var(--text); }
.footer .wordmark { color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-legal { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; color: var(--text-3); font-size: .8125rem; }
@media (min-width: 768px) {
  .footer-inner { grid-template-columns: 1fr auto; align-items: center; }
  .footer-legal { grid-column: 1 / -1; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;
  padding: 0 1.375rem;
  border: 2px solid transparent;
  border-radius: var(--r-pill);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease, filter var(--t-fast) ease;
}
.btn:hover { text-decoration: none; }
/* Primär: Text #07080b auf Cyan (11.3:1), Rand im Verlauf Cyan → Magenta */
.btn-primary {
  color: var(--on-cyan);
  background:
    linear-gradient(var(--cyan), var(--cyan)) padding-box,
    var(--grad) border-box;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { filter: brightness(.94); }
.btn-secondary {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line-strong);
  padding: 0 calc(1.375rem + 1px);
}
.btn-secondary:hover { background: var(--surface-2); border-color: rgba(255, 255, 255, .36); }
.btn-secondary:active { background: var(--surface-3); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

/* Textlink mit Pfeil («Alle Fotos ›») */
.link-arrow {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--cyan);
  font-weight: 500;
  text-decoration: none;
}
.link-arrow::after {
  content: "\203A";
  content: "\203A" / "";
  margin-left: .3em;
  font-size: 1.2em;
  line-height: 1;
}
.link-arrow:hover { text-decoration: underline; }

/* Rundes Symbol-Knopf (Lightbox, Steuerung), 44 × 44 */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  transition: background-color var(--t-fast) ease;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Kachel ---------- */
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--r-tile);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
a.tile:hover { text-decoration: none; }
.tile-media {
  position: relative;
  aspect-ratio: var(--ratio, 4 / 5);
  overflow: hidden;
  background: var(--surface-2);
}
.tile-media img, .tile-media video, .tile-media canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* <picture> (WebP-Quelle) soll die Kachel genauso füllen wie ein einzelnes img */
.tile-media picture { display: block; width: 100%; height: 100%; }
.tile-body { display: grid; gap: .5rem; padding: 1.25rem 1.5rem 1.75rem; }
.tile-title { display: flex; align-items: center; gap: .6rem; }
a.tile:hover .link-arrow { text-decoration: underline; }

/* ---------- Galerie ---------- */
.gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem) var(--gap);
  align-items: start;
}
@media (min-width: 768px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* 3 Spalten erst ab 1180 px: darunter würden Hochformate zu schmal */
@media (min-width: 1180px) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Jede Kachel ist ein <button> mit Bild + EXIF-Zeile */
.gallery-item {
  display: flex;
  flex-direction: column;
  gap: .625rem;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--r-img);
  background: none;
  color: inherit;
  text-align: left;
  cursor: zoom-in;
}
.gallery-frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--r-img);
  background: var(--surface);
}
.gallery-frame img {
  width: 100%;
  height: auto;     /* Seitenverhältnis aus width/height, nichts hart beschneiden */
}
/* Sucher-Ecken (Fokus-Klammern): nur bei Hover und Tastaturfokus */
.gallery-frame::after {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  opacity: 0;
  --c: #fff;
  --l: 20px;
  --w: 2px;
  background:
    linear-gradient(var(--c) 0 0) top left / var(--l) var(--w),
    linear-gradient(var(--c) 0 0) top left / var(--w) var(--l),
    linear-gradient(var(--c) 0 0) top right / var(--l) var(--w),
    linear-gradient(var(--c) 0 0) top right / var(--w) var(--l),
    linear-gradient(var(--c) 0 0) bottom left / var(--l) var(--w),
    linear-gradient(var(--c) 0 0) bottom left / var(--w) var(--l),
    linear-gradient(var(--c) 0 0) bottom right / var(--l) var(--w),
    linear-gradient(var(--c) 0 0) bottom right / var(--w) var(--l);
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, .7));
  transition: opacity var(--t-fast) ease;
}
/* :active = Druckzustand auf Touch-Geräten (dort gibt es kein Hover) */
.gallery-item:hover .gallery-frame::after,
.gallery-item:focus-visible .gallery-frame::after,
.gallery-item:active .gallery-frame::after { opacity: 1; }
.gallery-caption { display: grid; gap: .125rem; padding-inline: 2px; }
.gallery-title { font-size: .9375rem; font-weight: 600; color: var(--text); }
/* Bricht die EXIF-Zeile um, dann in zwei ähnlich lange Zeilen statt «ISO 800» allein
   (gilt auch in der Lightbox-Leiste) */
.gallery-caption .t-exif,
.lightbox-exif { text-wrap: balance; }

/* ---------- Chips + REC ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 28px;
  padding: .25rem .75rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}
/* KI-Hinweis: neutral umrandet mit kleinem Funken, keine Signalfarbe */
.chip-ki {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text);
}
.chip-ki::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: none;
  background: currentColor;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

/* REC-Punkt: Rot bedeutet nur «Video / Abspielen». Kein Blinken. */
.rec {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rec);
  box-shadow: 0 0 0 3px rgba(255, 69, 58, .22);
  vertical-align: middle;
}

/* ---------- Video-Karte (9:16) ---------- */
.video-card { display: grid; gap: 1rem; cursor: pointer; }
.video-frame {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: var(--r-tile);
  background: var(--surface);
}
.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface);
}
.video-play {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  padding: 0 1.1rem 0 .95rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: rgba(16, 18, 23, .86);
  color: var(--text);
  font-size: .9375rem;
  font-weight: 600;
  transition: background-color var(--t-fast) ease;
}
.video-play:hover { background: rgba(35, 39, 47, .94); }
.video-play:active { background: var(--surface-3); }   /* Druckzustand (Touch) */
.video-card.is-playing { cursor: auto; }
.video-card.is-playing .video-play { display: none; }
.video-body { display: grid; gap: .35rem; }
.video-body .cluster { margin-top: .35rem; gap: .5rem; }

/* ---------- Scroll-gekoppelt (--p von js/main.js) ---------- */
/* Reveal: 0.94 → 1 und 0 → 1, direkt aus der Scroll-Position.
   Ohne JavaScript ist --p nicht gesetzt → voll sichtbar. */
[data-scroll="reveal"] {
  opacity: var(--p, 1);
  transform: scale(calc(.94 + .06 * var(--p, 1)));
  transform-origin: 50% 60%;
}

/* Hohe Sticky-Sektion mit festgehaltener Bühne.
   Höhe pro Seite: style="--sticky-h: 400vh". --p läuft 0 → 1 über die Sektion. */
.sticky-section {
  position: relative;
  height: var(--sticky-h, 250vh);
}
.sticky-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

/* Teil-Bereich von --p auf Deckkraft abbilden: style="--from:.4; --to:.55" */
.p-fade {
  opacity: clamp(0, calc((var(--p, 1) - var(--from, 0)) / (var(--to, 1) - var(--from, 0))), 1);
}

/* Canvas-Bildfolge (js/sequence.js) */
.sequence-canvas { width: 100%; height: 100%; }
.sequence-video { width: 100%; height: 100%; object-fit: contain; background: var(--bg); }
.sequence-play {
  position: absolute;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(16, 18, 23, .86);
}

/* ---------- Lightbox (<dialog>, js/lightbox.js) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  opacity: 1;
  transition: opacity var(--t-panel) ease, overlay var(--t-panel) allow-discrete, display var(--t-panel) allow-discrete;
}
.lightbox:not([open]) { display: none; opacity: 0; }
@starting-style {
  .lightbox[open] { opacity: 0; }
}
.lightbox::backdrop { background: rgba(7, 8, 11, .92); }

.lightbox-stage {
  position: relative;
  min-height: 0;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}
.lightbox-img {
  position: absolute;
  inset: calc(64px + env(safe-area-inset-top)) 16px 16px;
  margin: auto;
  width: auto;
  height: auto;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 80px - env(safe-area-inset-top));
  border-radius: var(--r-img);
  -webkit-user-drag: none;
  transition: opacity var(--t-fast) ease;
}
.lightbox-img.is-loading { opacity: .35; }

.lightbox-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem var(--gutter) calc(.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.lightbox-meta { flex: 1; min-width: 0; display: grid; gap: .125rem; }
.lightbox-title {
  font-size: .9375rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lightbox-exif { overflow-wrap: anywhere; }
/* Handy: neben den Pfeilen ist wenig Platz. Längere Titel bis 2 Zeilen statt «…» nach 22 Zeichen */
@media (max-width: 767.98px) {
  .lightbox-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: normal;
  }
}
.lightbox-controls { display: flex; align-items: center; gap: .5rem; flex: none; }
.lightbox-count {
  min-width: 4.5ch;
  text-align: center;
  font-family: var(--font-mono);
  font-size: .8125rem;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.lightbox-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  z-index: 2;
}
@media (min-width: 1100px) {
  .lightbox-img {
    inset: 72px 96px 24px;
    max-width: calc(100% - 192px);
    max-height: calc(100% - 96px);
  }
  .lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 52px;
    height: 52px;
    transform: translateY(-50%);
  }
  .lightbox-prev { left: 24px; }
  .lightbox-next { right: 24px; }
  .lightbox-close { top: 20px; right: 24px; }
}

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
  /* 0s statt .01ms: Mit .01ms bekamen auch ul/li im Handy-Menü (Vorgabe «all 0s») einen
     Übergang, die geerbte visibility kam einen Frame zu spät, und der Fokus blieb beim
     Öffnen auf «Schliessen» statt auf dem aktuellen Link. */
  *, *::before, *::after {
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
  }
  /* Keine Skalierung, nur Deckkraft (JS setzt --p für Reveal fest auf 1) */
  [data-scroll="reveal"] { transform: none; }
  /* Sticky-Sektionen stehen still: keine leere Scroll-Strecke */
  .sticky-section { height: auto; }
  .sticky-stage { position: relative; }
  .p-fade { opacity: 1; }
}

/* ---------- Windows-Kontrastmodus ---------- */
@media (forced-colors: active) {
  .nav::before { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .btn, .chip, .icon-btn, .video-play { border: 1px solid ButtonText; }
  .rec { forced-color-adjust: none; }
}
