/* Landingpage von learnly.school. Farben, Schriften und Rundungen kommen ausschließlich aus dem
   Theme der App (ds/tokens/app.css): --brand-* und --mat-sys-*. Die Seite färbt sich dadurch so
   um wie die App, wenn sich das Theme ändert. */

body {
  margin: 0;
  background: var(--brand-page-bg);
  color: var(--mat-sys-on-surface);
}

.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

section {
  padding-block: clamp(56px, 9vw, 104px);
}

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 4.4vw, 3.5rem);
  line-height: 1.04;
}

h2 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.08;
}

h3 {
  font-size: 1.6rem;
  line-height: 1.15;
}

p {
  margin: 0;
  text-wrap: pretty;
}

.eyebrow {
  margin: 0 0 12px;
  font: var(--mat-sys-label-large);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-primary-strong);
}

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.6;
  color: var(--mat-sys-on-surface-variant);
}

.text {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--mat-sys-on-surface-variant);
}

.stack > * + * {
  margin-top: 18px;
}

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px;
  border: 0;
  border-radius: var(--mat-sys-corner-full);
  background: var(--brand-primary);
  color: var(--mat-sys-on-primary);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--brand-primary-strong);
  color: var(--mat-sys-on-primary);
}

.btn-outline {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--brand-primary);
  background: transparent;
  color: var(--brand-primary-strong);
  font-size: 0.95rem;
}

.btn-outline:hover {
  background: var(--brand-surface);
  color: var(--brand-primary-strong);
}

/* ---------- Kopf ---------- */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--mat-sys-on-surface);
  text-decoration: none;
}

.brand svg {
  width: 40px;
  height: 40px;
  color: var(--brand-primary);
}

.brand-word {
  font-family: var(--brand-heading-font);
  font-weight: var(--brand-wordmark-weight);
  font-size: 1.7rem;
  line-height: 1;
}

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(24px, 5vw, 64px);
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 0;
  margin-bottom: 0;
  list-style: none;
  font-size: 0.92rem;
  color: var(--mat-sys-on-surface-variant);
}

/* Punkt und Text stehen nebeneinander, damit eine umbrechende Zeile bündig unter dem Text steht. */
.facts li {
  display: flex;
  align-items: flex-start;
}

.facts li::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0.5em 8px 0 0;
  border-radius: 50%;
  background: var(--brand-accent);
}

/* ---------- Chat-Vorschau ----------
   Das Chat-Fenster der Schüler-Ansicht, wie es am Smartphone bildschirmfüllend erscheint: Kopf mit
   Begleiter und Mitlese-Hinweis, Nachrichten, Vorschläge und Eingabezeile. Maße und Farben folgen
   student-lernweg.scss. */
.chat {
  justify-self: center;
  width: min(100%, 350px);
  margin: 0;
}

.chat-phone {
  display: flex;
  flex-direction: column;
  height: 640px;
  overflow: hidden;
  border: 10px solid var(--mat-sys-inverse-surface);
  border-radius: 40px;
  background: var(--mat-sys-surface);
  box-shadow: 0 40px 80px -40px color-mix(in srgb, var(--brand-primary-strong) 60%, transparent);
}

.chat-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 22px 4px;
  background: var(--brand-surface);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--mat-sys-on-surface);
}

.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  font-size: 0.875rem;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px 8px 10px;
  background: var(--brand-surface);
  border-bottom: 1px solid var(--mat-sys-outline-variant);
}

.chat-head img {
  flex: none;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.chat-headtext {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-right: auto;
  line-height: 1.25;
}

.chat-headtext span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  white-space: nowrap;
  color: var(--mat-sys-on-surface-variant);
}

.chat-headtext svg {
  flex: none;
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.chat-iconbtn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--mat-sys-on-surface-variant);
}

.chat-iconbtn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.chat-stream {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 12px 12px 12px 18px;
}

.chat-stream::-webkit-scrollbar {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .chat-stream {
    scroll-behavior: smooth;
  }
}

/* Der Anfang des Verlaufs rutscht nach oben weg, wie im echten Chat, der unten weiterwächst. */
.chat-stream > :first-child {
  margin-top: auto;
}

.chat-bubble {
  position: relative;
  max-width: 88%;
  align-self: flex-start;
  margin: 0;
  padding: 10px 13px;
  border-radius: 16px 16px 16px 16px;
  border-top-left-radius: 4px;
  background: var(--brand-surface);
  line-height: 1.45;
}

.chat-bubble::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 12px;
  border: 7px solid transparent;
  border-right-color: var(--brand-surface);
  border-left: 0;
}

.chat-bubble-user {
  align-self: flex-end;
  border: 1px solid var(--mat-sys-outline-variant);
  border-radius: 16px;
  border-top-right-radius: 4px;
  background: var(--mat-sys-surface);
}

.chat-bubble-user::before {
  display: none;
}

.chat-pending {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mat-sys-on-surface-variant);
}

.chat-spinner {
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, var(--brand-primary) 25%, transparent);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: chat-dreh 0.8s linear infinite;
}

@keyframes chat-dreh {
  to {
    transform: rotate(360deg);
  }
}

.chat-foot {
  display: grid;
  gap: 8px;
  padding: 8px 10px 12px;
  border-top: 1px solid var(--mat-sys-outline-variant);
  background: var(--mat-sys-surface);
}

.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.chat-chip {
  padding: 3px 10px;
  border: 1px solid var(--brand-primary);
  border-radius: 999px;
  color: var(--brand-primary-strong);
  font-size: 0.78rem;
  line-height: 1.5;
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-field {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  overflow: hidden;
  white-space: nowrap;
  border: 1px solid var(--mat-sys-outline);
  border-radius: 999px;
  color: var(--mat-sys-on-surface);
}

/* Leeres Feld zeigt den Platzhalter wie in der App. */
.chat-field:empty::before {
  content: attr(data-placeholder);
  color: var(--mat-sys-on-surface-variant);
}

.chat-field.tippt {
  border-color: var(--brand-primary);
  outline: 2px solid var(--brand-primary);
  outline-offset: 1px;
}

/* Die Schreibmarke beim Tippen. */
.chat-field.tippt::after {
  content: '';
  flex: none;
  width: 1.5px;
  height: 1.1em;
  margin-left: 1px;
  background: var(--mat-sys-on-surface);
  animation: chat-blinken 1s steps(1) infinite;
}

@keyframes chat-blinken {
  50% {
    opacity: 0;
  }
}

.chat-send {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: var(--mat-sys-surface);
  opacity: 0.45;
  transition: opacity 150ms ease, transform 150ms ease;
}

.chat-send.bereit {
  opacity: 1;
}

.chat-send.gedrueckt {
  transform: scale(0.88);
}

.chat-send svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.chat-replay {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-primary-strong);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .chat-neu {
    animation: chat-rein 280ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }
}

@keyframes chat-rein {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.caption {
  margin: 14px 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--mat-sys-on-surface-variant);
}

/* ---------- Flächen und Merkmale ---------- */
.tinted {
  background: var(--brand-surface-soft);
}

.head {
  max-width: 760px;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: clamp(20px, 3vw, 40px);
}

.feature {
  padding-top: 18px;
  border-top: 2px solid var(--brand-primary);
}

.feature h3 {
  margin-bottom: 8px;
}

.animals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0 0 clamp(28px, 4vw, 44px);
  padding: 0;
  list-style: none;
}

.animals li {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--mat-sys-on-surface-variant);
}

.animals img {
  width: 96px;
  height: 120px;
  object-fit: contain;
}

/* ---------- Bilder aus der App ---------- */
.shot {
  margin: 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--mat-sys-outline-variant);
  border-radius: var(--mat-sys-corner-large);
  background: var(--mat-sys-surface);
  box-shadow: 0 24px 60px -36px color-mix(in srgb, var(--brand-primary-strong) 55%, transparent);
}

.shot figcaption {
  margin-top: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--mat-sys-on-surface-variant);
}

.shot-tall img {
  max-height: 720px;
  object-fit: cover;
  object-position: top;
}

.shots-pair {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 32px);
  align-items: start;
}

@media (max-width: 720px) {
  .shots-pair {
    grid-template-columns: 1fr;
  }

  .shots-pair .shot:last-child {
    max-width: 320px;
  }
}

.points {
  margin: 0;
  padding: 0;
  list-style: none;
}

.points li {
  padding: 18px 0;
  border-top: 1px solid var(--mat-sys-outline-variant);
}

.points li:last-child {
  border-bottom: 1px solid var(--mat-sys-outline-variant);
}

.points b {
  display: block;
  margin-bottom: 4px;
  font-size: 1.05rem;
}

/* ---------- Jugendschutz-Band ---------- */
.band {
  background: var(--brand-primary-strong);
  color: var(--mat-sys-on-primary);
}

.band .eyebrow,
.band .text,
.band a {
  color: var(--mat-sys-on-primary);
}

.band h3 {
  margin-bottom: 8px;
  font-size: 1.45rem;
  color: var(--brand-accent);
}

.band .text {
  opacity: 0.92;
}

/* Vier Karten stehen als 2 × 2 statt als 3 + 1. */
/* Feste Spaltenzahlen statt auto-fit, damit nie eine einzelne Karte in der letzten Reihe steht:
   drei Karten stehen in einer Reihe oder untereinander, vier als 2 × 2 oder (im Band) in einer Reihe. */
.features-3,
.features-quad {
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .features-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 600px) {
  .features-quad {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .band .features-quad {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Wird die Zweispaltigkeit zur Spalte, steht der Text vor dem Bild. */
@media (max-width: 960px) {
  .split > figure:first-child {
    order: 2;
  }

  .split .contact-art {
    width: 140px;
  }
}

.band .more {
  margin-top: clamp(28px, 4vw, 40px);
}

/* ---------- Kontakt ---------- */
.contact-art {
  width: min(200px, 50%);
  margin-top: 8px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--mat-sys-outline-variant);
  border-radius: var(--mat-sys-corner-extra-large);
  background: var(--mat-sys-surface-container-lowest);
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

.form input,
.form textarea {
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--mat-sys-outline);
  border-radius: var(--mat-sys-corner-small);
  background: var(--mat-sys-surface-container-lowest);
  font: inherit;
  font-weight: 400;
}

.form textarea {
  resize: vertical;
}

.form input:focus,
.form textarea:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: -1px;
}

.hint {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--mat-sys-on-surface-variant);
}

/* ---------- Fuß ---------- */
.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  padding: 24px 20px 40px;
  border-top: 1px solid var(--mat-sys-outline-variant);
  font-size: 0.9rem;
  color: var(--mat-sys-on-surface-variant);
}

.site-foot a {
  color: inherit;
}

@media (prefers-reduced-motion: no-preference) {
  .msg {
    animation: msg-in 0.25s ease-out;
  }

  @keyframes msg-in {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
  }
}

/* ---------- Geräte-Gruppe: dasselbe Motiv auf Monitor, Tablet und Telefon ----------
   Der Monitor steht hinten, Tablet und Telefon überlappen ihn vorne links und rechts. Am
   Telefon stehen der Monitor oben und die beiden kleinen Geräte nebeneinander darunter. */
.devices {
  position: relative;
  margin: 0;
  padding-bottom: 6%;
}

/* Jedes Gerät zeigt die ganze Seite: sichtbar ist die erste Bildschirmhöhe, der Rest lässt sich
   im Gerät scrollen. Ohne sichtbare Scrollbar, damit das Gerät wie ein Bildschirm aussieht. */
.device {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--mat-sys-surface);
}

.device::-webkit-scrollbar {
  display: none;
}

.device:focus-visible {
  outline: 3px solid var(--mat-sys-primary);
  outline-offset: 3px;
}

.device img {
  display: block;
  width: 100%;
  height: auto;
}

.monitor {
  width: 76%;
  margin-left: 12%;
}

.monitor-screen {
  aspect-ratio: 16 / 10;
  border: clamp(6px, 0.9vw, 12px) solid var(--mat-sys-inverse-surface);
  border-radius: clamp(8px, 1.2vw, 16px);
  box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--brand-primary-strong) 55%, transparent);
}

.monitor-stand {
  width: 18%;
  height: clamp(18px, 3vw, 40px);
  margin: 0 auto;
  background: linear-gradient(var(--mat-sys-outline), var(--mat-sys-outline-variant));
  clip-path: polygon(22% 0, 78% 0, 92% 100%, 8% 100%);
}

.monitor-foot {
  width: 30%;
  height: clamp(5px, 0.7vw, 9px);
  margin: 0 auto;
  border-radius: 999px 999px 4px 4px;
  background: var(--mat-sys-outline);
}

.tablet,
.phone {
  position: absolute;
  bottom: 0;
  border: solid var(--mat-sys-inverse-surface);
  box-shadow: 0 24px 50px -24px color-mix(in srgb, var(--brand-primary-strong) 60%, transparent);
}

.tablet {
  left: 0;
  width: 28%;
  aspect-ratio: 834 / 1112;
  border-width: clamp(6px, 0.8vw, 11px);
  border-radius: clamp(14px, 1.8vw, 24px);
}

.phone {
  right: 2%;
  width: 14%;
  aspect-ratio: 390 / 844;
  border-width: clamp(4px, 0.55vw, 8px);
  border-radius: clamp(16px, 2.2vw, 28px);
}

/* Tablet und Telefon reichen bis an die Unterkante der Gruppe; die Bildunterschrift steht
   deshalb darunter und nicht im Fluss neben ihnen. */
.devices {
  margin-bottom: calc(clamp(20px, 3vw, 32px) + 3em);
}

/* Eine Geräte-Gruppe mitten im Abschnitt braucht Luft zu den Karten darunter; ihre
   Bildunterschrift kann zwei Zeilen lang sein. */
.devices + .features {
  margin-top: calc(clamp(20px, 3vw, 32px) + 3.5em + clamp(28px, 4vw, 48px));
}

.devices figcaption {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: clamp(20px, 3vw, 32px);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--mat-sys-on-surface-variant);
}

@media (max-width: 720px) {
  .devices {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    align-items: end;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .monitor {
    grid-column: 1 / -1;
    width: 100%;
    margin-left: 0;
  }

  .tablet,
  .phone {
    position: static;
    width: 100%;
  }

  .devices figcaption {
    grid-column: 1 / -1;
    position: static;
    margin-top: 4px;
  }

  .devices + .features {
    margin-top: 40px;
  }
}

/* ---------- Bewegung ----------
   Alles hier ist Zugabe: Ohne Unterstützung im Browser oder bei „Bewegung reduzieren“ steht die
   Seite ohne Animation da, vollständig sichtbar. */

@keyframes einblenden {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes von-links {
  from {
    opacity: 0;
    transform: translateX(-48px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes von-rechts {
  from {
    opacity: 0;
    transform: translateX(48px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  /* Der Hero ist beim Laden schon im Bild: er blendet einmal gestaffelt ein. */
  .hero .stack > *,
  .hero .chat {
    animation: einblenden 700ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }

  .hero .stack > :nth-child(2) {
    animation-delay: 80ms;
  }

  .hero .stack > :nth-child(3) {
    animation-delay: 160ms;
  }

  .hero .stack > :nth-child(4) {
    animation-delay: 220ms;
  }

  .hero .chat {
    animation-delay: 260ms;
  }

  /* Alles darunter kommt beim Scrollen herein: Es beginnt, sobald das Element unten auftaucht,
     und steht, wenn es ein knappes Drittel des Weges durchs Bild zurückgelegt hat. */
  @supports (animation-timeline: view()) {
    section:not(.hero) .head,
    .feature,
    .band .features > div,
    .points li,
    .animals li,
    .shot,
    .monitor,
    .tablet,
    .phone,
    .contact-art,
    .form {
      animation: einblenden cubic-bezier(0.2, 0.7, 0.3, 1) both;
      animation-timeline: view();
      animation-range: entry 0% cover 30%;
    }

    .tablet {
      animation-name: von-links;
      animation-range: entry 10% cover 34%;
    }

    .phone {
      animation-name: von-rechts;
      animation-range: entry 15% cover 36%;
    }

    /* Karten und Tiere einer Reihe kommen leicht nacheinander. */
    .feature:nth-child(2),
    .band .features > div:nth-child(2),
    .animals li:nth-child(2) {
      animation-range: entry 6% cover 33%;
    }

    .feature:nth-child(3),
    .band .features > div:nth-child(3),
    .animals li:nth-child(3) {
      animation-range: entry 12% cover 36%;
    }

    .feature:nth-child(4),
    .band .features > div:nth-child(4),
    .animals li:nth-child(4) {
      animation-range: entry 18% cover 39%;
    }
  }

  /* View Transitions: Die Bewegung (Lage und Größe) steckt in der Gruppe, alt und neu blenden nur
     über. Eigene Transforms auf alt oder neu würden den Morph zu einer Überblendung machen. */
  ::view-transition-group(lightbox-shot) {
    animation-duration: 460ms;
    animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
  }

  ::view-transition-old(lightbox-shot),
  ::view-transition-new(lightbox-shot) {
    animation-duration: 460ms;
    animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
    height: 100%;
    object-fit: cover;
    object-position: top;
  }
}

/* ---------- Lightbox ----------
   Ein Klick auf ein Gerät oder einen Druckbogen öffnet das Bild groß. Das Gerät wächst dabei per
   View Transition an seinen neuen Platz; die Scroll-Position im Bild reist mit. */
.device,
.shot img {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mat-sys-on-surface);
}

.lightbox[open] {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
}

.lightbox::backdrop {
  background: transparent;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--mat-sys-inverse-surface) 72%, transparent);
  backdrop-filter: blur(6px);
  view-transition-name: lightbox-backdrop;
}

.lightbox-frame {
  position: relative;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  border: 10px solid var(--mat-sys-inverse-surface);
  border-radius: 18px;
  background: var(--mat-sys-surface);
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.55);
  cursor: auto;
}

.lightbox-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.lightbox-caption {
  position: relative;
  max-width: min(92vw, 70ch);
  margin: 0;
  padding-inline: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
  color: var(--mat-sys-inverse-on-surface);
}

.lightbox-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--mat-sys-surface);
  color: var(--mat-sys-on-surface);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:focus-visible {
  outline: 3px solid var(--mat-sys-primary);
  outline-offset: 3px;
}

html:has(.lightbox[open]) {
  overflow: hidden;
}

/* ---------- Zur App ---------- */
.app-cta {
  padding-block: clamp(40px, 6vw, 72px);
}

.app-cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
}

.app-cta h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.4rem);
}

.app-cta .text {
  margin: 0;
}

.app-cta .btn span {
  margin-left: 0.4em;
}

.chat-replay[hidden] {
  display: none;
}

/* ---------- Rechtstexte (Impressum, Datenschutz) ---------- */
/* Die Spalte steht bündig unter dem Logo, die Zeilen bleiben lesbar schmal. */
.legal {
  padding-block: clamp(24px, 5vw, 56px) clamp(48px, 8vw, 96px);
  line-height: 1.65;
}

.legal > * {
  max-width: 720px;
}

.legal h1 {
  margin-bottom: 8px;
  font-size: clamp(2.2rem, 4vw, 3rem);
}

.legal h2 {
  margin: 1.5em 0 0.3em;
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
}

.legal h3 {
  margin: 1.4em 0 0.2em;
  font-size: 1.35rem;
}

.legal p,
.legal ul {
  margin: 0.5em 0;
}

.legal ul {
  padding-left: 1.2em;
}

.legal li + li {
  margin-top: 0.5em;
}

.legal address {
  font-style: normal;
}

.legal a {
  color: var(--brand-primary-strong);
}

/* .note ist im Theme der App eine Kit-Klasse mit pre-line; im Fließtext gilt normaler Umbruch. */
.legal .note {
  white-space: normal;
  color: var(--mat-sys-on-surface-variant);
}
