:root {
  --green-900: #1e3c00;
  --green-700: #2c5601;   /* AllTrails-Dunkelgrün */
  --green-600: #428813;   /* AllTrails-Primärgrün */
  --green-100: #e3efd4;
  --green-50:  #f0f6e7;
  --ink:       #191919;
  --muted:     #6e6e6e;
  --paper:     #ffffff;
  --sand:      #f6f5f1;
  --line:      #e4e2dc;
  --radius:    16px;
  --shadow:    0 2px 8px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.14);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Hero mit Hintergrundbild & quadratischer 3D-Ansicht ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 130px 24px 0;
  background: var(--green-900) url('hero-background.jpg') center / cover no-repeat;
}

/* Dunkler Verlauf über dem Hintergrundbild, damit Titel & Nav lesbar bleiben */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10, 24, 2, .7), rgba(10, 24, 2, .3) 45%, rgba(10, 24, 2, .55));
  pointer-events: none;
  z-index: 1;
}

/* 3D-Ansicht randlos in voller Breite unterhalb von Titel & Subtitel
   (negative Ränder gleichen das Hero-Padding aus) */
.map-frame {
  position: relative;
  z-index: 2;
  align-self: stretch;
  height: 60vh;
  max-height: 100vw; /* nie höher als breit */
  margin: 40px -24px 0;
  overflow: hidden;
  animation: fadeUp .9s cubic-bezier(.22,1,.36,1) both .6s;
}
.map-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.topnav {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 1.35rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand svg { display: block; }

.topnav nav { display: flex; gap: 8px; }
.topnav nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  padding: 8px 16px;
  border-radius: 999px;
  transition: background .2s;
}
.topnav nav a:hover { background: rgba(255,255,255,.18); }

/* Burger-Button — nur in der Mobilansicht sichtbar */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: transform .3s, opacity .3s;
}

.hero-title {
  position: relative;
  z-index: 2;
  text-align: center;
  pointer-events: none;
  padding: 0 24px;
}

.hero-title h1 {
  color: #fff;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  animation: fadeDown .9s cubic-bezier(.22,1,.36,1) both .15s;
}

.hero-title p {
  color: rgba(255,255,255,.92);
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 600;
  margin-top: 6px;
  animation: fadeUp .9s cubic-bezier(.22,1,.36,1) both .4s;
}

/* Chip unten in der 3D-Ansicht, benennt die aktuell angezeigte Route */
.route-chip {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: fit-content;
  bottom: 14px;
  z-index: 3;
  display: none;
  align-items: center;
  max-width: calc(100% - 28px);
  background: #fff;
  border-radius: 999px;
  padding: 10px 20px;
  box-shadow: var(--shadow-lg);
  font-weight: 700;
  font-size: .9rem;
}
.route-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.route-chip.visible {
  display: inline-flex;
  animation: fadeUp .5s cubic-bezier(.22,1,.36,1);
}
/* ---------- Abschnitte ---------- */
section { padding: 88px 0; }

.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 10px;
}
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* ---------- Touren ---------- */
.tours-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.tour-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .25s, transform .25s;
}
.tour-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

.tour-thumb { aspect-ratio: 16 / 9; }
.tour-thumb svg { display: block; width: 100%; height: 100%; }

.tour-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
}

.tour-body h3 { font-size: 1.15rem; font-weight: 800; }

.badge {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  width: fit-content;
}
.badge.leicht  { background: var(--green-100); color: var(--green-700); }
.badge.mittel  { background: #fdeecd; color: #8a5a00; }
.badge.schwer  { background: #fadfd8; color: #a1301a; }

.tour-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 600;
}
.tour-meta span { display: inline-flex; align-items: center; gap: 6px; }
.tour-meta svg { flex: none; }

.tour-body p.desc { color: var(--muted); font-size: .93rem; flex: 1; }

.btn-route {
  position: relative;
  overflow: hidden;
  border: 0;
  background: var(--green-600);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: .95rem;
  padding: 11px 20px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .2s, transform .2s, box-shadow .2s;
}
.btn-route::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.4), transparent);
  transform: skewX(-20deg);
}
.btn-route:hover {
  background: var(--green-700);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(44,86,1,.35);
}
.btn-route:hover::after { animation: shine .6s ease forwards; }
.tour-card.active .btn-route { background: var(--green-900); }

/* ---------- Galerie ---------- */
.gallery-section { background: var(--sand); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .gallery-grid { grid-template-columns: 1fr; } }

.gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.gallery-item svg, .gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.gallery-item:hover svg, .gallery-item:hover img { transform: scale(1.05); }

.gallery-item figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 24px 16px 12px;
  color: #fff;
  font-size: .88rem;
  font-weight: 700;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent);
  transition: transform .35s ease;
}
.gallery-item:hover figcaption { transform: translateY(-4px); }
.gallery-item { transition: box-shadow .3s; }
.gallery-item:hover { box-shadow: var(--shadow-lg); }

/* ---------- Über das Hörnli ---------- */
.about .container { max-width: 760px; text-align: center; }
.about h2 { font-size: clamp(1.75rem, 3.5vw, 2.4rem); font-weight: 800; margin-bottom: 18px; }
.about p { color: var(--muted); font-size: 1.08rem; margin-bottom: 14px; }

.facts {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}
.facts div {
  background: var(--green-50);
  border-radius: var(--radius);
  padding: 16px 26px;
  min-width: 150px;
  transition: transform .25s, box-shadow .25s, background .25s;
}
.facts div:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  background: var(--green-100);
}
.facts strong { display: block; color: var(--green-700); font-size: 1.3rem; font-weight: 800; }
.facts span { color: var(--muted); font-size: .85rem; font-weight: 600; }

/* ---------- Footer ---------- */
footer {
  background: #161f13;
  color: rgba(255,255,255,.85);
  padding: 40px 0;
}
footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .9rem;
}
footer .brand { font-size: 1.15rem; }

/* ---------- Animationen & Effekte ---------- */
@keyframes fadeDown { from { opacity: 0; transform: translateY(-26px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(22px); }  to { opacity: 1; transform: none; } }
@keyframes shine    { to { left: 130%; } }
@keyframes twinkle  { from { opacity: .55; } to { opacity: 1; } }
@keyframes drift    { from { transform: translateX(-10px); } to { transform: translateX(10px); } }

/* Einblenden beim Hineinscrollen (Klassen werden per JS gesetzt) */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.22,1,.36,1);
}
.reveal.visible { opacity: 1; transform: none; }

/* Sonnen & Sterne pulsieren, Wolken & Nebel ziehen langsam */
.tour-thumb svg circle, .gallery-item svg circle {
  animation: twinkle 3.5s ease-in-out infinite alternate;
}
.gallery-item svg circle:nth-of-type(2n) { animation-delay: -1.8s; }
.tour-thumb svg ellipse, .gallery-item svg ellipse {
  animation: drift 10s ease-in-out infinite alternate;
}
.gallery-item svg ellipse:nth-of-type(2n) { animation-duration: 14s; animation-delay: -5s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 640px) {
  section { padding: 64px 0; }

  /* Hero maximal bildschirmhoch; die 3D-Ansicht füllt den restlichen Platz */
  .hero {
    height: 100vh;
    height: 100svh;
    padding: 84px 16px 0;
  }
  .map-frame {
    flex: 1;
    height: auto;
    min-height: 0;
    margin: 28px -16px 0;
  }

  /* Burger-Menü */
  .nav-toggle { display: flex; }
  .topnav nav {
    display: none;
    position: absolute;
    top: 76px;
    left: 16px;
    right: 16px;
    flex-direction: column;
    gap: 2px;
    background: #fff;
    border-radius: var(--radius);
    padding: 10px;
    box-shadow: var(--shadow-lg);
  }
  .topnav.menu-open nav { display: flex; }
  .topnav nav a { color: var(--ink); padding: 12px 16px; }
  .topnav nav a:hover, .topnav nav a:active { background: var(--green-50); }
  .topnav.menu-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .topnav.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .topnav.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
