/* ============================================================================
   NUMIYA Blog — standalone stylesheet.
   Hand-written against the site's design tokens (client/src/index.css) instead
   of a second Tailwind toolchain: the generator emits a FIXED set of classes,
   and scripts/build-blog.mjs fails the build if it ever emits a class this
   file does not define (Fremdkörper-Guard). Keep the two in sync.
   ========================================================================== */

:root {
  --violet: #b794f6;
  --rose: #f6a5c8;
  --blue: #93c5fd;
  --ink: #1f2937;
  --ink-strong: #0f172a;
  --muted: #475569;
  --bg-top: #fafbfc;
  --bg-bottom: #f4f6fa;
  --grad-tri: linear-gradient(120deg, #3d6fc4 0%, #6d4aa8 48%, #b04a86 100%);
  --cta-from: #6d4aa8;
  --cta-to: #b04a86;
  --card-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.9) inset,
    0 18px 50px -12px rgba(124, 58, 237, 0.18),
    0 8px 20px -8px rgba(31, 41, 55, 0.1);
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Raleway', 'Helvetica Neue', Arial, sans-serif;
  --font-script: 'Great Vibes', 'Snell Roundhand', cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  min-height: 100vh;
  line-height: 1.75;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

/* Soft aurora atmosphere, fixed behind everything (mirrors StarryBackground) */
.bg-wash { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-wash::before,
.bg-wash::after {
  content: '';
  position: absolute;
  width: 55vw; height: 55vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
}
.bg-wash::before { top: -18vw; right: -12vw; background: radial-gradient(circle, #d9c7fb 0%, transparent 65%); }
.bg-wash::after { bottom: -22vw; left: -14vw; background: radial-gradient(circle, #fbd3e3 0%, transparent 65%); }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(183, 148, 246, 0.18);
}
.site-header-inner {
  max-width: 72rem; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; padding: 0.7rem 1.25rem; min-width: 0;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink-strong); min-width: 0; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand-name { font-family: var(--font-body); font-weight: 600; letter-spacing: 0.28em; font-size: 0.95rem; }
.header-nav { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; justify-content: flex-end; }
.header-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.header-link:hover { color: var(--ink-strong); }
.lang-switch { display: inline-flex; gap: 0.15rem; background: rgba(255,255,255,0.75); border: 1px solid rgba(183,148,246,0.25); border-radius: 999px; padding: 0.18rem; }
.lang-switch a, .lang-switch span {
  padding: 0.14rem 0.55rem; border-radius: 999px; text-decoration: none;
  font-size: 0.76rem; font-weight: 600; color: var(--muted);
}
.lang-switch a:hover { color: var(--ink-strong); }
.lang-switch .lang-active { background: var(--cta-from); color: #fff; }
.header-cta {
  background: linear-gradient(120deg, var(--cta-from), var(--cta-to));
  color: #fff; text-decoration: none; font-size: 0.85rem; font-weight: 600;
  padding: 0.45rem 1rem; border-radius: 999px; white-space: nowrap;
}
.header-cta:hover { filter: brightness(1.08); }

/* ------------------------------------------------------------------ page */
.page { max-width: 46rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.page-wide { max-width: 64rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }

.crumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 1.6rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink-strong); text-decoration: underline; }
.crumbs span[aria-hidden] { margin: 0 0.35rem; opacity: 0.6; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: #6d28d9;
  border: 1px solid rgba(183, 148, 246, 0.45);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.32rem 0.85rem; border-radius: 999px; margin-bottom: 1.1rem;
}

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 5.5vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
  margin-bottom: 0.9rem;
}
.h1-accent {
  display: block;
  font-family: var(--font-script);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 400;
  background: var(--grad-tri);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  margin-top: 0.35rem;
}

.byline {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.55rem;
  font-size: 0.86rem; color: var(--muted); margin: 1.1rem 0 2rem;
}
.byline img { width: 26px; height: 26px; border-radius: 8px; }
.byline strong { color: var(--ink-strong); font-weight: 600; }
.byline .dot { opacity: 0.5; }

/* --------------------------------------------------------- glass blocks */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 1.5rem;
  box-shadow: var(--card-shadow);
}

.takeaways { padding: 1.4rem 1.6rem; margin: 0 0 2.2rem; }
.takeaways h2 {
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: #6d28d9;
  margin: 0 0 0.8rem; border: 0; padding: 0;
}
.takeaways ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.takeaways li { display: flex; gap: 0.6rem; font-size: 0.98rem; line-height: 1.6; }
.takeaways li::before { content: '✦'; color: #b04a86; flex: 0 0 auto; margin-top: 0.1rem; }

.toc { padding: 1.2rem 1.6rem; margin: 0 0 2.4rem; font-size: 0.95rem; }
.toc h2 {
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 0.7rem; border: 0; padding: 0;
}
.toc ol { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: #6d28d9; text-decoration: underline; }

/* ------------------------------------------------------------- prose */
.prose { font-size: 1.0625rem; }
.prose h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.55rem, 3.6vw, 2rem); line-height: 1.2;
  color: var(--ink-strong);
  margin: 2.6rem 0 1rem; padding-top: 0.4rem;
  scroll-margin-top: 5.5rem;
}
.prose h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.35rem; color: var(--ink-strong);
  margin: 2rem 0 0.7rem; scroll-margin-top: 5.5rem;
}
.prose p { margin: 0 0 1.15rem; }
.prose ul, .prose ol { margin: 0 0 1.2rem; padding-left: 1.4rem; }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { color: #b04a86; }
.prose a { color: #6d28d9; text-decoration: underline; text-decoration-color: rgba(109, 40, 217, 0.35); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: #6d28d9; }
.prose strong { color: var(--ink-strong); font-weight: 600; }
.prose em { font-style: italic; }
.prose blockquote {
  border-left: 3px solid var(--violet);
  background: rgba(255, 255, 255, 0.65);
  border-radius: 0 1rem 1rem 0;
  padding: 0.9rem 1.3rem; margin: 0 0 1.2rem;
  font-family: var(--font-display); font-size: 1.15rem; font-style: italic; color: var(--ink-strong);
}
.prose blockquote p { margin: 0; }
.prose hr { border: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(183,148,246,0.5), transparent); margin: 2.4rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4rem; font-size: 0.95rem; background: rgba(255,255,255,0.7); border-radius: 0.9rem; overflow: hidden; }
.prose th { text-align: left; font-weight: 600; color: var(--ink-strong); background: rgba(183, 148, 246, 0.14); padding: 0.6rem 0.85rem; }
.prose td { padding: 0.55rem 0.85rem; border-top: 1px solid rgba(183, 148, 246, 0.16); vertical-align: top; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em; background: rgba(183, 148, 246, 0.14);
  padding: 0.12em 0.4em; border-radius: 0.4em; color: var(--ink-strong);
}
.table-scroll { overflow-x: auto; }

/* Rechenbeispiel-Kasten */
.prose .calc {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(183, 148, 246, 0.35);
  border-radius: 1.1rem;
  padding: 1.1rem 1.3rem; margin: 0 0 1.3rem;
  font-variant-numeric: tabular-nums;
}
.prose .calc p { margin: 0 0 0.4rem; }
.prose .calc p:last-child { margin: 0; }

/* ----------------------------------------------------------- CTA card */
.cta-card {
  margin: 2.8rem 0; padding: 1.8rem 1.7rem; text-align: center;
  background:
    radial-gradient(120% 160% at 15% 0%, rgba(183, 148, 246, 0.22) 0%, transparent 55%),
    radial-gradient(120% 160% at 85% 100%, rgba(246, 165, 200, 0.22) 0%, transparent 55%),
    rgba(255, 255, 255, 0.85);
}
.cta-card h2 {
  font-family: var(--font-display); font-size: 1.7rem; font-weight: 600;
  color: var(--ink-strong); margin: 0 0 0.5rem; border: 0; padding: 0;
}
.cta-card p { margin: 0 auto 1.2rem; max-width: 34rem; color: var(--muted); font-size: 0.98rem; }
.cta-card img { height: 52px; width: auto; }
.cta-note { display: block; margin-top: 0.7rem; font-size: 0.8rem; color: var(--muted); }

/* --------------------------------------------------------- author box */
.author-box { display: flex; gap: 1rem; align-items: flex-start; padding: 1.3rem 1.5rem; margin: 2.4rem 0 0; }
.author-box img { width: 52px; height: 52px; border-radius: 14px; flex: 0 0 auto; }
.author-box h2 { font-family: var(--font-body); font-size: 1rem; font-weight: 700; color: var(--ink-strong); margin: 0 0 0.2rem; border: 0; padding: 0; }
.author-box p { margin: 0; font-size: 0.9rem; color: var(--muted); line-height: 1.6; }

/* ----------------------------------------------- disclosure / legal */
.disclosure {
  margin: 1.4rem 0 0; padding: 1.2rem 1.5rem;
  border: 1px solid rgba(183, 148, 246, 0.3);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.66);
  font-size: 0.85rem; color: var(--muted); line-height: 1.65;
}
.disclosure p { margin: 0 0 0.55rem; }
.disclosure p:last-child { margin: 0; }
.disclosure strong { color: var(--ink-strong); }

/* ------------------------------------------------------------ related */
.related { margin: 2.6rem 0 0; }
.related h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--ink-strong); margin: 0 0 1rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.9rem; }
.related-card { display: block; padding: 1rem 1.15rem; text-decoration: none; color: var(--ink); }
.related-card:hover { transform: translateY(-2px); transition: transform 160ms ease; }
.related-card .num {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 600;
  background: var(--grad-tri);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.related-card .t { display: block; font-weight: 600; color: var(--ink-strong); font-size: 0.95rem; margin-top: 0.2rem; }
.related-card .d { display: block; font-size: 0.83rem; color: var(--muted); margin-top: 0.25rem; }

/* -------------------------------------------------------- index page */
.index-hero { text-align: center; margin: 1rem 0 2.6rem; }
.index-hero .script { font-family: var(--font-script); font-size: clamp(1.6rem, 4vw, 2.2rem); background: var(--grad-tri); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.index-hero p { max-width: 38rem; margin: 0.8rem auto 0; color: var(--muted); }
.article-list { display: grid; gap: 1rem; }
.article-card { display: block; padding: 1.35rem 1.5rem; text-decoration: none; color: var(--ink); }
.article-card:hover { transform: translateY(-2px); transition: transform 160ms ease; }
.article-card h2 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; color: var(--ink-strong); margin: 0 0 0.35rem; }
.article-card p { margin: 0; font-size: 0.93rem; color: var(--muted); }
.article-card .meta { display: block; margin-top: 0.55rem; font-size: 0.8rem; color: var(--muted); opacity: 0.85; }

/* ------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid rgba(183, 148, 246, 0.18); margin-top: 3rem; background: rgba(255, 255, 255, 0.55); }
.site-footer-inner { max-width: 72rem; margin: 0 auto; padding: 1.6rem 1.25rem; display: flex; flex-wrap: wrap; gap: 0.9rem 1.4rem; align-items: center; justify-content: space-between; font-size: 0.84rem; color: var(--muted); }
.site-footer a { color: var(--muted); text-decoration: none; margin-right: 1rem; }
.site-footer a:hover { color: var(--ink-strong); text-decoration: underline; }

@media (max-width: 480px) {
  .page, .page-wide { padding-top: 1.8rem; }
  .byline { gap: 0.4rem; }
  .brand-name { display: none; }
}

/* ---------------------------------------------------- consent banner */
.consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; padding: 0.85rem; }
.consent-box { max-width: 42rem; margin: 0 auto; padding: 1rem 1.2rem; font-size: 0.9rem; line-height: 1.6; color: var(--ink); background: rgba(255, 255, 255, 0.96); }
.consent-box a { color: #6d28d9; text-decoration: underline; text-underline-offset: 2px; }
.consent-row { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.8rem; }
@media (min-width: 480px) { .consent-row { flex-direction: row; } }
.consent-row button { flex: 1; padding: 0.6rem 1rem; border-radius: 999px; font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.consent-decline { border: 1px solid #cbd5e1; background: #fff; color: var(--ink); }
.consent-decline:hover { background: #f8fafc; }
.consent-accept { border: 1px solid transparent; background: linear-gradient(120deg, var(--cta-from), var(--cta-to)); color: #fff; }
.consent-accept:hover { filter: brightness(1.08); }
