@font-face {
  font-family: "Roboto";
  src: url("fonts/roboto-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --text: #141414;
  --text-muted: #4a4a4a;
  --border: rgba(0, 0, 0, 0.1);
  --pad: clamp(1.25rem, 4vw, 4rem);
  --container-max: 1400px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(0.9rem, 2vw, 1.6rem);
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 400;
  letter-spacing: -0.01em;
  font-size: 1.7rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  padding: 0.5rem;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  display: flex;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 400;
  font-size: 1.05rem;
  transition: color 0.2s ease;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--text);
}

.nav-list a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Split page (Kontakt / Über uns) */

.split-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}

.split-page-copy {
  padding: clamp(3rem, 7vw, 6rem) clamp(3rem, 7vw, 6rem) clamp(3rem, 7vw, 6rem) var(--pad);
  max-height: calc(100vh - var(--header-height, 0px));
  overflow-y: auto;
}

.split-page-copy h1 {
  margin: 0 0 1.75rem;
  font-weight: 400;
  font-size: clamp(2.4rem, 4.5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  max-width: 26ch;
}

.split-page-copy h2 {
  margin: 2.5rem 0 1rem;
  font-weight: 400;
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  max-width: 34rem;
}

.split-page-copy p {
  margin: 0 0 1.25rem;
  max-width: 34rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text);
}

.split-page-media {
  position: relative;
}

.split-page-media.is-sticky {
  position: sticky;
  top: var(--header-height, 0px);
  height: calc(100vh - var(--header-height, 0px));
  align-self: start;
}

.split-page-media img,
.split-page-media .placeholder-block {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.split-page-media .placeholder-block {
  min-height: 100vh;
}

.split-page-text {
  font-size: 1rem;
  color: var(--text-muted);
}

/* Contact form */

.contact-form {
  margin-top: 2.75rem;
  max-width: 36rem;
}

.form-group-label {
  margin: 0 0 1rem;
  font-weight: 400;
  font-size: 1rem;
}

.field-row {
  display: flex;
  gap: 1.25rem;
}

.field {
  flex: 1;
  margin-bottom: 1.5rem;
}

.field label {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

.field .required {
  color: var(--text-muted);
  font-weight: 400;
}

.field input,
.field textarea {
  width: 100%;
  display: block;
  border: 1px solid rgba(0, 0, 0, 0.25);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  padding: 0.9rem 1.3rem;
}

.field input {
  height: 3.25rem;
  border-radius: 999px;
}

.field textarea {
  min-height: 9rem;
  border-radius: 20px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--text);
}

.submit-btn {
  border: none;
  background: var(--text);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  padding: 0.9rem 2.4rem;
  border-radius: 999px;
  cursor: pointer;
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.botcheck {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.form-status {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.form-status[data-state="success"] {
  color: #1a7a3c;
}

.form-status[data-state="error"] {
  color: #b3261e;
}

/* Login (temporary test page — remove alongside login.html/login.js) */

.login-page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
}

.login-page-inner {
  width: 100%;
  max-width: 22rem;
}

.login-page-inner .brand {
  display: inline-block;
  margin-bottom: 3rem;
  font-size: 1.7rem;
}

.login-page-inner h1 {
  margin: 0 0 0.75rem;
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2rem);
  line-height: 1.25;
}

.login-page-intro {
  margin: 0 0 2.5rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.login-form {
  width: 100%;
}

.login-form .split-page-text {
  margin: 0 0 2rem;
}

/* Projects grid */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--pad);
}

.project-card {
  margin: 0;
  cursor: pointer;
}

.project-card .placeholder-block,
.project-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: opacity 0.2s ease;
}

.project-card:hover .placeholder-block,
.project-card:hover img,
.project-card:focus-visible .placeholder-block,
.project-card:focus-visible img {
  opacity: 0.85;
}

.project-card:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
}

.project-card figcaption {
  margin-top: 1rem;
  font-size: 1.1rem;
  color: var(--text);
}

/* Project modal */

body.project-modal-open {
  overflow: hidden;
}

.project-modal[hidden] {
  display: none;
}

.project-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 3rem);
}

.project-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.project-modal-dialog {
  position: relative;
  z-index: 1;
  background: var(--bg);
  width: min(900px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: clamp(2rem, 5vw, 3.5rem);
}

.project-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  outline: none;
}

.project-modal-close:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.project-modal-close span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 2px;
  background: var(--text);
}

.project-modal-close span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.project-modal-close span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.project-modal-title {
  margin: 0 0 1.5rem;
  font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  padding-right: 2rem;
}

.project-modal-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.project-modal-images img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  cursor: pointer;
  outline: none;
  transition: opacity 0.2s ease;
}

.project-modal-images img:hover,
.project-modal-images img:focus-visible {
  opacity: 0.85;
}

.project-modal-images img:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.project-modal-text p {
  margin: 0 0 1em;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.project-modal-text p:last-child {
  margin-bottom: 0;
}

/* Image lightbox */

body.image-lightbox-open {
  overflow: hidden;
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 6vw, 4rem);
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
}

.image-lightbox-figure {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-lightbox-figure img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.image-lightbox-counter {
  margin-top: 1rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
}

.image-lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: clamp(1.25rem, 4vw, 2.5rem);
  z-index: 1;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  outline: none;
}

.image-lightbox-close span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 2px;
  background: #ffffff;
}

.image-lightbox-close span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.image-lightbox-close span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.image-lightbox-close:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.image-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  transition: opacity 0.2s ease;
}

.image-lightbox-nav[hidden] {
  display: none;
}

.image-lightbox-nav:hover {
  opacity: 0.7;
}

.image-lightbox-nav:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.image-lightbox-nav.prev {
  left: clamp(0.25rem, 3vw, 1.5rem);
}

.image-lightbox-nav.next {
  right: clamp(0.25rem, 3vw, 1.5rem);
}

/* Hero */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  background-image: url("images/hero.jpg");
  background-image: image-set(url("images/hero.webp") type("image/webp"), url("images/hero.jpg") type("image/jpeg"));
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.4) 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-heading {
  margin: 0;
  max-width: 40ch;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 400;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

/* Sections shared */

.about,
.showcase,
.gallery,
.contact {
  padding-block: clamp(4rem, 10vw, 9rem);
}

/* About */

.about-copy {
  max-width: 70rem;
}

.about-copy p {
  margin: 0 0 1.4em;
  color: var(--text);
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: clamp(1.2rem, 2.2vw, 2.6rem);
  line-height: 1.3;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

/* Showcase */

.showcase {
  padding-block: 0;
}

.showcase-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.showcase-copy {
  padding-inline-start: var(--pad);
  max-width: 34rem;
}

.eyebrow {
  display: block;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text);
}

.showcase-copy h2 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(1.9rem, 3.6vw, 3.1rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
}

.showcase-media img {
  width: 100%;
  height: clamp(360px, 55vw, 640px);
  object-fit: cover;
}

/* Gallery */

.gallery-row {
  display: flex;
  align-items: flex-start;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.gallery-row + .gallery-row {
  margin-top: clamp(2rem, 6vw, 5rem);
}

.gallery-row--top {
  padding-inline: var(--pad);
  justify-content: space-between;
}

.gallery-row--bottom {
  justify-content: space-between;
}

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

.placeholder-block {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000000;
}

/* Large/small are the only two size roles — every "large" image is the
   same width as every other "large" image, same for "small", regardless
   of which row it's in. Each image keeps its own natural aspect ratio
   (no cropping) — only the box width is fixed, height follows from that. */
.gallery-item--large {
  width: 38%;
}

.gallery-item--small {
  width: 22%;
  margin-top: clamp(3rem, 9vw, 7rem);
  align-self: flex-start;
}

/* Contact */

.contact {
  border-top: 1px solid var(--border);
}

.contact h2 {
  margin: 0 0 2rem;
  font-weight: 400;
  font-size: clamp(1.6rem, 2.8vw, 2.25rem);
}

.contact address {
  font-style: normal;
  margin-bottom: 1.75rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.contact p {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.contact a {
  text-decoration: underline;
  color: var(--text);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  color: var(--text-muted);
  text-decoration: underline;
}

.footer-inner a:hover,
.footer-inner a:focus-visible {
  color: var(--text);
}

/* Legal page (Impressum) */

.legal-page {
  padding-block: clamp(3rem, 7vw, 6rem);
}

.legal-page-inner {
  max-width: 46rem;
}

.legal-page h1 {
  margin: 0 0 2.5rem;
  font-weight: 400;
  font-size: clamp(2.4rem, 4.5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.legal-page h2 {
  margin: 2.5rem 0 1rem;
  font-weight: 400;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

.legal-page h2:first-of-type {
  margin-top: 0;
}

.legal-page p,
.legal-page address {
  margin: 0 0 1rem;
  font-style: normal;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.legal-page a {
  color: var(--text);
  text-decoration: underline;
}

.legal-page mark {
  background: #fff2a8;
  color: var(--text);
  padding: 0.05em 0.3em;
}

/* Mobile */

@media (max-width: 860px) {
  .header-inner {
    padding-block: 6vw;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    inset: 100% 0 auto 0;
    max-height: 0;
    overflow: hidden;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    transition: max-height 0.3s ease;
  }

  .site-nav.open {
    max-height: 280px;
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem var(--pad) 1.5rem;
  }

  .nav-list a {
    display: block;
    padding: 0.85rem 0;
  }

  .hero-heading {
    font-size: clamp(2.1rem, 8vw, 3rem);
    max-width: 16ch;
  }

  .showcase-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  .showcase-copy {
    padding-inline-start: var(--pad);
    padding-inline-end: var(--pad);
    max-width: none;
  }

  .showcase-media img {
    height: 70vw;
  }

  .gallery-row {
    flex-direction: column;
    gap: 1.5rem;
  }

  .gallery-row + .gallery-row {
    margin-top: 1.5rem;
  }

  .gallery-row--top {
    padding-inline: 0;
  }

  .gallery-item--large,
  .gallery-item--small {
    width: 100%;
    margin: 0;
  }

  .split-page {
    grid-template-columns: minmax(0, 1fr);
  }

  .split-page-copy {
    padding: 5.5rem var(--pad) 3rem;
    max-height: none;
    overflow-y: visible;
  }

  .split-page-media.is-sticky {
    position: relative;
    top: auto;
    height: 70vw;
  }

  .split-page-media .placeholder-block {
    min-height: 70vw;
  }

  .field-row {
    flex-direction: column;
    gap: 0;
  }

  .projects-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 3rem;
  }

  .project-modal {
    padding: 1rem;
  }

  .project-modal-images {
    grid-template-columns: minmax(0, 1fr);
  }

  .image-lightbox {
    padding: 1rem;
  }

  .image-lightbox-nav {
    width: 36px;
    height: 36px;
    font-size: 2rem;
  }

  .image-lightbox-nav.prev {
    left: 0.25rem;
  }

  .image-lightbox-nav.next {
    right: 0.25rem;
  }
}
