:root {
  color-scheme: light dark;
  font-family: ui-rounded, "SF Pro Rounded", "Avenir Next", system-ui, sans-serif;
  --background: #f5efe5;
  --card: #fffaf2;
  --text: #2e2018;
  --muted: #6f5a4b;
  --accent: #8b4d2f;
  --on-accent: #fffaf2;
  --line: #dfd0bd;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--background); color: var(--text); line-height: 1.65; }
header, main, footer { width: min(760px, calc(100% - 32px)); margin-inline: auto; }
header { padding: 48px 0 24px; }
header a { color: inherit; text-decoration: none; }
h1 { margin: 0; font-size: clamp(2.25rem, 8vw, 4.5rem); letter-spacing: -0.055em; line-height: 1.02; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.topbar .eyebrow { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
nav { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 20px; }
.lang {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .08em;
}
.lang a { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; padding: 4px 10px; border-radius: 999px; color: var(--muted); text-decoration: none; }
.lang a:hover { color: var(--accent); }
.lang a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
nav a, main a { color: var(--accent); }
article { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: clamp(22px, 5vw, 48px); box-shadow: 0 16px 55px rgb(60 35 20 / 8%); }
h2 { margin-top: 2em; line-height: 1.2; }
h2:first-child { margin-top: 0; }
p, li { color: var(--muted); }
address { font-style: normal; }
footer { padding: 28px 0 48px; color: var(--muted); font-size: .9rem; }
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* Startseite */
.hero { padding-top: 8px; }
.lede { margin: 0; font-size: 1.15rem; max-width: 48ch; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 26px 0 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 22px; border: 1px solid transparent; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 650; text-decoration: none; max-width: 100%; }
.button:hover { filter: brightness(1.06); }
.button.secondary { background: transparent; border-color: var(--line); color: var(--accent); }
.button.secondary:hover { border-color: var(--accent); }
.button.appstore { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 22px; border: 1px solid transparent; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 650; text-decoration: none; max-width: 100%; }
.appstore-icon { flex: none; width: 18px; height: 18px; fill: currentColor; }
.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 34px 0 0;
}
.grid a {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 20px;
  color: inherit;
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.grid a:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 18px 40px rgb(60 35 20 / 10%); }
.grid strong { display: block; color: var(--text); font-size: 1rem; }
.grid span { color: var(--muted); font-size: .92rem; }
.notice { margin-top: 34px; font-size: .92rem; }

/* Projektgeschichte */
.story { margin-top: 34px; padding: clamp(20px, 3vw, 30px); background: var(--card); border: 1px solid var(--line); border-radius: 24px; }
.story h2 { margin: 0 0 12px; font-size: 1.2rem; }
.story p { margin: 0 0 12px; max-width: 72ch; }
.story p:last-child { margin-bottom: 0; }

/* Instagram */
.social { margin-top: 30px; }
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  max-width: 100%;
}
.social-link:hover { border-color: var(--accent); }
.social-link svg { flex: none; width: 24px; height: 24px; color: var(--accent); }
.social-link strong { display: block; color: var(--text); font-size: .98rem; }
.social-handle { display: block; color: var(--muted); font-size: .9rem; line-height: 1.3; }
footer .socials { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 8px; }
footer .socials a { color: var(--accent); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Barrierefreiheit & Fehlerseite */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 10; padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.error-code { margin: 0; color: var(--accent); font-size: clamp(3rem, 14vw, 6rem); font-weight: 800; letter-spacing: -0.06em; line-height: 1; }

/* Karte der bewerteten Cafés */
.map-view header, .map-view main, .map-view footer { width: min(1080px, calc(100% - 32px)); }
.map-stats { margin: 12px 0 14px; color: var(--muted); font-size: .92rem; }
.map {
  height: clamp(320px, 58vh, 540px);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 16px 55px rgb(60 35 20 / 8%);
}
.leaflet-container { font: inherit; background: var(--card); }
.cafe-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid #fffaf2;
  background: var(--accent);
  color: var(--on-accent);
  font-size: .86rem;
  font-weight: 750;
  box-shadow: 0 6px 18px rgb(60 35 20 / 28%);
}
.cafe-cluster span { line-height: 1; }
.leaflet-popup-content-wrapper { border-radius: 16px; background: var(--card); color: var(--text); box-shadow: 0 18px 40px rgb(60 35 20 / 18%); }
.leaflet-popup-tip { background: var(--card); }
.cafe-popup { width: 196px; }
.cafe-popup img { display: block; width: 100%; height: 108px; margin-bottom: 8px; border-radius: 10px; object-fit: cover; background: var(--line); }
.cafe-popup strong { display: block; line-height: 1.3; }
.cafe-city { display: block; color: var(--muted); font-size: .86rem; line-height: 1.4; }
.cafe-rating { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; margin-top: 6px; font-size: .86rem; }
.cafe-rating-value { color: var(--text); font-weight: 750; }
.cafe-rating-stars { color: #b98a3f; letter-spacing: .06em; }
.cafe-rating-count { color: var(--muted); }
.list-title { margin: 36px 0 0; font-size: 1.15rem; }
.map-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-top: 16px; }
.cafe-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  font: inherit;
  color: inherit;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.cafe-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 18px 40px rgb(60 35 20 / 10%); }
.cafe-card img { display: block; width: 100%; height: 132px; object-fit: cover; background: var(--line); }
.cafe-photo-empty { display: flex; align-items: center; justify-content: center; height: 132px; background: var(--line); color: var(--muted); font-size: 2rem; font-weight: 800; }
.cafe-card-body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 14px; }
.cafe-name { color: var(--text); font-weight: 650; }
.cafe-meta { color: var(--muted); font-size: .86rem; }

@media (prefers-color-scheme: dark) {
  :root { --background: #19130f; --card: #241b16; --text: #f8eadb; --muted: #ccb8a7; --accent: #efa879; --on-accent: #241b16; --line: #4b382d; }
  .leaflet-tile { filter: brightness(.72) contrast(.92) saturate(.8); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .grid a:hover { transform: none; }
  .cafe-card:hover { transform: none; }
}

@media print {
  :root { --background: #fff; --card: #fff; --text: #000; --muted: #222; --line: #ccc; --accent: #000; }
  body { background: #fff; }
  nav, .actions, .grid, footer nav, .map { display: none; }
  article { border: 0; box-shadow: none; padding: 0; }
  a { color: #000; }
}

/* Desktop-Layout für die Startseite (Mobil bleibt unverändert) */
@media (min-width: 900px) {
  .home header,
  .home main,
  .home footer { width: min(1080px, calc(100% - 80px)); }

  .home header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: end;
    column-gap: 48px;
    padding: 64px 0 34px;
  }
  .home header .topbar { grid-column: 1 / -1; margin-bottom: 2px; }
  .home header h1 { grid-column: 1; font-size: clamp(2.75rem, 4.6vw, 3.75rem); }
  .home header nav:not(.lang) {
    grid-column: 2;
    justify-content: flex-end;
    justify-self: end;
    gap: 12px 26px;
    margin: 0 0 10px;
    font-size: 1rem;
  }

  .home main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: start;
    column-gap: 64px;
  }
  .home .hero { grid-column: 1; }
  .home .lede { font-size: 1.3rem; max-width: 54ch; }
  .home .social { grid-column: 2; align-self: end; justify-self: end; margin: 0 0 4px; }
  .home .social-link { padding: 14px 24px 14px 20px; }

  .home .grid {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 52px;
  }
  .home .grid a { padding: 20px 22px; }
  .home .grid a:last-child { grid-column: span 2; }

  .home .notice { grid-column: 1 / -1; margin-top: 30px; }
  .home .story { grid-column: 1 / -1; column-count: 2; column-gap: 52px; }
  .home .story h2 { column-span: all; }
  .home .story p { max-width: none; break-inside: avoid-column; }

  .home footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 24px;
    padding-top: 34px;
  }
  .home footer p { margin: 0; }
}

/* Schmale Bildschirme: Buttons gleich breit untereinander */
@media (max-width: 599px) {
  .actions .button { width: 100%; }
  .eyebrow { font-size: .8rem; letter-spacing: .06em; }
}
