/* ==========================================================
   finnhennig.de · Variante B
   Eine Schrift (EB Garamond), eine kleine Maschinenschrift,
   viel Weiß. Farben stehen hier oben.
   ========================================================== */

@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-latin-400-italic.woff2") format("woff2"); font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-display: swap; }

/* Helle Fassung (Standard) */
:root {
  --paper: #fbfaf7;
  --ink: #111110;
  --muted: #8d8b84;
  --line: rgba(17, 17, 16, .14);
  --sea: #15285a;
  --soil: #2d4a33; /* Grün für Erde und Land */
  --on-color: #fbfaf7;    /* Schrift auf den farbigen Flächen */
  --sea-text: #15285a;    /* Blau als Schriftfarbe (Meer) */
  --arch-text: #946800;   /* Gelb/Ocker für Architektur, auf Weiß gut lesbar */
  --soil-text: #2d4a33;   /* Grün als Schriftfarbe */
  color-scheme: light dark;
  --serif: "EB Garamond", Garamond, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(20px, 4.5vw, 64px);
  /* Abstandsskala: nur diese drei Werte werden für Abstände genutzt */
  --space-l: clamp(80px, 10vw, 152px);  /* zwischen Abschnitten */
  --space-m: clamp(24px, 3vw, 44px);    /* innerhalb eines Abschnitts */
  --space-s: clamp(12px, 1.4vw, 18px);  /* eng zusammengehörig */
  --ease: cubic-bezier(.2, .7, .1, 1);
  /* Schriftskala: nur diese Größen werden verwendet */
  --t-display: clamp(64px, 13.5vw, 232px);  /* Name */
  --t-1: clamp(40px, 5.6vw, 88px);          /* große Aussagen: Land, Erde, Wasser */
  --t-2: clamp(32px, 4.2vw, 64px);          /* Schluss und Kontaktfenster */
  --t-3: clamp(22px, 2.3vw, 32px);          /* Kapitelzeilen, Einladungen, Dreiklang */
  --t-4: clamp(18px, 1.6vw, 22px);          /* Fließtext */
  --t-5: 14px;                              /* Kleingedrucktes */
}

/* Dunkle Fassung: automatisch nach Geräteeinstellung,
   außer jemand hat per Schalter „hell“ gewählt */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121211;
    --ink: #ecebe6;
    --muted: #8b8a83;
    --line: rgba(236, 235, 230, .16);
    --sea-text: #9cb0ea;
    --arch-text: #e8c35a;
    --soil-text: #9cc4a2;
  }
  :root:not([data-theme="light"]) .hero__img img { filter: grayscale(1) contrast(1.02) brightness(.92); }
  :root:not([data-theme="light"]) dialog.contact { box-shadow: 0 40px 120px -30px rgba(0,0,0,.9), 0 0 0 1px var(--line); }
}
/* Dunkel per Schalter gewählt */
:root[data-theme="dark"] {
    --paper: #121211;
    --ink: #ecebe6;
    --muted: #8b8a83;
    --line: rgba(236, 235, 230, .16);
    --sea-text: #9cb0ea;
    --arch-text: #e8c35a;
    --soil-text: #9cc4a2;
}
:root[data-theme="dark"] .hero__img img { filter: grayscale(1) contrast(1.02) brightness(.92); }
:root[data-theme="dark"] dialog.contact { box-shadow: 0 40px 120px -30px rgba(0,0,0,.9), 0 0 0 1px var(--line); }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: var(--t-4); line-height: 1.45;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  font-feature-settings: "kern", "liga", "onum";
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--ink); color: var(--paper); }
h1, h2, p { margin: 0; font-weight: 400; }
em { font-style: italic; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.pad-x { padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---------- Kopf ---------- */
.top { display: flex; justify-content: space-between; align-items: center; height: 76px; }
.top button[data-talk] { all: unset; cursor: pointer; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
.top button[data-talk]:hover { opacity: .65; }

.top__right { display: flex; align-items: center; gap: var(--space-m); }
/* Hell/Dunkel-Schalter: ein halb gefüllter Kreis */
.theme { all: unset; display: inline-block; box-sizing: border-box; cursor: pointer; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--ink);
  background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); transition: transform .5s var(--ease); }
.theme:hover { transform: rotate(180deg); }
.theme:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

/* ---------- Einstieg ---------- */
.hero {
  min-height: calc(100svh - 76px - var(--space-l));
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: 1fr auto;
  gap: 0 clamp(32px, 6vw, 96px);
}
.hero h1 {
  grid-column: 1; grid-row: 1; align-self: end;
  font-size: var(--t-display); line-height: .84; letter-spacing: -.035em; font-weight: 400;
  margin-left: -.04em;
}
.hero h1 span { display: block; }
.hero h1 span + span { font-style: italic; padding-left: .55em; }
.hero__img { grid-column: 2; grid-row: 1 / 3; align-self: end; width: clamp(150px, 17vw, 260px); }
.hero__img img { filter: grayscale(1) contrast(1.02); }
.hero__line {
  grid-column: 1; grid-row: 2; margin-top: var(--space-m);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px .3em;
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; grid-template-rows: auto; min-height: 0; padding-top: var(--space-m); }
  .hero__img { grid-column: 1; grid-row: 1; width: 132px; margin-bottom: var(--space-m); }
  .hero h1 { grid-row: 2; }
  .hero__line { grid-row: 3; }
}

/* ---------- Zwei Sätze mit Einladung beim Überfahren ---------- */
.duo { all: unset; cursor: pointer; position: relative; display: inline-block; font-size: var(--t-3); line-height: 1.2; transition: opacity .45s var(--ease); }
.duo > span { display: inline-block; pointer-events: none; transition: opacity .45s var(--ease), transform .45s var(--ease); }
/* Fester, etwas großzügigerer Bereich für die Maus. Die beweglichen Texte selbst reagieren nicht,
   sonst entsteht an der Unterkante ein Flackern. */
.duo::after { content: ""; position: absolute; inset: -.2em -.15em; }
.duo__b { position: absolute; left: 0; top: 0; white-space: nowrap; font-style: italic; opacity: 0; transform: translateY(40%); border-bottom: 1px solid currentColor; }
.duo--arch .duo__b { color: var(--arch-text); }
.duo--land .duo__b { color: var(--soil-text); }
.duo--photo .duo__b { color: var(--ink); }
.duo:hover .duo__a, .duo:focus-visible .duo__a { opacity: 0; transform: translateY(-40%); }
.duo:hover .duo__b, .duo:focus-visible .duo__b { opacity: 1; transform: none; }
.duo .arr { font-style: normal; }
/* Leiser Hinweis im Ruhezustand: feine, gepunktete Unterstreichung in der Themenfarbe */
.duo__a {
  padding-bottom: .14em;
  background-image: radial-gradient(circle, var(--dot) .9px, transparent 1.3px);
  background-size: 7px 3px; background-repeat: repeat-x; background-position: 0 100%;
}
.duo--arch { --dot: var(--arch-text); }
.duo--land { --dot: var(--soil-text); }
.duo--photo { --dot: var(--muted); }
/* Beim Überfahren eines Satzes treten die anderen zurück */
.hero__line:hover .duo:not(:hover) { opacity: 0; }
/* Auf Geräten ohne Maus: nur der Dreiklang mit Unterstreichung, Tippen löst direkt aus */
@media (hover: none) {
  .duo > .duo__b { display: none; }
  .hero__line:hover .duo:not(:hover) { opacity: 1; }
  .duo:hover .duo__a { opacity: 1; transform: none; }
}

/* ---------- Gesprächs-Link ---------- */
.talk {
  all: unset; cursor: pointer; display: inline-flex; align-items: baseline; gap: .35em;
  font-family: var(--serif); font-size: var(--t-3); font-style: italic;
  border-bottom: 1px solid currentColor; padding-bottom: 1px; line-height: 1.2;
  transition: color .3s var(--ease), opacity .3s var(--ease);
}
.talk:hover { opacity: .65; }
.talk .arr { font-style: normal; transition: transform .3s var(--ease); display: inline-block; }
.talk:hover .arr { transform: translateX(5px); }

/* ---------- Kapitel: ein Muster für 01, 02 und 03 ----------
   Linie, Nummer und Etikett, Überschrift, Text, Einladung, danach das Bild.
   Auf dem Handy in genau derselben Reihenfolge. */
.ch { padding-top: var(--space-l); }
.ch__head { display: grid; grid-template-columns: 80px 1fr; gap: 24px; align-items: baseline; }
.ch__head::before { content: ""; grid-column: 1 / -1; height: 1px; background: var(--line); margin-bottom: var(--space-m); }
.ch__text { margin-top: var(--space-m); padding-left: calc(var(--gutter) + 104px); }
.ch__title { font-size: var(--t-1); line-height: .98; letter-spacing: -.03em; max-width: 18ch; }
.ch__text p { margin-top: var(--space-m); max-width: 40ch; }
.ch__text .ch__note { margin-top: var(--space-s); color: var(--muted); max-width: 44ch; }
.ch__cta { margin-top: var(--space-m); }
.ch__cta--arch { color: var(--arch-text); }
.ch__cta--land, #land .ch__title em { color: var(--soil-text); }
/* Abstand vom Text zum Bild ist in jedem Kapitel gleich */
.ch__text + .drift, .ch__text + .ch__figure, .ch__text + .elements, .ch__sub + .drift { margin-top: calc(var(--space-m) * 2.2); }
.ch__figure { margin: 0; padding: 0 var(--gutter) 0 calc(var(--gutter) + 104px); }
/* Einzelbild auf der Textkante, bis zum rechten Rand, unbeschnitten */
.ch__figure img { width: auto; max-width: 100%; max-height: 82vh; }
/* Zwischenzeile vor der Fotoreihe, in derselben Form wie die Kapitelzeile, nur ohne Linie */
.ch__sub { margin-top: var(--space-l); display: grid; grid-template-columns: 80px 1fr; gap: 24px; align-items: baseline; }
.ch__sub p { color: var(--muted); }
.ch__sub p span { color: var(--ink); }
@media (max-width: 760px) {
  .ch__head, .ch__sub { grid-template-columns: auto 1fr; gap: var(--space-m); }
  .ch__sub { grid-template-columns: 1fr; gap: var(--space-s); }
  .ch__text { padding-left: var(--gutter); }
  .ch__figure { padding-left: var(--gutter); }
}

/* ---------- Bildreihen ---------- */
/* Fotoreihe: dicht an dicht, läuft endlos und gleichmäßig durch */
.drift {
  margin: 0 calc(-1 * var(--gutter));
  overflow: hidden; cursor: grab; touch-action: pan-y; user-select: none;
}
.ch > .drift { margin-left: 0; margin-right: 0; }
.drift[data-lightbox] { cursor: zoom-in; }
.drift.is-dragging { cursor: grabbing; }
.drift__track { display: flex; gap: 6px; width: max-content; will-change: transform; }
.drift img {
  display: block; flex: none; height: clamp(300px, 64vh, 720px); width: auto;
  pointer-events: none; -webkit-user-drag: none;
}
@media (max-width: 760px) { .drift img { height: 56svh; max-height: 460px; } }
/* Fotografie: größer als die Referenzen, fast bildschirmhoch */
.drift[data-lightbox] img { height: clamp(380px, 82vh, 980px); }
@media (max-width: 760px) { .drift[data-lightbox] img { height: 70svh; max-height: 620px; } }

/* ---------- Erde und Wasser ---------- */
.elements { display: grid; grid-template-columns: 1fr 1fr; min-height: 80svh; color: var(--on-color); }
.element { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: var(--space-m) var(--gutter) var(--gutter); }
.element h2 { position: relative; z-index: 1; font-size: var(--t-1); line-height: .98; letter-spacing: -.03em; }
.element p { position: relative; z-index: 1; margin-top: var(--space-s); color: rgba(251,250,247,.72); }
.element .mono { position: absolute; top: var(--space-m); left: var(--gutter); color: rgba(251,250,247,.6); z-index: 1; }
.element--soil { background: var(--soil); }
.element--sea { background: var(--sea); }
.element svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.furrows line { stroke: rgba(251,250,247,.2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.waves path { fill: none; stroke: rgba(251,250,247,.2); stroke-width: 1; vector-effect: non-scaling-stroke; animation: swell 9s ease-in-out infinite alternate; }
.waves path:nth-child(2n) { animation-duration: 11s; animation-delay: -3s; }
.waves path:nth-child(3n) { animation-duration: 13s; animation-delay: -6s; }
@keyframes swell { from { transform: translateX(-4%); } to { transform: translateX(4%); } }
@media (max-width: 760px) { .elements { grid-template-columns: 1fr; min-height: 0; } .element { min-height: 70svh; } }

/* ---------- Schluss ---------- */
.end { padding-top: var(--space-l); padding-bottom: var(--space-l); }
.end h2 { font-size: var(--t-2); line-height: 1; letter-spacing: -.025em; margin-bottom: var(--space-m); }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-s); padding-top: var(--space-s); padding-bottom: var(--space-m); border-top: 1px solid var(--line); }
.foot nav { display: flex; gap: var(--space-m); }
.foot a { text-decoration: none; }
.foot a { transition: opacity .3s; }
.foot a:hover { opacity: .65; }

/* ---------- Rechtsseiten (Impressum, Datenschutz) ---------- */
.legal { padding-top: var(--space-l); padding-bottom: var(--space-l); max-width: 820px; }
.legal h1 { font-size: var(--t-2); line-height: 1; letter-spacing: -.025em; margin-bottom: var(--space-m); }
.legal h2 { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: var(--space-m) 0 var(--space-s); font-weight: 400; }
.legal p { margin: 0 0 var(--space-s); max-width: 60ch; }
.legal a { color: inherit; }

/* ---------- Kontaktfenster ---------- */
dialog.contact {
  width: min(640px, calc(100vw - 32px)); max-height: calc(100svh - 32px);
  border: 0; padding: clamp(28px, 4vw, 48px); background: var(--paper); color: var(--ink);
  box-shadow: 0 40px 120px -30px rgba(0,0,0,.45);
}
dialog.contact::backdrop { background: rgba(17,17,16,.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.contact h2 { font-size: min(var(--t-2), 52px); line-height: 1; letter-spacing: -.025em; margin-bottom: var(--space-s); }
.contact > p { color: var(--muted); margin-bottom: var(--space-m); }
.contact__close { all: unset; cursor: pointer; position: absolute; top: var(--space-m); right: clamp(28px, 4vw, 48px); font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); transition: opacity .3s; }
.contact__close:hover { opacity: .65; }
.form { display: grid; gap: var(--space-m); }
.field label { display: block; margin-bottom: 4px; }
.field input, .field textarea {
  width: 100%; background: transparent; color: var(--ink); font: inherit; font-size: var(--t-4);
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 4px 0 8px;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.form__foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-s); flex-wrap: wrap; }
.form__foot small { font-size: var(--t-5); color: var(--muted); max-width: 30ch; }
.send { all: unset; cursor: pointer; font-size: var(--t-3); font-style: italic; border-bottom: 1px solid currentColor; }
.send:hover { opacity: .65; }
.hp { position: absolute; left: -9999px; }

/* ---------- Großansicht der Fotos ---------- */
dialog.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(12, 12, 11, .97); color: #ecebe6;
}
dialog.lightbox[open] { display: grid; place-items: center; animation: lbIn .4s var(--ease); }
dialog.lightbox::backdrop { background: transparent; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox img:focus { outline: none; }
.lightbox img {
  max-width: 92vw; max-height: calc(100dvh - 140px); width: auto; height: auto;
  transition: opacity .35s var(--ease); user-select: none; -webkit-user-drag: none; touch-action: pan-y;
}
.lightbox img.is-fading { opacity: 0; }
.lightbox button { all: unset; cursor: pointer; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #ecebe6; transition: opacity .3s; }
.lightbox button:hover { opacity: .6; }
.lightbox button:focus-visible { outline: 1px solid #ecebe6; outline-offset: 6px; }
.lightbox .lightbox__close { position: absolute; top: 28px; right: var(--gutter); }
.lightbox__bar { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 28px; display: flex; justify-content: space-between; align-items: center; }
.lightbox__bar .mono { color: rgba(236,235,230,.6); }

/* ---------- Hinweis für Besucher von otherhomes.de ---------- */
.notice {
  position: fixed; left: 16px; bottom: 16px; z-index: 60; width: min(380px, calc(100vw - 32px));
  background: var(--ink); color: var(--paper); padding: 20px 22px 18px;
  transform: translateY(20px); opacity: 0; pointer-events: none; transition: transform .6s var(--ease), opacity .6s var(--ease);
}
.notice.is-open { transform: none; opacity: 1; pointer-events: auto; }
.notice .mono { display: block; margin-bottom: 8px; padding-right: 96px; color: var(--paper); opacity: .6; }
.notice p { font-size: var(--t-4); line-height: 1.4; }
.notice button { all: unset; cursor: pointer; position: absolute; z-index: 1; top: 12px; right: 12px; padding: 8px 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--paper); opacity: .6; }

/* ---------- Sanftes Einblenden ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .waves path { animation: none; }
}
