@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/assets/fraunces.7f9d191d99.woff2) format('woff2-variations');
}

:root {
  --bg: #f6f1e7;
  --surface: #fffaf1;
  --ink: #23302a;
  --muted: #5f6c64;
  --line: #e2d9c8;
  --brand: #2f6b4f;
  --brand-ink: #ffffff;
  --sun: #f2c14e;
  --clay: #e07a5f;
  --accent: var(--brand);
  --radius: 1.25rem;
  --shadow: 0 1px 2px rgb(40 30 10 / 0.06), 0 8px 24px -12px rgb(40 30 10 / 0.25);
  --serif: 'Fraunces', ui-serif, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141a17;
    --surface: #1c2420;
    --ink: #ebe6da;
    --muted: #a5b0a8;
    --line: #2f3a34;
    --brand: #7fc79f;
    --brand-ink: #10261a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px -12px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}

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

/* --tint dort berechnen, wo --accent gesetzt wird (Seite, Karte) */
body, .card { --tint: color-mix(in oklab, var(--accent) 13%, var(--surface)); }
@media (prefers-color-scheme: dark) {
  body, .card { --tint: color-mix(in oklab, var(--accent) 18%, var(--surface)); }
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.map-open { overflow: hidden; }

body {
  margin: 0;
  background:
    radial-gradient(60rem 30rem at 110% -10%, color-mix(in oklab, var(--sun) 16%, transparent), transparent 70%),
    radial-gradient(50rem 30rem at -20% 10%, color-mix(in oklab, var(--accent) 12%, transparent), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
  overflow-wrap: break-word;
}

h1, h2, h3 { font-family: var(--serif); line-height: 1.15; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.4rem, 9vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 5vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-underline-offset: 0.15em; }
img, svg { display: block; max-width: 100%; height: auto; }

main, .site-header, .site-footer {
  width: 100%;
  max-width: 64rem;
  margin-inline: auto;
  padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
}

section { margin-block: 3.5rem; }

.kicker {
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.lead { font-family: var(--serif); font-size: clamp(1.25rem, 4vw, 1.55rem); line-height: 1.35; }
.note { color: var(--muted); font-size: 0.95rem; }
.by { color: var(--muted); font-style: italic; margin-bottom: 0.6em; }

/* ---------- Kopf & Fuß ---------- */

.site-header { padding-block: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.lang-switch {
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px var(--line);
}
.lang-switch:hover { background: var(--surface); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
}
.brand svg { width: 2.3rem; }

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2rem calc(2rem + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}
.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-bottom: 1rem; }
.site-footer a { color: inherit; }
.fineprint { font-size: 0.8rem; }

/* ---------- Knöpfe ---------- */

.button, .link-button, .map-full-button { font: inherit; cursor: pointer; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 3rem;
  padding: 0.7rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 650;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.button:hover { filter: brightness(1.08); }
.button:active { transform: translateY(1px) scale(0.99); }
.button.secondary { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.button:disabled, .button[aria-busy] { opacity: 0.7; cursor: progress; }
.link-button {
  border: 0;
  background: none;
  padding: 0.25rem 0;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  font-size: 0.95rem;
}
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 0.3rem; }

/* ---------- Startseite ---------- */

.hero { display: grid; gap: 2rem; align-items: center; margin-top: 1rem; }
.hero .lead { margin-bottom: 1rem; }
.hero .button { margin-top: 0.5rem; }

.pile { display: flex; flex-wrap: wrap; justify-content: center; padding: 1rem; }
.pile-stone { width: clamp(6rem, 26vw, 9.5rem); margin: -0.6rem; filter: drop-shadow(0 10px 12px rgb(40 30 10 / 0.2)); }
.pile-stone:nth-child(1) { transform: rotate(-8deg); }
.pile-stone:nth-child(2) { transform: rotate(6deg) translateY(1rem); }
.pile-stone:nth-child(3) { transform: rotate(-3deg) translateY(-0.4rem); }
.pile-stone:nth-child(4) { transform: rotate(10deg); }
.pile-stone:nth-child(5) { transform: rotate(-12deg) translateY(0.6rem); }
.pile .stone-photo { aspect-ratio: 1; object-fit: cover; border-radius: 52% 48% 46% 54% / 55% 50% 50% 45%; }

.steps ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 0.5rem 4.25rem;
  box-shadow: var(--shadow);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1.1rem;
  display: grid;
  place-items: center;
  width: 2.4rem;
  aspect-ratio: 1;
  border-radius: 50%;
  line-height: 1;
  background: var(--sun);
  color: #3b2a00;
  font: 700 1.15rem var(--serif);
}
.steps li:nth-child(2)::before { background: var(--clay); color: #fff; }
.steps li:nth-child(3)::before { background: var(--brand); color: var(--brand-ink); }
.steps h3 { margin-bottom: 0.3em; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 0.5rem;
  box-shadow: var(--shadow);
}
.stats strong { display: block; font: 700 clamp(1.5rem, 6vw, 2.4rem)/1.1 var(--serif); color: var(--brand); }
.stats span { font-size: 0.85rem; color: var(--muted); }

.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(10rem, 45%), 1fr)); gap: 1rem; }
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem 0.9rem;
  box-shadow: var(--shadow);
  border-top: 5px solid var(--accent);
}
.card .stone-photo, .card .pebble { aspect-ratio: 1; width: 100%; object-fit: cover; border-radius: calc(var(--radius) - 0.4rem); margin-bottom: 0.7rem; }
.card .pebble { display: grid; place-items: center; background: var(--tint); padding: 0.5rem; }
.card h3 { font-size: 1.1rem; margin-bottom: 0.15em; }
.card .by, .card .meta { font-size: 0.85rem; margin-bottom: 0.3em; }
.card .meta { color: var(--muted); }

.about { max-width: 40rem; }

/* ---------- Karte ---------- */

.map {
  /* selbst setzen: sonst schreibt Leaflet position: relative inline, und .is-full wird nie fixed */
  position: relative;
  height: min(65vh, 30rem);
  min-height: 18rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--line);
  z-index: 0;
}
.map.is-full {
  position: fixed;
  inset: 0;
  height: 100dvh;
  border-radius: 0;
  z-index: 1000;
}
.map-full-button {
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}
.leaflet-container { font: inherit; font-size: 0.9rem; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
.leaflet-container .leaflet-control-attribution { background: color-mix(in oklab, var(--surface) 80%, transparent); color: var(--muted); }
.leaflet-container .leaflet-control-attribution a { color: inherit; }
/* Rasterkacheln (Ersatzkarte ohne WebGL) fast farblos und warm getönt, passend zum
   Hintergrund der Seite. Die Vektorkarte (.leaflet-gl-layer) bringt ihre Farben selbst mit. */
.leaflet-tile-pane > .leaflet-layer { filter: grayscale(0.9) sepia(0.22) contrast(0.92) brightness(1.04); }
@media (prefers-color-scheme: dark) {
  /* hell/dunkel umdrehen, Farbton zurückdrehen, dann wie oben fast farblos */
  .leaflet-tile-pane > .leaflet-layer { filter: invert(1) hue-rotate(180deg) grayscale(0.9) sepia(0.12) brightness(0.9) contrast(0.88); }
}

.pin { overflow: visible; }
.pin svg { display: block; overflow: visible; filter: drop-shadow(0 3px 3px rgb(0 0 0 / 0.35)); transition: transform 0.15s ease; transform-origin: 50% 100%; }
.pin:hover svg, .pin:focus-visible svg { transform: scale(1.12); }
.pin text { font: 700 10px var(--sans); fill: #23302a; }
/* Puls am Boden unter der neuesten Nadel */
.pin.latest::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 22px;
  height: 10px;
  margin-left: -11px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse 2s ease-out infinite;
  pointer-events: none;
}
@keyframes pulse { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(2.4); opacity: 0; } }

/* ---------- Steinseite ---------- */

.stone-hero { display: grid; gap: 1.5rem; margin-top: 0.5rem; }
.stone-hero-image { justify-self: center; position: relative; width: min(72vw, 19rem); margin-block: 0.5rem 1rem; }
/* weicher Farbfleck in der Steinfarbe hinter dem Foto */
.stone-hero-image:has(.stone-photo)::before {
  content: '';
  position: absolute;
  inset: 4% -6% -6% 6%;
  background: color-mix(in oklab, var(--accent) 35%, transparent);
  border-radius: 46% 54% 58% 42% / 52% 44% 56% 48%;
  transform: rotate(8deg);
}
.stone-hero-image .stone-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 52% 48% 46% 54% / 55% 50% 50% 45%;
  border: 0.4rem solid var(--surface);
  box-shadow: 0 18px 30px -14px rgb(40 30 10 / 0.45);
  transform: rotate(-4deg);
}
.stone-hero-image .pebble { filter: drop-shadow(0 12px 16px rgb(40 30 10 / 0.18)); }

.chips { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips li {
  background: var(--tint);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.found {
  background: var(--tint);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  border: 2px dashed color-mix(in oklab, var(--accent) 45%, transparent);
}
.found ol { padding-left: 1.3rem; margin: 0 0 1.25rem; }
.found li { margin-bottom: 0.4rem; }
.photo-hint {
  background: var(--surface);
  border-left: 4px solid var(--clay);
  border-radius: 0.6rem;
  padding: 0.75rem 0.9rem;
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  font-weight: 550;
}
.found-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.found-actions .button { flex: 1 1 14rem; }
.locate-status { flex-basis: 100%; margin: 0; font-size: 0.9rem; color: var(--muted); min-height: 1lh; }
.found .note { margin: 1rem 0 0; font-size: 0.85rem; }

.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 0.5rem;
  bottom: 0.5rem;
  border-left: 3px dotted color-mix(in oklab, var(--accent) 60%, var(--line));
  transform: translateX(-50%);
}
.entry { position: relative; padding-left: 3rem; margin-bottom: 2rem; }
.entry-dot {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
}
.entry.latest .entry-dot { background: var(--accent); color: #fff; }
.entry-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.2rem; }
.entry h3 { margin-bottom: 0.3em; }
.photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-top: 0.75rem; }
.photos.single { grid-template-columns: 1fr; max-width: 28rem; }
.photos img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 0.8rem; }
.photos.single img { aspect-ratio: auto; }

.photos a { display: block; border-radius: 0.8rem; overflow: hidden; }
.photos img { transition: transform 0.25s ease; }
.photos a:hover img { transform: scale(1.03); }

.popup-photo { display: block; margin: -0.25rem -0.25rem 0.5rem; }
.popup-photo img { width: 100%; height: auto; max-height: 9rem; object-fit: cover; border-radius: 0.6rem; }

.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(10 14 12 / 0.94);
  color: #fff;
}
.lightbox::backdrop { background: rgb(10 14 12 / 0.94); }
.lightbox figure {
  margin: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  padding: 3.5rem 0.5rem calc(1rem + env(safe-area-inset-bottom));
  pointer-events: none;
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 0.5rem; pointer-events: auto; }
.lightbox figcaption { padding-top: 0.75rem; font-size: 0.95rem; text-align: center; opacity: 0.85; }
.lightbox button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.5);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.25);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox button:hover { background: rgb(0 0 0 / 0.7); }
.lb-close { top: max(0.75rem, env(safe-area-inset-top)); right: 0.75rem; font-size: 1.2rem !important; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 0.5rem; }
.lb-next { right: 0.5rem; }
.lb-count { position: absolute; top: max(1.5rem, env(safe-area-inset-top)); left: 1rem; margin: 0; font-size: 0.9rem; opacity: 0.8; }

.back { text-align: center; font-family: var(--serif); font-size: 1.2rem; }

.text-page { max-width: 40rem; margin-block: 2rem 4rem; }

/* ---------- breitere Bildschirme ---------- */

@media (min-width: 48rem) {
  section { margin-block: 5rem; }
  .hero { grid-template-columns: 1.1fr 1fr; margin-top: 2rem; }
  .steps ol { grid-template-columns: repeat(3, 1fr); }
  .stone-hero { grid-template-columns: 22rem 1fr; gap: 2.5rem; align-items: start; }
  .found { padding: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pin.latest::before { animation: none; }
  .button { transition: none; }
}
