/* =====================================================================
   Startseite Architekturbüro Reiner Bayer – Formensprache der Projektseiten (VORLAGE/projektseite/ui.css):
   Geist, Glas, gleiche Kurven, gleicher Satz der Marke. Seite hell (Off-White, Jakob 16.10.), Bühne dunkel mit Video.
   Blau #0152A8 aus dem Logo nur als Akzent. Referenzen: Zeichnung → Modell (SKRIPTE/referenz-bilder.mjs).
   ===================================================================== */
:root {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --gutter: clamp(16px, 3.2vw, 48px);
  --sans: "Geist", -apple-system, "SF Pro Text", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* hell */
  --paper: #f4f2ed;
  --paper-2: #ebe8e1;
  --ink: #16181c;
  --ink-2: rgba(22, 24, 28, 0.66);
  --ink-3: rgba(22, 24, 28, 0.46);
  --ink-4: rgba(22, 24, 28, 0.16);
  --line: rgba(22, 24, 28, 0.10);
  /* auf der dunklen Bühne */
  --hell: #f6f4ef;
  --hell-2: rgba(246, 244, 239, 0.72);
  --blau: #0152a8;
  --blau-licht: #2f7ad6;

  --glass-bg: rgba(16, 18, 22, 0.30);
  --glass-edge: rgba(255, 255, 255, 0.14);
  --glass-blur: blur(24px) saturate(1.7);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 40px -12px rgba(0, 0, 0, 0.45), 0 2px 8px -2px rgba(0, 0, 0, 0.18);
  --legible: 0 1px 2px rgba(0, 0, 0, 0.35), 0 0 18px rgba(0, 0, 0, 0.22);

  --r-card: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --t: 0.32s;
  --wandel: 1.1s;   /* Zeichnung → Modell */
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-padding-top: 96px; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ol, ul, address { margin: 0; padding: 0; font-style: normal; }
ol, ul { list-style: none; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.glass { background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); }
:focus-visible { outline: 1.5px solid var(--blau-licht); outline-offset: 3px; border-radius: 6px; }

/* ---------- Kopf: auf der Bühne hell, danach dunkel auf hellem Verlauf ---------- */
#kopf { position: fixed; z-index: 10; inset: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: max(var(--gutter), env(safe-area-inset-top)) var(--gutter) 0; pointer-events: none; color: var(--hell);
  transition: color 0.5s var(--ease); }
#kopf > * { pointer-events: auto; }
#kopf::before { content: ""; position: absolute; inset: 0 0 -40px; z-index: -1; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, var(--paper) 0%, rgba(244,242,237,.94) 55%, rgba(244,242,237,0) 100%); transition: opacity 0.5s var(--ease); }
body.gescrollt #kopf { color: var(--ink); }
body.gescrollt #kopf::before { opacity: 1; }
/* Marke im Satz des Haustitels der Projektseite (.brand-title 19 px / 500, zweite Zeile 400 + gedimmt) */
.marke { display: inline-flex; align-items: center; gap: var(--s3); text-shadow: var(--legible); transition: text-shadow 0.5s var(--ease); }
body.gescrollt .marke { text-shadow: none; }
.marke-zeichen { width: 34px; height: 34px; fill: currentColor; flex: none; }
.marke-text { font-size: 19px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.12; }
.marke-sub { font-weight: 400; opacity: 0.78; }
body.gescrollt .marke-sub { opacity: 0.66; }
.kopf-nav { display: flex; gap: 2px; padding: 4px; border-radius: 999px; transition: background 0.5s var(--ease), border-color 0.5s var(--ease); }
.kopf-nav a { padding: 8px 14px; border-radius: 999px; font-size: 13px; opacity: 0.8;
  transition: opacity var(--t) var(--ease), background var(--t) var(--ease); }
.kopf-nav a:hover { opacity: 1; background: rgba(255,255,255,0.1); }
body.gescrollt .kopf-nav { background: rgba(255,255,255,0.55); border-color: rgba(22,24,28,0.08);
  box-shadow: 0 8px 30px -14px rgba(22,24,28,0.25); }
body.gescrollt .kopf-nav a:hover { background: rgba(22,24,28,0.06); }

/* ---------- Bühne (dunkel, Video) ---------- */
.buehne { position: relative; height: 100svh; min-height: 560px; overflow: hidden; isolation: isolate; color: var(--hell); background: #0e0f11; }
.buehne-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.6s linear; }
.buehne-film { position: absolute; inset: 0; z-index: -1; }   /* Clips aus dem CMS (buehne.js, abspieler.js) */
.buehne-film video, .buehne-film canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.buehne.wartet .buehne-video { opacity: 0; transition: none; }   /* bis die Liste aus dem CMS da ist (buehne.js) */
.buehne::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10,11,12,.58) 0%, rgba(10,11,12,.18) 18%, rgba(10,11,12,0) 30%),
    linear-gradient(0deg, rgba(10,11,12,.62) 0%, rgba(10,11,12,.18) 45%, rgba(10,11,12,.08) 100%); }
.buehne-text { position: absolute; z-index: 1; left: var(--gutter); right: var(--gutter); bottom: clamp(72px, 12vh, 128px); }
.claim { font-weight: 400; font-size: clamp(46px, 8.4vw, 132px); line-height: 0.95; letter-spacing: -0.035em;
  text-shadow: 0 2px 30px rgba(0,0,0,.25); }
.buehne-weiter { position: absolute; z-index: 1; right: var(--gutter); bottom: clamp(72px, 12vh, 128px); display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%; color: var(--hell-2); }
.buehne-weiter svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; animation: wippen 2.4s var(--ease-io) infinite; }
@keyframes wippen { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
.auftritt { animation: auftritt 1.2s var(--ease) var(--d, 0s) both; }
@keyframes auftritt { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* ---------- Abschnitte ---------- */
.abschnitt { padding: clamp(96px, 14vw, 190px) var(--gutter) 0; }
.einblenden { opacity: 0; transform: translateY(22px); transition: opacity 1s var(--ease) var(--d, 0s), transform 1.2s var(--ease) var(--d, 0s); }
.einblenden.da { opacity: 1; transform: none; }

/* ---------- Projekte ---------- */
/* Großer Abschnittstitel statt der Grundsätze (Jakob 16.10.) */
.abschnitt-titel { font-weight: 400; font-size: clamp(44px, 7.2vw, 112px); line-height: 0.95; letter-spacing: -0.035em; }
.raster { margin-top: clamp(32px, 4vw, 56px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 3vw, 48px) clamp(18px, 2vw, 32px); }   /* 3 nebeneinander (Jakob 16.10.) */
@media (max-width: 1099px) { .raster { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .raster { grid-template-columns: 1fr; } }

/* Häuser frei im Raum, ohne Kasten (Jakob 16.10.): Modell und Zeichnung freigestellt (transparent), nichts angeschnitten.
   Wandel: Haus wird leicht größer, Zeichnung geht in das farbige Modell über, weicher Schatten setzt es auf den Grund. */
.ref a { display: block; }
.karte { position: relative; aspect-ratio: 3 / 2; transition: transform 0.55s var(--ease); }
.karte img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
/* Zeichnung zeichnet sich beim ersten Erscheinen von links nach rechts */
.karte .zeichnung { z-index: 2; clip-path: inset(0 100% 0 0); transition: clip-path 1.2s var(--ease-io), opacity 0.4s var(--ease); }
.ref.da .zeichnung { clip-path: inset(0 0 0 0); }
.karte .modell { z-index: 1; opacity: 0; filter: blur(6px) drop-shadow(0 0 0 rgba(22,24,28,0));
  transition: opacity 0.45s var(--ease), filter 0.55s var(--ease); }
.ref.an .karte { transform: scale(1.06); }
.ref.an .modell { opacity: 1; filter: blur(0) drop-shadow(0 22px 22px rgba(22,24,28,0.16)); }
.ref.an .zeichnung { opacity: 0; }
/* Beta-Schild wie am Rundgang-Knopf der Hausseite (Jakob 17.10.: bei jedem 3D-Projekt) */
.karte .beta { position: absolute; z-index: 3; left: 0; top: 0; font: 500 10px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: #f4f2ed; background: rgba(22,24,28,0.82); padding: 5px 8px 4px; border-radius: 999px; pointer-events: none; }
/* Touch (iPhone): Safari malt das freigestellte Modell mit filter (blur/drop-shadow) als weiße Fläche (Jakob 17.10., Screenshot)
   → dort nur Überblenden, ohne Filter. */
@media (hover: none), (pointer: coarse) {
  .karte .modell, .ref.an .modell { filter: none; transition: opacity 0.45s var(--ease); }
}
/* Trenner immer blau, ohne Animation (Jakob 08.11.2026) */
.ref-linie { display: block; height: 1px; margin-top: 12px; background: var(--blau); }

/* Unter dem Haus: links Titel, rechts Grundfläche (Jakob 16.10.: einheitlich überbaute Fläche, nur „119 m²“) */
.ref-text { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); padding: 18px 2px 0; }
.ref-titel { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.ref-sub { font-weight: 400; color: var(--ink-2); }
.ref-masse { font-size: 13px; color: var(--ink-2); white-space: nowrap; transition: color var(--t) var(--ease); }
.ref.an .ref-masse { color: var(--blau); }

/* Foto-Referenzen der alten Seite: unter den 3D-Häusern mit Abstand; Foto im ruhigen Rahmen, Hover: leicht größer */
.raster-fotos { margin-top: clamp(96px, 11vw, 168px); }
.foto { position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 10px; background: var(--paper-2); }
.foto img, .foto video, .foto canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(0.9); transition: transform 0.6s var(--ease), filter 0.45s var(--ease); }
.foto canvas { opacity: 0; }   /* Leinwände des Abspielers, er blendet sie selbst ein */
.ref.an .foto img, .ref.an .foto video, .ref.an .foto canvas { transform: scale(1.04); filter: saturate(1.02); }

/* Impressum */
.recht { max-width: 760px; padding: clamp(140px, 16vw, 200px) var(--gutter) 0; }
.recht .abschnitt-titel { font-size: clamp(40px, 6vw, 84px); margin-bottom: var(--s7); }
.recht h2 { margin: var(--s6) 0 var(--s2); }
.recht p { margin: 0 0 var(--s3); font-size: 16px; line-height: 1.6; }
.recht a { text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 3px; }
.fuss a.fuss-claim:hover { color: var(--blau); }

/* ---------- Kontakt ---------- */
.kontakt-raster { margin-top: var(--s6); padding-top: var(--s6); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6); font-size: clamp(17px, 1.6vw, 22px); line-height: 1.35; letter-spacing: -0.01em; }
.kontakt-name { font-weight: 500; }
.kontakt-name span { font-weight: 400; color: var(--ink-2); }
.kontakt-wege a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.5s var(--ease), color var(--t); }
.kontakt-wege a:hover { color: var(--blau); background-size: 100% 1px; }

/* ---------- Fuß ---------- */
.fuss { margin-top: clamp(120px, 14vw, 200px); padding: var(--s6) var(--gutter) max(var(--s6), env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); display: flex; align-items: center; gap: var(--s3); color: var(--ink-2); font-size: 13px; }
.fuss .marke-zeichen { width: 20px; height: 20px; color: var(--ink-3); }
.fuss-claim { margin-left: auto; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- Handy ---------- */
@media (max-width: 760px) {
  .marke-text { font-size: 16px; }
  .marke-zeichen { width: 30px; height: 30px; }
}
@media (max-width: 899px) {
  .kontakt-raster { grid-template-columns: 1fr; gap: var(--s5); }
}
@media (max-width: 639px) {
  .kopf-nav a { padding: 7px 11px; font-size: 12px; }
  .buehne-weiter { display: none; }
  .fuss { flex-wrap: wrap; }
  .fuss-claim { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01s !important; transition-delay: 0s !important; }
  .einblenden { opacity: 1; transform: none; }
  .buehne-video { display: none; }
  .buehne { background: #0e0f11 url(video/buehne-poster.jpg) center / cover; }
}
