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

:root {
  --cream:  #FBF5EC;
  --beige:  #EFE3CC;
  --terra:  #C4703A;
  --brown:  #7B5240;
  --dark:   #3D2E1E;
  --green:  #7A8E6E;
  --light:  #F5EDE0;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Lato', sans-serif;
  background: var(--cream);
  color: var(--dark);
  font-size: 17px;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

[x-cloak], [hidden] { display: none !important; }

/* NAV */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  background: rgba(251,245,236,0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--beige);
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--brown);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  align-items: center;
  flex-wrap: wrap;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'Lato', sans-serif;
  color: var(--dark);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  transition: color 0.2s, background 0.2s;
}

.tab-btn:hover { color: var(--terra); }
.tab-btn.active { background: var(--terra); color: #fff; }

/* Tab-Icons nur in der mobilen Bottom-Navigation sichtbar. */
.tab-ico { display: none; width: 24px; height: 24px; flex: none; }

.lang-toggle {
  display: flex;
  gap: 0.4rem;
  background: var(--beige);
  border-radius: 20px;
  padding: 0.25rem 0.5rem;
}

.lang-toggle button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: 'Lato', sans-serif;
  letter-spacing: 0.05em;
  color: var(--brown);
  padding: 0.15rem 0.5rem;
  border-radius: 15px;
  transition: background 0.2s, color 0.2s;
}

.lang-toggle button.active { background: var(--terra); color: #fff; }

/* LAYOUT */
main { flex: 1; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade 0.3s ease; }

@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

section { padding: 4rem 2.5rem; }

.section-inner { max-width: 1100px; margin: 0 auto; }

.section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--terra);
  margin-bottom: 0.75rem;
}

h1.page-h {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  color: var(--brown);
  margin-bottom: 1.5rem;
}

h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--brown);
  margin-bottom: 1.25rem;
}

/* ABOUT */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: start;
}

.about-text { color: #5a4535; }
.about-text p { margin-bottom: 1rem; }

.about-image img {
  width: 100%;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: top;
  box-shadow: 0 20px 60px rgba(61,46,30,0.2);
}

/* CV / Lebenslauf */
.cv { margin-top: 3.5rem; }

.cv-list {
  border-left: 2px solid var(--beige);
  margin-top: 1.5rem;
  padding-left: 1.5rem;
}

.cv-entry { position: relative; padding-bottom: 1.75rem; }

.cv-entry::before {
  content: '';
  position: absolute;
  left: -1.9rem;
  top: 0.45rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--terra);
  box-shadow: 0 0 0 4px var(--cream);
}

.cv-period {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--green);
  text-transform: uppercase;
}

.cv-label { font-weight: 700; color: var(--brown); font-size: 1.1rem; }
.cv-degree { font-style: italic; color: var(--terra); font-size: 0.95rem; }
.cv-desc { color: #5a4535; }

/* GALLERY */
/* Masonry-Layout: Bilder behalten ihr natürliches Seitenverhältnis (kein Crop,
   kein Hineinzoomen) und werden nur auf die Spaltenbreite herunterskaliert. */
.gallery-grid {
  columns: 260px;
  column-gap: 1.25rem;
  margin-top: 2rem;
}

.gallery-item {
  break-inside: avoid;
  width: 100%;
  margin: 0 0 1.25rem;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  background: var(--beige);
  box-shadow: 0 4px 20px rgba(61,46,30,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item:hover { transform: translateY(-6px); box-shadow: 0 12px 40px rgba(61,46,30,0.2); }

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-cap { padding: 0.75rem 1rem; }
.gallery-cap .t { font-weight: 700; color: var(--brown); }
.gallery-cap .d { font-size: 0.9rem; color: #5a4535; }

/* LIGHTBOX */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,20,10,0.88);
  z-index: 200;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
}

.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 80vh; border-radius: 12px; box-shadow: 0 20px 80px rgba(0,0,0,0.5); }
.lightbox-cap { color: #fff; text-align: center; max-width: 600px; }
.lightbox-close { position: absolute; top: 1.5rem; right: 2rem; font-size: 2.5rem; color: #fff; cursor: pointer; line-height: 1; }

/* BOOKS */
.booklist { margin-bottom: 3rem; }
.booklist-desc { color: #5a4535; max-width: 700px; margin-bottom: 1.5rem; }

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.book-card {
  background: var(--light);
  border: 1px solid var(--beige);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.book-card .b-title { font-weight: 700; color: var(--brown); font-size: 1.1rem; }
.book-card .b-isbn { font-size: 0.78rem; color: var(--green); letter-spacing: 0.03em; }
.book-card .b-desc { font-size: 0.92rem; color: #5a4535; }
.book-card .b-link { margin-top: auto; }
.book-card .b-link a { color: var(--terra); text-decoration: none; font-size: 0.9rem; }
.book-card .b-link a:hover { text-decoration: underline; }

/* CONTACT */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.contact-info p { color: #5a4535; margin-bottom: 1.5rem; }

form { display: flex; flex-direction: column; gap: 1rem; }

form input, form textarea {
  width: 100%;
  padding: 0.85rem 1.1rem;
  border: 1.5px solid var(--beige);
  border-radius: 10px;
  background: var(--cream);
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  color: var(--dark);
  transition: border-color 0.2s;
}

form input:focus, form textarea:focus { outline: none; border-color: var(--terra); }
form textarea { resize: vertical; min-height: 150px; }

form button {
  align-self: flex-start;
  padding: 0.75rem 2rem;
  background: var(--terra);
  color: #fff;
  border: none;
  border-radius: 30px;
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

form button:hover { background: var(--brown); }

.empty-hint { color: #9a7a60; font-style: italic; }

/* FOOTER */
footer {
  background: var(--dark);
  color: #c9b49a;
  text-align: center;
  padding: 2rem;
  font-size: 0.85rem;
}

footer a { color: #c9b49a; }

/* IMPRESSUM MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(61,46,30,0.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--cream);
  border-radius: 8px;
  padding: 2.5rem;
  max-width: 480px;
  width: 90%;
  position: relative;
  color: var(--dark);
}

.modal-box h2 { font-family: 'Playfair Display', serif; font-size: 1.5rem; margin-bottom: 1.25rem; color: var(--brown); }
.modal-box p { margin-bottom: 0.4rem; font-size: 0.95rem; }
.modal-box a { color: var(--terra); text-decoration: none; }
.modal-box a:hover { text-decoration: underline; }
.modal-close { position: absolute; top: 1rem; right: 1.25rem; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--brown); line-height: 1; }

#form-status { display: none; padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.9rem; }

/* RESPONSIVE */
@media (max-width: 768px) {
  nav { padding: 0.75rem 1.25rem; justify-content: space-between; }
  section { padding: 2rem 1.25rem; }
  .about-grid { grid-template-columns: 1fr; }
  .about-image { max-width: 240px; margin: 0 auto; }
  .contact-grid { grid-template-columns: 1fr; }

  /* Tabs als feste Bottom-Navigation (app-typisch, groß tappbar). */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  .nav-links {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 200;
    gap: 0;
    margin: 0;
    padding: 0 0 env(safe-area-inset-bottom);
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--beige);
    box-shadow: 0 -4px 20px rgba(61,46,30,0.10);
  }

  .nav-links li { flex: 1 1 0; min-width: 0; }

  .tab-btn {
    width: 100%;
    flex-direction: column;
    gap: 4px;
    padding: 0.55rem 0.2rem 0.5rem;
    border-radius: 0;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--brown);
    position: relative;
  }

  .tab-btn .tab-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tab-ico { display: block; }

  /* Aktiven Tab über Farbe + Indikator statt Pill-Hintergrund hervorheben. */
  .tab-btn.active { background: none; color: var(--terra); }
  .tab-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--terra);
  }
  .tab-btn:hover { color: var(--terra); }
}
