/* Galerie "Bewegte Modelle", ag-physics, Stand 16.11.2026. Eine Quelle fuer Artefakt (inline) und Webseite (Datei). */
:root {
  --paper: #f3efe6;
  --card: #fbf9f3;
  --ink: #1a222c;
  --muted: #5a616b;
  --line: #d8d1c2;
  --grid: rgba(26, 34, 44, 0.07);
  --accent: #0d6767;
  --warm: #b4512a;
  --cool: #2b5d93;
  --violet: #6a3f9e;
  --ochre: #85620f;
  --green: #2d6a4c;
  --stage: #ece6d8;
  --stage-ink: #1a222c;
  --c-sim: #0d6767;   --c-sim-bg: #dcefeb;
  --c-rec: #2b5d93;   --c-rec-bg: #e0e9f4;
  --c-bild: #85620f;  --c-bild-bg: #f5ebd2;
  --c-erkl: #2d6a4c;  --c-erkl-bg: #e3f0e8;
  --c-expl: #6a3f9e;  --c-expl-bg: #eee6f7;
  --c-ber: #5a616b;   --c-ber-bg: #e9e6df;
  --c-proj: #5a616b;
  --focus: #b4512a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f141a; --card: #151c24; --ink: #e5e1d6; --muted: #9aa2ac; --line: #28323d;
    --grid: rgba(229, 225, 214, 0.06);
    --accent: #5cc1b6; --warm: #e58a60; --cool: #7fb0e6; --violet: #c2a2ee; --ochre: #e0b65a; --green: #8fd0ad;
    --stage: #0b1015; --stage-ink: #e5e1d6;
    --c-sim: #5cc1b6; --c-sim-bg: #133331; --c-rec: #7fb0e6; --c-rec-bg: #17283b;
    --c-bild: #e0b65a; --c-bild-bg: #33290f; --c-erkl: #8fd0ad; --c-erkl-bg: #16301f;
    --c-expl: #c2a2ee; --c-expl-bg: #2a2140; --c-ber: #b3b9c1; --c-ber-bg: #242a31; --c-proj: #9aa2ac;
    --focus: #e58a60;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f141a; --card: #151c24; --ink: #e5e1d6; --muted: #9aa2ac; --line: #28323d;
  --grid: rgba(229, 225, 214, 0.06);
  --accent: #5cc1b6; --warm: #e58a60; --cool: #7fb0e6; --violet: #c2a2ee; --ochre: #e0b65a; --green: #8fd0ad;
  --stage: #0b1015; --stage-ink: #e5e1d6;
  --c-sim: #5cc1b6; --c-sim-bg: #133331; --c-rec: #7fb0e6; --c-rec-bg: #17283b;
  --c-bild: #e0b65a; --c-bild-bg: #33290f; --c-erkl: #8fd0ad; --c-erkl-bg: #16301f;
  --c-expl: #c2a2ee; --c-expl-bg: #2a2140; --c-ber: #b3b9c1; --c-ber-bg: #242a31; --c-proj: #9aa2ac;
  --focus: #e58a60;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(var(--grid) 1px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font: 17px/1.58 "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  overflow-x: hidden;
}
.gal-rahmen {
  max-width: 76rem;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.mono, .gal-kicker, .chip, .gal-datum, .gal-nav a, .gal-schalter button, .gal-legende dt, .gal-par {
  font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--warm); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

/* Kopf */
.gal-kopf { padding: 2.6rem 0 1.4rem; border-bottom: 1px solid var(--line); }
.gal-zurueck { display: none; font-size: .9rem; margin-bottom: 1rem; }
body[data-ort="web"] .gal-zurueck { display: inline-block; }
.gal-kicker { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 .7rem; }
.gal-titel { font-size: clamp(2.3rem, 7vw, 4.4rem); line-height: 1.02; font-weight: 500; margin: 0 0 1rem;
  letter-spacing: -.01em; font-variation-settings: "opsz" 72; }
.gal-titel em { font-style: italic; color: var(--accent); }
.gal-lede { max-width: 44rem; font-size: 1.12rem; margin: 0 0 1.2rem; }
.gal-schalter { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.gal-schalter button {
  font-size: .78rem; letter-spacing: .04em; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem; cursor: pointer; min-height: 2.2rem;
}
.gal-schalter button:hover { border-color: var(--accent); }
.gal-schalter button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Legende */
.gal-legende { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .6rem 1.4rem;
  margin: 1.4rem 0 0; padding: 1rem 0 0; }
.gal-legende div { display: flex; gap: .6rem; align-items: baseline; }
.gal-legende dt { flex: none; }
.gal-legende dd { margin: 0; font-size: .92rem; color: var(--muted); line-height: 1.4; }

/* Inhaltsnavigation */
.gal-nav { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line);
  padding: .6rem 0; }
.gal-nav ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.gal-nav a { font-size: .78rem; text-decoration: none; color: var(--muted); padding: .2rem 0; display: inline-block; }
.gal-nav a:hover { color: var(--accent); }
.gal-nav a span { color: var(--warm); margin-right: .25rem; }

/* Gruppen */
.gal-gruppe { padding: 2.6rem 0 1rem; scroll-margin-top: 3.2rem; }
.gal-gruppe > header { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; align-items: baseline;
  margin-bottom: 1.3rem; }
.gal-par { font-size: 1.6rem; color: var(--warm); line-height: 1; grid-row: span 2; }
.gal-gruppe h2 { font-size: clamp(1.45rem, 3.4vw, 2rem); font-weight: 500; margin: 0; line-height: 1.15; }
.gal-gruppe header p { margin: 0; color: var(--muted); max-width: 46rem; font-size: 1rem; }
@media (max-width: 34rem) { .gal-gruppe > header { grid-template-columns: 1fr; } .gal-par { grid-row: auto; } }

.gal-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.2rem; }

/* Karte */
.karte { background: var(--card); border: 1px solid var(--line); border-radius: 4px; display: flex; flex-direction: column;
  min-width: 0; position: relative; }
.karte-buehne { position: relative; margin: 0; background: var(--stage); border-bottom: 1px solid var(--line);
  aspect-ratio: 16 / 10; overflow: hidden; border-radius: 4px 4px 0 0; }
.karte-buehne canvas, .karte-buehne img { display: block; width: 100%; height: 100%; object-fit: cover; }
.karte-buehne figcaption { position: absolute; left: .5rem; bottom: .4rem; font: .64rem/1.2 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .06em; text-transform: uppercase; color: var(--stage-ink); opacity: .62; pointer-events: none; }
.karte-text { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.karte-meta { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.gal-datum { margin-left: auto; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.karte h3 { margin: .1rem 0 0; font-size: 1.22rem; line-height: 1.25; font-weight: 600; }
.karte p { margin: 0; font-size: .97rem; line-height: 1.5; }
.karte .zugang { margin-top: auto; padding-top: .4rem; font-size: .9rem; }
.karte .zugang a { font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; }
.karte .zugang a::after { content: " \2197"; font-weight: 400; }
.karte .zugang .intern { color: var(--muted); font-style: italic; }

.chip { display: inline-block; font-size: .66rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: .22rem .45rem; border-radius: 3px; border: 1px solid currentColor; line-height: 1.2; }
.chip-sim { color: var(--c-sim); background: var(--c-sim-bg); }
.chip-rec { color: var(--c-rec); background: var(--c-rec-bg); }
.chip-bild { color: var(--c-bild); background: var(--c-bild-bg); }
.chip-erkl { color: var(--c-erkl); background: var(--c-erkl-bg); }
.chip-expl { color: var(--c-expl); background: var(--c-expl-bg); }
.chip-ber { color: var(--c-ber); background: var(--c-ber-bg); }
.chip-proj { color: var(--c-proj); background: transparent; border-style: dashed; }

.karte-film img { object-fit: contain; }
.nur-web { display: none; }
body[data-ort="web"] .nur-web { display: block; }
body[data-ort="web"] .nur-artefakt { display: none; }

/* Fuss */
.gal-fuss { margin-top: 2.4rem; padding: 1.6rem 0 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.gal-fuss h2 { font-size: 1.1rem; color: var(--ink); font-weight: 600; margin: 0 0 .5rem; }
.gal-fuss p { max-width: 50rem; margin: 0 0 .8rem; }

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