/* Archivo (variable: width + weight), self-hosted – SIL Open Font License, see fonts/OFL.txt */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations");
  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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  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;
}

:root {
  --ink: #111111;
  --muted: #6b6b6b;
  --paper: #ffffff;
  --side: 250px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.3;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--ink); }
a:hover { color: var(--muted); }
p { margin: 0; }
[hidden] { display: none !important; }

/* language: show only the active one */
html[lang="de"] [lang="en"]:not(html),
html[lang="en"] [lang="de"]:not(html) { display: none !important; }

.b { font-weight: 700; }
.muted { color: var(--muted); }
.gap { margin-top: 18px; }

/* ---------- layout ---------- */
.wrap {
  display: flex;
  gap: clamp(20px, 3vw, 48px);
  padding: 14px clamp(12px, 1.4vw, 20px) 40px;
}

.side {
  flex: 0 0 var(--side);
  width: var(--side);
  position: sticky;
  top: 14px;
  align-self: flex-start;
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  font-size: 22px;
  font-weight: 800;
  font-stretch: 115%;
  line-height: 0.82;
  letter-spacing: -0.015em;
  padding-bottom: 0.2em; /* room for descenders (the g in "english") below the tight line-height */
}

main { flex: 999 1 560px; min-width: 0; padding-top: 2px; }

/* ---------- menu ---------- */
.brand { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.n, .sub { display: block; text-decoration: none; color: var(--ink); }
.n:hover { color: var(--ink); }

.navs { display: flex; flex-direction: column; gap: 22px; }
.grp { display: flex; flex-direction: column; }

.m, .s {
  display: block;
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  text-align: left;
  text-decoration: none;
  line-height: inherit;
  cursor: pointer;
  transition: padding-left 0.28s var(--ease);
}
.m:hover, .m:focus-visible, .m.on { padding-left: 0.55em; color: var(--ink); outline: none; }
.s:hover, .s:focus-visible { padding-left: 0.7em; color: var(--ink); outline: none; }
.s.on { font-weight: 700; }

.tog {
  display: none;
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  margin: -10px -10px 0 0;
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.28s var(--ease);
}
/* plus aus zwei balken, so fett wie die schrift; offen dreht es sich zum kreuz */
.tog::before, .tog::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 19px;
  width: 24px;
  height: 6px;
  background: currentColor;
}
.tog::after { transform: rotate(90deg); }
.tog[aria-expanded="true"] { transform: rotate(45deg); }

/* ---------- übersicht ---------- */
.feed { column-count: 4; column-gap: 10px; }
.feed figure { break-inside: avoid; margin: 0 0 36px; }
.feed a { display: block; text-decoration: none; }
.feed a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.feed figcaption { margin-top: 8px; font-size: 13px; line-height: 1.25; }
.feed .no { display: block; color: var(--muted); }
.feed .t { display: block; font-weight: 700; font-stretch: 110%; }

/* unregelmässig: bilder unterschiedlich breit, versetzt und mit wechselnden abständen (nur desktop) */
@media (min-width: 821px) {
  .feed figure:nth-child(3n + 2) { width: 74%; }
  .feed figure:nth-child(4n + 3) { width: 86%; margin-left: 14%; }
  .feed figure:nth-child(5n + 4) { width: 62%; margin-left: 38%; margin-bottom: 96px; }
  .feed figure:nth-child(7n + 1) { margin-bottom: 72px; }
}

/* ---------- arbeiten ---------- */
.work {
  display: grid;
  grid-template-columns: 200px 280px minmax(0, 1fr);
  column-gap: clamp(16px, 2vw, 32px);
  row-gap: 32px;
  align-items: start;
}
.series { font-size: 14px; line-height: 1.2; position: sticky; top: 16px; }
.txt { font-size: 14px; line-height: 1.3; position: sticky; top: 16px; }
.pre { white-space: pre-line; }
.mo .pre { margin: 4px 0 0; font-size: 14px; line-height: 1.3; }
.pics { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
/* jedes bild ganz sichtbar: breite so begrenzt, dass die höhe ins fenster passt. --r = breite / höhe, in main.js gesetzt */
.pics img { width: min(100%, calc((100vh - 28px) * var(--r))); }

/* hover-vorschau: bild nutzt den platz ab dem untermenü, ohne text */
.work.peek .txt { display: none; }
.work.peek .pics { grid-column: 2 / -1; position: sticky; top: 14px; }

.mo { display: none; flex-direction: column; gap: 56px; }
.mo section { display: flex; flex-direction: column; gap: 10px; }
.mo h2 { margin: 0 0 4px; font-size: 15px; line-height: 1.2; font-weight: 700; font-stretch: 110%; }
.mo h2 span { font-weight: 400; color: var(--muted); }

/* ---------- textseiten ---------- */
.page { max-width: 520px; font-size: 15px; line-height: 1.35; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .work { grid-template-columns: 200px minmax(0, 1fr); }
  .work .txt { grid-column: 2; }
  .work .pics { grid-column: 1 / -1; }
  .feed { column-count: 3; }
}

@media (max-width: 820px) {
  .wrap { flex-direction: column; gap: 24px; }
  .side { position: static; width: auto; flex: none; max-height: none; overflow: visible; font-size: 30px; gap: 18px; }
  .tog { display: block; }
  .navs { display: none; }
  .navs.open { display: flex; padding: 8px 0 12px; }
  .feed { column-count: 2; }
  .feed figure { margin-bottom: 24px; }
  .work { display: none; }
  .mo { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  .m, .s, .tog { transition: none; }
}
