/* =========================
   Design-Variablen (Grautöne)
   ========================= */
:root {
  --primary: #2D3748;    /* Dunkelgrau */
  --secondary: #E2E8F0;  /* Hellgrau */
  --accent: #718096;     /* Mittleres Grau */
  --bg: #F7FAFC;         /* Sehr heller Hintergrund */
  --text: #1A202C;       /* Dunkler Text */
}

/* Grundlayout */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Roboto', Arial, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header & Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--primary);
  color: #fff;
  padding: 1.25rem 1rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}
header h1 {
  margin: 0 0 0.5rem 0;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-align: center;
}
nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
nav a {
  color: #F7FAFC;
  text-decoration: none;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}
nav a.active {
  background: #fff;
  color: var(--primary);
  border-color: var(--secondary);
}

/* Main-Container */
main {
  position: relative;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
  min-height: 60vh;
  overflow: hidden;
}

/* Seiten (Slide-System) */
.section {
  position: absolute;
  inset: 0;
  background: #fff;
  border: 1px solid var(--secondary);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
  padding: 2rem 1.5rem;
  opacity: 0;
  transform: translateX(100%);
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.55s ease;
  pointer-events: none;

  /* Fix fürs Scrollen auf Handy */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.section.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  z-index: 1;
  animation: fadeIn 0.6s ease;
}
.section.enter-from-left { transform: translateX(-100%); opacity: 1; }
.section.enter-from-right { transform: translateX(100%); opacity: 1; }
.section.exit-left { transform: translateX(-100%); opacity: 0; }
.section.exit-right { transform: translateX(100%); opacity: 0; }
.section h2 {
  margin: 0 0 0.75rem 0;
  font-size: 1.75rem;
  color: var(--primary);
  text-align: center;
}
.section p {
  margin: 0.5rem auto 1rem;
  max-width: 780px;
  font-size: 1.05rem;
}

/* Fade-in Effekt */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Über mich Container */
.about-container {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap; /* Bricht auf Mobile um */
}
.about-photo img {
  width: 150px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.about-photo img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.about-text {
  flex: 1;
  min-width: 220px;
}

/* Projekte (Accordion) */
.project {
  border: 1px solid var(--secondary);
  border-radius: 10px;
  overflow: hidden;
  margin: 0.9rem 0;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}
.project:hover {
  transform: translateY(-3px);
}
.project-title {
  margin: 0;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.25s ease;
  outline: none;
}
.project-title:hover {
  background: #2A3644;
}
.project-title:focus-visible {
  box-shadow: 0 0 0 3px rgba(113, 128, 150, 0.3);
}
.arrow {
  display: inline-block;
  transition: transform 0.25s ease;
}
.arrow.open { transform: rotate(180deg); }

/* Accordion-Inhalt */
.project-details {
  max-height: 0;
  overflow: hidden;
  border-top: 1px solid var(--secondary);
  background: #F9FAFB;
  opacity: 0;
  transition: max-height 0.45s ease, opacity 0.4s ease;
}
.project-details.open {
  opacity: 1;
  max-height: 300px;
}
.project-details-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Inline Gallery */
.project-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  height: 100px;
  width: 100%;
  max-width: 400px;
}
.carousel-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  width: 100%;
  overflow: hidden;
}
.carousel-image {
  width: calc(100% / 3 - 10px);
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--accent);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.carousel-image:hover {
  transform: scale(1.1);
  opacity: 1;
}

/* Modal Sliding Carousel */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.modal.active { display: flex; }
.modal-carousel {
  height: 300px;
  max-width: 800px;
  width: 90%;
  position: relative;
}
.modal-carousel .carousel-container {
  height: 100%;
  position: relative;
  overflow: hidden;
}
.modal-carousel .carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  height: 100%;
}
.modal-carousel .carousel-image {
  flex: 0 0 100%;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  border: none;
  box-shadow: none;
  transition: none;
  margin: 0;
}
.modal-carousel .carousel-btn {
  background: rgba(45, 55, 72, 0.8);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  transition: background 0.2s ease;
}
.modal-carousel .carousel-btn:hover {
  background: var(--primary);
}
.modal-carousel .carousel-btn.prev { left: 10px; }
.modal-carousel .carousel-btn.next { right: 10px; }
.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}
.modal-close:hover { color: var(--accent); }

/* Buttons */
.btn {
  display: inline-block;
  margin: 0.25rem 0.35rem 0 0;
  padding: 0.5rem 0.85rem;
  border-radius: 0.6rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  background: var(--primary);
}
.btn.ghost {
  background: #fff;
  color: var(--primary);
  border-color: var(--secondary);
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  color: #4A5568;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
  header h1 { font-size: 1.35rem; }
  nav { gap: 0.25rem; }
  .section { padding: 1.25rem 0.9rem; }
  .project-media { height: 80px; max-width: 300px; }
  .carousel-image { width: calc(100% / 3 - 8px); }
  .carousel-container { gap: 8px; }
  .modal-carousel { height: 200px; max-width: 90%; }
  .modal-carousel .carousel-btn { width: 35px; height: 35px; font-size: 1rem; }
}

