:root {
    --ground: #EAE7E1;
    --paper: #F4F2ED;
    --ink: #141413;
    --ink-soft: #57534B;
    --ink-faint: #6E6960;
    --line: #C9C4BA;
    --line-faint: #D9D4CA;
    --accent: #39151B;

    --sans: "Helvetica Neue", HelveticaNeue, Helvetica, Arial, sans-serif;

    --pad: clamp(1.25rem, 5vw, 5rem);
    --stack: clamp(4.5rem, 11vw, 9rem);
  }

  * { box-sizing: border-box; }

  body {
    background: var(--ground);
    color: var(--ink);
    font-family: var(--sans);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.65;
    letter-spacing: 0.005em;
    -webkit-font-smoothing: antialiased;
    margin: 0;
  }

  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }

  a { color: inherit; }

  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }

  .label {
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    color: var(--ink-faint);
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
  }

  h1, h2 { margin: 0; font-size: inherit; font-weight: inherit; }

  /* sichtbar für Suchmaschinen und Vorleseprogramme, nicht im Layout */
  .nur-vorlesen {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .sq {
    width: 0.44em;
    height: 0.44em;
    background: var(--accent);
    flex: none;
    display: inline-block;
  }

  .pipe {
    color: var(--accent);
    padding: 0 0.45em;
  }

  /* ---------- Hinweisleiste ---------- */




  /* ---------- Auftaktbild ---------- */

  .hero {
    position: relative;
    height: min(92vh, 860px);
    min-height: 420px;
    overflow: hidden;
    background: var(--ink);
  }

  .hero-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
  }

  /* ---------- Navigationsleiste ---------- */

  .barnav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--ground);
    border-bottom: 1px solid var(--line-faint);
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem 2rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem var(--pad);
  }

  .barnav .logo {
    display: block;
    width: clamp(140px, 18vw, 176px);
    height: auto;
  }

  .barnav nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.7rem;
  }

  .barnav nav a {
    font-size: 0.82rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--ink-soft);
    text-decoration: none;
    padding-bottom: 3px;
    border-bottom: 1px solid transparent;
    transition: color 0.25s, border-color 0.25s;
  }

  .barnav nav a:hover {
    color: var(--ink);
    border-bottom-color: var(--accent);
  }

  /* ---------- Bilddarstellung ---------- */

  /* Projektbilder ruhen in Graustufen und kommen unter dem Zeiger zur Farbe.
     Nur dort, wo es einen echten Mauszeiger gibt - auf Touchgeraeten bleiben
     sie farbig, weil es dort kein Darueberfahren gibt. */
  @media (hover: hover) and (pointer: fine) {
    .tile img,
    .hero-media {
      filter: grayscale(1);
      transition: filter 0.6s ease;
    }

    .tile:hover img,
    .tile:focus-visible img,
    .hero:hover .hero-media {
      filter: grayscale(0);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .tile img,
    .hero-media { transition: none; }
    .tile-text { transition: none; }
  }

  /* Die Zeichnung sitzt so tief, dass die Monitoroberkante auf der ersten
     Zeile des Fließtextes liegt - also unterhalb des herausgehobenen Satzes. */
  .zeichnung { margin: 4.95rem 0 0; }

  @media (max-width: 760px) {
    .zeichnung { margin-top: 0; }
  }

  .zeichnung img {
    display: block;
    width: 100%;
    height: auto;
  }

  /* ---------- Auftakt ---------- */

  .lede {
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--stack) var(--pad) 0;
    display: grid;
    gap: 1.7rem;
    justify-items: center;
    text-align: center;
  }

  .lede p {
    font-size: clamp(1.5rem, 3.2vw, 2.5rem);
    font-weight: 300;
    line-height: 1.32;
    letter-spacing: -0.02em;
    max-width: 22ch;
    margin: 0;
    text-wrap: balance;
  }

  .lede .meta {
    font-size: 0.86rem;
    letter-spacing: 0.05em;
    color: var(--ink-faint);
  }

  /* ---------- Abschnitte ---------- */

  .section {
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--stack) var(--pad) 0;
  }

  .section-head {
    display: grid;
    gap: 0.9rem;
    padding-bottom: 2.5rem;
  }

  .section-head hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 0;
    width: 100%;
  }

  /* ---------- Projektkacheln ---------- */

  .tiles {
    column-count: 3;
    column-gap: clamp(1rem, 2vw, 1.75rem);
  }

  .tile {
    position: relative;
    display: block;
    width: 100%;
    margin: 0 0 clamp(1rem, 2vw, 1.75rem);
    padding: 0;
    border: 0;
    overflow: hidden;
    break-inside: avoid;
    background: var(--paper);
    font: inherit;
    color: inherit;
    cursor: pointer;
  }

  .tile img {
    display: block;
    width: 100%;
    height: auto;
  }

  @media (max-width: 980px) { .tiles { column-count: 2; } }
  @media (max-width: 560px) { .tiles { column-count: 1; } }

  .tile-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2.2rem 1rem 0.9rem;
    background: linear-gradient(to top, rgba(16, 15, 14, 0.78), rgba(16, 15, 14, 0));
    color: #F4F2ED;
    font-size: 0.86rem;
    letter-spacing: 0.04em;
    line-height: 1.35;
    text-align: left;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }

  .tile:hover .tile-text,
  .tile:focus-visible .tile-text {
    opacity: 1;
    transform: none;
  }

  /* ---------- Lupe ---------- */

  .lupe {
    border: 0;
    padding: 0;
    margin: auto;
    max-width: min(94vw, 1180px);
    max-height: 92vh;
    background: transparent;
    overflow: visible;
  }

  .lupe::backdrop { background: rgba(16, 15, 14, 0.88); }

  .lupe img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    margin: 0 auto;
  }

  .lupe-text {
    margin: 1rem auto 0;
    max-width: 70ch;
    text-align: center;
    color: #F4F2ED;
  }

  .lupe-text p { margin: 0; }

  .lupe-titel {
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.01em;
  }

  .lupe-daten {
    margin-top: 0.3rem !important;
    font-size: 0.84rem;
    font-weight: 300;
    letter-spacing: 0.04em;
    color: rgba(244, 242, 237, 0.72);
  }

  .lupe-beschreibung {
    margin-top: 0.7rem !important;
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.6;
    color: rgba(244, 242, 237, 0.86);
  }

  .lupe-beschreibung:empty,
  .lupe-daten:empty { display: none; }

  .lupe-hinweis {
    display: block;
    margin-top: 0.9rem;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: rgba(244, 242, 237, 0.5);
  }

  /* ---------- Aktuelles ---------- */

  .aktuell {
    display: grid;
    max-width: 68ch;
    border-top: 1px solid var(--line-faint);
  }

  .aktuell div {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 0.1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line-faint);
    font-size: 1.02rem;
    font-weight: 300;
    line-height: 1.5;
  }

  .aktuell .ort { color: var(--ink-faint); }

  /* ---------- Büro ---------- */

  .office {
    display: grid;
    grid-template-columns: minmax(240px, 380px) minmax(0, 1fr);
    gap: clamp(1.75rem, 5vw, 4.5rem);
    align-items: stretch;
  }

  .office-text { display: grid; gap: 1.2rem; max-width: 60ch; }

  .office-text p { margin: 0; font-weight: 300; }

  .office-text .pull {
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1.45;
    letter-spacing: -0.015em;
    color: var(--ink);
  }

  .office-text .body { color: var(--ink-soft); }

  /* Porträt oben, Partnerangaben unten - so schließen beide Spalten
     auf gleicher Höhe ab, egal wie lang der Text daneben wird. */
  .office-side {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .office-side .partner { margin-top: auto; }

  .partner {
    display: grid;
    gap: 0.75rem;
    justify-items: end;
    text-align: right;
  }


  .partner .namen {
    display: grid;
    gap: 0.3rem;
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--ink-soft);
  }

  /* ---------- Leistungen ---------- */

  .services-intro {
    max-width: 62ch;
    margin: 0 0 clamp(2.25rem, 5vw, 3.5rem);
    font-size: 1.08rem;
    font-weight: 300;
    line-height: 1.7;
    color: var(--ink-soft);
  }

  .services {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.75rem, 4vw, 3.5rem);
    max-width: 62rem;
  }

  @media (max-width: 620px) {
    .services { grid-template-columns: minmax(0, 1fr); }
  }

  .service { display: grid; gap: 0.7rem; align-content: start; }

  .service h3 {
    font-size: 1.05rem;
    font-weight: 500;
    margin: 0;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
  }

  .service p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.92rem;
    font-weight: 300;
  }

  /* ---------- Kontakt ---------- */

  .contact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: clamp(1.75rem, 4vw, 3.5rem);
    align-items: start;
  }

  .contact-block { display: grid; gap: 0.4rem; align-content: start; }

  .contact-block .rows {
    display: grid;
    gap: 0;
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.5;
    color: var(--ink-soft);
  }

  /* wie im Logo: der Bürname kräftig, der Zusatz leicht - Farbe bleibt gleich */
  .contact-block .rows strong {
    font-weight: 700;
    color: inherit;
  }

  /* Das Wort links, Nummer und Mailadresse beginnen auf gleicher Flucht */
  .contact-block .wort {
    display: inline-block;
    min-width: 5.2em;
  }

  /* ohne Unterstreichung im Ruhezustand - sie erscheint erst unter dem Zeiger */
  .contact-block a {
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s, color 0.25s;
  }

  .contact-block a:hover {
    border-bottom-color: var(--accent);
    color: var(--ink);
  }

  /* ---------- Fuß ---------- */

  .colophon {
    max-width: 1440px;
    margin: var(--stack) auto 0;
    padding: 2rem var(--pad) 3.5rem;
    border-top: 1px solid var(--line-faint);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2rem;
    align-items: end;
    justify-content: space-between;
  }

  .colophon .logo {
    display: block;
    width: 168px;
    height: auto;
    opacity: 0.9;
  }

  .colophon .legal {
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    color: var(--ink-faint);
  }

  .colophon .legal a {
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s;
  }

  .colophon .legal a:hover { border-bottom-color: var(--accent); }

  /* ---------- Einblenden ---------- */

  .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.9s ease, transform 0.9s ease;
  }

  .reveal.shown {
    opacity: 1;
    transform: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
  }

  /* ---------- Schmale Fenster ---------- */

  @media (max-width: 760px) {
    .project,
    .office,
    .contact {
      grid-template-columns: minmax(0, 1fr);
    }

    .project.flip .project-visual,
    .project.flip .project-meta { order: 0; }

    .hero { height: 76vh; }
    .barnav { position: static; }
    .barnav nav { gap: 1.1rem; }
  }
/* ---------- Ansichten (Vorschau: eine Datei, spätere Seite: eigene Dateien) ---------- */
  .view[hidden] { display: none !important; }
  .section-first { padding-top: clamp(2.5rem, 6vw, 4.5rem); }

  /* ---------- Verweise auf die Projektseiten ---------- */
  .view[hidden] { display: none !important; }
  .section-first { padding-top: clamp(2.5rem, 6vw, 4.5rem); }

  /* ---------- Impressum und Datenschutz ---------- */
  .rechtstext .text {
    max-width: 70ch;
    font-size: 0.86rem;
    line-height: 1.6;
    font-weight: 300;
    color: var(--ink-soft);
  }

  .rechtstext h3 {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--ink);
    margin: 1.1rem 0 0.2rem;
    padding: 0;
    border: 0;
  }

  .rechtstext p { margin: 0 0 0.35rem; }
  .rechtstext .text { line-height: 1.5; }

  .rechtstext a {
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    transition: border-color 0.25s, color 0.25s;
  }

  .rechtstext a:hover { border-bottom-color: var(--accent); color: var(--ink); }

  /* Anmerkungen von Claude – vor dem Livegang entfernen */
  .pruefen { color: #1F5FBF; }

  /* Logo im Fuß in voller Farbe, wie in der Navigationsleiste */
  .colophon .logo { opacity: 1; }

  /* Ohne JavaScript bleibt alles sichtbar; die Einblendung greift nur, wenn das Skript die Klasse setzt */
  .reveal { opacity: 1; transform: none; }
  .js .reveal { opacity: 0; transform: translateY(14px); }
  .js .reveal.shown { opacity: 1; transform: none; }
  @media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

  /* Kontrast: ein Hauch dunkleres Grau für Navigation und Abschnittsmarken (4,5:1 erreicht) */
  :root { --ink-faint: #66615A; }

  /* Auf Touchgeräten gibt es kein Darüberfahren: Titel dauerhaft zeigen */
  @media (hover: none) {
    .tile-text { opacity: 1; transform: none; }
    /* Kacheln auch auf Touchgeräten erst schwarzweiß, farbig nach der ersten Berührung */
    .tile img { filter: grayscale(1); transition: filter 0.6s ease; }
    .tile.beruehrt img { filter: grayscale(0); }
  }

  /* Büroname im Kontakt in Weinrot */
  .contact-block .rows strong { color: var(--accent); }

  /* Einstiegssatz über dem Film, oben rechts */
  .hero-text {
    position: absolute; top: 0; right: 0; left: 0;
    padding: clamp(1.6rem, 4vw, 3.2rem) var(--pad) 0;
    display: grid; justify-items: end; gap: 1.1rem;
    text-align: right; color: #fff; isolation: isolate;
    text-shadow: 0 1px 3px rgba(0,0,0,0.55), 0 0 28px rgba(0,0,0,0.45);
    pointer-events: none;
  }
  .hero-text::before {
    content: ""; position: absolute; inset: 0; z-index: -1; height: 55vh;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0));
  }
  .hero-text p {
    margin: 0; max-width: 34ch;
    font-size: clamp(1.25rem, 2.4vw, 1.9rem); font-weight: 300; line-height: 1.32; letter-spacing: -0.02em;
  }
  .hero-text .satz2 { display: block; margin-top: 0.45em; }
  .hero-text .meta { font-size: 0.86rem; letter-spacing: 0.05em; color: rgba(255,255,255,0.85); }
  .hero-text .pipe { color: rgba(255,255,255,0.85); }
  /* Projekte direkt unter der Navigation: kein Trennstrich, weniger Abstand */
  #projekte { padding-top: clamp(1.4rem, 3vw, 2.4rem); }
  #projekte .section-head hr { display: none; }
  #projekte .section-head { padding-bottom: 1.6rem; }
  /* Raster: drei Spalten (Zeilenvariante vom 10.09. verworfen, Funktion zeilen() bleibt im Skript) */
  /* Drei Spalten mit gleich hohen Enden: Aufteilung im Bauskript, der kleine
     Höhenrest je Spalte wird über einen minimalen Bildbeschnitt ausgeglichen */
  .tiles { column-count: auto !important; display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 0 clamp(1rem, 2vw, 1.75rem); align-items: start; }
  .tiles .col { display: block; min-width: 0; }
  .tiles .col .tile:last-child { margin-bottom: 0; }
  .tiles .col .tile img { aspect-ratio: var(--ar, auto); object-fit: cover; }
  /* Ohne Skript auf schmalen Bildschirmen: normale CSS-Spalten */
  @media (max-width: 980px) {
    html:not(.js) .tiles { display: block; column-count: 2 !important; }
    html:not(.js) .tiles .col { display: contents; }
    html:not(.js) .tiles .col .tile:last-child { margin-bottom: clamp(1rem, 2vw, 1.75rem); }
    html:not(.js) .tiles .col .tile img { aspect-ratio: auto; }
  }
  @media (max-width: 560px) { html:not(.js) .tiles { column-count: 1 !important; } }
  /* Schwarzweiß-Zustand der Kacheln etwas aufgehellt (die Bilder sind bewusst dunkel abgestimmt,
     in Graustufen auf hellem Grund wirkt das schwer); farbig bleibt unverändert */
  @media (hover: hover) and (pointer: fine) {
    .tile img { filter: grayscale(1) brightness(1.12); }
    .tile:hover img, .tile:focus-visible img { filter: grayscale(0); }
  }
  @media (hover: none) {
    .tile img { filter: grayscale(1) brightness(1.12); }
    .tile.beruehrt img { filter: grayscale(0); }
  }
  /* Kleine Bildschirme: Film läuft dort farbig, deshalb kräftigere Schrift und stärkerer Verlauf */
  @media (max-width: 720px) {
    .hero-text p { font-weight: 400; }
    .hero-text { text-shadow: 0 1px 3px rgba(0,0,0,0.7), 0 0 20px rgba(0,0,0,0.6); }
    .hero-text::before { height: 70vh; background: linear-gradient(to bottom, rgba(0,0,0,0.66) 0%, rgba(0,0,0,0.35) 50%, rgba(0,0,0,0) 100%); }
    .hero-text .meta, .hero-text .pipe { color: #fff; }
  }
  /* Auftakt: Film plus Navigationsleiste füllen beim Aufruf genau den Bildschirm */
  :root { --nav-h: 82px; }
  .hero { height: calc(100vh - var(--nav-h)); height: calc(100svh - var(--nav-h)); min-height: 360px; }
  @media (max-width: 720px) { .hero { height: calc(100vh - var(--nav-h)); height: calc(100svh - var(--nav-h)); } }

  .weiter {
    margin: clamp(2rem, 4vw, 3rem) 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.6rem 1.6rem;
  }

  .weiter-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
  }

  .weiter-links a {
    font-size: 0.86rem;
    letter-spacing: 0.1em;
    color: var(--ink-soft);
    text-decoration: none;
    padding-bottom: 3px;
    border-bottom: 1px solid transparent;
    transition: color 0.25s, border-color 0.25s;
  }

  .weiter-links a:hover,
  .weiter-links a.aktiv {
    color: var(--ink);
    border-bottom-color: var(--accent);
  }

  .filter {
    margin: 0 0 clamp(1.75rem, 4vw, 2.75rem);
    display: flex;
    flex-wrap: wrap;
    gap: 1.6rem;
  }

  .filter a {
    font-size: 0.86rem;
    letter-spacing: 0.1em;
    color: var(--ink-soft);
    text-decoration: none;
    padding-bottom: 3px;
    border-bottom: 1px solid transparent;
    transition: color 0.25s, border-color 0.25s;
  }

  .filter a:hover,
  .filter a.aktiv {
    color: var(--ink);
    border-bottom-color: var(--accent);
  }

  /* kleiner Zwischenraum zwischen Außenaufnahmen und Detail */
  .tiles-detail { margin-top: clamp(2.5rem, 6vw, 4.5rem); }

  .barnav nav a.aktiv {
    color: var(--ink);
    border-bottom-color: var(--accent);
  }

  /* ---------- Kacheln mit mehreren Aufnahmen ---------- */
  .tile-mehr {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    display: grid;
    place-items: center;
    background: rgba(16, 15, 14, 0.55);
    color: #F4F2ED;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    opacity: 0;
    transition: opacity 0.4s ease;
  }

  .tile:hover .tile-mehr,
  .tile:focus-visible .tile-mehr { opacity: 1; }

  @media (hover: none) { .tile-mehr { opacity: 1; } }

  /* ---------- Lupe mit Blättern ---------- */
  .lupe-bild {
    position: relative;
    display: grid;
    justify-items: center;
  }

  .lupe-pfeil {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: rgba(16, 15, 14, 0.45);
    color: #F4F2ED;
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: none;
  }

  .lupe-pfeil:hover { background: var(--accent); }
  .lupe-pfeil.zurueck { left: 0.4rem; }
  .lupe-pfeil.vor { right: 0.4rem; }
  .lupe.mehrere .lupe-pfeil { display: block; }

  .lupe-zaehler {
    display: none;
    margin-left: 0.8em;
    color: rgba(244, 242, 237, 0.55);
  }
  .lupe.mehrere .lupe-zaehler { display: inline; }
