/* Cosmo & Wanda – Zeitleiste
   Farben aus dem Logo: Cosmos Schokoladenfell, Wandas Grau, die goldenen Augen. */

/* Bricolage Grotesque, lokal ausgeliefert. Kein Aufruf bei Google oder einem
   anderen fremden Server - die Seite laedt ausschliesslich von sich selbst.

   Variable Schrift: Staerke 200-800, Breite 75-100 %. Einen echten
   Kursivschnitt gibt es NICHT. Betonungen laufen deshalb ueber Staerke und
   Breite, nie ueber font-style: italic - das waere eine vom Browser
   schiefgestellte Faelschung.

   SIL Open Font License 1.1, Wortlaut in fonts/bricolage-grotesque-OFL.txt. */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("/static/fonts/bricolage-grotesque-latin.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: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("/static/fonts/bricolage-grotesque-latin-ext.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;
}

:root {
  color-scheme: dark;
  --bg:     #262322;   /* Cosmos Fell, der dunkle Ring des Logos */
  --ink:    #ECE7E0;   /* Wandas helles Grau */
  --muted:  #9B948D;
  --line:   #433E3B;
  --mat:    #302C2A;   /* Passepartout hinter Fotos */
  --gold:   #D3AE55;   /* die Augen */
  --lb-bg:  rgba(24, 21, 20, 0.94);

  /* Eine Schrift fuer alles. Die Ersatzliste greift nur, solange die eigene
     Datei noch laedt. */
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;

  --col: 680px;
  --spine: 22px;                /* Abstand Spine → Inhalt */
  --raute: 20px;                /* Kantenlaenge der Rauten auf der Zeitleiste */
}

/* font-synthesis: die Schrift bringt alle Staerken selbst mit - der Browser
   soll keine nachbauen. */
* { box-sizing: border-box; font-synthesis: none; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.55;
  padding: 0 clamp(16px, 4vw, 40px);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

em { font-style: normal; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ── Kopf ─────────────────────────────────────────────────────────── */
.hero {
  max-width: var(--col);
  margin: 0 auto;
  padding: clamp(40px, 8vh, 88px) 0 clamp(36px, 6vh, 64px);
  text-align: center;
}
.hero-logo {
  display: block;
  width: clamp(150px, 30vw, 200px);
  height: auto;
  margin: 0 auto 26px;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
}
.hero-title {
  font-family: var(--font);
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 4rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}
.hero-lede {
  font-family: var(--font);
  font-size: clamp(1.15rem, 2.6vw, 1.35rem);
  line-height: 1.4;
  color: var(--muted);
  margin: 0 auto;
  max-width: 34ch;
}
/* Betonung ueber Staerke statt ueber einen Kursivschnitt, den es nicht gibt. */
.hero-lede em { color: var(--gold); font-weight: 600; }
.hero-jump {
  display: inline-block;
  margin-top: 26px;
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.hero-jump:hover { color: var(--ink); border-color: var(--ink); }

/* ── Zeitleiste ───────────────────────────────────────────────────── */
.timeline {
  position: relative;
  max-width: var(--col);
  margin: 0 auto;
  padding-left: var(--spine);
}
/* Die Linie selbst */
.timeline::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  /* Linie läuft von oben (heute) nach unten (Geburtstag) und blendet oben sanft ein */
  background: linear-gradient(to bottom, transparent, var(--line) 48px);
  width: 1px;
}

.entry {
  position: relative;
  padding: 6px 0 clamp(40px, 6vh, 64px);
}
/* Rauten auf der Zeitleiste, im selben Gold wie die Alterszeile.
   clip-path statt rotate(45deg): so ist die Raute von Spitze zu Spitze genau
   so breit wie --raute, und die Zentrierformel bleibt dieselbe.
   Einen Rahmen kann die Raute nicht tragen - clip-path schneidet ihn mit ab -,
   deshalb sind sie gefuellt. */
.entry-marker {
  position: absolute;
  left: calc(-1 * var(--spine) - var(--raute) / 2 + 0.5px);
  /* Mitte der Raute auf derselben Hoehe wie vorher die Mitte des Punktes. */
  top: calc(0.85em - (var(--raute) - 11px) / 2);
  width: var(--raute); height: var(--raute);
  background: var(--gold);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
/* Der Ursprung hatte einen Schein-Ring; den wuerde clip-path wegschneiden.
   Er hebt sich jetzt durch Groesse ab. */
.entry-origin .entry-marker {
  --raute: 28px;
}
.entry-date {
  font-family: var(--font);
  font-weight: 400;
  font-size: clamp(1.45rem, 3.4vw, 1.75rem);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.005em;
}
.entry-age {
  font-family: var(--font);
  /* Eigene Stimme ohne Kursiv: leichter und etwas schmaler. */
  font-weight: 300;
  font-stretch: 92%;
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  color: var(--gold);
  margin: 4px 0 0;
}
.entry-origin { padding-bottom: clamp(56px, 10vh, 120px); }
.entry-origin .entry-age { color: var(--muted); }
.entry-empty .entry-age { color: var(--muted); max-width: 40ch; }
/* Tage ohne Bild: dieselbe Raute, nur zurueckgenommen. */
.entry-empty .entry-marker { background: color-mix(in srgb, var(--gold) 32%, transparent); }

.month {
  position: relative;
  margin: 0 0 clamp(22px, 3vh, 32px);
  font-size: 0.8125rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.month::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--spine) - 3px + 0.5px);
  top: 50%;
  width: 7px; height: 1px;
  background: var(--line);
}


/* ── Fotos ────────────────────────────────────────────────────────── */
.photos {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.photos-many { grid-template-columns: 1fr 1fr; }
.photos-many .photo:first-child { grid-column: 1 / -1; }

.photo { margin: 0; }
.photo-link {
  display: block;
  /* Ohne Passepartout: die Fotos stehen randlos. Nur der weiche
     Tiefenschatten bleibt, damit sie sich vom Hintergrund abheben. */
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.6);
}
.photo-link img {
  display: block;
  width: 100%;
  height: auto;
}
.photos-many .photo:not(:first-child) img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.photo-caption {
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ── Lightbox ─────────────────────────────────────────────────────── */
.lightbox {
  border: 0; padding: 0; margin: 0;
  max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh;
  background: var(--lb-bg);
  color: #ECE7E0;
  overflow: hidden;
}
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: grid; place-items: center; }
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] { animation: lb-in 160ms ease-out; }
  @keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
}
.lb-figure {
  margin: 0;
  display: grid;
  gap: 14px;
  justify-items: center;
  width: 100%;
  padding: 56px clamp(16px, 8vw, 96px) 24px;
}
.lb-img {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  width: auto; height: auto;
  border-radius: 2px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
}
.lb-meta {
  font-family: var(--font);
  font-size: 1.15rem;
  text-align: center;
  line-height: 1.3;
}
.lb-meta span { display: block; }
.lb-age { font-weight: 300; font-stretch: 92%; color: #D3AE55; }
.lb-caption { font-family: var(--font); font-size: 0.875rem; color: #B8B1AA; margin-top: 6px; }
.lb-caption:empty { display: none; }

.lb-close, .lb-nav {
  position: absolute;
  background: transparent;
  color: inherit;
  border: 0;
  padding: 12px;
  cursor: pointer;
  border-radius: 50%;
  opacity: 0.75;
}
.lb-close:hover, .lb-nav:hover { opacity: 1; background: rgba(255,255,255,0.08); }
.lb-close { top: 10px; right: 10px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lb-nav[disabled] { opacity: 0.2; cursor: default; }

@media (max-width: 560px) {
  .lb-nav { top: auto; bottom: 8px; transform: none; }
  .lb-figure { padding: 48px 16px 64px; }
  .lb-img { max-height: calc(100vh - 190px); }
}
