/* klöpping.de – ein Sternatlas: tags Papier und Tinte, nachts Himmel und Rotlicht.
   Schrift: Bricolage Grotesque (OFL, liegt daneben), eine Familie für alles. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  /* Tag: Atlas-Papier, Tinte, Rotstift */
  --paper:  #edf1f7;
  --ink:    #182a4b;
  --muted:  #56678a;
  --rule:   #c5d0e1;
  --signal: #b4231b;
  --star:   #182a4b;

  --measure: 38rem;
  --step--1: 0.875rem;
  --step-0:  1.125rem;
  --step-1:  1.375rem;
  --step-2:  1.75rem;
  --step-hero: clamp(3rem, 11vw, 6.25rem);

  color-scheme: light dark;
}

/* Nacht: wenn das Gerät es will und niemand „Tag“ gewählt hat, oder per „Nacht“ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Nacht: tiefes Blau, Sterne, Rotlicht wie an der Montierung */
    --paper:  #121b33;
    --ink:    #dbe3f1;
    --muted:  #8c9ab6;
    --rule:   #2a3858;
    --signal: #ff6a5c;
    --star:   #f4f1e6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    /* Nacht: tiefes Blau, Sterne, Rotlicht wie an der Montierung */
  --paper:  #121b33;
  --ink:    #dbe3f1;
  --muted:  #8c9ab6;
  --rule:   #2a3858;
  --signal: #ff6a5c;
  --star:   #f4f1e6;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: var(--step-0);
  font-variation-settings: "opsz" 14;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-color: var(--signal); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: var(--signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: 0.25rem 0.5rem; }

/* --- Kopf ---------------------------------------------------------------- */
header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 0;
}
.wordmark {
  font-weight: 700;
  font-stretch: 80%;
  font-size: var(--step-1);
  letter-spacing: -0.01em;
  text-decoration: none;
}
header.site ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; list-style: none; }
header.site nav a { text-decoration: none; color: var(--muted); }
header.site nav a:hover { color: var(--ink); }
header.site nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--signal);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

/* Tag | Nacht – nach der Navigation; ohne JavaScript unsichtbar */
.theme { display: none; color: var(--rule); white-space: nowrap; font-size: var(--step--1); }
.js .theme { display: inline; }
.theme button { font: inherit; color: var(--muted); background: none; border: 0; padding: 0 0.15em; cursor: pointer; }
.theme button:hover { color: var(--ink); }
.theme button[aria-pressed="true"] {
  color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--signal);
  text-decoration-thickness: 2px; text-underline-offset: 0.35em;
}
header.site .right { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.5rem; }

/* --- Inhalt -------------------------------------------------------------- */
main { max-width: 64rem; margin: 0 auto; padding: 3rem 1rem 4rem; }
main > h1, .prose, main > .lead { max-width: var(--measure); }

h1, h2, h3 { font-variation-settings: "opsz" 96; line-height: 1.12; letter-spacing: -0.015em; }
main > h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); font-weight: 650; font-stretch: 85%; margin: 0 0 1rem; }
h2 { font-size: var(--step-2); font-weight: 600; margin: 2.75rem 0 0.75rem; }
h3 { font-size: var(--step-1); font-weight: 600; margin: 2rem 0 0.25rem; }
p, ul, ol, table { margin: 0 0 1rem; }
.lead { font-size: var(--step-1); line-height: 1.4; color: var(--muted); margin-bottom: 2.5rem; }
.meta { color: var(--muted); font-size: var(--step--1); margin-top: 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

/* Startseite: der Name ist das Bild */
.hero h1 {
  font-size: var(--step-hero);
  font-weight: 760;
  font-stretch: 75%;
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin: 0 0 1.25rem;
  max-width: 10ch;
}
.hero .lead { max-width: 30rem; }

.sky { margin: 0 0 3rem; max-width: 40rem; }

/* Breit: Name links, Himmel rechts – das Sternbild ist das eine große Bild der Seite */
@media (min-width: 60rem) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    grid-template-rows: auto 1fr;
    column-gap: 3rem;
    align-items: start;
    margin-bottom: 2rem;
  }
  .hero h1 { grid-column: 1; grid-row: 1; }
  .hero .lead { grid-column: 1; grid-row: 2; }
  .hero .sky { grid-column: 2; grid-row: 1 / span 2; align-self: center; max-width: none; margin: 0; }
}
.sky svg { display: block; width: 100%; height: auto; overflow: visible; }
.sky .line { fill: none; stroke: var(--rule); stroke-width: 1.5; stroke-linejoin: round; }
.sky .halo { fill: var(--star); opacity: 0.08; transition: opacity 0.2s; }
.sky .core { fill: var(--star); }
.sky .quiet { opacity: 0.55; }
.sky text { fill: var(--ink); font-size: 15px; font-weight: 550; text-anchor: middle; font-family: inherit; }
.sky .star:hover .halo, .sky .star:focus-visible .halo { opacity: 0.3; fill: var(--signal); }
.sky .star:hover text, .sky .star:focus-visible text { fill: var(--signal); }
.sky .star:focus-visible { outline: none; }
.sky figcaption { color: var(--muted); font-size: var(--step--1); margin-top: 0.5rem; }

/* Einmal beim Laden: die Linie wird gezogen */
@media (prefers-reduced-motion: no-preference) {
  .sky .line { stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 1.6s 0.2s ease-out forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

/* Tabellen (Vorträge, Beobachtungen) */
.prose table { width: 100%; border-collapse: collapse; font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.prose th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--ink); padding: 0.4rem 0.75rem 0.4rem 0; }
.prose td { border-bottom: 1px solid var(--rule); padding: 0.55rem 0.75rem 0.55rem 0; vertical-align: top; }
.table-wrap { overflow-x: auto; }

/* Lebenslauf: echte Abfolge, deshalb mit Jahreszahlen */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--rule); }
.timeline li { position: relative; padding: 0 0 1.75rem 1.5rem; }
.timeline li::before {
  content: ""; position: absolute; left: -5px; top: 0.55em;
  width: 9px; height: 9px; border-radius: 50%; background: var(--star);
}
.timeline .when { display: block; color: var(--muted); font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.timeline strong { font-weight: 600; }

/* Social: Name links, Adresse rechts */
.links { list-style: none; padding: 0; }
.links li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
.links span { color: var(--muted); }

/* Galerie: Absatz aus Bildern im Markdown → Vorschauen; Klick zeigt das Bild
   groß in der Seite (:target, ohne JavaScript). Klick aufs große Bild schließt. */
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1.25rem; margin: 1.5rem 0 2rem; }
.bild { margin: 0; }
.bild a { display: block; }
.bild img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; background: var(--rule); }
.bild a:hover img { outline: 2px solid var(--signal); outline-offset: 2px; }
.bild figcaption { font-size: var(--step--1); color: var(--muted); margin-top: 0.4rem; line-height: 1.35; }

.gross {
  display: none;
  position: fixed; inset: 0; z-index: 10;
  flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem;
  padding: 1.5rem;
  background: rgb(8 12 24 / 0.94);
  color: #e6ebf4; text-decoration: none; cursor: zoom-out;
}
.gross:target { display: flex; }
.gross img { max-width: 100%; max-height: calc(100vh - 7rem); object-fit: contain; }
.gross .unterschrift { max-width: 40rem; text-align: center; font-size: var(--step--1); }
.gross small { display: block; color: #9aa7c0; margin-top: 0.15rem; }
.gross:hover { color: #fff; }

/* Lebenslauf: Zeitraum links, Stelle rechts; die Linie verbindet die Stationen */
.cv { list-style: none; margin: 0 0 1rem; padding: 0; }
.cv > li { position: relative; display: grid; grid-template-columns: 11rem 1fr; column-gap: 1.75rem; padding-bottom: 1.6rem; }
.cv > li::before {                      /* Linie */
  content: ""; position: absolute; left: calc(11rem + 0.85rem); top: 0.6em; bottom: -0.6em;
  border-left: 1px solid var(--rule);
}
.cv > li:last-child::before { display: none; }
.cv > li::after {                       /* Punkt */
  content: ""; position: absolute; left: calc(11rem + 0.85rem - 4px); top: 0.45em;
  width: 9px; height: 9px; border-radius: 50%; background: var(--star);
}
.cv > li.jetzt::after { background: var(--signal); }   /* aktuelle Stelle */
.cv .when { color: var(--muted); font-size: var(--step--1); font-variant-numeric: tabular-nums; padding-top: 0.15em; text-align: right; }
.cv .what { grid-column: 2; padding-left: 0.75rem; }
.cv strong { display: block; font-weight: 600; line-height: 1.3; }
.cv .org { display: block; color: var(--muted); }
.cv .tags { display: block; font-size: var(--step--1); color: var(--muted); margin-top: 0.25rem; }
.cv .roles { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.cv .roles li { margin-bottom: 0.4rem; }
.cv .roles .when { display: block; text-align: left; padding: 0; }

@media (max-width: 40rem) {
  .cv > li { grid-template-columns: 1fr; padding-left: 1.5rem; }
  .cv > li::before { left: 0.25rem; top: 0.6em; }
  .cv > li::after { left: calc(0.25rem - 4px); }
  .cv .when { text-align: left; }
  .cv .what { grid-column: 1; padding-left: 0; }
}

code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; }

/* --- Fuß ----------------------------------------------------------------- */
footer.site { max-width: 64rem; margin: 0 auto; padding: 2rem 1rem 3rem; color: var(--muted); font-size: var(--step--1); border-top: 1px solid var(--rule); }
footer.site { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
footer.site p { margin: 0; }
footer.site .legal { display: flex; gap: 1.25rem; }
footer.site .legal a { color: var(--muted); text-decoration: none; }
footer.site .legal a:hover, footer.site .legal a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--signal); }

@media (max-width: 40rem) {
  main { padding-top: 2rem; }
  .sky text { font-size: 26px; }
}
