/* =========================================================================
   365 GRUNDBESITZ — Design-Fundament
   Farb- und Typo-System, Reset, Layout-Primitives.

   FARBLOGIK (§4 Briefing)
   --c-orange      #FF4D01  Markenorange, unverändert. Nur für Flächen,
                            Linien, Sterne, große Zahlen, Hover.
                            Kontrast gegen Creme: 3,14:1 -> NICHT für
                            kleinen Text verwenden.
   --c-orange-cta  #D93F00  Abgeleitete barrierefreie Variante für
                            gefüllte Buttons mit weißer Schrift (4,51:1).
   Verteilung Ziel: ~78 % Creme/Weiß, ~17 % Anthrazit, ~5 % Orange.
   ========================================================================= */

/* ---------- Fonts (selbst gehostet — kein Google-Fonts-CDN, DSGVO) ------- */
/* Newsreader als zwei statische optische Größen statt eines Variable Fonts:
   45 KB statt 132 KB, bei besserer Darstellung in beiden Größenbereichen.
   'Newsreader Display' (opsz 72) für große Headlines,
   'Newsreader' (opsz 16) für Zitate, Zahlen und kleinere Serifentexte. */
@font-face {
  font-family: 'Newsreader Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/newsreader-display.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/newsreader-text.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------- Tokens ------------------------------ */
:root {
  /* Farben */
  --c-ink:        #16181a;
  --c-ink-2:      #3d4348;
  --c-ink-3:      #555d63;   /* ~6,3:1 auf Creme — bewusst über AA */
  --c-paper:      #fbf9f6;
  --c-paper-2:    #f4f0ea;
  --c-white:      #ffffff;
  --c-line:       #e6e0d7;
  --c-line-soft:  #efeae2;
  --c-orange:     #ff4d01;
  --c-orange-cta: #d93f00;
  --c-orange-tint:#fff2ec;
  --c-dark:       #191b1d;
  --c-dark-2:     #23262a;

  /* Typografie */
  --f-display: 'Newsreader Display', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --f-serif:   'Newsreader', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --f-sans:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Kalibriert auf Eigentümer ab ca. 55 Jahren: Presbyopie ist ab 45 die
     Regel, die Kontrastempfindlichkeit nimmt ab 55 messbar ab. Deshalb
     keine grauen Mini-Texte — Fließtext 18 px, Sekundärtext 16,5 px,
     Kontextzeilen 13 px, gedämpfte Farbe bei rund 6:1 statt 4,5:1.       */
  /* Untergrenze gesenkt, damit die Zeile „Eine Ansprechpartnerin." in der
     Hero-Ueberschrift auf dem Telefon nicht nach „Eine" umbricht. Betrifft
     nur diese eine Ueberschrift — die anderen .display-Elemente setzen
     ihre Groesse selbst ueber --t-h2. */
  --t-display: clamp(1.75rem, 0.7rem + 3.7vw, 3.95rem);
  --t-h2:      clamp(1.95rem, 1.25rem + 2.7vw, 3.35rem);
  --t-h3:      clamp(1.25rem, 1.12rem + 0.55vw, 1.5rem);
  --t-lead:    clamp(1.12rem, 1.04rem + 0.42vw, 1.3rem);
  --t-body:    1.125rem;      /* 18 px */
  --t-small:   1.03125rem;    /* 16,5 px */
  --t-micro:   0.8125rem;     /* 13 px — nur für Kontext-/Versalzeilen */
  --t-eyebrow: 0.8125rem;     /* 13 px statt 11,5 px */

  /* Raum */
  --space-section: clamp(4.5rem, 2.6rem + 6.4vw, 8.75rem);
  --gutter:        clamp(1.25rem, 0.6rem + 2.6vw, 3rem);
  --container:     1320px;
  --container-narrow: 880px;

  --radius:    3px;
  --radius-lg: 4px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ----------------------------------- Reset ------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
/* overflow-x auch auf html, nicht nur auf body: Bei schmalen Fenstern
   trug das weit überbreite (aber selbst mit overflow:hidden geclippte)
   Laufband trotzdem zu documentElement.scrollWidth bei — vermutlich weil
   die Propagation von body auf die Wurzel bei „clip" anders greift als
   bei „hidden". Auf html direkt gesetzt, ist der Fall eindeutig. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: var(--t-body);
  line-height: 1.65;
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* clip statt hidden: „hidden" macht den Body selbst zum Scroll-Container.
     Dann greifen window.scrollTo, Ankersprünge und scrollIntoView nicht mehr
     auf das Fenster — auf dem Telefon wirkt das wie eine hakende Seite.
     „clip" beschneidet genauso, erzeugt aber keinen Scroll-Container. */
  overflow-x: clip;
}

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

/* Muss alle display-Regeln der Komponenten schlagen */
[hidden] { display: none !important; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }

h1, h2, h3, h4 { margin: 0; font-weight: 400; text-wrap: balance; }
p  { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

a { color: inherit; }

/* Sichtbarer, konsistenter Fokus (§32) */
:focus-visible {
  outline: 2px solid var(--c-orange-cta);
  outline-offset: 3px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

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

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

.skip-link {
  position: absolute; left: 50%; top: 0;
  transform: translate(-50%, -140%);
  z-index: 200;
  background: var(--c-ink); color: #fff;
  padding: 0.75rem 1.25rem;
  font-size: var(--t-small); font-weight: 600;
  transition: transform 0.18s var(--ease);
}
.skip-link:focus-visible { transform: translate(-50%, 0); }

/* -------------------------------- Layout -------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--space-section); position: relative; }
.section--tight { padding-block: clamp(3rem, 1.8rem + 4vw, 5.5rem); }
.section--paper-2 { background: var(--c-paper-2); }
.section--white   { background: var(--c-white); }
.section--dark    { background: var(--c-dark); color: #fff; }

.rule { height: 1px; background: var(--c-line); border: 0; margin: 0; }

/* ------------------------------ Typo-Klassen ---------------------------- */
.eyebrow {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--c-ink-2);
  margin: 0 0 1.25rem;
  line-height: 1.45;
}
.eyebrow::before {
  content: '';
  flex: none;
  width: 26px; height: 2px;
  background: var(--c-orange);
}
.eyebrow--center { justify-content: center; }
/* Für längere, ansprechende Vorzeilen: Versalien wären hier schwer lesbar. */
.eyebrow--sentence {
  text-transform: none;
  letter-spacing: 0.005em;
  font-size: 1rem;
  font-weight: 500;
  color: var(--c-ink-2);
}
.eyebrow--sentence::before { width: 30px; }
.section--dark .eyebrow { color: rgba(255,255,255,0.72); }

.display {
  font-family: var(--f-display);
  font-size: var(--t-display);
  line-height: 1.03;
  letter-spacing: -0.021em;
  font-weight: 400;
}
.h2 {
  font-family: var(--f-display);
  font-size: var(--t-h2);
  line-height: 1.1;
  letter-spacing: -0.017em;
  font-weight: 400;
}
.h3 {
  font-family: var(--f-sans);
  font-size: var(--t-h3);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.008em;
}
.lead {
  font-size: var(--t-lead);
  line-height: 1.62;
  color: var(--c-ink-2);
}
.section--dark .lead { color: rgba(255,255,255,0.78); }

.prose p + p { margin-top: 1.1em; }
.muted { color: var(--c-ink-3); }
.small { font-size: var(--t-small); }

.measure    { max-width: 54ch; }
.measure-sm { max-width: 44ch; }

/* -------------------------------- Buttons ------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.6rem;
  min-height: 52px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease),
              border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.btn:active { transform: translateY(1px); }

/* Primär — abgeleitetes Orange, weiße Schrift, AA-konform (4,51:1) */
.btn--primary { background: var(--c-orange-cta); color: #fff; }
.btn--primary:hover { background: #bf3700; }

.btn--dark { background: var(--c-ink); color: #fff; }
.btn--dark:hover { background: #000; }

.btn--outline {
  background: transparent; color: var(--c-ink);
  border-color: var(--c-ink);
}
.btn--outline:hover { background: var(--c-ink); color: #fff; }

.section--dark .btn--outline { color: #fff; border-color: rgba(255,255,255,0.45); }
.section--dark .btn--outline:hover { background: #fff; color: var(--c-ink); }

.btn--sm { padding: 0.7rem 1.15rem; min-height: 44px; font-size: 0.95rem; }
.btn--block { width: 100%; }

/* Sekundärer CTA — hochwertiger Textlink, kein zweiter Button (§8) */
.link-cta {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: var(--t-small); font-weight: 600;
  color: var(--c-ink); text-decoration: none;
  padding-block: 0.55rem;
  border-bottom: 1px solid var(--c-line);
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), gap 0.18s var(--ease);
}
.link-cta:hover { border-color: var(--c-orange); color: var(--c-orange-cta); gap: 0.85rem; }
.link-cta .arw { flex: none; transition: transform 0.18s var(--ease); }
.link-cta:hover .arw { transform: translateX(2px); }
.section--dark .link-cta { color: #fff; border-color: rgba(255,255,255,0.3); }
.section--dark .link-cta:hover { color: #fff; border-color: var(--c-orange); }

/* ------------------------------ Sterne (SVG) ---------------------------- */
.stars { display: inline-flex; gap: 2px; color: var(--c-orange); }
.stars svg { width: 15px; height: 15px; fill: currentColor; }
.stars--lg svg { width: 18px; height: 18px; }

/* ------------------- Kompetenznachweise (Vertrauensanker) ---------------
   Beantwortet den unausgesprochenen Einwand „Kann sie ein Objekt dieser
   Größe?" mit überprüfbaren Fakten statt mit Adjektiven.                 */
.credentials {
  display: grid;
  gap: 1px;
  background: var(--c-line);
  border-block: 1px solid var(--c-line);
}
.credentials li {
  background: var(--c-paper);
  display: flex; align-items: flex-start; gap: 0.85rem;
  padding: 1.35rem 0;
}
.credentials li > span { flex: 1 1 auto; min-width: 0; }
.section--white .credentials li { background: var(--c-white); }
.credentials svg {
  flex: none; width: 20px; height: 20px; margin-top: 2px;
  color: var(--c-orange);
}
.credentials__value { display: block; font-weight: 600; font-size: 1.0625rem; line-height: 1.35; }
.credentials__label { display: block; color: var(--c-ink-3); font-size: var(--t-micro); line-height: 1.5; margin-top: 0.25rem; }
@media (min-width: 760px) {
  /* auto-fit: solange nur zwei Nachweise gepflegt sind, füllen sie die Zeile */
  .credentials { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
  .credentials li { padding: 1.5rem clamp(1.25rem, 2.4vw, 2.25rem); }
  .credentials li:first-child { padding-left: 0; }
}

/* ------------------------- Scroll-Reveal (dezent) ----------------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

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