/* Flieder und Pflaume. Ein Buch für Lea, das sich beim Öffnen aufklappt. */

@font-face { font-family: "Bricolage"; src: url("fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Ballet"; src: url("fonts/ballet-400.woff2") format("woff2"); font-display: swap; }

:root {
  --grund: #E7DFF6;
  --hell: #F4EFFC;
  --papier: #FBF9FE;
  --ink: #3A1D4D;
  --ink-tief: #2A1338;
  --leise: #5E4870;
  --zart: #D3C5F1;
  --ziffer: #B9A3E8;
  --linie: rgba(58, 29, 77, .16);
  --fehler: #B3263E;

  --text: "Bricolage", system-ui, sans-serif;
  --hand: "Ballet", cursive;
  --rand: clamp(1.25rem, 6vw, 2.5rem);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: 112.5%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (min-width: 60rem) { html { font-size: 118.75%; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
html.intro-laeuft { overflow: hidden; }

body {
  margin: 0;
  font-family: var(--text);
  line-height: 1.55;
  color: var(--ink);
  background: var(--grund);
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.025em; line-height: 1.05; }
p { margin: 0 0 .75em; }
a { color: var(--ink); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 3px; }

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

/* Knöpfe */

.knopf, .knopf-rand {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.2rem;
  padding: .85rem 1.9rem;
  font: inherit; font-weight: 700;
  border-radius: 99px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, color .15s, transform .15s;
}
.knopf { color: var(--hell); background: var(--ink); border: 0; }
.knopf:hover { color: var(--hell); background: var(--ink-tief); }
.knopf:active { transform: scale(.98); }
.knopf-rand { color: var(--ink); background: transparent; border: 2px solid currentColor; }
.knopf-rand:hover { background: rgba(58, 29, 77, .06); }
.knopf:disabled { opacity: .55; cursor: progress; }
.knopf-breit { width: 100%; }

/* Intro: das Buch geht auf */

.intro { display: none; }
.mit-js .intro {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  background: var(--grund);
}
.mit-js.ohne-intro .intro { display: none; }

.buch { --sw: clamp(9rem, 40vw, 14rem); position: relative; width: calc(var(--sw) * 2); height: calc(var(--sw) * 1.36); perspective: 2200px; }
.buch::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -9%; height: 12%; border-radius: 50%; background: radial-gradient(closest-side, rgba(58, 29, 77, .28), transparent); z-index: -1; }
.buch-innen { position: absolute; inset: 0; transform: translateX(-25%); }
.blatt, .seitenblock { position: absolute; left: 50%; top: 0; width: 50%; height: 100%; }
.seitenblock { background: var(--papier) linear-gradient(to right, rgba(58, 29, 77, .12), transparent 14%); border-radius: 0 .4rem .4rem 0; box-shadow: 1px 1px 0 #efe9fa, 2px 2px 0 #e3d9f6, 3px 3px 0 #efe9fa, 4px 4px 0 #ddd2f2, 0 10px 24px -8px rgba(58, 29, 77, .35); }
.blatt { transform-origin: 0 50%; transform-style: preserve-3d; }
.blatt > div { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.blatt > .vorne { border-radius: 0 .4rem .4rem 0; background: var(--papier) linear-gradient(to right, rgba(58, 29, 77, .12), transparent 14%); }
.blatt > .hinten { transform: rotateY(180deg); border-radius: .4rem 0 0 .4rem; background: var(--papier) linear-gradient(to left, rgba(58, 29, 77, .12), transparent 14%); }

.deckel > .vorne { display: grid; place-items: center; align-content: center; gap: .4rem; background: var(--ink); color: var(--zart); box-shadow: inset 0 0 0 .45rem var(--ink), inset 0 0 0 .55rem rgba(211, 197, 241, .35); }
.deckel > .vorne::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8%; background: linear-gradient(to right, rgba(0, 0, 0, .35), transparent); }
.deckel-lea { width: 66%; height: auto; fill: var(--zart); }
.deckel-30 { font-size: calc(var(--sw) * .22); font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.deckel > .hinten { display: grid; place-items: center; background: var(--zart); }
.deckel > .hinten span { font-family: var(--hand); font-size: calc(var(--sw) * .17); color: var(--ink); }

.mini-foto { position: absolute; left: 18%; top: 20%; width: 64%; aspect-ratio: 2 / 3; background: linear-gradient(150deg, #C9B6EE, #9F86D6); transform: rotate(2deg); box-shadow: 0 2px 6px rgba(58, 29, 77, .25); }
.mini-foto.quer { top: 28%; left: 15%; width: 70%; aspect-ratio: 3 / 2; transform: rotate(-2deg); background: linear-gradient(150deg, #E6B7C9, #B58BC7); }
.mini-brief { position: absolute; inset: 16% 14%; display: grid; align-content: start; gap: 9%; }
.mini-brief svg { width: 100%; height: auto; stroke: rgba(58, 29, 77, .5); stroke-width: 1.6; fill: none; stroke-linecap: round; }
.mini-brief svg:nth-child(3n) { width: 78%; }
.mini-brief svg:last-child { width: 40%; justify-self: end; }

/* Konfetti fliegt über allem */
.konfetti { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.konfetti i { position: absolute; left: 0; top: 0; display: block; will-change: transform; }

/* Kopf */

.kopf { position: relative; padding: clamp(3.5rem, 13vw, 6rem) var(--rand) clamp(3.5rem, 11vw, 5.5rem); text-align: center; }
.ecke { position: absolute; width: min(9vw, 3.5rem); aspect-ratio: 1; border: 0 solid var(--linie); }
.ecke-ol { left: 4vw; top: 4vw; border-width: 1.5px 0 0 1.5px; }
.ecke-or { right: 4vw; top: 4vw; border-width: 1.5px 1.5px 0 0; }
.ecke-ul { left: 4vw; bottom: 4vw; border-width: 0 0 1.5px 1.5px; }
.ecke-ur { right: 4vw; bottom: 4vw; border-width: 0 1.5px 1.5px 0; }

.titel { font-size: inherit; }
.lea { display: block; width: min(74vw, 28rem); height: auto; margin: 0 auto; overflow: visible; color: var(--ink); }
.lea-tinte { fill: currentColor; }
.lea-kontur { fill: none; stroke: currentColor; stroke-width: 1px; vector-effect: non-scaling-stroke; opacity: 0; }
.mit-js .lea { visibility: hidden; }
.mit-js .lea.bereit, .mit-js.ohne-intro .lea { visibility: visible; }

.wird { display: block; overflow: hidden; margin-top: -.5vw; padding-bottom: .06em; font-size: clamp(2.8rem, 15vw, 6.5rem); font-weight: 800; letter-spacing: -.045em; line-height: .95; }
.wird > span { display: inline-block; }
.einleitung { max-width: 31rem; margin: 2rem auto 0; font-size: 1.125rem; line-height: 1.6; color: var(--leise); }
.einleitung p { margin: 0 0 1em; }
.gruss { margin: 1.5rem 0 0 !important; color: var(--leise); }
.unterschrift { display: block; margin-top: .35rem; font-family: var(--hand); font-size: 2.8rem; line-height: 1.1; color: var(--ink); }

.abgabe { display: grid; justify-items: center; gap: 1.1rem; margin-top: 3rem; }
.kalender { position: relative; width: min(72vw, 16rem); aspect-ratio: 4 / 4.5; }
.kblatt { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; background: var(--papier); border-radius: .7rem; box-shadow: 0 1px 0 rgba(58, 29, 77, .08), 0 20px 34px -20px rgba(58, 29, 77, .6); overflow: hidden; transform-origin: 50% 0; }
.kblatt-kopf { position: relative; padding: .8rem 1rem .9rem; background: var(--ink); color: var(--zart); font-weight: 700; }
.kblatt-kopf::before, .kblatt-kopf::after { content: ""; position: absolute; top: .38rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--grund); }
.kblatt-kopf::before { left: 1.4rem; }
.kblatt-kopf::after { right: 1.4rem; }
.kblatt-zahl { display: grid; place-items: center; font-size: clamp(5rem, 30vw, 8.5rem); font-weight: 800; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.kblatt-zahl.wort { font-size: clamp(3rem, 16vw, 4.5rem); }
.kblatt-fuss { padding: 0 1rem 1.1rem; color: var(--leise); font-size: .95rem; }
.kblatt-fuss b { display: block; color: var(--ink); font-size: 1.1rem; }
.uhr { margin: 0; color: var(--leise); font-variant-numeric: tabular-nums; }
.uhr b { color: var(--ink); font-weight: 700; }
.ziffer { display: inline-block; position: relative; overflow: hidden; vertical-align: top; }
.ziffer > span { display: block; }
.ziffer > span + span { position: absolute; left: 0; top: 0; width: 100%; }

.abschnitt-titel { font-size: clamp(2rem, 8.5vw, 3rem); }

/* Anleitung: eine Linie führt durch die drei Schritte */

.anleitung { max-width: 38rem; margin: 0 auto; padding: 1.5rem var(--rand) 5rem; }
.anleitung .abschnitt-titel { margin-bottom: 2.25rem; text-align: center; }
.schritte-rahmen { position: relative; }
.schritte-linie { position: absolute; left: calc(1.55rem - 1px); top: 1.55rem; bottom: 2.5rem; width: 2px; background: var(--zart); }
.schritte-linie span { display: block; height: 100%; background: var(--ink); transform-origin: 50% 0; }
.schritte { position: relative; list-style: none; margin: 0; padding: 0; display: grid; gap: 2.25rem; }
.schritte li { display: grid; grid-template-columns: 3.1rem 1fr; gap: .9rem; }
.schritt-nr {
  display: grid; place-items: center;
  width: 3.1rem; height: 3.1rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--hell);
  font-size: 1.35rem; font-weight: 800;
}
.schritte h3 { font-size: 1.25rem; margin: .55rem 0 .4rem; letter-spacing: -.015em; }
.schritte p { color: var(--leise); }
.schritte p:last-child { margin-bottom: 0; }

/* Einsenden: die Albumseite */

.einsenden { background: var(--hell); padding: 4.5rem var(--rand) 5rem; }
.einsenden-rahmen { max-width: 58rem; margin: 0 auto; }
.einsenden-intro { max-width: 32rem; margin-bottom: 2.25rem; }
.einsenden-intro .abschnitt-titel { margin-bottom: .7rem; }
.einsenden-intro p { color: var(--leise); }

.formular { display: grid; gap: 2rem; }
@media (min-width: 52rem) {
  .formular { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
  .album { position: sticky; top: 1.5rem; }
}

.album {
  position: relative;
  aspect-ratio: 1;
  background: var(--ink);
  border-radius: .35rem;
  box-shadow: 0 1px 2px rgba(58, 29, 77, .3), 0 18px 38px -14px rgba(58, 29, 77, .55);
  container-type: inline-size;
}
.fach { position: absolute; }
.fach-brief { left: 6%; top: 13%; width: 49.3%; aspect-ratio: 148 / 210; }
.fach-foto { left: 61.5%; top: 21%; width: 33.3%; aspect-ratio: 100 / 150; }

.fach-flaeche {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  color: var(--zart);
  border: 1.5px dashed rgba(211, 197, 241, .5);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.fach-flaeche:hover, .fach.ziehen .fach-flaeche { border-color: var(--zart); background: rgba(211, 197, 241, .08); }
.fach-eingabe:focus-visible + .fach-flaeche { outline: 3px solid var(--zart); outline-offset: 3px; }

.fach-leer { display: grid; gap: .2rem; padding: .5rem; }
.fach-titel { font-weight: 700; font-size: clamp(.8rem, 4cqi, 1rem); line-height: 1.2; }
.fach-info { font-size: clamp(.7rem, 3.2cqi, .85rem); opacity: .75; line-height: 1.25; }
.fach-laedt { font-size: .85rem; }

.fach-bild {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 1px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .25), 0 6px 14px -4px rgba(0, 0, 0, .5);
}
.fach-brief .fach-bild { object-fit: contain; background: #fff; }
.fach.gefuellt .fach-flaeche { border-color: transparent; }
.fach.gefuellt .fach-leer { visibility: hidden; }
.fach-brief.gefuellt .fach-bild { transform: rotate(-1.2deg); }
.fach-foto.gefuellt .fach-bild { transform: rotate(1.8deg); }

.fach-foto.gefuellt .fach-flaeche::before,
.fach-foto.gefuellt .fach-flaeche::after {
  content: ""; position: absolute; z-index: 1;
  width: 16%; aspect-ratio: 1;
  background: linear-gradient(to bottom right, rgba(26, 10, 36, .92) 50%, transparent 50%);
  transform: rotate(1.8deg);
}
.fach-foto.gefuellt .fach-flaeche::before { left: -3%; top: -2%; }
.fach-foto.gefuellt .fach-flaeche::after { right: -3%; bottom: -2%; transform: rotate(181.8deg); }

.album-bildunterschrift {
  position: absolute; left: 0; right: 0; top: calc(100% + 6%);
  margin: 0;
  color: var(--zart);
  font-size: clamp(.7rem, 3.4cqi, .95rem);
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}

/* Felder */

.felder { display: grid; gap: 1.25rem; }
.feld { display: grid; gap: .3rem; }
.feld label { font-weight: 700; }
.freiwillig { font-weight: 400; color: var(--leise); }
.feld input[type="text"] {
  width: 100%;
  min-height: 3.1rem;
  padding: .55rem .95rem;
  font: inherit;
  color: var(--ink);
  background: var(--papier);
  border: 1.5px solid rgba(58, 29, 77, .22);
  border-radius: .8rem;
}
.feld input[type="text"]::placeholder { color: #9A88AA; }
.feld input[type="text"]:focus-visible { outline-offset: 1px; border-color: var(--ink); }
.feld input[aria-invalid="true"] { border-color: var(--fehler); }
.feld-info { margin: 0; font-size: .875rem; color: var(--leise); }

.honigtopf { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.meldungen { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.meldungen:empty { display: none; }
.meldung { padding: .65rem .9rem; font-size: .9375rem; line-height: 1.4; background: var(--papier); border-left: 3px solid var(--ziffer); border-radius: 0 .5rem .5rem 0; }
.meldung-fehler { border-left-color: var(--fehler); color: var(--fehler); }

.fortschritt { display: grid; gap: .4rem; }
.fortschritt-balken { height: .45rem; background: var(--zart); border-radius: 1rem; overflow: hidden; }
.fortschritt-balken span { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s; }
.fortschritt-text { margin: 0; font-size: .9375rem; color: var(--leise); font-variant-numeric: tabular-nums; }

.danke { align-self: center; max-width: 30rem; }
.danke:focus { outline: none; }
.danke-haken { width: 3.5rem; height: auto; margin-bottom: .75rem; fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.danke h3 { font-size: 1.9rem; margin-bottom: .5rem; }
.danke p { color: var(--leise); }
.danke .knopf-rand { margin-top: .75rem; }

.geschlossen-hinweis { font-size: 1.125rem; max-width: 32rem; }

/* Psst */

.psst { padding: clamp(4rem, 16vw, 7rem) var(--rand); background: var(--ink); color: var(--hell); text-align: center; }
.psst h2 { max-width: 14ch; margin: 0 auto .9rem; font-size: clamp(2.4rem, 12vw, 4.5rem); letter-spacing: -.04em; line-height: 1; }
.psst p { max-width: 30rem; margin: 0 auto; font-size: 1.125rem; color: var(--zart); }
