/* Kinder-Cash – Startseite
   Schriften liegen lokal in /fonts (SIL Open Font License). */

@font-face {
  font-family: "KC Fredoka";
  src: url("../fonts/fredoka-latin-wght.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "KC Hand";
  src: url("../fonts/patrick-hand-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --tinte: #1c2e3a;
  --tinte-weich: #47596a;
  --papier: #ffffff;
  --himmel: #a9f3fb;
  --himmel-hell: #e3fbfe;
  --rot: #c4211f;
  --rot-tief: #8f1514;
  --pink: #f75bc9;
  --ausgeben: #c9b6ee;
  --sparen: #9edba6;
  --investieren: #f8d56e;
  --gutetat: #f7ab7c;
  --muenze: #f2b632;

  --schrift: "KC Fredoka", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --hand: "KC Hand", "Comic Sans MS", "Segoe Print", cursive;

  --rand: clamp(1rem, 4vw, 2.5rem);
  --abstand: clamp(3.5rem, 9vw, 7rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--tinte);
  background: var(--papier);
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
p,
ul,
figure,
address {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

address {
  font-style: normal;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--tinte);
  outline-offset: 3px;
  border-radius: 6px;
}

.rahmen {
  width: 100%;
  max-width: 73.75rem;
  margin-inline: auto;
  padding-inline: max(var(--rand), env(safe-area-inset-left)) max(var(--rand), env(safe-area-inset-right));
}

.nur-vorlesen {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--tinte);
  color: #fff;
  border-radius: 0.5rem;
}

.skip:focus {
  top: 1rem;
}

/* Knopf */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.7rem 1.75rem;
  font-family: var(--schrift);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  text-decoration: none;
  background: var(--rot);
  border-radius: 999px;
  box-shadow: 0 5px 0 var(--rot-tief);
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, background-color 0.12s ease-out;
  touch-action: manipulation;
}

.knopf:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--rot-tief);
}

.knopf--klein {
  min-height: 2.75rem;
  padding: 0.45rem 1.35rem;
  font-size: 1.0625rem;
  box-shadow: 0 4px 0 var(--rot-tief);
}

@media (hover: hover) {
  .knopf:hover {
    background: #d62a27;
  }
}

/* Notizen in Handschrift, wie auf dem Produktbild */

.notiz {
  font-family: var(--hand);
  font-weight: 400;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.125rem);
  line-height: 1.15;
  color: var(--tinte);
}

/* Kopf */

.kopf {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #dfe9ee;
  padding-top: env(safe-area-inset-top);
}

.kopf__innen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
}

.kopf__logo {
  flex: none;
  display: block;
}

.kopf__logo img {
  width: auto;
  height: 3.5rem;
}

.kopf__nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.25rem);
}

.kopf__nav a:not(.knopf) {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 500;
  text-decoration: none;
  text-underline-offset: 0.3em;
  text-decoration-thickness: 2px;
}

@media (hover: hover) {
  .kopf__nav a:not(.knopf):hover {
    text-decoration: underline;
    text-decoration-color: var(--rot);
  }
}

.kopf__schalter {
  display: none;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  color: var(--tinte);
  background: var(--himmel-hell);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
}

.kopf__schalter-striche,
.kopf__schalter-striche::before,
.kopf__schalter-striche::after {
  display: block;
  width: 1.25rem;
  height: 2.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.18s ease-out, background-color 0.18s ease-out;
}

.kopf__schalter-striche {
  position: relative;
}

.kopf__schalter-striche::before,
.kopf__schalter-striche::after {
  content: "";
  position: absolute;
  left: 0;
}

.kopf__schalter-striche::before {
  top: -7px;
}

.kopf__schalter-striche::after {
  top: 7px;
}

.kopf__schalter[aria-expanded="true"] .kopf__schalter-striche {
  background: transparent;
}

.kopf__schalter[aria-expanded="true"] .kopf__schalter-striche::before {
  transform: translateY(7px) rotate(45deg);
}

.kopf__schalter[aria-expanded="true"] .kopf__schalter-striche::after {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 47.99rem) {
  .kopf__schalter {
    display: inline-flex;
  }

  .kopf__nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--rand) 1.5rem;
    background: #fff;
    border-bottom: 1px solid #dfe9ee;
    box-shadow: 0 18px 30px -18px rgba(28, 46, 58, 0.35);
  }

  .kopf__nav.ist-offen {
    display: flex;
  }

  .kopf__nav a:not(.knopf) {
    min-height: 3.25rem;
    font-size: 1.25rem;
    border-bottom: 1px solid #e8eff3;
  }

  .kopf__nav .knopf {
    margin-top: 1.25rem;
  }
}

/* Bühne */

.buehne {
  background:
    radial-gradient(ellipse 70% 80% at 62% 45%, #fff 0 38%, rgba(255, 255, 255, 0) 100%),
    linear-gradient(100deg, var(--himmel) 0%, var(--himmel-hell) 45%, var(--himmel) 100%);
  padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(3rem, 8vw, 6rem);
}

.buehne__raster {
  display: grid;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  align-items: center;
}

.buehne h1 {
  font-size: clamp(2.5rem, 1.35rem + 5.2vw, 5rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.buehne__zeile {
  margin-block: 1.25rem 1.75rem;
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.625rem);
  color: var(--tinte-weich);
}

.buehne__bild {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
}

.buehne__bild a {
  display: block;
  width: 100%;
  max-width: 35rem;
}

.buehne__bild img {
  width: 100%;
}

.notiz--schwein {
  position: relative;
  padding-left: 3.25rem;
  margin-bottom: -0.5rem;
  text-align: center;
}

.notiz__pfeil {
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 2.5rem;
  height: 3.75rem;
  fill: none;
  stroke: #4e9aa6;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 56rem) {
  .buehne__raster {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  }
}

@media (max-width: 55.99rem) {
  .buehne__text {
    text-align: center;
  }
}

/* Was dabei ist */

.dabei {
  padding-block: var(--abstand);
  scroll-margin-top: 4.5rem;
}

.dabei__raster {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
}

.dabei__stueck {
  display: grid;
  gap: 1.25rem;
  align-content: start;
}

.dabei__stueck img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  padding: clamp(0.75rem, 3vw, 1.75rem);
  background: var(--himmel-hell);
  border-radius: 2.25rem;
}

.dabei__stueck p {
  margin-top: 0.35rem;
  max-width: 34ch;
  color: var(--tinte-weich);
}

@media (min-width: 44rem) {
  .dabei__raster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dabei__stueck:nth-child(2) {
    margin-top: 4rem;
  }
}

/* Vier Abteile */

.abteile {
  padding-block: var(--abstand);
  color: #fff;
  background: var(--tinte);
  scroll-margin-top: 4.5rem;
}

.abteile :focus-visible {
  outline-color: #fff;
}

.abteile h2,
.downloads h2 {
  font-size: clamp(2rem, 1.4rem + 2.8vw, 3.25rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.abteile__hinweis {
  margin-top: 0.75rem;
  font-family: var(--hand);
  font-size: clamp(1.4rem, 1.2rem + 0.9vw, 1.75rem);
  line-height: 1.2;
  color: var(--himmel);
}

.abteile__reihe {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.625rem, 2vw, 1.25rem);
  margin-top: clamp(4.5rem, 9vw, 6rem);
}

.abteil {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: clamp(15rem, 34vw, 22rem);
  padding: 1.5rem clamp(0.75rem, 2vw, 1.5rem) 1.5rem;
  font: inherit;
  color: var(--tinte);
  text-align: center;
  background: var(--farbe);
  border: 0;
  border-radius: 50% 50% 1.75rem 1.75rem / 5.5rem 5.5rem 1.75rem 1.75rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.12s ease-out;
}

.abteil:active {
  transform: translateY(3px);
}

.abteil--ausgeben {
  --farbe: var(--ausgeben);
}

.abteil--sparen {
  --farbe: var(--sparen);
}

.abteil--investieren {
  --farbe: var(--investieren);
}

.abteil--gutetat {
  --farbe: var(--gutetat);
}

.abteil__schlitz {
  position: relative;
  z-index: 2;
  flex: none;
  width: min(4.25rem, 55%);
  height: 0.75rem;
  background: var(--tinte);
  border-radius: 999px;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.35);
}

.abteil__name {
  margin-top: auto;
  padding-top: 2rem;
  font-size: clamp(1.3rem, 1rem + 1.5vw, 2rem);
  font-weight: 600;
  line-height: 1.1;
}

.abteil__text {
  margin-top: 0.5rem;
  max-width: 20ch;
  font-size: 1rem;
  line-height: 1.35;
}

.abteil__stand {
  margin-top: 1rem;
  padding: 0.2rem 0.8rem;
  font-size: 0.9375rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 999px;
}

.muenze {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  margin-left: -1.25rem;
  background: var(--muenze);
  border: 3px solid #c98a12;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.45);
  pointer-events: none;
  animation: muenze-faellt 0.55s cubic-bezier(0.5, 0, 0.9, 0.55) forwards;
}

@keyframes muenze-faellt {
  0% {
    transform: translateY(-4.5rem) rotate(-25deg);
    opacity: 0;
  }

  15% {
    opacity: 1;
  }

  72% {
    transform: translateY(-0.2rem) rotate(0deg) scaleY(1);
    opacity: 1;
  }

  100% {
    transform: translateY(0.9rem) scaleY(0.1);
    opacity: 0;
  }
}

@media (min-width: 52rem) {
  .abteile__reihe {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 22rem) {
  .abteil__text {
    font-size: 0.9375rem;
  }
}

/* Downloads */

.downloads {
  padding-block: var(--abstand);
  color: #fff;
  background: var(--rot);
  scroll-margin-top: 4.5rem;
}

.downloads :focus-visible {
  outline-color: #fff;
}

.downloads__raster {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
}

.downloads__kopf p {
  margin-top: 1rem;
  max-width: 30ch;
  font-size: 1.1875rem;
}

.downloads__liste {
  border-top: 2px solid rgba(255, 255, 255, 0.55);
}

.downloads__liste a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  padding-block: 0.9rem;
  font-size: clamp(1.1875rem, 1.05rem + 0.7vw, 1.5rem);
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.55);
}

/* Schloss: Die Downloads sind mit Code geschützt */
.downloads__liste a::after {
  content: "";
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-1V7a5 5 0 0 0-5-5zm-3 8V7a3 3 0 0 1 6 0v3z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-1V7a5 5 0 0 0-5-5zm-3 8V7a3 3 0 0 1 6 0v3z'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (hover: hover) {
  .downloads__liste a:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.25em;
  }
}

@media (min-width: 52rem) {
  .downloads__raster {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    align-items: start;
  }
}

/* Fuss */

.fuss {
  padding-block: clamp(3rem, 7vw, 5rem) max(1.5rem, env(safe-area-inset-bottom));
  color: #dbe6ec;
  background: var(--tinte);
  scroll-margin-top: 4.5rem;
}

.fuss :focus-visible {
  outline-color: #fff;
}

.fuss__raster {
  display: grid;
  gap: 2.5rem;
}

.fuss h2 {
  margin-bottom: 0.75rem;
  font-size: 1.375rem;
  font-weight: 600;
  color: #fff;
}

.fuss a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-underline-offset: 0.25em;
}

.fuss__mail {
  font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.625rem);
  font-weight: 500;
  color: #fff;
}

.fuss__ende {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  font-size: 1rem;
}

.fuss__zeile {
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

@media (min-width: 44rem) {
  .fuss__raster {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

/* Weniger Bewegung */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
