/* ============================================================
   Hedgehog AI – Designsystem v15 ("Politur")
   ------------------------------------------------------------
   Wird NACH hh.css bzw. nach dem Inline-Stylesheet der Startseite
   geladen und hebt die bestehende Navy/Gold-Welt auf ein höheres
   handwerkliches Niveau: Typoskala, Raumrhythmus, Flächen mit
   Tiefe, getönte Schatten, Fokus-Stile, ruhige Bewegung.

   Es werden KEINE Farben oder Schriften ausgetauscht – die Marke
   bleibt. Geändert werden Abstufung, Abstand, Kante und Bewegung.

   Keine externen Requests. Keine Bibliothek. Reines CSS.
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  /* Flächen: eine konsistente Tiefenstaffel statt drei Einzelwerten */
  --hh-0: #070f1d;   /* Fußzeile, tiefste Ebene */
  --hh-1: #0a1628;   /* Seitengrund (= --navy) */
  --hh-2: #0e1b32;   /* Abschnitt im Wechsel */
  --hh-3: #121f3a;   /* Karte */
  --hh-4: #17274a;   /* Karte gehoben / aktiv */
  --hh-5: #1e3157;   /* Kante innen, Hover */

  /* Gold: zusätzliche Stufen für Text auf Hell und für Glanzkanten */
  --gold-deep: #a8862f;   /* Gold auf hellem Grund, AA-tauglich */
  --gold-soft: #e8d49b;
  --gold-glow: rgba(201, 168, 76, .28);

  /* Linien – eine Haarlinienfamilie, konsistent getönt */
  --line: rgba(201, 168, 76, .16);
  --line-quiet: rgba(240, 237, 232, .10);
  --line-strong: rgba(201, 168, 76, .42);

  /* Schatten: navyblau getönt, nicht schwarz. Ein Lichtpunkt von oben. */
  --sh-1: 0 1px 2px rgba(3, 8, 18, .45);
  --sh-2: 0 10px 28px -10px rgba(3, 8, 18, .6), 0 2px 6px rgba(3, 8, 18, .35);
  --sh-3: 0 28px 64px -24px rgba(3, 8, 18, .78), 0 4px 12px rgba(3, 8, 18, .4);
  --sh-inset: inset 0 1px 0 rgba(240, 237, 232, .07);
  --sh-gold: 0 0 0 1px var(--line-strong), 0 16px 40px -18px var(--gold-glow);

  /* Radien: außen weicher, innen straffer */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Raster */
  --space-section: clamp(88px, 8.5vw, 136px);
  --space-section-tight: clamp(56px, 5vw, 80px);
  --measure: 68ch;

  /* Bewegung: Masse statt linearer Interpolation */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-spring: cubic-bezier(.32, .72, 0, 1);
  --t-fast: 160ms;
  --t-base: 260ms;
  --t-slow: 520ms;
  --t-reveal: 760ms;
}

/* ---------- 2. Typografie ---------- */
body {
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, .h1, .hero-h1 {
  letter-spacing: -.024em;
  line-height: 1.05;
  text-wrap: balance;
}

h2, .section-h2 {
  letter-spacing: -.021em;
  line-height: 1.08;
  text-wrap: balance;
}

h3 {
  letter-spacing: -.008em;
  text-wrap: balance;
}

p, li {
  text-wrap: pretty;
}

.lead, .section-lead, .hero-sub {
  font-size: clamp(17px, 1.25vw, 19px);
  line-height: 1.66;
  max-width: var(--measure);
}

/* Gliederungsmarken: ruhiger gesetzt, mit Haarlinie statt nur Farbe */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: .16em;
}
.section-label::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--line-strong);
  flex: none;
}

/* Zahlen laufen in Tabellenziffern – sonst springt die Breite beim Zählen */
.stat-number, .kpi b, .card .num, .result .big, .result .tile b,
.hh-roi output, .hh-roi .zahl, .pkg .card b, .nr-zahl,
[data-count], table td, table th {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---------- 3. Raumrhythmus ---------- */
section {
  padding-top: var(--space-section);
  /* unten optisch etwas großzügiger – so sitzt der Abschnitt nicht auf der Kante */
  padding-bottom: calc(var(--space-section) * 1.08);
}
section.tight { padding: var(--space-section-tight) 0; }
#stats-bar { padding: 0; }

.section-inner { max-width: 1140px; }

/* ---------- 4. Flächen mit Tiefe ---------- */
/* Doppelrand: Karten sitzen in einer Schale statt flach auf dem Grund */
.card,
.problem-card,
.usecase-card,
.panel,
.pricing-card,
.founder-card,
.ref-card {
  background:
    linear-gradient(180deg, rgba(240, 237, 232, .035), rgba(240, 237, 232, 0) 42%),
    var(--hh-3);
  border: 1px solid var(--line-quiet);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2), var(--sh-inset);
  transition:
    transform var(--t-base) var(--ease-spring),
    border-color var(--t-base) var(--ease),
    box-shadow var(--t-base) var(--ease),
    background-color var(--t-base) var(--ease);
}

.card:hover,
.problem-card:hover,
.usecase-card:hover,
.pricing-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--sh-3), var(--sh-inset);
  background:
    linear-gradient(180deg, rgba(201, 168, 76, .06), rgba(240, 237, 232, 0) 46%),
    var(--hh-4);
}

/* Der Lichtreflex folgt dem Zeiger – wird von hh-v15.js gesetzt */
.usecase-card, .problem-card, .card, .pricing-card { position: relative; overflow: hidden; }
.usecase-card::after,
.problem-card::after,
.card::after,
.pricing-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 0%),
    rgba(201, 168, 76, .13),
    transparent 62%
  );
}
.usecase-card:hover::after,
.problem-card:hover::after,
.card:hover::after,
.pricing-card:hover::after { opacity: 1; }

/* Abschnittswechsel weich statt als Kante */
section.alt, .hh-band {
  background:
    radial-gradient(1200px 380px at 50% -12%, rgba(201, 168, 76, .05), transparent 70%),
    var(--hh-2);
}

/* ---------- 5. Bedienelemente ---------- */
.btn-primary,
.nav-cta,
button.btn-primary {
  border-radius: var(--r-pill);
  padding: 14px 28px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, var(--sh-2);
  transition:
    transform var(--t-fast) var(--ease-spring),
    background-color var(--t-base) var(--ease),
    box-shadow var(--t-base) var(--ease);
}
.btn-primary:hover, .nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, var(--sh-3);
}
.btn-primary:active, .nav-cta:active { transform: translateY(0) scale(.985); }

.btn-secondary {
  border-radius: var(--r-pill);
  padding: 14px 26px;
  border-color: var(--line-quiet);
  transition:
    border-color var(--t-base) var(--ease),
    color var(--t-base) var(--ease),
    background-color var(--t-base) var(--ease),
    transform var(--t-fast) var(--ease-spring);
}
.btn-secondary:hover {
  background: rgba(240, 237, 232, .045);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.btn-secondary:active { transform: translateY(0) scale(.985); }

/* Pfeil in eigener Scheibe statt nackt neben der Schrift */
.btn-primary .pfeil, .btn-secondary .pfeil, .hh-pfeil {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 10px;
  margin-right: -8px;
  border-radius: var(--r-pill);
  background: rgba(10, 22, 40, .14);
  font-size: 12px;
  line-height: 1;
  transition: transform var(--t-base) var(--ease-spring), background-color var(--t-base) var(--ease);
}
.btn-secondary .pfeil, .hh-pfeil-hell { background: rgba(240, 237, 232, .1); }
.btn-primary:hover .pfeil,
.btn-secondary:hover .pfeil,
a:hover > .hh-pfeil { transform: translateX(3px); }

/* ---------- 6. Tastaturfokus ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
.btn-primary:focus-visible, .nav-cta:focus-visible { outline-offset: 4px; }

/* Sprungmarke zum Inhalt */
.hh-skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 200;
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: top var(--t-base) var(--ease);
}
.hh-skip:focus { top: 14px; }

/* ---------- 7. Navigation ---------- */
nav.hh-nav {
  transition: background-color var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease);
}
nav.hh-nav.hh-scrolled {
  background: rgba(8, 18, 34, .92);
  box-shadow: 0 10px 30px -18px rgba(3, 8, 18, .9);
  border-bottom-color: var(--line);
}

/* Die schlichte Navigation der Rechtstexte lief auf schmalen Geräten über
   den rechten Rand hinaus (48 px Innenabstand bei 390 px Breite). */
@media (max-width: 680px) {
  nav:not(.hh-nav) {
    padding: 13px 16px;
    gap: 10px;
    flex-wrap: wrap;
  }
  nav:not(.hh-nav) .nav-back { font-size: 13px; }
  nav:not(.hh-nav) .nav-logo { font-size: 19px; }
}

/* Lesefortschritt als Haarlinie an der Unterkante der Navigation */
.hh-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  z-index: 120;
  pointer-events: none;
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-soft));
  opacity: .9;
}

/* Aktueller Abschnitt in der Navigation */
.hh-menu a[aria-current="true"],
.nav-links a[aria-current="page"] { color: var(--gold); }

/* ---------- 8. Einblendung beim Scrollen ---------- */
.reveal,
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity var(--t-reveal) var(--ease),
    transform var(--t-reveal) var(--ease);
  will-change: opacity, transform;
}
.reveal.visible,
[data-reveal].visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}
/* Gestaffelt, wenn ein Container mehrere Kinder einblendet */
[data-reveal-group] > * { transition-delay: calc(var(--i, 0) * 65ms); }

/* ---------- 9. FAQ ---------- */
.faq-item h3 { transition: color var(--t-base) var(--ease); }
.faq-item:hover h3 { color: var(--gold); }
.faq-item h3::after { transition: transform var(--t-base) var(--ease-spring); }
.faq-item.open h3::after { transform: rotate(180deg); }
.faq-item p {
  max-width: var(--measure);
}

/* ---------- 10. Stats-Band ---------- */
#stats-bar .stat-number {
  letter-spacing: -.02em;
}
#stats-bar .stat-item {
  transition: transform var(--t-base) var(--ease-spring);
}
#stats-bar .stat-item:hover { transform: translateY(-2px); }
#stats-bar .stat-label {
  max-width: 24ch;
}

/* ---------- 11. Bilder und Medien ---------- */
img, video, svg { max-width: 100%; }
img[loading="lazy"] { background: var(--hh-2); }

/* ---------- 12. Fußzeile ----------
   Nur der Seitenfuß. Es gibt weitere <footer>-Elemente im Inhalt
   (die Kennzeichen unter den beiden Karten im Vergleichs-Simulator) –
   die dürfen von dieser Regel nicht erwischt werden. */
body > footer {
  background:
    radial-gradient(900px 300px at 50% 0%, rgba(201, 168, 76, .05), transparent 68%),
    var(--hh-0);
}

/* ---------- 13. Auswahlfarbe und Bildlaufleiste ---------- */
::selection { background: rgba(201, 168, 76, .3); color: #fff; }
::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, .34); }
::-webkit-scrollbar-thumb:hover { background: rgba(201, 168, 76, .55); }

/* ---------- 14. Ausdruck ---------- */
@media print {
  nav, .hh-nav, .hh-search, .hh-progress, .hero-mascot,
  .hh-explorer-filter, .hh-roi-panel, .hh-skip, video { display: none !important; }
  body { background: #fff; color: #111; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 10px; }
  .reveal, [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ---------- 15. Bewegung abschalten ---------- */
@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, [data-reveal] { opacity: 1 !important; transform: none !important; }
  .hh-progress { display: none; }
}

/* ---------- 16. Schmale Geräte ---------- */
@media (max-width: 380px) {
  .section-inner { padding-left: 16px; padding-right: 16px; }
  .btn-primary, .btn-secondary { width: 100%; text-align: center; }
}
