/* ==========================================================================
   Portfolio Miles Zöller — Design-System nach Spec
   Fonts: Instrument Serif (Logo) + Inter (alles andere), Google Fonts
   Layout: zentrierter Container max-width 1024px, padding 0 30px
   ========================================================================== */

/* ---------- Reset / Basis ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  background: #f2f2f2;
  color: #000000;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 15px;
  letter-spacing: -0.2px;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Container ---------- */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: 26px;
}

.logo {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: 60px;
  line-height: 64px;
  letter-spacing: normal;
  color: #c3c3c3;
  transition: color 0.25s ease;
}

.logo:hover {
  color: #6f6f6f;
}

.nav {
  display: flex;
  gap: 60px;
  padding-top: 4px; /* Anker-Links sitzen lt. Spec bei y=30, Logo bei y=26 */
}

.nav a {
  font-size: 13px;
  line-height: 15px;
  letter-spacing: -0.2px;
  color: #c3c3c3;
}

/* ---------- Startseite: Hero ---------- */

/* Vollflächige Hero-Section: füllt zusammen mit dem Header (~90px)
   den ersten Viewport, das Portfolio-Grid beginnt unter dem Fold. */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100svh - 90px);
}

.hero-claim {
  max-width: 531px;
  text-align: center;
}

/* ---------- Startseite: Portfolio-Grid ---------- */

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 11px;
  row-gap: 105px; /* Reihe 1 endet y≈784, Reihe 2 beginnt y=870 */
  margin-top: 60px;
}

.project-card {
  display: block;
  transition: transform 0.25s ease;
}

/* Ganze Kachel (Bild + Titel + Untertitel) poppt leicht auf */
.project-card:hover {
  transform: scale(1.03);
}

.project-card .img-placeholder,
.project-card img {
  aspect-ratio: 314 / 210;
  width: 100%;
  object-fit: cover;
}

.project-card .card-title {
  margin-top: 15px; /* Bild endet y=750, Titel y≈765 */
  font-size: 11px;
  line-height: 13px;
  letter-spacing: -0.2px;
  font-weight: 600;
}

.project-card .card-subtitle {
  margin-top: 6px; /* Untertitel y≈784 */
  font-size: 10px;
  line-height: 13px;
  letter-spacing: normal;
}

/* ---------- Startseite: About ---------- */

.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 20px;
  margin-top: 150px; /* y=1365 */
}

.about-text {
  max-width: 477px; /* Textzeilen nicht zu lang werden lassen */
}

.about-text p + p {
  margin-top: 15px;
}

.about-contact {
  margin-top: 60px; /* y≈1500 */
}

.about-photo .img-placeholder,
.about-photo img {
  aspect-ratio: 477 / 330;
  width: 100%;
  object-fit: cover;
}

.about-photo-credits {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 12px; /* Foto endet y≈1695, Zeile y≈1710 */
}

.photo-credit {
  font-size: 9px;
  line-height: 10px;
  letter-spacing: -0.2px;
  color: rgba(0, 0, 0, 0.6);
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 150px;
  padding-bottom: 26px;
  font-size: 9px;
  line-height: 10px;
  letter-spacing: -0.2px;
}

/* ---------- Detailseiten ---------- */

.project-hero {
  margin-top: 60px; /* Logo endet y≈90, Hero y=150 */
}

.project-hero .img-placeholder,
.project-hero img {
  aspect-ratio: 964 / 630;
}

/* Hero- und Galerie-Bilder füllen ihre Fläche formatfüllend */
.project-hero img,
.gallery img {
  width: 100%;
  object-fit: cover;
}

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  margin-top: 30px; /* Hero endet y=780, Titel y=810 */
}

.project-title {
  font-size: 24px;
  line-height: 24px;
  letter-spacing: normal;
}

.project-meta {
  flex-shrink: 0;
  text-align: left;
}

.project-description {
  max-width: 477px;
  margin-top: 21px; /* y=855 */
}

.project-description p + p {
  margin-top: 15px;
}

/* Galerien */

.gallery {
  margin-top: 60px;
}

.gallery-grid {
  display: grid;
  column-gap: 10px;
  row-gap: 30px;
  align-items: start;
}

.gallery figure figcaption {
  margin-top: 8px;
  font-size: 9px;
  line-height: 10px;
  letter-spacing: -0.2px;
}

/* Seite 2 & generisch: zwei gleiche Spalten */
.gallery-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* Seite 4: sechs schmale Spalten */
.gallery-grid.cols-6 {
  grid-template-columns: repeat(6, 1fr);
}

.gallery-grid .span-2 {
  grid-column: span 2;
}

/* Seite 7: einzelnes Hochformat rechts */
.gallery-grid.cols-2 .col-2 {
  grid-column: 2;
}

/* Seite 5/7: Elemente rechts ausrichten */
.gallery-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.gallery-grid .col-2 {
  grid-column: 2;
}

.gallery-grid .col-3 {
  grid-column: 3;
}

.gallery-grid .full {
  grid-column: 1 / -1;
}

/* Seite 6: 256 + 515 nebeneinander (Verhältnis ~1 : 2) */
.gallery-grid.catalog {
  grid-template-columns: 256fr 515fr;
  max-width: 802px; /* 256 + 10 + 515 + Rest frei wie im Original */
}

.gallery .half {
  max-width: 477px;
}

/* ---------- Bild-Platzhalter ---------- */

.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #ededed;
  color: #b0b0b0;
  font-size: 10px;
  line-height: 13px;
  letter-spacing: normal;
  text-align: center;
}

/* ---------- Scroll-Fade ---------- */

.fade-in {
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

.fade-in.is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fade-in {
    opacity: 1;
    transition: none;
  }

  .logo,
  .project-card {
    transition: none;
  }

  .project-card:hover {
    transform: none;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .site-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .nav {
    justify-content: center;
    gap: 30px;
    padding-top: 0;
  }

  .hero-claim {
    text-align: center;
  }

  .hero {
    min-height: calc(100svh - 160px); /* Header ist hier zweizeilig */
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 60px;
    margin-top: 60px;
  }

  .about {
    grid-template-columns: 1fr;
    row-gap: 40px;
    margin-top: 100px;
  }

  /* Portrait über dem Vorstellungstext */
  .about-photo {
    order: -1;
  }

  .about-text {
    max-width: none;
  }

  .project-head {
    flex-direction: column;
    gap: 15px;
  }

  .gallery-grid.cols-6 {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery-grid.cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid.cols-3 .col-2 {
    grid-column: 1;
  }

  .gallery-grid.cols-3 .col-3 {
    grid-column: 2;
  }

  .site-footer {
    margin-top: 90px;
  }
}

@media (max-width: 520px) {
  .container {
    padding: 0 20px;
  }

  .logo {
    font-size: 40px;
    line-height: 44px;
  }

  .hero {
    min-height: calc(100svh - 130px);
  }

  .portfolio-grid,
  .gallery-grid.cols-2,
  .gallery-grid.cols-3,
  .gallery-grid.catalog {
    grid-template-columns: 1fr;
  }

  .gallery-grid.cols-3 .col-2,
  .gallery-grid.cols-3 .col-3,
  .gallery-grid.cols-2 .col-2 {
    grid-column: 1;
  }

  /* Hochformatige Instagram-Mockups: 2 Spalten statt 1 */
  .gallery-grid.cols-6 {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid.cols-6 .span-2 {
    grid-column: span 2;
  }

  .gallery .half {
    max-width: none;
  }
}
