/* Hafenlicht Immobilien — Konzeptprojekt (Phase R9)
   Eigenes Design-System, bewusst nicht die Tokens der Hauptseite.
   Genau eine Kartensektion (die Objektliste), keine Glasflächen, keine Icons. */

@font-face {
  font-family: 'Newsreader';
  src: url('assets/fonts/Newsreader-latin.woff2') format('woff2');
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('assets/fonts/Archivo-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --deep:      #0b1e33;
  --deep-2:    #102a45;
  --champagne: #d9c39a;
  --champ-dim: #b9a279;   /* nur auf dunklem Grund */
  --champ-text:#7a6438;   /* Champagner als Text auf hellem Grund — 5,3:1 */
  --offwhite:  #f6f4f0;
  --paper:     #fdfcfa;
  --mist:      #c9d3dd;
  --ink:       #14202b;
  --muted:     #55636f;   /* Fließtext sekundär — 5,5:1 auf --offwhite */
  --line:      #dcd8d1;
  --line-2:    #c7c2b9;
  --line-dark: #22384f;

  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-text: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --t-h1:    clamp(2.5rem, 6vw, 4.5rem);
  --t-h2:    clamp(1.75rem, 3.4vw, 2.75rem);
  --t-h3:    1.25rem;
  --t-body:  1.0625rem;
  --t-small: 0.9375rem;
  --t-micro: 0.8125rem;

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --sec: clamp(4rem, 9vw, 8rem);
  --measure: 62ch;

  --r-card: 6px;
  --r-control: 3px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: 520ms;
  --dur-fast: 260ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5.5rem; }

body {
  margin: 0;
  background: var(--offwhite);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.08; }
p { margin: 0; }
ul, ol, dl, dd, figure { margin: 0; padding: 0; }
li { list-style: none; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--deep); outline-offset: 3px; }

.h2 {
  font-family: var(--font-display);
  font-size: var(--t-h2);
  letter-spacing: -0.01em;
}
.h2--light { color: var(--offwhite); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 60;
  background: var(--deep); color: var(--offwhite); padding: .875rem 1.25rem;
  font-size: var(--t-small);
}
.skip:focus { left: 0; }

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

.head {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.5rem);
  padding: .5rem var(--gutter);
  background: color-mix(in srgb, var(--offwhite) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease);
}
.head.is-stuck { border-bottom-color: var(--line); }

.head__mark {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--font-display); font-size: 1.4rem; letter-spacing: .01em;
}
.head__nav { display: flex; gap: clamp(.875rem, 2vw, 1.75rem); margin-left: auto; }
.head__nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: var(--t-small); color: var(--muted);
  transition: color var(--dur-fast) var(--ease);
}
.head__nav a:hover { color: var(--ink); }
.head__action {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 1.125rem; border-radius: var(--r-control);
  background: var(--deep); color: var(--offwhite);
  font-size: var(--t-small); font-weight: 500;
  transition: background-color var(--dur-fast) var(--ease);
}
.head__action:hover { background: var(--deep-2); }

@media (max-width: 720px) {
  .head { flex-wrap: wrap; padding-bottom: 0; row-gap: 0; }
  .head__action { margin-left: auto; order: 2; }
  .head__nav {
    order: 3; width: 100%; margin-left: 0; justify-content: space-between;
    border-top: 1px solid var(--line); gap: .25rem;
  }
  .head__nav a { font-size: var(--t-micro); }
}

/* ------------------------------------------------------------------ Hero
   Eigener Hero-Typ: ein typografisches Navy-Feld, darunter ein liegendes
   Bildband, und die Suchleiste liegt auf der Naht zwischen beiden. */

.hero { position: relative; background: var(--deep); }

.hero__field {
  padding: clamp(3rem, 8vw, 6.5rem) var(--gutter) clamp(4.5rem, 8vw, 6rem);
  color: var(--offwhite);
}
.hero__title {
  font-family: var(--font-display);
  font-size: var(--t-h1); font-weight: 300;
  letter-spacing: -0.015em; max-width: 16ch;
}
.hero__lead {
  margin-top: 1.25rem; max-width: 46ch;
  color: var(--mist); font-size: var(--t-small);
}

.search {
  position: relative; z-index: 3;
  display: grid; gap: .75rem;
  grid-template-columns: auto 1fr 1fr auto;
  align-items: end;
  width: min(100% - 2 * var(--gutter), 62rem);
  margin: 0 auto -2.75rem;
  padding: 1rem 1.125rem;
  background: var(--paper);
  border-radius: var(--r-card);
  border: 1px solid var(--line);
}
.search__mode { display: flex; border: 1px solid var(--line-2); border-radius: var(--r-control); overflow: hidden; }
.search__seg {
  font: inherit; font-size: var(--t-small);
  min-height: 44px; padding: 0 1rem; border: 0; cursor: pointer;
  background: transparent; color: var(--muted);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.search__seg.is-on { background: var(--deep); color: var(--offwhite); }
.search__field { display: grid; gap: .25rem; }
.search__field label, .filter__field label {
  font-size: var(--t-micro); color: var(--muted);
}
.search select, .filter select {
  font: inherit; font-size: var(--t-small); color: var(--ink);
  min-height: 44px; width: 100%;
  padding: 0 .75rem; background: var(--paper);
  border: 1px solid var(--line-2); border-radius: var(--r-control);
}
.search__go {
  font: inherit; font-size: var(--t-small); font-weight: 500;
  min-height: 44px; padding: 0 1.375rem; cursor: pointer;
  background: var(--deep); color: var(--offwhite);
  border: 1px solid var(--deep); border-radius: var(--r-control);
  transition: background-color var(--dur-fast) var(--ease);
}
.search__go:hover { background: var(--deep-2); }

@media (max-width: 860px) {
  .search { grid-template-columns: 1fr 1fr; margin-bottom: -2rem; }
  .search__mode { grid-column: 1 / -1; }
  .search__go { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .search { grid-template-columns: 1fr; }
  .search__mode > * { flex: 1; }
}

.hero__band { overflow: hidden; }
.hero__band img {
  width: 100%; height: clamp(240px, 34vw, 430px); object-fit: cover;
  will-change: transform;
}
.hero__note {
  padding: .875rem var(--gutter) 1.25rem;
  font-size: var(--t-micro); color: var(--mist);
}

/* --------------------------------------------------------------- Objekte */

.objects { padding: var(--sec) var(--gutter); }
.objects__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.objects__count { font-size: var(--t-small); color: var(--muted); }

.filter {
  display: grid; gap: 1rem var(--gap);
  grid-template-columns: minmax(0, 10rem) minmax(0, 10rem) minmax(0, 18rem) auto;
  align-items: end;
  margin: clamp(1.5rem, 3vw, 2.25rem) 0 clamp(2rem, 4vw, 3rem);
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.filter__field { display: grid; gap: .25rem; }
.filter__field--range output { font-variant-numeric: tabular-nums; color: var(--ink); }
.filter input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 44px; background: transparent; cursor: pointer;
}
.filter input[type="range"]::-webkit-slider-runnable-track {
  height: 2px; background: var(--line-2);
}
.filter input[type="range"]::-moz-range-track { height: 2px; background: var(--line-2); }
.filter input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; margin-top: -8px; border-radius: 50%;
  background: var(--deep); border: 0;
}
.filter input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--deep); border: 0;
}
.filter__reset {
  font: inherit; font-size: var(--t-small); color: var(--muted);
  min-height: 44px; padding: 0 .25rem; cursor: pointer;
  background: none; border: 0; border-bottom: 1px solid var(--line-2);
  justify-self: start;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.filter__reset:hover { color: var(--ink); border-bottom-color: var(--ink); }

@media (max-width: 900px) { .filter { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .filter { grid-template-columns: 1fr; } }

/* Die einzige Kartensektion des Projekts: eine echte Sammlung gleichartiger Dinge. */
.grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}
.obj {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease), border-color var(--dur-fast) var(--ease);
}
.obj:hover { border-color: var(--line-2); }
.obj.is-out { opacity: 0; pointer-events: none; }
.obj[hidden] { display: none; }

.obj__media { position: relative; overflow: hidden; background: var(--deep); }
.obj__track {
  display: flex; width: 300%;
  transition: transform var(--dur) var(--ease);
}
.obj__track img { width: 33.3333%; aspect-ratio: 3 / 2; object-fit: cover; }
.obj__dots {
  position: absolute; left: .75rem; bottom: .75rem;
  display: flex; gap: .375rem;
}
.obj__dots button {
  width: 26px; height: 44px; padding: 0; border: 0; cursor: pointer;
  background: none; position: relative;
}
.obj__dots button::after {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 26px; height: 3px; border-radius: 2px;
  background: rgb(246 244 240 / .5);
  transition: background-color var(--dur-fast) var(--ease);
}
.obj__dots button.is-on::after { background: var(--champagne); }

.obj__body { padding: 1.125rem 1.25rem 1.375rem; display: grid; gap: .375rem; }
.obj__status {
  font-size: var(--t-micro); letter-spacing: .04em; color: var(--muted);
}
.obj__status[data-status="reserviert"] { color: var(--champ-text); }
.obj__status[data-status="verkauft"] { color: var(--muted); text-decoration: line-through; }
.obj__name { font-family: var(--font-display); font-size: var(--t-h3); }
.obj__place { font-size: var(--t-small); color: var(--muted); }
.obj__data { margin-top: .625rem; }
.obj__data > div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .4375rem 0; border-top: 1px solid var(--line);
  font-size: var(--t-small);
}
.obj__data dt { color: var(--muted); }
.obj__data dd { font-variant-numeric: tabular-nums; }

.grid__empty {
  margin-top: 2rem; max-width: var(--measure);
  color: var(--muted); font-size: var(--t-small);
}

/* --------------------------------------------------------------- Vergleich */

.compare { padding: 0 var(--gutter) var(--sec); }
.compare__intro { max-width: var(--measure); margin-bottom: clamp(1.75rem, 3vw, 2.5rem); }
.compare__intro p { margin-top: .875rem; color: var(--muted); font-size: var(--t-small); }

.cmp { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.cmp th, .cmp td { text-align: left; vertical-align: top; padding: .875rem 1rem .875rem 0; }
.cmp thead th {
  font-weight: 500; font-size: var(--t-micro); color: var(--muted);
  border-bottom: 1px solid var(--ink); padding-bottom: .625rem;
}
.cmp tbody th { font-weight: 400; font-family: var(--font-display); font-size: 1.0625rem; width: 22%; }
.cmp tbody tr { border-bottom: 1px solid var(--line); }
.cmp tbody td:first-of-type { color: var(--muted); width: 34%; }
.cmp tbody td:last-of-type { color: var(--ink); }

@media (max-width: 760px) {
  .cmp thead { display: none; }
  .cmp tbody tr { display: grid; gap: .25rem; padding: 1rem 0; }
  .cmp tbody th, .cmp tbody td { width: auto; padding: 0; }
  .cmp tbody td::before {
    content: attr(data-label) ' ';
    color: var(--muted); font-size: var(--t-micro);
  }
}

/* ---------------------------------------------------------- Wertermittlung */

.value { background: var(--deep); color: var(--offwhite); padding: var(--sec) var(--gutter); }
.value__inner {
  display: grid; gap: var(--gap) clamp(2rem, 6vw, 5rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  align-items: start;
}
.value__text p { margin-top: 1rem; max-width: 48ch; color: var(--mist); font-size: var(--t-small); }
.value__fine { color: var(--champ-dim) !important; }

.vform { display: grid; gap: 1rem; }
.field { display: grid; gap: .3125rem; }
.field label { font-size: var(--t-micro); color: var(--mist); }
.field input {
  font: inherit; font-size: 1rem; color: var(--offwhite);
  background: var(--deep-2);
  border: 1px solid var(--line-dark); border-radius: var(--r-control);
  padding: .75rem .875rem; min-height: 48px; width: 100%;
  transition: border-color var(--dur-fast) var(--ease);
}
.field input:focus { border-color: var(--champagne); }
.field.is-bad input { border-color: #e8a08c; }
.field__err { font-size: var(--t-small); color: #e8a08c; }

.vform__send {
  justify-self: start;
  font: inherit; font-size: var(--t-small); font-weight: 500;
  color: var(--deep); background: var(--champagne);
  border: 1px solid var(--champagne); border-radius: var(--r-control);
  padding: .875rem 1.5rem; min-height: 48px; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease);
}
.vform__send:hover { background: var(--champ-dim); }
.vform__done {
  border-top: 1px solid var(--line-dark); padding-top: .75rem;
  font-size: var(--t-small); color: var(--champagne);
}
@media (max-width: 860px) { .value__inner { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------- Kontor */

.kontor { padding: var(--sec) 0; }
.kontor__fig { margin: 0; overflow: hidden; }
.kontor__fig img { width: 100%; height: clamp(260px, 40vw, 520px); object-fit: cover; will-change: transform; }
.kontor__fig figcaption {
  max-width: var(--measure); margin: .875rem var(--gutter) 0;
  font-size: var(--t-micro); color: var(--muted);
}
.kontor__text {
  display: grid; gap: 1rem; max-width: var(--measure);
  padding: clamp(2rem, 4vw, 3rem) var(--gutter) 0;
}
.kontor__text p { color: var(--muted); font-size: var(--t-small); }
.kontor__people {
  padding-top: .875rem; border-top: 1px solid var(--line);
  color: var(--ink) !important;
}

/* ---------------------------------------------------------------- Stimmen */

.voices { padding: 0 var(--gutter) var(--sec); }
.voices__note { font-size: var(--t-micro); color: var(--muted); margin-bottom: 1rem; }
.voices__grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}
.voice { margin: 0; padding-top: 1rem; border-top: 1px solid var(--ink); }
.voice p { max-width: 48ch; font-size: var(--t-small); }
.voice footer { margin-top: .75rem; font-size: var(--t-micro); color: var(--muted); }

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

.contact { padding: 0 var(--gutter) var(--sec); }
.contact__grid {
  display: grid; gap: var(--gap) clamp(2rem, 6vw, 5rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
.contact__addr {
  margin-top: 1.25rem; font-style: normal;
  font-family: var(--font-display); font-size: 1.375rem; line-height: 1.4;
}
.contact__meta { border-top: 1px solid var(--line); }
.contact__meta > div {
  display: flex; flex-wrap: wrap; gap: .25rem 1.5rem;
  padding: .625rem 0; border-bottom: 1px solid var(--line);
  font-size: var(--t-small);
}
.contact__meta dt { color: var(--muted); min-width: 7rem; }
.contact__meta a {
  display: inline-flex; align-items: center; min-height: 44px;
  text-decoration: underline; text-decoration-color: var(--line-2);
  text-underline-offset: .22em; text-decoration-thickness: 1px;
}
.contact__meta a:hover { text-decoration-color: var(--ink); }
@media (max-width: 860px) { .contact__grid { grid-template-columns: 1fr; } }

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

.foot { background: var(--deep); color: var(--mist); padding: clamp(3rem, 6vw, 5rem) var(--gutter) 2rem; }
.foot__grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(4, 1fr);
  font-size: var(--t-small);
}
.foot__mark {
  font-family: var(--font-display); font-size: 1.4rem;
  color: var(--offwhite); margin-bottom: .75rem;
}
.foot address { font-style: normal; }
.foot__h { color: var(--offwhite); margin-bottom: .5rem; }
.foot a {
  text-decoration: underline; text-decoration-color: var(--line-dark);
  text-underline-offset: .22em; text-decoration-thickness: 1px;
}
.foot a:hover { text-decoration-color: var(--champagne); }
.foot address a, .foot__nav a, .foot__bar a {
  display: inline-flex; align-items: center; min-height: 44px;
}
.foot__nav a { text-decoration: none; }
.foot__nav a:hover { text-decoration: underline; text-decoration-color: var(--champagne); }

.note {
  margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: 1rem;
  border-top: 1px solid var(--line-dark);
}
.note summary {
  display: inline-flex; align-items: center; min-height: 44px;
  list-style: none; cursor: pointer;
  font-size: var(--t-small); color: var(--mist);
  text-decoration: underline; text-decoration-color: var(--line-dark);
  text-underline-offset: .22em; text-decoration-thickness: 1px;
  transition: color var(--dur-fast) var(--ease);
}
.note summary::-webkit-details-marker { display: none; }
.note summary::marker { content: ''; }
.note summary:hover, .note[open] summary { color: var(--offwhite); }
.note > p { max-width: var(--measure); padding-bottom: .5rem; font-size: var(--t-small); }

.foot__bar {
  display: flex; flex-wrap: wrap; gap: .25rem 2rem; justify-content: space-between;
  margin-top: 1.25rem; font-size: var(--t-micro);
}
@media (max-width: 860px) { .foot__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .foot__grid { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------- Reveal
   Maske auf den Kindern von [data-reveal], nie auf dem beobachteten
   Element selbst (Spec §8 h). */

.js [data-reveal] > * {
  opacity: 0; transform: translate3d(0, 12px, 0);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.js [data-reveal].is-visible > * { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] > * { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero__band img, .kontor__fig img { transform: none !important; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
