/* ===================================================================
   AbiKarten Website — gemeinsame Basis (Tokens + Bausteine)
   Quelle der Token-Werte: DESIGN-TOKENS.css (Repo-Root).
   Erweiterungen (Display-Typo, Selten-Gold, Nacht-Vitrine) sind dort
   nachgezogen. Leitmotiv M0: "Alles ist eine Karte".
   =================================================================== */

/* ---------- Fonts (selbst gehostet, DSGVO) ---------- */
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/plus-jakarta-sans-v12-latin_latin-ext-regular.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('../fonts/plus-jakarta-sans-v12-latin_latin-ext-500.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('../fonts/plus-jakarta-sans-v12-latin_latin-ext-600.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('../fonts/plus-jakarta-sans-v12-latin_latin-ext-700.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-style: normal; font-display: swap;
  src: url('../fonts/plus-jakarta-sans-v12-latin_latin-ext-800.woff2') format('woff2'); }

/* ---------- Tokens ---------- */
:root {
  --brand:        #2563eb;
  --brand-dark:   #1d4ed8;
  --brand-soft:   #eff6ff;
  --indigo:       #4f46e5;
  --indigo-soft:  #eef2ff;

  --ink:          #0f172a;
  --ink-2:        #334155;
  --muted:        #64748b;
  --muted-2:      #94a3b8;

  --line:         #e5e9f2;
  --line-2:       #eef1f7;
  --bg-1:         #f6f8fc;
  --bg-2:         #eef2fb;

  --success:      #16a34a;
  --success-soft: #f0fdf4;
  --success-line: #bbf7d0;
  --warn:         #c2410c;
  --warn-soft:    #fff7ed;
  --warn-line:    #fed7aa;
  --danger:       #ef4444;
  --warm:         #fbbf24;
  --whatsapp:     #25d366;

  /* Selten-Gold (Premium-Akzent, nur fuer besondere Momente) */
  --gold:         #b07f1a;
  --gold-strong:  #8a5f0f;
  --gold-soft:    #fbf3df;
  --gold-line:    #ecd9a8;
  --gold-grad:    linear-gradient(120deg,#f3d27a 0%,#d9a441 38%,#a9741c 72%,#eec868 100%);

  /* Nacht-Vitrine (dunkle Sektionen, gleiche Blau-Familie wie --ink) */
  --night:        #0b1223;
  --night-2:      #111b36;
  --night-line:   #24314f;
  --night-text:   #e8edf8;
  --night-muted:  #93a1bf;

  --r-sm:   10px;
  --r-md:   14px;
  --r-lg:   22px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 1px rgba(15,23,42,.04);
  --shadow-md: 0 6px 18px rgba(15,23,42,.06), 0 2px 6px rgba(15,23,42,.04);
  --shadow-lg: 0 14px 36px rgba(37,99,235,.10), 0 6px 14px rgba(15,23,42,.05);
  --shadow-card: 0 18px 44px rgba(15,23,42,.16), 0 6px 14px rgba(15,23,42,.10);

  --fs-2xs:  11px;
  --fs-xs:   12.5px;
  --fs-sm:   13.5px;
  --fs-base: 15px;
  --fs-lg:   17px;
  --fs-xl:   19px;
  --fs-2xl:  24px;
  /* Display-Skala (Website) */
  --fs-3xl:     clamp(26px, 3.4vw, 36px);
  --fs-4xl:     clamp(32px, 5vw, 50px);
  --fs-display: clamp(38px, 6.4vw, 66px);

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-7: 28px; --sp-8: 32px; --sp-9: 36px; --sp-10: 40px; --sp-16: 64px;

  --t: cubic-bezier(.4,0,.2,1);
  --t-pop: cubic-bezier(.23,1,.32,1);

  --nav-h: 68px;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ink);
  background: #fff;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 var(--sp-4); letter-spacing: -0.02em; }
h1 { font-size: var(--fs-display); font-weight: 800; }
h2 { font-size: var(--fs-4xl); font-weight: 800; }
h3 { font-size: var(--fs-2xl); font-weight: 700; }
p  { margin: 0 0 var(--sp-4); }
.lead { font-size: var(--fs-lg); color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 var(--sp-5); }
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section-head { max-width: 720px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head p { color: var(--muted); font-size: var(--fs-lg); }

/* ---------- Header / Navigation (S0) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--t), background .25s var(--t);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; gap: var(--sp-6); height: var(--nav-h); }
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: var(--fs-xl); color: var(--ink); }
.nav-logo:hover { text-decoration: none; }
.nav-logo img { height: 34px; width: auto; }
.nav-links { display: flex; gap: var(--sp-6); margin-left: auto; align-items: center; }
.nav-links a { color: var(--ink-2); font-weight: 600; font-size: var(--fs-sm); }
.nav-links a:hover { color: var(--brand); text-decoration: none; }
.nav-cta { margin-left: var(--sp-2); }
.nav-burger { display: none; margin-left: auto; background: none; border: 0; padding: 10px; cursor: pointer; color: var(--ink); }
.nav-burger svg { display: block; }

@media (max-width: 820px) {
  .nav-links {
    display: none;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: var(--sp-2) var(--sp-5) var(--sp-5);
    box-shadow: var(--shadow-md);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid var(--line-2); font-size: var(--fs-base); }
  .nav-links a:last-of-type { border-bottom: 0; }
  .nav-cta { margin: var(--sp-3) 0 0; }
  .nav-burger { display: block; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: var(--r-pill);
  font-weight: 700; font-size: var(--fs-base); line-height: 1.2;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .12s var(--t), box-shadow .2s var(--t), background .2s var(--t);
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.25); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted-2); }
/* WhatsApp-Gruen abgedunkelt fuer AA-Kontrast mit weissem Text (4,5:1) */
.btn-wa { background: #0e7a3d; color: #fff; box-shadow: 0 6px 16px rgba(14,122,61,.30); }
.btn-wa:hover { background: #0c6834; }
.btn-gold { background: var(--gold-grad); color: #3d2a05; box-shadow: 0 6px 18px rgba(176,127,26,.32); }
.btn-lg { padding: 16px 28px; font-size: var(--fs-lg); }
.btn-sub { display: block; margin-top: 8px; font-size: var(--fs-xs); color: var(--muted); }
.btn svg { flex: 0 0 auto; }

/* ---------- Pills / Badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: var(--fs-sm); font-weight: 600;
}
.pill-gold { background: var(--gold-soft); color: var(--gold-strong); border: 1px solid var(--gold-line); }
.pill-plain { background: var(--bg-1); color: var(--ink-2); border: 1px solid var(--line); }

/* ---------- Karten-Baukasten (M0) ---------- */
/* Physische Karte: 6,8 x 9,2 cm */
.ak-card {
  aspect-ratio: 68 / 92;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--bg-2);
  position: relative;
}
.ak-card img { width: 100%; height: 100%; object-fit: cover; }

/* Holo-Tilt (L3): JS setzt --rx/--ry/--mx/--my */
.tilt { transform-style: preserve-3d; will-change: transform; transition: transform .35s var(--t-pop); }
.tilt.is-tilting { transition: none; }
.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.tilt .holo {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background:
    radial-gradient(circle at var(--mx,50%) var(--my,50%), rgba(255,255,255,.55), transparent 42%),
    linear-gradient(115deg, transparent 30%, rgba(255,215,130,.25) 47%, rgba(140,190,255,.25) 53%, transparent 70%);
  mix-blend-mode: soft-light;
  transition: opacity .3s var(--t);
}
.tilt.is-tilting .holo, .tilt:hover .holo { opacity: 1; }

/* Deck-Faecher (L1): statisch immer aufgefaechert, Einfahr-Animation per Keyframes */
.deck { position: relative; height: 100%; }
.deck .ak-card { position: absolute; inset: 0; margin: auto; }
.deck .ak-card:nth-child(1) { z-index: 5; }
.deck .ak-card:nth-child(2) { z-index: 4; transform: rotate(-9deg) translateX(-13%) translateY(2.5%); }
.deck .ak-card:nth-child(3) { z-index: 3; transform: rotate(9deg) translateX(13%) translateY(2.5%); }
.deck .ak-card:nth-child(4) { z-index: 2; transform: rotate(-18deg) translateX(-27%) translateY(7%); }
.deck .ak-card:nth-child(5) { z-index: 1; transform: rotate(18deg) translateX(27%) translateY(7%); }
@keyframes deck-fan { from { transform: rotate(0deg) translateX(0) translateY(0); } }
@media (prefers-reduced-motion: no-preference) {
  .deck .ak-card:nth-child(n+2) { animation: deck-fan .7s var(--t-pop) .15s backwards; }
}

/* Flip-Karte (L7 / U1) */
.flip { perspective: 1100px; }
.flip-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s var(--t-pop); }
.flip.is-flipped .flip-inner { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 12px; overflow: hidden; }
.flip-back { transform: rotateY(180deg); }

/* ---------- Scroll-Reveal ---------- */
.rv { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--t), transform .6s var(--t-pop); }
.rv.rv-in { opacity: 1; transform: none; }
.rv-d1 { transition-delay: .06s; } .rv-d2 { transition-delay: .12s; }
.rv-d3 { transition-delay: .18s; } .rv-d4 { transition-delay: .24s; }

/* ---------- Nacht-Vitrine ---------- */
.vitrine { background: linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%); color: var(--night-text); }
.vitrine h2, .vitrine h3 { color: #fff; }
.vitrine .muted, .vitrine p { color: var(--night-muted); }
.vitrine .lead { color: var(--night-muted); }

/* ---------- WhatsApp-FAB ---------- */
.wa-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  background: #0e7a3d; color: #fff;
  border-radius: var(--r-pill); padding: 12px 18px 12px 14px;
  font-weight: 700; font-size: var(--fs-sm);
  box-shadow: 0 10px 26px rgba(14,122,61,.38);
  transition: transform .15s var(--t);
}
@media (hover: hover) {
  .wa-fab:hover { text-decoration: none; transform: translateY(-2px); }
}
.wa-fab:active { transform: scale(.97); }
@media (max-width: 640px) { .wa-fab span { display: none; } .wa-fab { padding: 14px; } }
@media (max-width: 520px) { .btn { white-space: normal; } }

/* ---------- FAQ ---------- */
.faq details {
  border-bottom: 1px solid var(--line);
  padding: var(--sp-4) 0;
}
.faq summary {
  cursor: pointer; font-weight: 700; font-size: var(--fs-lg);
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 22px; font-weight: 600; color: var(--muted); transition: transform .2s var(--t); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: var(--sp-3) 0 0; color: var(--ink-2); max-width: 65ch; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-1); border-top: 1px solid var(--line); padding: var(--sp-16) 0 var(--sp-8); font-size: var(--fs-sm); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--sp-8); }
.footer-grid h2 { font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0; margin: 0 0 var(--sp-3); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 10px; }
.footer-grid a { color: var(--ink-2); }
.footer-legal { margin-top: var(--sp-10); padding-top: var(--sp-5); border-top: 1px solid var(--line); color: var(--muted); display: flex; flex-wrap: wrap; gap: var(--sp-4); justify-content: space-between; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Tabellen (Vergleich) ---------- */
.cmp-table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.cmp-table th, .cmp-table td { padding: 14px 16px; text-align: left; }
.cmp-table thead th { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.cmp-table tbody tr { border-bottom: 1px solid var(--line-2); }
.cmp-table .is-us { background: var(--brand-soft); font-weight: 700; }
.cmp-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }

/* ---------- Motion-Guards ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .flip-inner, .tilt { transition: none !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media (hover: none), (pointer: coarse) {
  .tilt { transform: none; }
}
