/* OneHope Group – Ansichtskarte */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;

  --card: #f4f6f8;
  --card-edge: #dde2e8;
  --ink: #161616;
  --ink-soft: #4a4844;
  --ink-faint: #6f6b63;
  --rule: #1d1d1b;
  --stamp-red: #b0291e;
  --stamp-red-deep: #8e1f16;
  --postmark: #1e1e1e;
  --sky: #7f97b4;
  --lake: #3b4350;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1rem, 3vw, 3rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--lake);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}

::selection { background: var(--stamp-red); color: #fff; }

img, svg { display: block; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

a { color: var(--stamp-red); }

:focus-visible {
  outline: 2px solid var(--stamp-red);
  outline-offset: 3px;
  border-radius: 1px;
}

/* Szene: Foto als Untergrund */
.scene {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  isolation: isolate;
}

.scene-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
  z-index: -2;
}

/* leichte Abdunklung nur am unteren Rand, damit die Rechtszeile lesbar bleibt */
.scene::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 11rem;
  background: linear-gradient(to top, rgba(22, 26, 34, 0.78), rgba(22, 26, 34, 0.35) 55%, rgba(22, 26, 34, 0));
  z-index: -1;
  pointer-events: none;
}

/* Logo im Himmel */
.brand {
  position: absolute;
  top: clamp(1.25rem, 3vw, 2.5rem);
  left: var(--gutter);
  width: clamp(4.5rem, 7vw, 6.5rem);
}

.brand img { width: 100%; height: auto; }

/* Die Karte (Rückseite, A6-Proportion) */
.card {
  align-self: end;
  justify-self: end;
  margin: var(--gutter) var(--gutter) 0;
  width: min(50rem, 100% - 2 * var(--gutter));
  aspect-ratio: 148 / 105;
  padding: clamp(1.75rem, 3.2vw, 3rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(1.5rem, 3vw, 2.75rem);
  background: var(--card);
  border-radius: 3px;
  box-shadow:
    0 1px 0 var(--card-edge) inset,
    0 1px 2px rgba(20, 22, 28, 0.18),
    0 10px 24px -6px rgba(20, 22, 28, 0.28),
    0 34px 70px -24px rgba(20, 22, 28, 0.45);
  overflow: hidden;
  animation: card-settle 900ms var(--ease-out) both;
}

.card-message {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-message h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.25rem, 3.6vw, 3.25rem);
  line-height: 0.98;
  font-weight: 640;
  font-stretch: 118%;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-wrap: balance;
}

.card-message p {
  margin: 0;
  max-width: 30ch;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.card-message .signature {
  margin-top: auto;
  padding-top: 1.5rem;
  font-size: 0.9375rem;
  color: var(--ink);
}

/* senkrechte Mittellinie mit Bildunterschrift wie auf echten Karten */
.card-divider {
  position: relative;
  width: 1px;
  background: var(--rule);
}

.card-divider span {
  position: absolute;
  left: 0.5rem;
  bottom: 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.6875rem;
  line-height: 1.4;
  font-stretch: 100%;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* Adressseite */
.card-address {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.franking {
  position: relative;
  justify-self: end;
  width: clamp(5.25rem, 8vw, 6.5rem);
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

/* Briefmarke mit Zähnung */
.stamp {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  padding: 6px;
  background: #fff;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    radial-gradient(farthest-side, transparent 92%, #000) -4px -4px / 8px 8px round;
  mask:
    linear-gradient(#000 0 0) content-box,
    radial-gradient(farthest-side, transparent 92%, #000) -4px -4px / 8px 8px round;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}

/* Poststempel: OneHope-Kreislogo in Stempelfarbe */
.postmark {
  position: absolute;
  top: -14%;
  right: 52%;
  width: clamp(6.5rem, 10vw, 8.25rem);
  pointer-events: none;
  mix-blend-mode: multiply;
  animation: postmark-strike 520ms var(--ease-out) 450ms both;
}

.postmark-logo {
  position: relative;
  width: 100%;
  height: auto;
  opacity: 0.9;
  transform: rotate(-11deg);
}

.postmark-waves {
  position: absolute;
  top: 26%;
  left: 78%;
  width: 90%;
  height: auto;
  fill: none;
  stroke: var(--postmark);
  stroke-width: 2.2;
  opacity: 0.6;
}

.address-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  align-self: end;
  display: grid;
}

.address-lines li {
  display: flex;
  align-items: flex-end;
  min-height: clamp(2.5rem, 4.2vw, 3.25rem);
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
  font-size: clamp(1rem, 1.45vw, 1.1875rem);
  line-height: 1.3;
  font-weight: 450;
  font-stretch: 104%;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.address-lines li:first-child {
  font-weight: 650;
  font-stretch: 116%;
  letter-spacing: 0.01em;
}

.address-lines a {
  color: var(--stamp-red);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 300ms var(--ease-out), color 200ms;
}

.address-lines a:hover {
  color: var(--stamp-red-deep);
  background-size: 100% 1.5px;
}

/* Rechtliches auf dem Foto */
.legal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding: 1.5rem var(--gutter) 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.legal a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.45);
  text-underline-offset: 3px;
  transition: text-decoration-color 200ms;
}

.legal a:hover { text-decoration-color: #fff; }

.legal .credit { margin-left: auto; color: rgba(255, 255, 255, 0.92); }

/* Impressum & Datenschutz als Kartenblatt */
.sheet {
  width: min(38rem, 100% - 2rem);
  max-height: min(42rem, 100% - 2rem);
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 10px 24px -6px rgba(20, 22, 28, 0.35), 0 40px 80px -30px rgba(20, 22, 28, 0.6);
}

.sheet::backdrop { background: rgba(28, 32, 40, 0.55); }

.sheet[open] { animation: sheet-in 380ms var(--ease-out); }

.sheet-head {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.75rem 2rem 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--rule);
}

.sheet-head h2 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.1;
  font-weight: 640;
  font-stretch: 116%;
  letter-spacing: -0.02em;
}

.sheet-close {
  font-size: 0.875rem;
  color: var(--stamp-red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sheet-close:hover { color: var(--stamp-red-deep); }

.sheet-body {
  padding: 1.25rem 2rem 2rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.sheet-body p { margin: 0 0 0.75rem; max-width: 65ch; }

.sheet-body .strong,
.sheet-body strong { color: var(--ink); font-weight: 620; }

.sheet-body .strong { margin-top: 1.25rem; }
.sheet-body .strong:first-child { margin-top: 0; }

/* Tablet: Karte füllt mehr Breite */
@media (max-width: 1100px) {
  .card { justify-self: center; width: min(46rem, 100% - 2 * var(--gutter)); }
}

/* Mobil: Foto oben, Karte darunter hochkant */
@media (max-width: 720px) {
  body { background: var(--lake); }
  .legal { color: #fff; }

  .scene { grid-template-rows: auto auto; min-height: 0; }

  .scene-photo {
    position: relative;
    grid-row: 1;
    height: 46vh;
    height: 46svh;
    min-height: 16rem;
    object-position: 45% 50%;
    -webkit-mask-image: linear-gradient(#000 62%, transparent);
    mask-image: linear-gradient(#000 62%, transparent);
  }

  .brand { width: 4rem; top: 1rem; left: 1rem; }

  .scene::after { display: none; }

  .card {
    grid-row: 2;
    margin: -4.5rem 1rem 0;
    width: auto;
    justify-self: stretch;
    aspect-ratio: auto;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem 1.25rem 1.5rem;
    position: relative;
  }

  .card-address { grid-template-rows: auto; }

  .franking {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 4.5rem;
    margin: 0;
  }

  .postmark { width: 4.5rem; top: -12%; right: 50%; }
  .postmark-waves { display: none; }

  .card-message h1 { padding-right: 5.5rem; font-size: clamp(2rem, 9vw, 2.5rem); }

  .card-divider { width: auto; height: 1px; }
  .card-divider span { display: none; }

  .address-lines li { font-size: 1.0625rem; }

  .legal {
    gap: 0.5rem 1.25rem;
    padding: 1.5rem 1rem 2rem;
  }

  .legal .credit { margin-left: 0; width: 100%; }
}

/* Bewegung: Karte legt sich ab, Stempel schlägt einmal auf */
@keyframes card-settle {
  from { transform: translateY(14px); box-shadow: 0 1px 2px rgba(20, 22, 28, 0.1), 0 50px 90px -20px rgba(20, 22, 28, 0.5); }
}

@keyframes postmark-strike {
  0% { transform: scale(1.18); opacity: 0; }
  55% { opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Eigenständige Seiten für Impressum und Datenschutz */
.legal-page {
  display: grid;
  place-items: start center;
  padding: clamp(1rem, 5vw, 4rem) 1rem;
  background: var(--lake);
}

.sheet-page {
  display: block;
  position: static;
  max-height: none;
}

.sheet-page .sheet-head h1 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.1;
  font-weight: 640;
  font-stretch: 116%;
  letter-spacing: -0.02em;
}
