/* ------------------------------------------------------------------
   MASPro — Rechtsdokumente
   Gleiche Designsprache wie maspro.app (dunkel, redaktionell, rot).
------------------------------------------------------------------ */
:root {
  --black: #08080a;
  --charcoal: #0e0e11;
  --surface: #141418;
  --surface-2: #1b1b20;
  --paper: #f1eee8;
  --text: #cfcbc4;
  --muted: #97938d;
  --red: #e32636;
  --red-bright: #ff3d4d;
  --line: rgba(255, 255, 255, .12);
  --line-strong: rgba(255, 255, 255, .22);
  --shell: min(100% - clamp(2rem, 7vw, 7rem), 1180px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --nav-h: 4.8rem;

  color-scheme: dark;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { min-width: 320px; margin: 0; }
body { background: var(--black); color: var(--text); line-height: 1.5; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red-bright); outline-offset: 3px; }

.shell { width: var(--shell); margin-inline: auto; }

.skip-link {
  position: fixed; top: 1rem; left: 1rem; z-index: 200;
  padding: .8rem 1rem; border-radius: .4rem;
  background: #fff; color: #000; font-weight: 700; text-decoration: none;
  transform: translateY(-200%); transition: transform .25s var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

/* ---------------------------- Kopfzeile --------------------------- */
.progress { position: fixed; inset: 0 0 auto; z-index: 60; height: 2px; background: rgba(255, 255, 255, .07); }
.progress i {
  display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, #a80f20, var(--red), var(--red-bright));
}
@supports (animation-timeline: scroll()) {
  .progress i { animation: progressGrow linear both; animation-timeline: scroll(root); }
}
@keyframes progressGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8, 8, 10, .82);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.4rem; min-height: var(--nav-h); }
.brand { flex: none; display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; color: #fff; }
.brand img { width: 2.3rem; transition: transform .5s var(--ease); }
.brand:hover img { transform: rotate(-6deg) scale(1.06); }
.brand b { font-size: .8rem; font-weight: 800; letter-spacing: .26em; text-transform: uppercase; }
.brand span {
  padding: .2rem .45rem; border: 1px solid var(--line-strong); border-radius: .2rem;
  color: var(--red-bright); font-size: .58rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
}

.topnav { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: flex-end;
  gap: clamp(.9rem, 2.2vw, 2rem); overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  position: relative; padding: .35rem 0; white-space: nowrap; text-decoration: none;
  color: rgba(255, 255, 255, .66); font-size: .7rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase;
  transition: color .3s var(--ease);
}
.topnav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--red-bright);
  transform: scaleX(0); transform-origin: 100% 50%; transition: transform .45s var(--ease);
}
.topnav a:hover, .topnav a[aria-current="page"] { color: #fff; }
.topnav a:hover::after, .topnav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: 0 50%; }
.topnav .to-site { color: var(--red-bright); }
.topnav .lang-link { padding-left: clamp(.6rem, 1.6vw, 1.2rem); border-left: 1px solid var(--line-strong); }

.translation-note {
  margin: -1.2rem 0 2.4rem; padding-left: .9rem;
  border-left: 2px solid var(--line-strong);
  color: var(--muted); font-size: .84rem; line-height: 1.6;
}
.translation-note a { color: var(--red-bright); }

/* ------------------------------ Inhalt ---------------------------- */
main { padding-block: clamp(3rem, 7vw, 6rem) clamp(4rem, 9vw, 8rem); }
.document { max-width: 74ch; }
.eyebrow {
  margin: 0 0 1.2rem; color: var(--red);
  font-size: .74rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase;
}
.eyebrow::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: 2.4rem; height: 1px; margin-right: .85rem; background: var(--red);
  transform-origin: 0 50%; animation: lineIn .9s var(--ease) .15s both;
}
@keyframes lineIn { from { transform: scaleX(0); } to { transform: scaleX(1); } }

h1, h2, h3 { color: var(--paper); text-wrap: pretty; }
h1 {
  margin: 0 0 1rem; font-size: clamp(2.3rem, 5.4vw, 4.4rem);
  font-weight: 680; line-height: .98; letter-spacing: -.05em;
  animation: rise 1s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
h2 {
  margin: 3rem 0 .9rem; font-size: clamp(1.35rem, 2.3vw, 1.85rem);
  font-weight: 650; line-height: 1.15; letter-spacing: -.03em;
}
h2::before {
  content: ""; display: block; width: 2.2rem; height: 2px; margin-bottom: .9rem; background: var(--red);
}
h3 { margin: 1.8rem 0 .4rem; font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
p, li { font-size: 1.02rem; line-height: 1.85; }
p { margin: 0 0 1.1rem; }
.lede { max-width: 52rem; color: var(--muted); font-size: clamp(1.05rem, 1.8vw, 1.3rem); line-height: 1.7; }
.meta {
  margin: 0 0 2.4rem; padding-bottom: 1.6rem; border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
a { color: var(--red-bright); text-underline-offset: .2em; text-decoration-thickness: 1px; }
/* Köder gegen E-Mail-Sammler: wird nie angezeigt und nicht mitkopiert */
.nospam { display: none; }
a:hover { color: #fff; }
ul, ol { margin: 0 0 1.2rem; padding-left: 1.3rem; }
li::marker { color: var(--red); }
li + li { margin-top: .5rem; }
strong { color: var(--paper); }
hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--line); }

.notice {
  margin: 1.8rem 0; padding: 1.2rem 1.4rem;
  border: 1px solid var(--line); border-left: 3px solid var(--red);
  background: linear-gradient(100deg, rgba(227, 38, 54, .1), rgba(255, 255, 255, .02));
}
.notice p:last-child { margin-bottom: 0; }
.notice strong { color: #fff; }

.toc {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .1rem 1.5rem;
  margin: 2rem 0 2.6rem; padding: 1.4rem 1.6rem;
  border: 1px solid var(--line); background: var(--surface);
}
.toc a {
  padding: .45rem 0; color: var(--text); font-size: .92rem; font-weight: 600; text-decoration: none;
  transition: color .3s var(--ease), padding-left .3s var(--ease);
}
.toc a:hover { color: #fff; padding-left: .35rem; }

.table-wrap { overflow-x: auto; margin: 1.6rem 0; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--surface); }
th, td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--surface-2); color: var(--paper); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }

section { scroll-margin-top: calc(var(--nav-h) + 1.5rem); }

/* --------------------------- Übersicht ---------------------------- */
.hero { max-width: 56rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; min-height: 14rem; padding: 1.6rem;
  background: var(--charcoal); text-decoration: none; color: inherit;
  transition: background .35s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: auto 0 0 0; height: 2px; z-index: -1; background: var(--red);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .5s var(--ease);
}
.card:hover { background: var(--surface-2); }
.card:hover::before { transform: scaleX(1); }
.card h2 { margin: 0 0 .7rem; font-size: 1.15rem; }
.card h2::before { display: none; }
.card p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.7; }
.card .go {
  margin-top: auto; padding-top: 1.4rem; color: var(--red-bright);
  font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
}
.card .go::after { content: "→"; display: inline-block; margin-left: .5em; transition: transform .4s var(--ease); }
.card:hover .go::after { transform: translateX(4px); }

/* ---------------------------- Fußzeile ---------------------------- */
.doc-nav { margin-top: clamp(3.5rem, 7vw, 6rem); padding-top: 2rem; border-top: 1px solid var(--line); }
.doc-nav p { margin: 0 0 1rem; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.doc-nav div { display: flex; flex-wrap: wrap; gap: .6rem; }
.doc-nav a {
  padding: .5rem .8rem; border: 1px solid var(--line); color: var(--text);
  font-size: .76rem; font-weight: 650; text-decoration: none;
  transition: border-color .3s var(--ease), color .3s var(--ease), background .3s var(--ease);
}
.doc-nav a:hover { border-color: var(--red); background: rgba(227, 38, 54, .1); color: #fff; }
.doc-nav a[aria-current="page"] { border-color: var(--red); color: #fff; }

.site-footer { padding-block: 2.4rem 3rem; border-top: 1px solid var(--line); background: var(--black); }
.site-footer .shell {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem;
  color: rgba(255, 255, 255, .45); font-size: .67rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase;
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer div { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; }

/* ------------------------- Scroll-Animation ----------------------- */
@supports (animation-timeline: view()) {
  .document > section, .document > .notice, .document > .toc, .card, .table-wrap {
    animation: revealIn linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 42%;
  }
}
@keyframes revealIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ----------------------------- Mobile ----------------------------- */
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; }
  .toc { grid-template-columns: 1fr; }
  .brand b { display: none; }
  .topbar__inner { gap: .8rem; }
}

@media (max-width: 620px) {
  .brand span { display: none; }
  .topnav { justify-content: flex-start; padding-left: .4rem; }
  .topnav a { font-size: .66rem; }
}

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

@media print {
  :root { --paper: #000; --text: #000; --muted: #333; }
  .topbar, .progress, .doc-nav, .site-footer, .skip-link { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; }
  .notice, .toc, table { background: #fff; border-color: #999; }
  th { background: #eee; color: #000; }
  h1, h2, h3, strong { color: #000; }
}
