:root {
  --card-w: 240px;
  --bg: #000;
  --fg: #ececea;
  --muted: #8a8985;
  --line: rgba(236, 236, 234, 0.18);
  --rule: rgba(236, 236, 234, 0.12);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-edge: rgba(255, 255, 255, 0.09);
  color-scheme: dark;
}

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

html, body { min-height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

#field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--glass);
  backdrop-filter: blur(3px) saturate(140%);
  -webkit-backdrop-filter: blur(3px) saturate(140%);
  border-bottom: 1px solid var(--glass-edge);
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 880px;
  height: 56px;
  margin: 0 auto;
  padding: 0 16px;
  font-size: 14px;
}

.site-header .home { white-space: nowrap; font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }

.site-header nav { display: flex; gap: 20px; }

.site-header nav a { color: var(--muted); text-decoration: none; transition: color 150ms ease; }

.site-header nav a:hover,
.site-header nav a[aria-current="page"] { color: var(--fg); }

main {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: calc(56px + 12vh) 16px 64px;
}

/* Startseite: Karten mittig im Fenster */
main.home {
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 88px 16px 48px;
}

h1 {
  font-size: clamp(32px, 6vw, 44px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

h2 {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 40px 0 12px;
}

h2:first-of-type { margin-top: 32px; }

p { margin-top: 8px; }

a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* Textseiten (Impressum, Datenschutz): Schein um die Schrift, damit sie sich vom Raster abhebt */
.text { max-width: 640px; text-shadow: 0 0 2px #000, 0 0 6px #000, 0 0 12px #000; }

/* Projektkarten */
.projects {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

/* zu wenig Platz für alle nebeneinander → alle untereinander (Klasse setzt layout.js) */
.projects.stacked { flex-direction: column; align-items: center; }
.projects.stacked li { flex: none; }

.projects li { flex: 0 0 var(--card-w); width: var(--card-w); max-width: 100%; }

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 20px;
  border: 1px solid var(--glass-edge);
  border-radius: 12px;
  background: var(--glass);
  backdrop-filter: blur(3px) saturate(140%);
  -webkit-backdrop-filter: blur(3px) saturate(140%);
  text-decoration: none;
  transition: border-color 200ms ease, background-color 200ms ease, box-shadow 250ms ease, transform 200ms cubic-bezier(0.2, 0, 0, 1);
}

.card .icon {
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
  border-radius: 13px; /* ~iOS-Verhältnis */
  overflow: hidden;
  flex-shrink: 0;
}

/* Platzhalter, solange kein Bild drin ist */
.card .icon:empty {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.card .icon img { display: block; width: 100%; height: 100%; object-fit: cover; }

.card .top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card .name { font-weight: 600; letter-spacing: -0.01em; }
.card .year { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.card .desc { color: var(--muted); font-size: 14px; line-height: 1.5; }

@media (hover: hover) {
  .card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 32px rgba(255, 255, 255, 0.22), 0 0 4px rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
  }
}

.card:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}

@media (max-width: 480px) {
  main { padding-top: calc(56px + 4vh); }
  main.home { padding-top: 88px; }
  .site-header .inner { font-size: 13px; }
  .site-header nav { gap: 12px; }
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.text h1 + p { margin-top: 24px; }
