/*
 * „Geprägte Einladung“ – Schriften, Tokens und Material der öffentlichen Seite
 * ===========================================================================
 * Die ganze Seite ist eine Einladungskarte aus Rosenquarz-Papier. Flächen sind entweder erhaben
 * (eine Stufe heller als das Papier, liegt darauf) oder geprägt (eine Stufe dunkler, ins Papier gedrückt).
 * Es gibt genau ein farbiges Material: Magenta, für Kauf-Knöpfe, die empfohlene Karte und die Plakette.
 *
 * Regeln
 *  - Licht kommt von oben. Erhabene Flächen werfen weiche Schatten in Pflaume nach unten und tragen oben
 *    eine 1-px-Lichtkante. Keine weißen Außenschatten: Auf dem rosa Grund wirken sie wie ein Blendhof.
 *  - Blindprägung (Text nur aus Licht und Schatten) ist Dekoration und immer aria-hidden.
 *  - Druck: Knopf gibt sofort nach (scale .96), Loslassen federt zurück (--feder).
 *  - Animiert werden nur opacity und transform.
 *
 * Kontrast (WCAG 2.x, gerechnet)
 *  Ink   #2B0B20 auf Papier #EBDDE3 ... 13,6:1
 *  Mut   #6A4559 auf Papier ............ 6,1:1
 *  Mag-lo #962F74 auf Papier ........... 5,4:1
 *  Weiß auf Mag #B13D8B ................ 5,4:1   (Verlauf #B13D8B → #962F74, #C75AA3 nur als Lichtkante)
 *
 * Schriften
 *  Big Shoulders Display 600/800/900: Titel, Zahlen, Preise, Uhrzeiten
 *  Bricolage Grotesque 300–600:       Fließtext, Bedienung, Formulare
 *  Pinyon Script 400:                 nur „Träume groß“ und „für dich“
 */

/* ---------- Schriften (selbst gehostet aus @fontsource, nur latin) ---------- */

@font-face {
  font-family: 'Big Shoulders Display';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/big-shoulders/big-shoulders-display-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Big Shoulders Display';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/big-shoulders/big-shoulders-display-latin-800-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Big Shoulders Display';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('/fonts/big-shoulders/big-shoulders-display-latin-900-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/bricolage/bricolage-grotesque-latin-300-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/bricolage/bricolage-grotesque-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/bricolage/bricolage-grotesque-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/bricolage/bricolage-grotesque-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Pinyon Script';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/pinyon/pinyon-script-latin-400-normal.woff2') format('woff2');
}

/* ---------- Tokens ---------- */

:root {
  /* Material */
  --papier: #EBDDE3;
  --hell: 255, 248, 252;
  --tief: 184, 152, 169;
  --ink: #2B0B20;
  --mut: #6A4559;
  --mag: #B13D8B;
  --mag-hi: #C75AA3;
  --mag-lo: #962F74;
  --mag-tief: 96, 22, 70;

  /* Flächen: erhaben eine Stufe heller, geprägt eine Stufe dunkler als das Papier */
  --flaeche: #F7F0F3;
  --mulde: #E4D4DB;

  /* Schatten: weich, in Pflaume, nach unten; oben eine feine Lichtkante. Kein weißer Hof. */
  --kante: inset 0 1px 0 rgba(255, 255, 255, .9);
  --erhaben: 0 0 0 1px rgba(var(--mag-tief), .05), 0 1px 2px rgba(var(--mag-tief), .06),
    0 12px 32px -12px rgba(var(--mag-tief), .24), var(--kante);
  --erhaben-s: 0 0 0 1px rgba(var(--mag-tief), .06), 0 1px 2px rgba(var(--mag-tief), .08),
    0 6px 14px -6px rgba(var(--mag-tief), .22), var(--kante);
  --erhaben-stark: 0 0 0 1px rgba(var(--mag-tief), .06), 0 2px 4px rgba(var(--mag-tief), .08),
    0 18px 40px -14px rgba(var(--mag-tief), .34), var(--kante);
  --gepraegt: inset 0 2px 6px rgba(var(--mag-tief), .12), inset 0 0 0 1px rgba(var(--mag-tief), .05),
    0 1px 0 rgba(255, 255, 255, .65);
  --gepraegt-s: inset 0 1px 3px rgba(var(--mag-tief), .16), inset 0 0 0 1px rgba(var(--mag-tief), .05),
    0 1px 0 rgba(255, 255, 255, .65);
  --flach: 0 0 0 1px rgba(var(--mag-tief), .08);
  --magenta-schatten: 0 1px 2px rgba(var(--mag-tief), .25), 0 12px 26px -10px rgba(150, 47, 116, .6),
    inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(var(--mag-tief), .25);
  --magenta-gedrueckt: inset 0 2px 6px rgba(var(--mag-tief), .5), inset 0 0 0 1px rgba(var(--mag-tief), .2);
  --glas: rgba(247, 240, 243, .74);
  --magenta-verlauf: linear-gradient(145deg, var(--mag), var(--mag-lo));

  /* Schrift */
  --schrift-titel: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --schrift-text: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --schrift-hand: 'Pinyon Script', 'Snell Roundhand', cursive;

  /* Maße */
  --breite: 1240px;
  --rand: clamp(16px, 4vw, 44px);
  --abschnitt: clamp(64px, 9vw, 120px);
  --r-s: 14px;
  --r-m: 22px;
  --r-l: 30px;
  --r-rund: 999px;
  --textmass: 65ch;

  /* Bewegung: --kurve für einfache Übergänge; Federn darunter (mit Ersatz für alte Browser). */
  --kurve: cubic-bezier(.22, 1, .36, 1);
  --feder: cubic-bezier(.34, 1.45, .64, 1);
  --feder-ruhig: cubic-bezier(.22, 1, .36, 1);

  /* Ebenen */
  --z-kopf: 10;
  --z-kasse: 20;
}

/* Federn aus Dämpfung und Antwortzeit berechnet (wie in iOS):
   --feder        Dämpfung .62, Antwort .42 s, Dauer .66 s – mit leichtem Nachschwingen, für Antippen und Aufpoppen
   --feder-ruhig  Dämpfung 1,   Antwort .36 s, Dauer .49 s – ohne Nachschwingen, für größere Flächen */
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --feder: linear(0, 0.019, 0.071, 0.145, 0.235, 0.333, 0.433, 0.533, 0.627, 0.714, 0.792, 0.86, 0.918, 0.966, 1.004, 1.034, 1.056, 1.07, 1.079, 1.083, 1.083, 1.08, 1.074, 1.068, 1.06, 1.051, 1.043, 1.035, 1.027, 1.02, 1.014, 1.009, 1.005, 1.001, 0.998, 0.996, 0.995, 0.994, 0.993, 0.993, 0.993, 0.994, 0.994, 0.995, 0.995, 0.996, 0.997, 0.997, 1);
    --feder-ruhig: linear(0, 0.014, 0.049, 0.099, 0.158, 0.221, 0.286, 0.35, 0.412, 0.471, 0.526, 0.577, 0.625, 0.667, 0.706, 0.741, 0.773, 0.801, 0.825, 0.847, 0.867, 0.884, 0.899, 0.912, 0.924, 0.934, 0.943, 0.951, 0.957, 0.963, 0.968, 0.973, 0.976, 0.98, 0.983, 0.985, 0.987, 0.989, 0.991, 0.992, 0.993, 0.994, 0.995, 0.996, 0.996, 0.997, 0.997, 0.998, 1);
  }
}

/* ---------- Grundstil ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background-color: var(--papier);
  font-family: var(--schrift-text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 800; line-height: 1; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

::selection { background: rgba(177, 61, 139, .22); }

:focus-visible {
  outline: 3px solid var(--mag);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Material ---------- */

.erhaben { background-color: var(--flaeche); box-shadow: var(--erhaben); }
.erhaben-s { background-color: var(--flaeche); box-shadow: var(--erhaben-s); }
.gepraegt { background-color: var(--mulde); box-shadow: var(--gepraegt); }
.gepraegt-s { background-color: var(--mulde); box-shadow: var(--gepraegt-s); }

.magenta {
  color: #fff;
  background-color: var(--mag);
  background-image: var(--magenta-verlauf);
  box-shadow: var(--magenta-schatten);
}

/* ---------- Knöpfe ---------- */

.knopf {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--r-rund);
  font-family: var(--schrift-text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  transition: transform .66s var(--feder);
}

/* Hover: eine stärkere Schattenebene blendet über ihre Deckkraft auf, box-shadow selbst bleibt fest. */
.knopf::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  box-shadow: var(--erhaben-stark);
  opacity: 0;
  transition: opacity .18s var(--kurve);
  pointer-events: none;
}
.knopf.magenta::before {
  box-shadow: 0 2px 4px rgba(var(--mag-tief), .25), 0 18px 34px -12px rgba(150, 47, 116, .7);
}

@media (hover: hover) and (pointer: fine) {
  .knopf:hover::before { opacity: 1; }
}

/* Druck: sofort nachgeben (beim Drücken, nicht erst beim Loslassen), beim Loslassen federt er zurück. */
.knopf:active { transform: scale(.96); transition: transform .08s ease-out; }
.knopf.erhaben-s:active { box-shadow: var(--gepraegt-s); background-color: var(--mulde); }
.knopf:active::before { opacity: 0; transition: none; }
.knopf.magenta:active { box-shadow: var(--magenta-gedrueckt); }

.knopf-gross {
  min-height: 56px;
  padding: 0 30px;
  font-size: 17px;
}

/* ---------- Hilfen ---------- */

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

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: calc(var(--z-kasse) + 1);
  padding: 12px 20px;
  border-radius: var(--r-rund);
  background: var(--flaeche);
  box-shadow: var(--erhaben-s);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus-visible { transform: none; }
/* Sprungziele (nav.js setzt den Fokus nach einem Sprung per Tastatur): kein Rahmen um den ganzen Abschnitt. */
main[tabindex="-1"]:focus,
main section[tabindex="-1"]:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
