:root {
  --bg: #f5f5f2;
  --fg: #111;
  --lightbox-bg: rgba(245, 245, 242, 0.96);
}

body.dark-mode {
  --bg: #111;
  --fg: #f5f5f2;
  --lightbox-bg: rgba(17, 17, 17, 0.97);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--fg);
  transition: background 0.3s ease, color 0.3s ease;
}

main {
  min-height: 100vh;
  padding: 140px 40px 60px;
}


/* Header und Navigation */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 25px 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  z-index: 1000;
  background: var(--bg);
  transition: background 0.3s ease;
}

.logo {
  justify-self: start;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 2px;
  line-height: 1;
}

nav {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  line-height: 1;
}

nav a {
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 1px;
  line-height: 1;
  transition: opacity 0.3s ease;
}

nav a:hover {
  opacity: 0.5;
}

#theme-toggle {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

#theme-toggle:hover {
  opacity: 0.5;
}

/* Wird nur auf dem Handy eingeblendet */
#menu-toggle {
  display: none;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}


/* Startseite */

.home {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero {
  width: 100%;
}

.hero-name {
  margin-bottom: 22px;
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  opacity: 0.55;
}

.hero h1 {
  font-size: clamp(55px, 9vw, 120px);
  font-weight: 400;
  letter-spacing: -3px;
  line-height: 0.95;
}

.portfolio-link {
  margin-top: 50px;
}


/* Links und Buttons mit Unterstrich (Startseite, Formular, Instagram) */

.portfolio-link,
.submit-button,
.instagram-link {
  display: inline-block;
  padding: 0 0 8px;
  border: none;
  border-bottom: 1px solid currentColor;
  background: none;
  color: inherit;
  text-decoration: none;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.portfolio-link:hover,
.submit-button:hover,
.instagram-link:hover {
  opacity: 0.5;
}

.portfolio-link:hover,
.submit-button:hover {
  transform: translateY(-2px);
}


/* Unterseiten: Portfolio, About, Kontakt */

.page {
  padding-top: 150px;
}

.page-title {
  font-size: clamp(50px, 8vw, 100px);
  font-weight: 400;
  letter-spacing: -3px;
  line-height: 1;
}


/* Portfolio */

.gallery {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  width: 100%;
  margin-top: 70px;
}

.masonry-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.masonry-column img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.masonry-column img:hover {
  opacity: 0.9;
  transform: scale(1.01);
}


/* About */

/* Die zweite Spalte bleibt leer, damit der Text schmal bleibt. */
.about-content {
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(0, 1fr);
  gap: 100px;
  align-items: start;
  margin-top: 90px;
}

.about-text {
  max-width: 550px;
  font-size: 17px;
  line-height: 1.7;
}

/* Zwei Zeilen Abstand zwischen den Absätzen */
.about-text p + p {
  margin-top: 3.4em;
}


/* Kontakt */

.contact-intro {
  max-width: 600px;
  margin-top: 35px;
  font-size: 16px;
  line-height: 1.7;
  opacity: 0.65;
}

.contact-content {
  max-width: 700px;
  margin-top: 90px;
}

.form-field {
  margin-bottom: 40px;
}

.form-field label {
  display: block;
  margin-bottom: 12px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.55;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 16px;
  outline: none;
  transition: border-width 0.2s ease;
}

.form-field textarea {
  min-height: 150px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  border-bottom-width: 2px;
}

.instagram-link {
  margin-top: 70px;
}


/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--lightbox-bg);
}

.lightbox.active {
  display: flex;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  border: none;
  background: none;
  color: var(--fg);
  line-height: 1;
  cursor: pointer;
  z-index: 2001;
}

.lightbox-close {
  top: 25px;
  right: 35px;
  padding: 5px;
  font-size: 32px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 50px;
  font-weight: 300;
  transition: opacity 0.3s ease;
}

.lightbox-prev {
  left: 25px;
}

.lightbox-next {
  right: 25px;
}

.lightbox-close:hover {
  opacity: 0.5;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 0.45;
}


/* Handy */

@media (max-width: 700px) {
  main {
    padding: 120px 20px 40px;
  }

  .page {
    padding-top: 120px;
  }

  .page-title {
    font-size: clamp(48px, 14vw, 70px);
  }

  header {
    padding: 20px 15px;
    display: flex;
    justify-content: space-between;
  }

  .logo {
    position: relative;
    z-index: 1001;
    font-size: 10px;
    letter-spacing: 1.5px;
  }

  #menu-toggle {
    display: block;
    position: relative;
    z-index: 1002;
  }

  /* Die Navigation wird zum Vollbild-Menü */
  #main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    flex-direction: column;
    gap: 30px;
    background: var(--bg);
    color: var(--fg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-15px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
  }

  #main-nav.menu-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  #main-nav a {
    font-size: 20px;
  }

  #main-nav #theme-toggle {
    position: static;
    transform: none;
    width: 40px;
    height: 40px;
    margin-top: 20px;
    font-size: 20px;
  }

  .home {
    min-height: calc(100vh - 80px);
  }

  .hero h1 {
    font-size: clamp(42px, 13vw, 70px);
    letter-spacing: -2px;
  }

  .hero-name {
    font-size: 17px;
    letter-spacing: 2px;
  }

  .portfolio-link {
    margin-top: 40px;
    font-size: 17px;
    letter-spacing: 1.5px;
  }

  .gallery {
    margin-top: 55px;
  }

  .masonry-column {
    gap: 22px;
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 45px;
    margin-top: 55px;
  }

  .about-text {
    font-size: 16px;
  }

  .contact-intro {
    margin-top: 25px;
    font-size: 15px;
  }

  .contact-content {
    max-width: 100%;
    margin-top: 55px;
  }

  .form-field {
    margin-bottom: 35px;
  }

  .instagram-link {
    margin-top: 55px;
  }

  .lightbox {
    padding: 20px;
  }

  .lightbox-image {
    max-width: 94vw;
    max-height: 85vh;
  }

  .lightbox-close {
    top: 20px;
    right: 20px;
    font-size: 28px;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 40px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }
}
