/* App-Farben aus app.json (calculator) */
:root {
  --app-flaeche: #01062a;
  --app-akzent: #fe8c27;
  --app-hell: #aec0d5;
  --app-akzent-hell: #b04f00;
}

/* App-Seite von Salathe Webservices (Familie salathe.net). Ruhig, gross, klar. Kein JavaScript, keine Fremdschriften.
   Die App-Farben (--app-*) setzt build.mjs aus app.json vor diese Datei. Kontraste misst tests/build.test.mjs (Test 7). */

:root {
  color-scheme: light dark;
  --grund: #fbfbfd;
  --flaeche: #f2f2f5;
  --text: #1d1d1f;
  --leise: #55565e;
  --linie: #d9d9de;
  --akzent: var(--app-akzent-hell);
  --akzent-text: #ffffff;
  --signal: var(--app-akzent);
  --signal-text: var(--app-flaeche);
  --marke: #4a3ae0;
  --leiste: rgba(251, 251, 253, 0.78);
  /* Aurora (nur Startseite, hinter dem Kopf): Farben des Symbols, zart */
  --aurora-1: color-mix(in srgb, var(--app-akzent) 12%, transparent);
  --aurora-2: color-mix(in srgb, var(--app-hell) 20%, transparent);
  --aurora-3: color-mix(in srgb, var(--app-flaeche) 4%, transparent);
  --symbol-ring: transparent;
  --rund: 18px;
  --breite: 62rem;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: var(--app-flaeche);
    --flaeche: color-mix(in srgb, var(--app-flaeche) 90%, #ffffff);
    --text: #f5f5f7;
    --leise: #b4bccc;
    --linie: color-mix(in srgb, var(--app-flaeche) 75%, #ffffff);
    --akzent: var(--app-akzent);
    --akzent-text: var(--app-flaeche);
    --marke: #a99fff;
    --symbol-ring: color-mix(in srgb, #ffffff 18%, transparent);
    --leiste: color-mix(in srgb, var(--app-flaeche) 80%, transparent);
    --aurora-1: color-mix(in srgb, var(--app-akzent) 20%, transparent);
    --aurora-2: color-mix(in srgb, var(--app-hell) 16%, transparent);
    --aurora-3: color-mix(in srgb, #000000 20%, transparent);
  }
}

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

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

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}

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

a {
  color: var(--akzent);
  text-underline-offset: 0.18em;
}

a:focus-visible,
main:focus-visible {
  outline: 3px solid var(--akzent);
  outline-offset: 3px;
  border-radius: 6px;
}

main:focus {
  outline: none;
}

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

p {
  margin: 0;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

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

.sprung {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--text);
  color: var(--grund);
  border-radius: 10px;
}

.sprung:focus {
  top: 0.75rem;
}

.vorschau-band {
  padding: 0.35rem 1rem;
  background: var(--akzent);
  color: var(--akzent-text);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.02em;
}

/* ---------- Wortmarke «salathe.» (Firmenzeichen, Punkt in der Firmenfarbe) ---------- */
.wortmarke {
  font-weight: 750;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.wortmarke .punkt {
  display: inline-block;
  width: 0.24em;
  height: 0.24em;
  margin-left: 0.05em;
  border-radius: 50%;
  background: var(--marke);
}

/* ---------- Leiste oben ---------- */
.leiste {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--leiste);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--linie) 70%, transparent);
}

.leiste-innen {
  max-width: var(--breite);
  margin: 0 auto;
  padding: 0 1rem;
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.marke {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-right: auto;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.marke img {
  width: 28px;
  height: 28px;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px var(--symbol-ring);
  flex: none;
}

.marke span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.haupt ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.25rem;
}

.haupt a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}

.haupt a:hover,
.haupt a[aria-current] {
  color: var(--akzent);
}

.sprachen {
  display: flex;
}

.sprachwahl {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0 0.7rem;
  border: 1px solid var(--linie);
  border-radius: 999px;
  color: var(--leise);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.sprachwahl:hover {
  color: var(--text);
  border-color: var(--leise);
}

.globus {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

@media (max-width: 26rem) {
  .leiste-innen {
    gap: 0.6rem;
  }

  .haupt ul {
    gap: 0.7rem;
  }

  .sprachwahl {
    padding: 0 0.6rem;
  }

  .globus {
    display: none;
  }

  .haupt a {
    font-size: 0.85rem;
  }

  .marke span {
    font-size: 0.95rem;
  }
}

/* ---------- Startseite ---------- */
.held {
  max-width: var(--breite);
  margin: 0 auto;
  padding: clamp(3.5rem, 10vw, 7rem) 1rem clamp(3rem, 8vw, 5rem);
  text-align: center;
}

.symbol {
  width: 8rem;
  height: 8rem;
  margin: 0 auto 1.75rem;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px var(--symbol-ring), 0 10px 30px color-mix(in srgb, var(--app-flaeche) 35%, transparent);
}

.held h1 {
  font-size: clamp(2.6rem, 1.6rem + 5vw, 5rem);
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.einleitung {
  color: var(--leise);
  font-size: clamp(1.15rem, 1.05rem + 0.6vw, 1.45rem);
  line-height: 1.42;
  max-width: 40rem;
  margin: 1.25rem auto 0;
}

.bald {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  background: var(--signal);
  color: var(--signal-text);
  font-weight: 650;
}

.funktionen {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem clamp(3.5rem, 8vw, 5.5rem);
}

.funktionen p + p,
.funktionsliste + p {
  margin-top: 1rem;
}

.funktionsliste {
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.funktionsliste li {
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--linie);
  border-radius: var(--rund);
  background: var(--flaeche);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.funktionsliste li:hover {
  transform: translateY(-2px);
  border-color: var(--leise);
}

.funktionsliste strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.funktionen .weiter {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
}

.mehr {
  font-weight: 600;
  text-decoration: none;
}

.mehr:hover {
  text-decoration: underline;
}

.pfeil {
  display: inline-block;
  transition: transform 0.2s ease;
}

a:hover .pfeil {
  transform: translateX(3px);
}

/* ---------- Leseseiten (Support, Datenschutz): keine Bewegung ausser Hover ---------- */
.lesespalte {
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5rem) 1rem clamp(3.5rem, 8vw, 5.5rem);
}

.lesespalte h1 {
  font-size: clamp(2.1rem, 1.5rem + 3vw, 3.25rem);
  letter-spacing: -0.035em;
  margin-bottom: 1.75rem;
}

.lesespalte h2 {
  font-size: 1.25rem;
  margin: 2.25rem 0 0.5rem;
}

.lesespalte p + p {
  margin-top: 0.9rem;
}

.stand {
  color: var(--leise);
}

/* ---------- Fusszeile ---------- */
.fuss {
  background: var(--flaeche);
  color: var(--leise);
  font-size: 0.85rem;
  border-top: 1px solid var(--linie);
}

.fuss-innen {
  max-width: var(--breite);
  margin: 0 auto;
  padding: 1.75rem 1rem 2.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.75rem;
}

.fuss-marke {
  font-size: 1rem;
}

.fuss ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.fuss a {
  color: var(--text);
  text-decoration: none;
}

.fuss a:hover,
.fuss a[aria-current] {
  text-decoration: underline;
}

.marken {
  flex-basis: 100%;
}

/* ---------- Bewegung (Baustein aus salathe.net, zurueckhaltend) ----------
   Nur CSS, kein JavaScript. Regeln, die tests/build.test.mjs erzwingt:
   1. opacity 0 nur in @keyframes, nie als Grundwert: wo Animationen nicht laufen, ist alles sichtbar.
   2. Jede animation-timeline steht in @supports (animation-timeline: ...): ohne Unterstuetzung normale Seite.
   3. prefers-reduced-motion: reduce schaltet alle Animationen und Uebergaenge ab (Block am Ende).
   Bewegung nur auf der Startseite (Aurora hinter dem Kopf, gestaffeltes Einblenden); Leseseiten nur Hover. */
.buehne {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.aurora {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(ellipse 55% 45% at 50% 55%, var(--aurora-3), transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 70%, transparent);
}

.aurora::before,
.aurora::after {
  content: "";
  position: absolute;
  width: max(30rem, 60vw);
  height: max(30rem, 60vw);
  border-radius: 50%;
}

.aurora::before {
  left: -16%;
  top: -30%;
  background: radial-gradient(closest-side, var(--aurora-1), transparent);
}

.aurora::after {
  right: -20%;
  top: 0;
  background: radial-gradient(closest-side, var(--aurora-2), transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .startseite .aurora::before {
    animation: aurora-a 30s ease-in-out infinite alternate;
    will-change: transform, opacity;
  }

  .startseite .aurora::after {
    animation: aurora-b 38s ease-in-out infinite alternate;
    will-change: transform, opacity;
  }

  /* Kopf der Startseite beim Laden gestaffelt einblenden. Startzustand nur in der Animation. */
  .held > * {
    animation: held-ein 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .held > :nth-child(2) {
    animation-delay: 0.07s;
  }

  .held > :nth-child(3) {
    animation-delay: 0.14s;
  }

  .held > :nth-child(4) {
    animation-delay: 0.21s;
  }

  /* Funktionen tauchen beim Scrollen auf, nur wo der Browser es kann */
  @supports (animation-timeline: view()) {
    .funktionsliste li {
      animation: auftauchen linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 18%;
    }
  }
}

@keyframes aurora-a {
  from {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
  }

  50% {
    transform: translate3d(10%, 7%, 0) scale(1.1);
    opacity: 0.75;
  }

  to {
    transform: translate3d(4%, 14%, 0) scale(0.95);
    opacity: 1;
  }
}

@keyframes aurora-b {
  from {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.85;
  }

  50% {
    transform: translate3d(-12%, 5%, 0) scale(0.92);
    opacity: 1;
  }

  to {
    transform: translate3d(-5%, -8%, 0) scale(1.08);
    opacity: 0.8;
  }
}

@keyframes held-ein {
  from {
    opacity: 0;
    transform: translateY(0.8rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes auftauchen {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Reduzierte Bewegung: alles steht still, aller Inhalt ist sichtbar */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
