﻿/* ==========================================================================
   Schwarzwald Immobilien — base.css
   Design-Tokens · Reset · Typografie · Utilities
   ========================================================================== */

/* --------------------------------------------------------------------------
   SCHRIFT
   Eine Familie für die gesamte Seite. Standard ist der System-Font-Stack:
   lädt sofort, kostet nichts, ruft keinen externen Server auf (kein
   Google-Fonts-Aufruf = keine Einwilligungspflicht).

   Wer später Inter einsetzen möchte: die Datei InterVariable.woff2 nach
   assets/fonts/ legen und den folgenden Block einkommentieren. Sonst ist
   nichts zu tun — --font wird dann automatisch mit Inter beginnen.

   @font-face {
     font-family: "Inter";
     src: url("../fonts/InterVariable.woff2") format("woff2-variations");
     font-weight: 100 900;
     font-display: swap;
   }
-------------------------------------------------------------------------- */

:root {

  /* --- Farben ------------------------------------------------------------
     Aus den Fotos abgeleitet: Tanne, Moos, Leinen, Messing.
  ---------------------------------------------------------------------- */
  --night:      #0d1a14;   /* tiefstes Grünschwarz, dunkle Sektionen */
  --night-2:    #0a1410;   /* noch tiefer, für Verläufe */
  --forest:     #14432f;   /* Primärfläche, Buttons */
  --forest-lt:  #1f6647;   /* Hover */
  --moss:       #8fc4a8;   /* helles Grün auf dunklem Grund */

  --ivory:      #faf8f4;   /* Seitenhintergrund */
  --linen:      #f1ece1;   /* zweiter Untergrund, Beige */
  --stone:      #ded8ca;   /* Linien, Rahmen */
  --white:      #ffffff;

  /* Gold in drei Abstufungen, nach Verwendungszweck getrennt. Der helle Ton
     ist auf hellem Grund nicht lesbar (2,2:1), deshalb gibt es für Text und
     für bedeutungstragende Symbole eigene, dunklere Werte. Wer hier etwas
     ändert, muss die Kontraste neu prüfen. */
  --gold:       #c19a4b;   /* Flächen, Linien, Ringe, dekorative Symbole */
  --gold-ink:   #7d5e21;   /* goldener TEXT auf hellem Grund, 5,1:1 */
  --gold-mark:  #b0832c;   /* Symbole mit Bedeutung, z. B. Sterne, 3,3:1 */
  --gold-lt:    #e3c489;   /* Gold auf dunklem Grund, 10,2:1 */

  --ink:        #15201a;   /* Fließtext */
  --ink-70:     #44544a;
  --ink-60:     #59665c;   /* kleine Sekundärtexte, 5,1:1 auf Beige */
  --ink-50:     #616e64;   /* Labels, Hilfstexte, 4,6:1 auf Beige */
  --ink-30:     #9aa39a;   /* NUR Linien und Deko, für Text zu hell */

  --db-blue:    #0018a8;   /* ausschließlich im Partner-Badge */

  /* Helle Töne auf dunklem Grund */
  --on-dark:     rgba(250, 248, 244, .82);
  --on-dark-dim: rgba(250, 248, 244, .58);
  --on-dark-line: rgba(250, 248, 244, .14);

  --ig-gradient: linear-gradient(45deg,
                 #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);

  /* --- Typografie -------------------------------------------------------- */
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
          "Segoe UI Variable Text", "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;

  /* Abgestimmt auf die Überschrift „Was ist Ihre / Immobilie wert?", die in
     zwei Zeilen stehen soll. Maßgeblich ist die längere Zeile,
     „Immobilie wert?" — mit 15 Zeichen kurz genug, dass die ursprüngliche
     Kurve wieder trägt.

     Der Engpass sitzt nicht am unteren Ende, sondern bei 900 px: Dort greift
     das zweispaltige Hero-Raster und halbiert die Textspalte schlagartig von
     851 auf 383 px, während die Schrift schon weit gestiegen ist. Wer die
     Überschrift verlängert, muss dort nachmessen — nicht bei 1440 px. */
  --fs-hero:  clamp(2.2rem, 0.97rem + 3.37vw, 4rem);
  --fs-h1:    clamp(2.1rem, 1.2rem + 3.6vw, 3.5rem);
  --fs-h2:    clamp(1.85rem, 1.2rem + 2.6vw, 3rem);
  --fs-h3:    clamp(1.18rem, 1.05rem + 0.6vw, 1.5rem);
  --fs-lead:  clamp(1.05rem, 0.98rem + 0.4vw, 1.28rem);
  --fs-body:  1rem;
  --fs-sm:    0.9375rem;
  --fs-xs:    0.8125rem;
  --fs-2xs:   0.75rem;

  /* --- Maße -------------------------------------------------------------- */
  --wrap:       1180px;
  --wrap-tight: 780px;
  --gutter:     clamp(1.25rem, 0.5rem + 2.8vw, 3rem);
  /* Steile Kurve mit Absicht: auf dem Handy sollen die Abschnitte eng sitzen
     (48 px statt 72 px), auf dem Desktop bleibt der großzügige Weißraum
     erhalten (bei 1440 px weiterhin rund 142 px). */
  --section-y:  clamp(3rem, -1rem + 11vw, 9rem);

  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 24px;

  /* Sehr weiche Schatten — die Wertigkeit entsteht über Weißraum, nicht Tiefe */
  --shadow-1: 0 1px 2px rgba(13, 26, 20, .04),
              0 4px 16px rgba(13, 26, 20, .05);
  --shadow-2: 0 2px 6px rgba(13, 26, 20, .06),
              0 18px 50px rgba(13, 26, 20, .10);

  --ease:     cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --header-h: 68px;
  --stickybar-h: 68px;
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.25rem);
  /* Die Seite ist durchgehend hell gestaltet. Ohne diese Angabe färbt ein
     Browser im Dunkelmodus Formularfelder und Scrollbalken dunkel ein —
     dunkle Eingabefelder auf elfenbeinfarbenem Grund. */
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Standard-Blau beim Antippen durch einen dezenten Grünton ersetzen */
  -webkit-tap-highlight-color: rgba(20, 67, 47, .12);
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; margin: 0; padding: 0; }

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

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

a { color: inherit; text-decoration: none; }

table { border-collapse: collapse; width: 100%; }

:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
  border-radius: 2px;
}
.section--dark :focus-visible,
.on-dark :focus-visible { outline-color: var(--gold-lt); }

::selection { background: var(--forest); color: var(--ivory); }

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

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); letter-spacing: -0.035em; }
h2 { font-size: var(--fs-h2); }
h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.018em;
}

p { text-wrap: pretty; }

/* Der Strich bleibt im hellen Gold, die Schrift wird dunkler — sonst ist die
   Zeile bei 12 px nicht lesbar. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin-bottom: 1.15rem;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--gold);
  flex: none;
}
.eyebrow--center { justify-content: center; }

.hero .eyebrow,
.section--dark .eyebrow,
.section--forest .eyebrow { color: var(--gold-lt); }
.hero .eyebrow::before,
.section--dark .eyebrow::before { background: var(--gold-lt); opacity: .75; }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--ink-70);
  max-width: 58ch;
}
.section--dark .lead { color: var(--on-dark); }

.num { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

.muted { color: var(--ink-50); }
.section--dark .muted { color: var(--on-dark-dim); }
.small { font-size: var(--fs-sm); }
.xs    { font-size: var(--fs-xs); }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--tight { max-width: var(--wrap-tight); }

.section { padding-block: var(--section-y); }
.section--sm { padding-block: clamp(2rem, .6rem + 4vw, 4rem); }

.section--dark {
  background:
    radial-gradient(ellipse 90% 80% at 12% 0%, rgba(31, 102, 71, .30), transparent 62%),
    var(--night);
  color: var(--ivory);
}
.section--linen { background: var(--linen); }
.section--forest { background: var(--forest); color: var(--ivory); }

.section-head { max-width: 60ch; margin-bottom: clamp(1.6rem, .4rem + 4vw, 4rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head--center .lead { margin-inline: auto; }
.section-head h2 + .lead { margin-top: 1.15rem; }

.grid { display: grid; gap: clamp(1.1rem, .7rem + 1.4vw, 1.75rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }

.center { text-align: center; }
.mt-s { margin-top: 1rem; }
.mt-m { margin-top: 1.75rem; }
.mt-l { margin-top: clamp(2rem, 1.2rem + 2.4vw, 3.25rem); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 300;
  background: var(--night);
  color: var(--ivory);
  padding: .8rem 1.25rem;
  border-radius: var(--r-sm);
  transition: top .18s var(--ease);
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Reveal -------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .08s; }
.reveal-d2 { transition-delay: .16s; }
.reveal-d3 { transition-delay: .24s; }
.reveal-d4 { transition-delay: .32s; }
.reveal-d5 { transition-delay: .4s; }

/* --- Auftritt im Hero ----------------------------------------------------
   Der Hero wartet nicht auf den IntersectionObserver, sondern läuft als
   reine CSS-Animation. Beim ersten Bild ist ohnehin alles im Blickfeld, und
   sollte das Skript später oder gar nicht laden, steht der Hero trotzdem
   sichtbar da statt auf Deckkraft 0 zu bleiben.
------------------------------------------------------------------------- */

.rise { animation: rise .85s var(--ease-out) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}
.rise-d1 { animation-delay: .09s; }
.rise-d2 { animation-delay: .18s; }
.rise-d3 { animation-delay: .34s; }
.rise-d4 { animation-delay: .44s; }

/* Das Foto kommt etwas später, langsamer und mit einer Spur Maßstab dazu,
   damit der Blick zuerst auf der Überschrift landet. */
.rise--shot { animation: riseShot 1.15s var(--ease-out) .2s both; }
@keyframes riseShot {
  from { opacity: 0; transform: translateY(26px) scale(.975); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .site-footer, .sticky-cta, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; }
}
