/* =========================================================================
   Andrea Heddergott Immobilien
   Design tokens and site styles.

   Farbsystem abgeleitet aus dem Bestands-Logo:
     #0a2375 Navy (Primaerfarbe, Dachlinien und Wortmarke)
     #b3b5ae Salbeigrau (Logo-Schattierung, frueherer Hero-Hintergrund)
   Ein Akzent auf der gesamten Seite: Navy. Kein zweiter Akzent.
   Radien: Flaechen 14px, Bedienelemente 8px. Keine Mischformen.
   ========================================================================= */

/* ---------- Schrift ---------- */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens: Hell ---------- */

:root {
  --bg:            #f6f6f4;
  --surface:       #ffffff;
  --surface-2:     #edeeea;
  --surface-brand: #0a2375;
  --surface-sage:  #e4e5e0;

  --ink:           #14161f;
  --ink-2:         #55596180;
  --ink-muted:     #565a63;
  --ink-on-brand:  #eef1ff;
  --ink-on-brand-muted: #b9c3e8;

  --brand:         #0a2375;
  --brand-hover:   #0e2f9c;
  --brand-soft:    #e6e9f7;
  --sage:          #b3b5ae;

  --line:          #dcdcd6;
  --line-strong:   #c3c4bd;
  /* Raender von Bedienelementen brauchen 3:1 gegen die Flaeche (WCAG 1.4.11).
     Geprueft: 3.15:1 auf --bg, 3.41:1 auf --surface. */
  --border-control: #8a8c83;
  --focus:         #0e2f9c;

  --shadow-sm: 0 1px 2px rgb(20 22 31 / .05), 0 2px 8px rgb(20 22 31 / .04);
  --shadow-md: 0 2px 4px rgb(20 22 31 / .05), 0 12px 32px rgb(20 22 31 / .07);

  --r-lg: 14px;
  --r-sm: 8px;

  --maxw: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --step: cubic-bezier(.16, 1, .3, 1);

  color-scheme: light;
}

/* ---------- Tokens: Dunkel ---------- */

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #101219;
    --surface:       #171a23;
    --surface-2:     #1e222e;
    --surface-brand: #16205a;
    --surface-sage:  #23262b;

    --ink:           #eceef2;
    --ink-2:         #9aa0ad80;
    --ink-muted:     #a1a7b4;
    --ink-on-brand:  #eef1ff;
    --ink-on-brand-muted: #b2bce4;

    --brand:         #93a8ff;
    --brand-hover:   #b3c1ff;
    --brand-soft:    #1b2246;
    --sage:          #82857e;

    --line:          #2a2f3c;
    --line-strong:   #3a4152;
    /* Geprueft: 3.46:1 auf --bg, 3.21:1 auf --surface. */
    --border-control: #616a80;
    --focus:         #93a8ff;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / .3), 0 2px 8px rgb(0 0 0 / .25);
    --shadow-md: 0 2px 4px rgb(0 0 0 / .3), 0 12px 32px rgb(0 0 0 / .4);

    color-scheme: dark;
  }
}

/* ---------- Reset ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, picture { max-width: 100%; display: block; }
img { height: auto; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.12;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }

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

::selection { background: var(--brand); color: #fff; }

/* ---------- Layout ---------- */

/* viewport-fit=cover laesst die Seite bis in die Display-Aussparungen
   reichen. Der seitliche Rand muss deshalb mindestens so breit sein wie
   der jeweilige Sicherheitsabstand des Geraets. */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* Sprungziele duerfen nicht unter der klebenden Kopfzeile landen. */
[id] { scroll-margin-top: calc(88px + env(safe-area-inset-top, 0px)); }

/* Kein Verzoegern beim Antippen, dafuer eine dezente Markenfarbe als
   Tipp-Rueckmeldung statt des blaugrauen Systemkastens. */
a, button, label, input, textarea, summary {
  touch-action: manipulation;
  -webkit-tap-highlight-color: color-mix(in srgb, var(--brand) 18%, transparent);
}

.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--brand);
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: 0 0 var(--r-sm) 0;
  font-weight: 500;
}
.skip-link:focus {
  left: env(safe-area-inset-left, 0px);
  top: env(safe-area-inset-top, 0px);
  color: #fff;
}

/* ---------- Typografie-Skala ---------- */

.h-display {
  font-size: clamp(2.0625rem, 1.2rem + 2.8vw, 3.125rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.h-section {
  font-size: clamp(1.625rem, 1.1rem + 1.9vw, 2.375rem);
  letter-spacing: -0.026em;
}

.h-card {
  font-size: 1.1875rem;
  letter-spacing: -0.014em;
  line-height: 1.3;
}

.lead {
  font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem);
  color: var(--ink-muted);
  line-height: 1.6;
  max-width: 34rem;
}

.prose p { max-width: 62ch; color: var(--ink-muted); }
.prose p + p { margin-top: 1.1em; }
.prose strong { color: var(--ink); font-weight: 550; }

/* ---------- Kopfzeile ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  /* Der Streifen zieht sich hinter die Statusleiste bzw. die Aussparung. */
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--step), background-color .25s var(--step);
}
.masthead[data-stuck="true"] {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}

@supports not (backdrop-filter: blur(1px)) {
  .masthead { background: var(--bg); }
}

.masthead__inner {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Das Bildzeichen traegt nur ein "HI"-Monogramm. Damit der Firmenname im
   Kopf lesbar bleibt, steht die Wortmarke gesetzt daneben. Das Logo selbst
   bleibt unveraendert. */
.masthead__logo {
  display: flex;
  align-items: center;
  gap: .875rem;
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--ink);
}
.masthead__logo img { width: 116px; height: auto; }

.masthead__wordmark {
  display: block;
  padding-inline-start: .875rem;
  border-inline-start: 1px solid var(--line-strong);
  font-size: .9375rem;
  font-weight: 550;
  line-height: 1.25;
  letter-spacing: -0.014em;
}
.masthead__wordmark span {
  display: block;
  font-weight: 400;
  color: var(--ink-muted);
  letter-spacing: 0;
}

.masthead__nav {
  display: flex;
  align-items: center;
  gap: clamp(.75rem, 2vw, 1.75rem);
  white-space: nowrap;
}

.masthead__tel {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: .9375rem;
  font-weight: 450;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: color .2s var(--step);
}
.masthead__tel:hover { color: var(--ink); }
.masthead__tel svg { width: 17px; height: 17px; flex: none; opacity: .65; }

@media (max-width: 820px) {
  .masthead__wordmark { display: none; }
}

@media (max-width: 560px) {
  .masthead__tel span { display: none; }
  .masthead__logo img { width: 100px; }
}

/* ---------- Schaltflaechen ---------- */

.btn {
  --btn-bg: var(--brand);
  --btn-fg: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  white-space: nowrap;
  padding: .75rem 1.375rem;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-size: .96875rem;
  font-weight: 500;
  letter-spacing: -0.006em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s var(--step), border-color .2s var(--step),
              transform .12s var(--step), box-shadow .2s var(--step);
}
.btn:hover { --btn-bg: var(--brand-hover); color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* Navy auf Weiss: Kontrast 13.9:1. In Dark Mode helles Blau auf #101219: 8.4:1. */
@media (prefers-color-scheme: dark) {
  .btn { --btn-fg: #0b1020; }
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: var(--border-control);
}
.btn--ghost:hover {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--ink);
  border-color: var(--ink-muted);
}

/* ---------- Hero ---------- */

.hero {
  padding-top: clamp(2.5rem, 5vw, 4.5rem);
  padding-bottom: clamp(3rem, 7vw, 6rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}

.hero__copy { max-width: 40rem; }
.hero__lead { margin-top: 1.25rem; }

.hero__actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
}

.hero__figure {
  position: relative;
  max-width: 460px;
  margin-inline-start: auto;
  width: 100%;
}
/* Versetzte Flaeche hinter dem Portrait, ruhige Tiefe statt Schlagschatten-Optik. */
.hero__figure::before {
  content: "";
  position: absolute;
  inset: 1.5rem -1.5rem -1.5rem 1.5rem;
  border-radius: var(--r-lg);
  background: var(--surface-sage);
  z-index: 0;
}
.hero__figure picture { position: relative; z-index: 1; display: block; }
.hero__figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero__copy { max-width: none; }
  .hero__figure { margin-inline: 0; max-width: 320px; }
  .hero__figure::before { inset: 1rem -1rem -1rem 1rem; }
}

@media (max-width: 480px) {
  .hero__actions .btn { width: 100%; }
}

/* ---------- Faktenzeile ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  border-top: 1px solid var(--line);
  padding-top: 2rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.fact__value {
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.1;
  color: var(--brand);
}
.fact__label {
  margin-top: .375rem;
  font-size: .9375rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

@media (max-width: 680px) {
  .facts { grid-template-columns: 1fr; gap: 1.5rem; }
  .fact + .fact { border-top: 1px solid var(--line); padding-top: 1.5rem; }
}

/* ---------- Leistungen (Bento, genau drei Zellen) ---------- */

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(0, auto);
  gap: clamp(.875rem, 1.6vw, 1.25rem);
  margin-top: clamp(2.25rem, 4vw, 3rem);
}

.cell {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 2.8vw, 2.25rem);
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Drei Inhalte, drei Zellen, drei unterschiedliche Flaechen. Die grosse
   Zelle zentriert ihren Inhalt, damit in der hoeheren Spalte kein Loch
   in der Mitte entsteht. */
.cell--primary {
  grid-column: span 7;
  grid-row: span 2;
  background: var(--surface-brand);
  border-color: transparent;
  color: var(--ink-on-brand);
  justify-content: center;
  gap: 1.5rem;
}
.cell--sage { grid-column: span 5; background: var(--surface-sage); border-color: transparent; }
.cell--mark { grid-column: span 5; background: var(--brand-soft); border-color: transparent; }

.cell__icon { width: 30px; height: 30px; opacity: .9; }
.cell--primary .cell__icon { width: 38px; height: 38px; color: var(--ink-on-brand); opacity: .95; }
.cell--sage .cell__icon, .cell--mark .cell__icon { color: var(--brand); }

.cell__title { margin-top: .625rem; }
.cell--primary .cell__title { color: var(--ink-on-brand); font-size: 1.4375rem; }

.cell__note {
  margin-top: .375rem;
  font-size: .9375rem;
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: 34ch;
}
.cell--primary .cell__note { color: var(--ink-on-brand-muted); }

.cell__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.cell__list li {
  font-size: .9375rem;
  line-height: 1.3;
  padding: .4375rem .75rem;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink-muted);
}
.cell--primary .cell__list li {
  background: rgb(255 255 255 / .11);
  color: var(--ink-on-brand);
}
.cell--sage .cell__list li,
.cell--mark .cell__list li { background: rgb(255 255 255 / .6); color: var(--ink); }

@media (prefers-color-scheme: dark) {
  .cell--sage .cell__list li,
  .cell--mark .cell__list li { background: rgb(255 255 255 / .07); color: var(--ink); }
}

@media (max-width: 860px) {
  .cell--primary { grid-column: span 12; grid-row: auto; min-height: 0; }
  .cell--sage, .cell--mark { grid-column: span 12; }
}

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

.contact {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: start;
}

.channels { list-style: none; margin: 1.75rem 0 0; padding: 0; }
.channels li + li { margin-top: .5rem; }

.channel {
  display: flex;
  align-items: center;
  gap: .9375rem;
  padding: .875rem 1rem;
  margin-inline: -1rem;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--ink);
  transition: background-color .2s var(--step);
}
.channel:hover { background: var(--surface-2); color: var(--ink); }
.channel:active { transform: translateY(1px); }

.channel__icon {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  color: var(--brand);
}
.channel__icon svg { width: 21px; height: 21px; }

.channel__kind {
  display: block;
  font-size: .8125rem;
  color: var(--ink-muted);
  line-height: 1.35;
}
.channel__value {
  display: block;
  font-weight: 500;
  letter-spacing: -0.012em;
  font-variant-numeric: tabular-nums;
}
/* Rufnummern nie umbrechen, sonst steht die Vorwahl allein in einer Zeile.
   Die Mailadresse dagegen muss umbrechen duerfen, sie ist laenger als
   die Spalte auf schmalen Geraeten. */
.channel__value--tel { white-space: nowrap; }
.channel__value--mail { overflow-wrap: anywhere; }

/* ---------- Formular ---------- */

.form { display: grid; gap: 1.125rem; }

.field { display: grid; gap: .5rem; }

.field__label {
  font-size: .90625rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.006em;
}
.field__req { color: var(--brand); margin-inline-start: .15em; }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border-control);
  border-radius: var(--r-sm);
  padding: .6875rem .875rem;
  transition: border-color .2s var(--step), box-shadow .2s var(--step), background-color .2s var(--step);
}
.field textarea { resize: vertical; min-height: 8.5rem; line-height: 1.55; }

/* Platzhalter werden bewusst nicht als Label genutzt. */
.field input::placeholder, .field textarea::placeholder { color: var(--ink-muted); opacity: .8; }

.field input:hover, .field textarea:hover { border-color: var(--ink-muted); }
.field input:focus, .field textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent);
}

.consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .75rem;
  align-items: start;
  font-size: .90625rem;
  line-height: 1.5;
  color: var(--ink-muted);
}
.consent input[type="checkbox"] {
  width: 19px;
  height: 19px;
  margin: .15rem 0 0;
  accent-color: var(--brand);
  flex: none;
}
.consent a { color: var(--brand); }

.form__submit { justify-self: start; margin-top: .25rem; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 900px) {
  .contact__grid { grid-template-columns: 1fr; gap: 2.75rem; }
  .form__submit { justify-self: stretch; }
  .form__submit .btn, .btn.form__submit { width: 100%; }
}

/* ---------- Fusszeile ---------- */

.foot {
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
  /* Platz fuer den Home-Indikator am unteren Displayrand. */
  padding-bottom: calc(clamp(2.5rem, 5vw, 3.5rem) + env(safe-area-inset-bottom, 0px));
}

.foot__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  align-items: flex-start;
  justify-content: space-between;
}

.foot__logo img { width: 132px; }

.foot__addr {
  font-style: normal;
  font-size: .9375rem;
  line-height: 1.6;
  color: var(--ink-muted);
}

.foot__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  font-size: .9375rem;
}
.foot__links a { color: var(--ink-muted); text-decoration: none; }
.foot__links a:hover { color: var(--ink); text-decoration: underline; }


/* ---------- Bewegung: Einblenden beim Scrollen ---------- */
/* Begruendung: die Abschnitte bauen beim Lesen nacheinander auf, das
   fuehrt den Blick. Keine Dauerschleifen, keine Parallax-Effekte.       */

/* Inhalt ist standardmaessig sichtbar. Versteckt wird er erst, wenn das
   Skript die Elemente scharf schaltet (.is-armed) und damit garantiert,
   dass es sie auch wieder einblenden kann. Faellt JavaScript aus, bricht
   der Observer ab oder verzoegert sich etwas, bleibt der Text lesbar. */
.reveal { transition: opacity .6s var(--step), transform .6s var(--step); }

.reveal.is-armed { opacity: 0; transform: translateY(18px); }
.reveal.is-armed.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.is-armed { opacity: 1 !important; transform: none !important; transition: none; }
  .btn, .channel, .masthead, .field input, .field textarea, .masthead__tel { transition: none; }
  .btn:active, .channel:active { transform: none; }
}

/* ---------- Statusmeldungen (kontakt.php) ---------- */

.notice {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  max-width: 40rem;
}
.notice__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 1.125rem;
}
.notice__icon svg { width: 24px; height: 24px; }
.notice ul { margin: .75rem 0 0; padding-inline-start: 1.15rem; color: var(--ink-muted); }
.notice li + li { margin-top: .35rem; }
.notice p { color: var(--ink-muted); margin-top: .625rem; }
.notice .btn { margin-top: 1.5rem; }

/* ---------- Rechtstexte ---------- */

.legal { padding-block: clamp(3rem, 6vw, 5rem); }
.legal__body { max-width: 68ch; }
.legal__body h2 {
  font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  margin-top: 2.75rem;
  margin-bottom: .875rem;
}
.legal__body h3 {
  font-size: 1.125rem;
  margin-top: 2rem;
  margin-bottom: .625rem;
}
.legal__body h2:first-child, .legal__body h3:first-child { margin-top: 0; }
.legal__body p, .legal__body li { color: var(--ink-muted); }
.legal__body p + p { margin-top: 1em; }
.legal__body ul, .legal__body ol { padding-inline-start: 1.25rem; margin: 1em 0; }
.legal__body li + li { margin-top: .4em; }
.legal__body address {
  font-style: normal;
  color: var(--ink-muted);
  margin-top: .5em;
}
.legal__body a { overflow-wrap: anywhere; }
.legal__lead { margin-bottom: 2.5rem; }

.legal__stand {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: .875rem;
}
