/* ==========================================================================
   Gemeinsame Apple-Design-Schicht (alle Seiten)
   Prinzipien: Zugänglichkeit zuerst, dann Konventionen, dann Handwerk, dann Politur.
   Signatur-Element: die "Faser" – ein Lichtfaden, der beim Scrollen die
   Verbindung zieht (Wir. Schaffen. Verbindung.).
   ========================================================================== */

:root {
  --ink: #0b1b36;
  --muted: #5b6472;          /* 5,98:1 auf Weiß */
  --muted-strong: #4a5568;   /* 7,53:1 auf Weiß */
  --faint: #595959;          /* 7,00:1 auf Weiß */
  --fiber-a: #163970;
  --fiber-b: #4d7fe0;
  --spring: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Weicher Seitenwechsel zwischen den Seiten (Cross-Document View Transitions) */
@view-transition { navigation: auto; }

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

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga";
}

h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

/* Sichtbarer Tastatur-Fokus – weißer Halo, damit er auch auf dunklen Flächen trägt */
:where(a, button, [tabindex]):focus-visible {
  outline: 3px solid #284A99;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px #fff;
  border-radius: 8px;
}

/* Press-Feedback wie bei Apple: Steuerelemente geben beim Drücken nach */
:where(a.btn-jobs, .slider__arrow, .slider__toggle, .slider__dots button):active { transform: scale(.96); }

/* ---------------------------------------------------------------------- */
/* Signatur: die Faser (Scroll-Fortschritt)                                */
/* ---------------------------------------------------------------------- */

.fiber {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 100;
  pointer-events: none;
}

.fiber__line {
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--fiber-a), var(--fiber-b));
}

.fiber__head {
  position: absolute;
  top: 50%;
  left: calc(var(--p, 0) * 100%);
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px var(--fiber-b), 0 0 18px 6px rgba(77,127,224,.75);
  opacity: calc(min(var(--p, 0) * 40, 1) * min((1 - var(--p, 0)) * 40, 1));
}

/* ---------------------------------------------------------------------- */
/* Licht folgt dem Zeiger auf Karten                                       */
/* ---------------------------------------------------------------------- */

.spot { position: relative; isolation: isolate; }

.spot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(77,127,224,.16), transparent 62%);
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .spot:hover::after { opacity: 1; }
}

/* ---------------------------------------------------------------------- */
/* Text, der sich beim Scrollen "einschaltet"                              */
/* ---------------------------------------------------------------------- */

.lit-word { opacity: var(--o, .2); transition: opacity .25s linear; }

/* ---------------------------------------------------------------------- */
/* Hero-Scrub: Inhalt tritt beim Scrollen zurück                           */
/* ---------------------------------------------------------------------- */

.scrub {
  transform: translate3d(calc(var(--hp, 0) * var(--sx, 0px)), calc(var(--hp, 0) * var(--sy, -36px)), 0) scale(calc(1 - var(--hp, 0) * .05));
  opacity: calc(1 - var(--hp, 0) * .9);
  will-change: transform, opacity;
}

/* ---------------------------------------------------------------------- */
/* Anpassung an Systemeinstellungen                                        */
/* ---------------------------------------------------------------------- */

@media (prefers-reduced-transparency: reduce) {
  * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .site-header { background: #fff !important; }
  .move-banner { background: #fff !important; }
}

@media (prefers-contrast: more) {
  :root { --muted: #3b4452; }
  .intro-card, .cycle__card, .service-col { border-color: #163970 !important; }
}

@media (prefers-reduced-motion: reduce) {
  .fiber { display: none; }
  .lit-word { opacity: 1 !important; transition: none; }
  .scrub { transform: none !important; opacity: 1 !important; }
  @view-transition { navigation: none; }
}
