:root {
  --bg: #fff;
  --text: #4d4d4d;
  --muted: #8a8a90;
  --line: #e2e2e6;
  --accent: #4d4d4d;
  --gutter: 16px;
  --hint-h: 56px;
  --hint-gap: clamp(16px, 3vh, 32px); /* Abstand Karte – „Read our message“ */
  /* Verfügbare Fläche für die Karte (Viewport minus Rand und „Read our message“) */
  --avail-w: calc(100vw - 2 * var(--gutter));
  --avail-h: calc(100svh - 2 * var(--gutter) - var(--hint-h) - var(--hint-gap));
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html,
body {
  margin: 0;
  height: 100%;
}

body {
  /* pure-snow.js misst die Body-Höhe – Body bleibt genau ein Viewport hoch,
     gescrollt wird im .scroller (verhindert Schnee-Neuaufbau beim Scrollen auf Mobile) */
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.scroller {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

/* ---------- Kartenvorderseite ---------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto var(--hint-h);
  align-content: center;
  justify-items: center;
  row-gap: var(--hint-gap);
  padding: var(--gutter) var(--gutter) 0;
}

.card {
  position: relative;
  z-index: 1;
  margin: 0;
  /* Desktop/Tablet: fester Ausschnitt (Schriftzug waagerecht mittig, nichts angeschnitten) */
  width: min(var(--avail-w), 2100px, var(--avail-h) * 2100 / 1126);
  aspect-ratio: 2100 / 1126;
  background: var(--bg);
  animation: card-in 1.2s cubic-bezier(.2, .7, .2, 1) both;
}

.card picture {
  display: block;
  height: 100%;
}

.card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  transform: scale(var(--card-zoom, 1)); /* Zoom um die Bildmitte = Schriftzug */
}

/* Smartphone (Hochformat): eigenes Bild (weiter oben/unten, Schriftzug exakt mittig),
   Karte randlos über die volle Breite und höher, leicht hineingezoomt */
@media (max-width: 600px) and (orientation: portrait) {
  .hero {
    padding-inline: 0;
  }

  .card {
    width: 100vw;
    height: min(var(--avail-h), 100vw / 1.08);
    aspect-ratio: auto;
    overflow: hidden;
    /* Hineinzoomen: Lenkrolle links wird leicht angeschnitten, rechts ist durch den
       weißen Rand neben dem Stellfuß noch Luft */
    --card-zoom: 1.15;
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.985);
  }
}

.scroll-hint {
  position: relative;
  z-index: 3;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  animation: card-in 1.2s .6s cubic-bezier(.2, .7, .2, 1) both;
}

.scroll-hint svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: nudge 2.4s ease-in-out infinite;
}

.scroll-hint:hover,
.scroll-hint:focus-visible {
  color: var(--text);
}

@keyframes nudge {
  50% { transform: translateY(4px); }
}

/* ---------- Grußbotschaft ---------- */

.message {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(48px, 10vh, 112px) var(--gutter) clamp(64px, 12vh, 128px);
  text-align: center;
}

.lang-switch {
  position: relative;
  z-index: 3;
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}

.lang-switch button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 8px 20px;
  background: transparent;
  color: var(--muted);
  font: 500 14px/1 var(--sans);
  letter-spacing: .02em;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

.lang-switch button:focus-visible,
.print-btn:focus-visible,
.scroll-hint:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.message__logo {
  display: block;
  width: clamp(180px, 30vw, 240px);
  height: auto;
  margin: clamp(32px, 6vh, 56px) auto 0;
}

.message__title {
  margin: clamp(20px, 3vh, 28px) 0 24px;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.05;
}

.message__text {
  font-size: clamp(18px, 2.1vw, 22px);
  font-weight: 300;
  line-height: 1.6;
  text-wrap: pretty;
}

.message__text p {
  margin: 0 0 1em;
}

.message__text p:last-child {
  margin-bottom: 0;
}

/* Unterschriften */

.signatures {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px clamp(24px, 6vw, 64px);
  margin: clamp(40px, 7vh, 64px) 0 0;
  padding: 0;
}

.signatures li {
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* Namenslinien bündig, auch bei unterschiedlich hohen Signaturen */
  align-items: center;
  min-width: 160px;
}

.signatures__img {
  display: block;
  width: auto;
  height: clamp(44px, 5.6vw, 56px);
}

/* Breite Signatur (Trevor Kropf) etwas kleiner, damit sie optisch nicht heraussticht */
.signatures__img--wide {
  height: clamp(36px, 4.6vw, 46px);
}

/* Hoch- bzw. quadratformatige Signaturen (Mark, Carlos) brauchen mehr Höhe für vergleichbare Wirkung */
.signatures__img--tall {
  height: clamp(64px, 8vw, 84px);
}

.signatures__name {
  margin-top: 6px;
  padding-top: 8px;
  min-width: 100%;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.print-btn {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: clamp(48px, 8vh, 72px);
  padding: 12px 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1 var(--sans);
  cursor: pointer;
  transition: border-color .2s;
}

.print-btn:hover {
  border-color: var(--muted);
}

.print-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

/* ---------- Schnee (pure-snow.js) ---------- */

#snow {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

/* pure-snow.js setzt pro Flocke transform (Position + Skalierung),
   opacity und die Fall-Animation. Optik + Drehung liegen im ::before. */
.snowflake {
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  will-change: transform;
  --flake: url("../img/flakes/flake-1.svg");
  --spin: 14s;
}

.snowflake::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--flake) center / contain no-repeat;
  filter: drop-shadow(0 1px 1px rgba(80, 80, 90, .18));
  animation: flake-spin var(--spin) linear infinite;
}

.snowflake:nth-child(4n + 2) { --flake: url("../img/flakes/flake-2.svg"); }
.snowflake:nth-child(4n + 3) { --flake: url("../img/flakes/flake-3.svg"); }
.snowflake:nth-child(4n)     { --flake: url("../img/flakes/flake-4.svg"); }

.snowflake:nth-child(3n)     { --spin: 22s; }
.snowflake:nth-child(5n)     { --spin: 9s; }
.snowflake:nth-child(odd)::before { animation-direction: reverse; }

@keyframes flake-spin {
  to { transform: rotate(360deg); }
}

/* ---------- Barrierefreiheit ---------- */

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

@media (prefers-reduced-motion: reduce) {
  /* Schnee nicht ausblenden (Windows meldet „reduzierte Bewegung“ oft schon, wenn
     die Animationseffekte aus sind), sondern ruhig: halb so viele Flocken,
     deutlich langsamer und ohne Drehung */
  .snowflake:nth-child(2n) { display: none; }
  .snowflake:nth-child(3n)     { animation-duration: 60s !important; }
  .snowflake:nth-child(3n + 1) { animation-duration: 48s !important; }
  .snowflake:nth-child(3n + 2) { animation-duration: 54s !important; }
  .snowflake::before { animation: none; }
  .card,
  .scroll-hint,
  .scroll-hint svg { animation: none; }
  .scroller { scroll-behavior: auto; }
}

/* ---------- Druck: Seite 1 Karte, Seite 2 Nachricht in gewählter Sprache ---------- */

@media print {
  @page {
    size: A4 landscape;
    margin: 12mm;
  }

  html,
  body,
  .scroller {
    height: auto;
    overflow: visible;
  }

  #snow,
  .scroll-hint,
  .lang-switch,
  .print-btn {
    display: none !important;
  }

  .hero {
    display: block;
    min-height: 0;
    padding: 0;
    break-after: page;
  }

  .card {
    width: 273mm;
    height: auto;
    margin: 0 auto;
    animation: none;
  }

  .message {
    max-width: 200mm;
    padding: 16mm 0 0;
    break-inside: avoid;
  }

  .message__logo {
    width: 55mm;
    margin-top: 0;
  }

  .message__title {
    margin-top: 6mm;
    font-size: 30pt;
  }

  .message__text {
    font-size: 14pt;
  }

  .signatures__img {
    height: 14mm;
  }

  .signatures__img--wide {
    height: 11.5mm;
  }

  .signatures__img--tall {
    height: 21mm;
  }
}
