/* ==========================================================================
   bubb — getbubb.app (auch joinbubbles.app)
   Handgeschriebenes CSS, kein Build-Step, keine externen Requests.
   Farben, Typo-Skala, Radien 1:1 aus dem App-Design-System
   (bubbles/src/constants/designTokens.ts + colors.ts, docs/Bubbles_v2_Design.md,
   Stand DS-2/XF-2, Neuaufbau 2026-11 T-253).
   ========================================================================== */

/* --- Nunito (Variable Font, selbst gehostet, SIL OFL — s. fonts/nunito-OFL.txt) --- */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("../fonts/nunito-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: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("../fonts/nunito-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 (colors.ts, Light) */
  --primary: #009688;
  --primary-light: #4db6ac;
  --accent: #ff6b47; /* Korall: Flächen ohne Schrift, Linien, Punkt im Zeichen */
  --accent-action: #cc4422; /* Knopf-Korall: jede Korall-Fläche mit Schrift (DS-2) */
  --accent-text: #b93a1c; /* Korall als Schrift auf hellem Grund */
  --on-accent: #ffffff;
  --on-primary: #ffffff;

  --bg: #ffffff;
  --surface: #e8f5f3;
  --text: #0a1f1c;
  --text-secondary: #4a7068;
  --border: #b2dfdb;
  --shadow-sm: 0 1px 3px rgba(10, 31, 28, 0.06);
  --shadow-md: 0 2px 6px rgba(10, 31, 28, 0.08);
  --shadow-lg: 0 4px 12px rgba(10, 31, 28, 0.12);
  --poster-shadow: 0 4px 12px rgba(10, 31, 28, 0.12);
  --scene-bg: #b2dfdb; /* = border, Grund der Szenen im hellen Modus */

  /* Typo-Skala (P2 „Klar"): display 34 · heading 28 · title 23 · section 20
     · subhead 17 · body 18 · callout 16 · caption 14 · micro 12 */
  --t-display: 2.125rem;
  --t-heading: 1.75rem;
  --t-title: 1.4375rem;
  --t-section: 1.25rem;
  --t-body: 1.125rem;
  --t-subhead: 1.0625rem;
  --t-callout: 1rem;
  --t-caption: 0.875rem;
  --t-micro: 0.75rem;

  /* Abstände: 4er-Raster. page 16 · card 16 · section 24 */
  --sp-page: 16px;
  --sp-card: 16px;
  --sp-section: 24px;
  --card-pad: 20px;
  --box-pad: 20px;

  /* Radien: badge 8 · input 12 · button 14 · card 16 · hero 20 · pill 999 */
  --r-badge: 8px;
  --r-input: 12px;
  --r-button: 14px;
  --r-card: 16px;
  --r-hero: 20px;
  --r-pill: 999px;
  --maxw: 1060px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1f1c;
    --surface: #132e2a;
    --text: #e0f2f0;
    --text-secondary: #7abdb5;
    --border: #1e4540;
    --accent-text: #ff8b6b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.45);
    --poster-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    --scene-bg: #132e2a; /* = surface */
  }
}

/* --- Reset / Basis ------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent-text);
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.01em;
  /* Notbremse gegen horizontales Scrollen bei langen Komposita. hyphens hier
     bewusst nicht: der Browser trennt sonst auch, wo es nur die Zeile füllt. */
  overflow-wrap: break-word;
  text-wrap: balance;
}
p {
  margin: 0;
}
.prose p,
.prose li,
.address {
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  /* im Querformat liegt die Notch seitlich — max() hält den Seitenrand 16 */
  padding-block: 0;
  padding-inline: max(var(--sp-page), env(safe-area-inset-left), env(safe-area-inset-right));
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 10;
  background: var(--bg);
  padding: 12px 16px;
  border-radius: var(--r-input);
  border: 1px solid var(--border);
}

/* --- Kopfzeile ---------------------------------------------------------- */
.site-header {
  background: var(--bg);
  /* Band bis an die Bildschirmkante (viewport-fit=cover), Polster hält den
     Inhalt unter der Statusleiste. sticky, damit Safari 26 die Statusleiste
     nach dem Kopf-Hintergrund färbt (theme-color wird dort nicht mehr gelesen).
     Keine Linie: wie die Reiter-Kopfzeilen der App (XF-2e) liegt der Kopf
     ohne Rahmen auf dem Seitenhintergrund. */
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top, 0px);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 10px;
  font-size: var(--t-section);
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand:hover {
  color: var(--text);
}
/* Wortmarke „bubb“ (Richtung 3, ohne Sporn, Design 4; K-693). Bilddatei aus
   bubbles/docs/design/marke-bubb/assets/final/, hell Teal, dunkel per <picture>.
   Kopf nur mit der Wortmarke, kein Zeichen daneben (WEB-5). */
.brand picture {
  display: block;
}
.wordmark {
  display: block;
  width: auto;
  height: 30px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: var(--t-callout);
  font-weight: 700;
}
.nav a {
  color: var(--text-secondary);
  text-decoration: none;
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--primary);
}

/* Sprach-Switch: reiner Link auf die Schwesterseite der anderen Sprache.
   Kein Toggle — die Seite läuft ohne JavaScript (CSP default-src 'none').
   Die Flaggen sind Inline-SVG, keine Emoji (die rendern auf Windows als
   Buchstaben-Codes). Styling nur über Klassen: style="" wäre CSP-geblockt. */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.flag {
  display: block;
  width: 20px;
  height: 14px;
  flex: none;
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--border);
}

/* --- Bühne (Hero) ---------------------------------------------------------
   Die eine solide Teal-Fläche der Seite (Design § 1 Prinzip 2): das Teal-Poster
   der Onboarding-Szenen, Heldkarte mit Radius 20. Schrift darauf ist weiß und
   groß fett (3,67 : 1 reicht ab 18,66 px fett, T-37). */
.hero {
  padding: 16px 0 8px;
}
.poster {
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--r-hero);
  box-shadow: var(--poster-shadow);
  padding: 36px 24px 0;
  display: grid;
  gap: 28px;
  overflow: hidden;
}
.poster h1 {
  color: var(--on-primary);
  font-size: clamp(2.125rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}
.poster .lead {
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--t-title);
  font-weight: 600;
  line-height: 1.4;
  max-width: 30ch;
}
.poster-art {
  justify-self: center;
  align-self: end;
  width: 100%;
  max-width: 480px;
}
.poster-art img {
  width: 100%;
}
@media (min-width: 800px) {
  .hero {
    padding: 24px 0 16px;
  }
  .poster {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 32px;
    padding: 56px 48px 0;
  }
  .poster-art {
    max-width: 520px;
  }
  .poster-text {
    padding-bottom: 56px;
  }
}

/* --- Knöpfe ---------------------------------------------------------------
   Teal führt, Korall handelt (§ 1 Prinzip 3): Weiterführen ist Teal bzw. auf
   dem Poster Weiß. Korall-Knöpfe gibt es auf der Website nicht, weil hier
   niemand zusagt oder etwas abschickt. */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 28px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--r-button);
  font-weight: 800;
  font-size: var(--t-subhead);
  text-decoration: none;
  line-height: 1.2;
}
.btn-light {
  background: var(--on-primary);
  color: var(--primary);
}
.btn-light:hover {
  color: var(--primary);
  background: #f3faf9;
}
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover {
  color: var(--on-primary);
}
.badge-soon {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  min-height: 48px;
  justify-content: center;
  padding: 8px 20px;
  border-radius: var(--r-button);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  line-height: 1.25;
  cursor: default;
}
.badge-soon .small {
  font-size: var(--t-micro);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}
.badge-soon .big {
  font-size: var(--t-subhead);
  font-weight: 800;
}

/* --- Abschnitte ----------------------------------------------------------- */
section {
  padding: 40px 0;
}
.section-title {
  font-size: var(--t-heading);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.section-intro {
  color: var(--text-secondary);
  font-size: var(--t-body);
  font-weight: 500;
  max-width: 58ch;
  margin-bottom: var(--sp-section);
}
.section-intro + .section-intro {
  margin-top: calc(-1 * var(--sp-section) + 12px);
}
.two-col {
  display: grid;
  gap: 24px;
  align-items: start;
}
@media (min-width: 800px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}
.two-col p + p {
  margin-top: 12px;
}
.two-col p {
  font-size: var(--t-body);
}

/* Szenen: die Onboarding-Grafiken der App (WebP mit Alpha), Radius 16.
   Die Szenen sind für Teal gezeichnet; ihre weißen Karten brauchen im hellen
   Modus einen Grund, der kräftiger ist als surface (dort verschwinden sie),
   deshalb der Border-Ton. Im dunklen Modus reicht surface. Der Rahmen ist
   immer 3 : 2, die 2 : 1-Szene liegt mittig darin. */
.scene {
  background: var(--scene-bg);
  border-radius: var(--r-card);
  padding: 12px;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  display: grid;
  place-items: center;
}
.scene img {
  width: 100%;
}

/* Schritte: Szene oben, Nummer, Titel, Text */
.steps {
  display: grid;
  gap: 16px;
}
@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}
.step {
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 12px 12px var(--card-pad);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.step .scene {
  padding: 8px;
}
.step-body {
  padding: 0 8px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 800;
  font-size: var(--t-callout);
  margin-bottom: 10px;
}
.step h3 {
  font-size: var(--t-section);
  font-weight: 800;
  margin-bottom: 6px;
}
.step p {
  color: var(--text-secondary);
  font-size: var(--t-callout);
  font-weight: 500;
}

/* Karten mit Icon (lucide-Striche, Strich 2) */
.cards {
  display: grid;
  gap: 16px;
}
@media (min-width: 700px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}
.card {
  border-radius: var(--r-card);
  padding: var(--card-pad);
  background: var(--surface);
}
.card .icon {
  display: inline-flex;
  color: var(--primary);
  margin-bottom: 12px;
}
.card h3 {
  font-size: var(--t-subhead);
  font-weight: 700;
  margin-bottom: 6px;
}
.card p {
  color: var(--text-secondary);
  font-size: var(--t-callout);
  font-weight: 500;
}

/* Versprechen: Liste mit Haken, Haken in Teal */
.promises {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
@media (min-width: 760px) {
  .promises {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 32px;
  }
}
.promises li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: var(--t-callout);
  font-weight: 600;
}
.promises .icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--on-primary);
  margin-top: 1px;
}

/* Hinweis (Beta) */
.note {
  border-left: 4px solid var(--accent);
  border-radius: var(--r-input);
  background: var(--surface);
  padding: var(--card-pad);
}
.note h2 {
  font-size: var(--t-section);
  font-weight: 800;
  margin-bottom: 8px;
}
.note p {
  color: var(--text-secondary);
  font-size: var(--t-callout);
  font-weight: 500;
}
.note p + p {
  margin-top: 12px;
}

/* --- Rechtstexte / Fließtext -------------------------------------------- */
.prose {
  max-width: 46rem;
  padding: 24px 0 8px;
}
.prose h1 {
  /* skaliert auf schmalen Displays herunter (28px), damit lange Titel wie
     "Datenschutzerklärung" nicht die halbe Zeile sprengen */
  font-size: clamp(1.75rem, 8vw, var(--t-display));
  -webkit-hyphens: auto;
  hyphens: auto;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.prose .meta {
  color: var(--text-secondary);
  font-size: var(--t-caption);
  font-weight: 600;
  margin-bottom: 32px;
}
.prose h2 {
  font-size: var(--t-section);
  font-weight: 800;
  margin: 40px 0 8px;
}
.prose h3 {
  font-size: var(--t-subhead);
  font-weight: 700;
  margin: 24px 0 8px;
}
.prose p,
.prose li {
  font-size: var(--t-callout);
  color: var(--text);
}
.prose p + p {
  margin-top: 12px;
}
.prose ul {
  margin: 8px 0 0;
  padding-left: 24px;
}
.prose li {
  margin-bottom: 8px;
}
.prose .box {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: var(--box-pad);
  margin-top: 16px;
}
.prose .box p {
  font-size: var(--t-callout);
}
.address {
  font-style: normal;
  font-size: var(--t-callout);
  line-height: 1.75;
}

/* --- Fußzeile ----------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 32px 0 44px;
  /* Home-Indicator: unten nicht unter die Systemleiste rutschen */
  padding-bottom: calc(44px + env(safe-area-inset-bottom, 0px));
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-size: var(--t-caption);
  font-weight: 600;
}
.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--primary);
}
.copy {
  font-size: var(--t-caption);
  font-weight: 600;
  color: var(--text-secondary);
}

/* --- Mobil (≤620px) ------------------------------------------------------
   Marke + Nav + Sprach-Switch brauchen nebeneinander mehr Platz als ein
   375px-iPhone hergibt — deshalb zweizeilig: Marke oben, Navigation darunter. */
@media (max-width: 620px) {
  .site-header .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 20px;
    padding-bottom: 12px;
    min-height: 0;
    position: relative; /* Bezug für den Sprach-Switch */
  }
  /* Der Switch wandert nach rechts oben auf Höhe der Marke. Reine
     CSS-Lösung: DOM-, Tab- und Vorlesereihenfolge bleiben unverändert. */
  .lang-switch {
    position: absolute;
    top: 22px;
    right: var(--sp-page);
  }
  .nav {
    gap: 8px 18px;
    flex-wrap: wrap;
  }
  .nav a {
    padding-block: 2px;
  }
  .site-footer .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .hero {
    padding: 8px 0 4px;
  }
  .poster {
    padding: 28px 20px 0;
    gap: 20px;
  }
  .poster h1 {
    font-size: 2.125rem;
  }
  .poster .lead {
    font-size: var(--t-section);
  }
  section {
    padding: 32px 0;
  }
  .site-footer {
    margin-top: 32px;
  }
}

/* --- Bewegung & Seitenübergänge (alles CSS, kein JavaScript) --------------
   Reines CSS und ausschließlich progressive Verbesserung: wo der Browser sie
   nicht kennt, passiert nichts, kein Inhalt wird versteckt, nichts bricht. */

/* 1) Seitenwechsel gleitet statt hart umzuspringen (Chrome 126+, Safari 18.2+).
      Das Kopfband bleibt beim Navigieren optisch stehen. */
@view-transition {
  navigation: auto;
}
.site-header {
  view-transition-name: site-header;
}
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

/* 2) Karten steigen beim Hereinscrollen leicht auf. @supports ist die
      Sicherheitsleine: ohne Unterstützung sind die Karten normal sichtbar. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .card,
    .step {
      animation: rise-in linear both;
      animation-timeline: view();
      animation-range: entry 10% entry 55%;
    }
    @keyframes rise-in {
      from {
        opacity: 0;
        transform: translateY(12px);
      }
      to {
        opacity: 1;
        transform: none;
      }
    }
  }
}

/* 3) Lesefortschritt, nur auf den langen Textseiten (body:has(.prose)). */
@supports (animation-timeline: scroll()) {
  body:has(.prose) .site-header::after {
    content: "";
    position: fixed;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: 0 50%;
    z-index: 20;
    animation: read-progress linear both;
    animation-timeline: scroll(root block);
  }
  @keyframes read-progress {
    to {
      transform: scaleX(1);
    }
  }
}

/* Faktische Technik-Angabe im Footer, ohne Zahlenwerte und ohne Ausrufezeichen. */
.techline {
  margin-top: 14px;
  font-size: var(--t-caption);
  font-weight: 500;
  color: var(--text-secondary);
  opacity: 0.85;
}

/* --- Färbung von Safaris Leisten ----------------------------------------
   Safari 26 liest kein theme-color mehr, sondern leitet die Färbung der
   Status- und Toolbar aus fixed/sticky Elementen am Viewport-Rand und aus der
   Hintergrundfarbe des Wurzelelements ab. Beides deshalb explizit setzen.
   Wer position: sticky am Kopf entfernt oder den html-Hintergrund löscht,
   holt sich den weißen Balken zurück (zweimal live geprüft, 2026-08-08). */
html {
  background-color: var(--bg);
}
