/* ---------------------------------------------------------------------------
   base.css — Schriften, Design-Tokens, Typografie-Skala, Flaechen, Motion
   Farben und Radien stammen aus dem @theme-Block in tailwind/input.css.
--------------------------------------------------------------------------- */

@layer base {
  /* === SCHRIFTEN (self-hosted, DSGVO-konform, ohne Flackern) === */
  @font-face {
    font-family: "Bricolage Grotesque";
    src: url("/fonts/bricolage-grotesque-latin-var.woff2") format("woff2");
    font-weight: 200 800;
    font-style: normal;
    font-display: optional;
    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: "Bricolage Grotesque";
    src: url("/fonts/bricolage-grotesque-latin-ext-var.woff2") format("woff2");
    font-weight: 200 800;
    font-style: normal;
    font-display: optional;
    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;
  }
  @font-face {
    font-family: "IBM Plex Sans";
    src: url("/fonts/ibm-plex-sans-latin-var.woff2") format("woff2");
    font-weight: 100 700;
    font-style: normal;
    font-display: optional;
    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: "IBM Plex Sans";
    src: url("/fonts/ibm-plex-sans-latin-ext-var.woff2") format("woff2");
    font-weight: 100 700;
    font-style: normal;
    font-display: optional;
    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;
  }

  /* Metrisch angepasste Fallbacks — kein Layout-Shift, falls die Variable Font
     ausnahmsweise nicht rechtzeitig geladen ist. Werte aus den Font-Metriken:
     Bricolage Grotesque 700 ist 13,4 % breiter als Arial (Ascender 930/1000,
     Descender 270/1000); IBM Plex Sans 400 ist 2,8 % breiter (1025/275). */
  @font-face {
    font-family: "Heading Fallback";
    src: local("Arial"), local("Liberation Sans"), local("Helvetica Neue");
    size-adjust: 113.4%;
    ascent-override: 82%;
    descent-override: 23.8%;
    line-gap-override: 0%;
  }
  @font-face {
    font-family: "Body Fallback";
    src: local("Arial"), local("Liberation Sans"), local("Helvetica Neue");
    size-adjust: 102.8%;
    ascent-override: 99.7%;
    descent-override: 26.8%;
    line-gap-override: 0%;
  }

  /* === TOKENS ===
     Ein Rhythmus fuer die ganze Website: Sektionen, Sektionskoepfe, Karten.
     Von aussen nach innen: Sektion → Block → Textblock.
     Die Textblock-Abstaende setzt die Website nicht mehr je Seite, sondern
     zentral ueber die Geschwister-Regeln weiter unten. */
  :root {
    --space-section: clamp(4.5rem, 3rem + 5vw, 8rem);
    --space-section-sm: clamp(3rem, 2.25rem + 2.5vw, 5rem);
    --space-block: clamp(3.25rem, 2.25rem + 3.5vw, 4.5rem);
    --header-h: 4rem;

    --gap-eyebrow: 0.875rem;
    --gap-eyebrow-block: 1.5rem;
    --gap-lead: 1.25rem;
    --gap-lead-sm: 1rem;
    --gap-tight: 0.75rem;

    --text-sm: clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);
    --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
    --text-lg: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
    --text-h3: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
    --text-h2: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
    --text-h1: clamp(1.625rem, 1.25rem + 1.4vw, 2.25rem);
    --text-display: clamp(1.875rem, 1.35rem + 1.9vw, 2.625rem);
    --text-hero: clamp(2rem, 1.4rem + 2.2vw, 2.875rem);

    --duration-fast: 150ms;
    --duration-base: 250ms;
    --duration-slow: 400ms;
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    --hairline: 1px solid var(--color-ink-200);
    --shadow-card: 0 1px 2px color-mix(in oklch, var(--color-navy-900) 6%, transparent);
    --shadow-lift: 0 18px 36px -22px color-mix(in oklch, var(--color-navy-900) 40%, transparent);
  }

  /* === BASIS === */
  html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
    -webkit-text-size-adjust: 100%;
  }
  body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--color-ink-700);
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
  }
  h1,
  h2,
  h3,
  h4 {
    font-family: var(--font-heading);
    color: var(--color-navy-900);
    text-wrap: balance;
  }
  strong {
    font-weight: 600;
  }
  a {
    color: inherit;
  }
  :focus-visible {
    outline: 3px solid var(--color-accent-600);
    outline-offset: 3px;
    border-radius: 2px;
  }
  ::selection {
    background: var(--color-navy-900);
    color: #fff;
  }

  /* === TYPOGRAFIE-SKALA ===
     hero > display (H1 der Unterseiten) > heading-1 (Sektions-H2) > heading-2 > heading-3
     Lange deutsche Komposita duerfen auf schmalen Displays umbrechen, statt aus
     ihrer Spalte herauszuragen. */
  .heading-hero,
  .heading-display,
  .heading-1,
  .heading-2,
  .heading-3 {
    overflow-wrap: break-word;
  }
  .heading-hero {
    font-family: var(--font-heading);
    font-size: var(--text-hero);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.025em;
  }
  .heading-display {
    font-family: var(--font-heading);
    font-size: var(--text-display);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.02em;
  }
  .heading-1 {
    font-family: var(--font-heading);
    font-size: var(--text-h1);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.02em;
  }
  .heading-2 {
    font-family: var(--font-heading);
    font-size: var(--text-h2);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
  }
  .heading-3 {
    font-family: var(--font-heading);
    font-size: var(--text-h3);
    font-weight: 600;
    line-height: 1.3;
  }
  .body-lg {
    font-size: var(--text-lg);
    line-height: 1.6;
  }
  .body-md {
    font-size: var(--text-base);
    line-height: 1.65;
  }
  .body-sm {
    font-size: var(--text-sm);
    line-height: 1.55;
  }
  .measure {
    max-width: 62ch;
  }
  .tabular {
    font-variant-numeric: tabular-nums;
  }

  /* Vorspann-Zeile ueber Ueberschriften — schlicht, ohne Schmuckelement,
     damit das Auge nur Ueberschrift und Text liest. */
  .eyebrow {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--color-primary-700);
  }
  .eyebrow-center {
    text-align: center;
  }

  /* Einstiegsfrage ueber der H1: spricht den Besucher direkt auf seine Lage an
     ("Sie bauen ein Rechenzentrum?") und bestaetigt sie im zweiten Teil. Beide
     Teile fliessen als ein Satzpaar, damit lange Fragen sauber umbrechen. */
  .opening {
    max-width: 44rem;
    font-size: var(--text-lg);
    line-height: 1.45;
    text-wrap: pretty;
  }
  .opening-q {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-navy-900);
  }
  .opening-a {
    color: var(--color-ink-700);
  }
  .opening + * {
    margin-top: var(--gap-lead-sm);
  }
  /* Auf dunklen Flaechen traegt die Frage die helle Textfarbe des Kontexts. */
  .panel-dark .opening-q,
  .surface-dark .opening-q {
    color: #fff;
  }
  .panel-dark .opening-a,
  .surface-dark .opening-a {
    color: var(--color-navy-200);
  }

  /* Textblock-Rhythmus — gilt ueberall gleich, ohne Abstands-Klassen je Seite:
     Vorspann bindet sich eng an die Ueberschrift, die Ueberschrift an den
     unmittelbar folgenden Fliesstext. Je groesser die Ueberschrift, desto
     groesser ihr Abstand zum Text. */
  .eyebrow + * {
    margin-top: var(--gap-eyebrow);
  }
  /* Folgt dem Vorspann direkt Inhalt statt einer Ueberschrift, braucht er
     mehr Luft — es fehlt die Ueberschrift als Klammer. */
  .eyebrow + :is(ul, ol, dl, div) {
    margin-top: var(--gap-eyebrow-block);
  }
  .heading-hero + p,
  .heading-display + p,
  .heading-1 + p {
    margin-top: var(--gap-lead);
  }
  .heading-2 + p {
    margin-top: var(--gap-lead-sm);
  }
  .heading-3 + p {
    margin-top: var(--gap-tight);
  }

  /* Sektionskopf: Vorspann, Ueberschrift, Einleitung. Den Abstand zum Inhalt
     der Sektion traegt .section-body (siehe components.css). */
  .section-head {
    max-width: 44rem;
  }

  /* === LAYOUT === */
  .shell {
    width: 100%;
    max-width: 78rem;
    margin-inline: auto;
    padding-inline: 1.25rem;
  }
  .shell-narrow {
    width: 100%;
    max-width: 50rem;
    margin-inline: auto;
    padding-inline: 1.25rem;
  }
  @media (min-width: 640px) {
    .shell,
    .shell-narrow {
      padding-inline: 1.5rem;
    }
  }
  @media (min-width: 1024px) {
    .shell,
    .shell-narrow {
      padding-inline: 2rem;
    }
  }
  .section {
    padding-block: var(--space-section);
  }
  .section-tight {
    padding-block: var(--space-section-sm);
  }

  /* === FLAECHEN === */
  /* Ruhige helle Flaeche fuer Startbereich und Seitenkoepfe: flach, ohne
     Muster, nur ein kaum sichtbarer Cyan-Hauch oben rechts. */
  .surface-soft {
    background-color: var(--color-ink-50);
    background-image: radial-gradient(
      64rem 32rem at 100% 0%,
      color-mix(in oklch, var(--color-primary-400) 9%, transparent),
      transparent 70%
    );
  }

  /* === SKIP-LINK === */
  .skip-link {
    position: absolute;
    left: 1rem;
    top: -100%;
    z-index: 100;
    background: var(--color-navy-900);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: top var(--duration-fast) var(--ease-out);
  }
  .skip-link:focus {
    top: 1rem;
  }

  /* === MOTION ===
     Der Ausgangszustand gilt erst, wenn das Skript laeuft. Ohne JavaScript,
     in Crawlern und in Vollseiten-Screenshots bleibt jeder Inhalt sichtbar. */
  .motion-ready .reveal {
    opacity: 0;
    transform: translateY(14px);
  }
  .motion-ready .reveal.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--duration-slow) var(--ease-out),
      transform var(--duration-slow) var(--ease-out);
  }
  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
    .motion-ready .reveal {
      opacity: 1;
      transform: none;
      transition: none;
    }
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      transition-duration: 0.01ms !important;
    }
  }

  /* === DRUCK === */
  @media print {
    .site-header,
    .site-footer,
    .skip-link {
      display: none !important;
    }
    body {
      color: #000;
      font-size: 11pt;
    }
    a[href^="/"]::after {
      content: " (" attr(href) ")";
      font-size: 9pt;
    }
  }
}
