/* Self-hosted fonts (SIL Open Font License): DM Sans, IBM Plex Mono */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/dm-sans-latin-400-normal.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: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/dm-sans-latin-ext-400-normal.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/dm-sans-latin-500-normal.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: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/dm-sans-latin-ext-500-normal.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-400-normal.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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-ext-400-normal.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-500-normal.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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-ext-500-normal.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* ─────────────────────────────────────────────────────────────
   Shared styles for all pages.
   To try other fonts, change --sans / --mono (and the <link> tag).
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #e7e6e6;
  --bg2: #dedddd;
  --line: #cbc9c9;
  --muted: #6b6764;        /* 4.5:1 on --bg */
  --muted-soft: #86827f;   /* lighter grey, used on the legal pages */
  --body: #2c2a28;
  --dark: #141312;
  --red: #b02a14;
  --red-dim: #8f2110;
  --red-faint: rgba(176, 42, 20, 0.09);
  --red-border: rgba(176, 42, 20, 0.28);

  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(1rem, 4vw, 3rem);
  --maxw: 1180px;
}

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

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

body {
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

::selection { background: rgba(176, 42, 20, 0.25); }

/* ── Links: thin underline, red on hover ── */
.intro a, .prose a, a.contact-email {
  color: var(--dark);
  text-decoration: underline;
  text-decoration-color: var(--red-border);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.intro a:hover, .prose a:hover, a.contact-email:hover {
  color: var(--red);
  text-decoration-color: var(--red);
}

code, .term {
  font-family: var(--mono);
  font-size: 0.8em;
  color: var(--red);
  background: var(--red-faint);
  padding: 0.05em 0.3em;
  hyphens: none;
  -webkit-hyphens: none;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ── Page frame ── */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.75rem var(--gutter) 2.5rem;
}

/* One-screen pages: footer sits at the bottom of the viewport */
.page.fit { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.page.fit > main { flex: 1; }
.page.fit .site-head { margin-bottom: clamp(2rem, 4.5vw, 3.5rem); }
.page.fit .site-foot { margin-top: clamp(2.5rem, 6vw, 4rem); }

.site-head {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  margin-bottom: clamp(2.5rem, 7vw, 5rem);
  border-bottom: 1px solid var(--line);
}
.site-name {
  font-family: var(--sans);
  font-size: clamp(1.45rem, 3.2vw, 2.05rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--dark);
  text-decoration: none;
}
.site-nav { display: flex; gap: clamp(1rem, 3vw, 2.25rem); list-style: none; flex-wrap: wrap; }
.site-nav a {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--red); }

/* Page switch, top right; the centred name / logo stays exactly centred.
   Current page first and red, the other one grey. */
.head-nav {
  position: absolute; right: 0; top: 0; bottom: 1.25rem;
  display: flex; align-items: center;
}
.head-nav .site-nav { gap: clamp(1rem, 2.5vw, 2rem); }
@media (max-width: 860px) {
  .site-head { flex-wrap: wrap; }
  .head-nav { position: static; width: 100%; justify-content: center; order: -1; margin-bottom: 1rem; }
}

/* Small mono links: invisible, larger hit area for touch */
.site-nav a, .legal a, .link-row a { position: relative; }
.site-nav a::after, .legal a::after, .link-row a::after {
  content: ""; position: absolute; inset: -0.75rem -0.4rem;
}

/* ── Mono labels ── */
.label {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Intro paragraph (large) ── */
.intro {
  font-size: clamp(1.12rem, 1.7vw, 1.38rem);
  line-height: 1.5;
  color: var(--dark);
}
.intro + .intro { margin-top: 0.9em; }

.affil {
  margin-top: 1.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.8;
  color: var(--muted);
}

/* ── Hero: text + photo ── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
  align-content: start;
  margin-bottom: clamp(3rem, 8vw, 6rem);
}
.page.fit .hero { margin-bottom: 0; }

/* Selected work + contact, side by side under the intro */
.meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 4vw, 3.5rem);
  margin-top: clamp(2rem, 5vw, 3.25rem);
}
.meta .label { margin-bottom: 0.9rem; }
.meta .affil { margin-top: 1rem; }
.meta .contact-email { font-size: 0.88rem; }
.emails { list-style: none; }
.emails li + li { margin-top: 0.15rem; }
.meta .affil { font-size: 0.66rem; }
.meta .works li { padding: 0.45rem 0; }
.meta .works li:first-child { padding-top: 0; }
.meta .works .title { font-size: 0.95rem; }
.meta .works .venue { font-size: 0.8rem; margin-top: 0.05rem; }
.meta .works .when { padding-top: 0.2rem; }
.portrait { display: flex; flex-direction: column; gap: 0.6rem; }
.portrait img, .photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12px;
}
/* Cut-out portrait (transparent PNG/WebP): shown uncropped, no rounded corners */
.portrait img { aspect-ratio: auto; height: auto; object-fit: contain; border-radius: 0; }
.photo-placeholder {
  background: var(--bg2);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.portrait .grid { height: 54px; }

/* ── Sections: label column + content column ── */
.section {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 1rem 2rem;
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3rem;
}
.section > .label { padding-top: 0.45rem; }
.section-body { max-width: 680px; }

.prose { font-size: 1rem; line-height: 1.7; }
.prose p + p { margin-top: 1em; }

/* ── Work / publications list ── */
.works { list-style: none; }
.works li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 0.25rem 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.works li:first-child { padding-top: 0; }
.works li:last-child { border-bottom: none; }
.works .when {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--red);
  padding-top: 0.3rem;
}
.works .title { color: var(--dark); line-height: 1.4; }
.works .title a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--red-border); }
.works .title a:hover { color: var(--red); border-color: var(--red); }
.works .venue { font-size: 0.88rem; color: var(--muted); margin-top: 0.15rem; }

/* ── Contact ── */
.contact-email {
  font-family: var(--mono);
  font-size: clamp(0.9rem, 2vw, 1.05rem);
}
.link-row {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem;
  margin-top: 1.25rem; list-style: none;
}
.link-row a {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--body);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s, border-color 0.2s;
}
.link-row a:hover { color: var(--red); border-color: var(--red); }
.contact-grid { height: 22px; max-width: 260px; margin-top: 2rem; }

/* ── Footer ── */
.site-foot {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-foot a { color: inherit; text-decoration: none; }
.site-foot a:hover { color: var(--red); }

/* ── Legal footer (Impressum · Datenschutz) ── */
.legal {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  text-align: center;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.legal a { color: inherit; text-decoration: none; transition: color 0.2s; }
.legal a:hover, .legal a[aria-current="page"] { color: var(--red); }

/* ── Legal pages ── */
.soft { --muted: var(--muted-soft); }
.legal-page { max-width: 680px; }
.legal-page h1 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); font-weight: 500; color: var(--dark); margin-bottom: 0.4rem; }
.legal-page .sub { font-size: 0.85rem; color: var(--muted); margin-bottom: 2.25rem; }
.legal-page h2 { margin: 2rem 0 0.6rem; }
.legal-page p, .legal-page li { font-size: 0.95rem; line-height: 1.65; }
.legal-page p + p { margin-top: 0.7em; }
.legal-page ul { padding-left: 1.1rem; }
.legal-page a { color: var(--dark); text-decoration: underline; text-decoration-color: var(--red-border); text-underline-offset: 0.2em; }
.legal-page a:hover { color: var(--red); text-decoration-color: var(--red); }
.legal-page dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 1.5rem; font-size: 0.95rem; line-height: 1.55; }
.legal-page dt { color: var(--muted); }
@media (max-width: 560px) { .legal-page dl { grid-template-columns: minmax(0, 1fr); gap: 0 0; } .legal-page dd { margin-bottom: 0.6rem; } }

/* ── Animated grids ── */
canvas.grid { display: block; width: 100%; }

/* ── Fade-in ── */
.js .fade { opacity: 0; transform: translateY(10px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .fade.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .fade { opacity: 1; transform: none; transition: none; }
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .portrait { max-width: 220px; order: -1; }
  .meta { grid-template-columns: minmax(0, 1fr); }
  .section { grid-template-columns: minmax(0, 1fr); padding: 2rem 0 2.5rem; }
  .section > .label { padding-top: 0; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .portrait { max-width: 132px; gap: 0.4rem; }
  .portrait .grid { height: 26px; }
}

/* All monospace text slightly heavier: medium weight, default (fuller) smoothing */
code, .term, .label, .site-nav a, .affil, .contact-email, .link-row a,
.works .when, .site-foot, .photo-placeholder, .door-arrow,
.rel-meta, .price, .cover-placeholder, .legal {
  font-weight: 500;
  -webkit-font-smoothing: auto;
}
