@font-face { font-family: Lato; src: url(fonts/Lato-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Lato; src: url(fonts/Lato-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: Lato; src: url(fonts/Lato-Black.ttf) format("truetype"); font-weight: 900; font-display: swap; }

:root {
  --ground: #141517;
  --surface: #1e2024;
  --surface-2: #26282d;
  --ink: #f2f2f3;
  --ink-soft: #b4b6bc;
  --accent: #f28c28;
  --on-accent: #141517;
  --ok: #3ddc84;
  --margin: clamp(16px, 4vw, 56px);
  --max: 1320px;
  --gap: clamp(96px, 12vw, 184px);
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { background: var(--ground); color: var(--ink); font: 400 18px/1.55 Lato, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--margin); }

/* Kopfzeile */
.bar { position: sticky; top: 0; z-index: 10; background: var(--ground); }
.bar .wrap { display: flex; align-items: center; gap: 32px; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 18px; text-decoration: none; letter-spacing: -0.01em; flex: none; }
.brand img { width: 36px; height: 36px; border-radius: 50%; }
.bar nav { display: flex; gap: 28px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.bar nav a { text-decoration: none; color: var(--ink-soft); font-weight: 700; font-size: 16px; white-space: nowrap; transition: color .15s; }
.bar nav a:hover, .bar nav a[aria-current] { color: var(--ink); }
.bar nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 16px 26px; font-weight: 900; font-size: 17px; text-decoration: none; background: var(--surface-2); color: var(--ink); transition: background .15s, transform .15s; }
.btn:hover { background: #2e3036; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: #ff9d3f; }

/* Regelwerk */
.search label { display: block; font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.search input { width: 100%; min-width: min(440px, 100%); font: inherit; font-size: 18px; color: var(--ink); background: var(--surface-2); border: 0; border-radius: 0; padding: 16px 18px; caret-color: var(--accent); transition: background .15s; }
.search input::placeholder { color: var(--ink-soft); }
.search input:hover { background: #2e3036; }
.search output { display: block; min-height: 1.5em; margin-top: 10px; color: var(--ink-soft); font-size: 16px; }
.book { padding: var(--gap) 0 0; }
.book-split .wrap { display: grid; grid-template-columns: 4fr 8fr; gap: clamp(40px, 6vw, 96px); }
.book-split aside { position: sticky; top: 104px; align-self: start; }
.book h2 { font-weight: 900; font-size: clamp(40px, 5.4vw, 80px); line-height: .95; letter-spacing: -0.035em; }
.book .intro { margin-top: 24px; max-width: 42ch; }
.toc { list-style: none; padding: 0; margin-top: 32px; display: grid; gap: 6px; }
.toc a { text-decoration: none; color: var(--ink-soft); font-weight: 700; font-size: 16px; transition: color .15s; }
.toc a:hover { color: var(--accent); }
.rules { display: grid; gap: 48px; }
.rule h3 { font-weight: 900; font-size: clamp(22px, 2vw, 28px); line-height: 1.15; letter-spacing: -0.015em; }
.rule h3 a { text-decoration: none; }
.para { color: var(--accent); margin-right: .35em; transition: color .15s; }
.rule h3 a:hover .para { color: var(--ink); }
.rule p { margin-top: 12px; max-width: 62ch; }
.rule[hidden] { display: none; }

/* Textseiten (Shop, Impressum, Datenschutz) */
.page { padding-top: clamp(48px, 8vw, 112px); max-width: 860px; }
.page h1 { font-weight: 900; font-size: clamp(48px, 8vw, 112px); line-height: .92; letter-spacing: -0.04em; }
.page h2 { font-weight: 900; font-size: 26px; margin-top: 48px; }
.page p, .page ul { margin-top: 14px; color: var(--ink-soft); }
.page .lead { color: var(--ink); margin-top: 28px; }
.page .actions { margin-top: 32px; }

/* Fußzeile */
.close { padding-top: var(--gap); padding-bottom: 48px; }
.close .name { font-weight: 900; font-size: clamp(64px, 15.5vw, 236px); line-height: .82; letter-spacing: -0.05em; }
.close .name span { color: var(--accent); }
.close .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; margin-top: 48px; color: var(--ink-soft); font-size: 16px; }
.close .row p:first-child { color: var(--ink); font-size: 18px; max-width: 46ch; }
.close .links { display: flex; gap: 20px; }
.close .links a { text-decoration: none; }
.close .links a:hover { color: var(--accent); }

/* Bewegung: Abschnitte treten gestaffelt auf, ohne Skript bleibt alles sichtbar.
   Eigene translate-Eigenschaft, damit transform für die 3D-Neigung frei bleibt */
.js .reveal { opacity: 0; translate: 0 24px; transition: opacity .6s ease, translate .6s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; translate: none; }

html, body { overflow-x: clip; }
main { position: relative; isolation: isolate; }

/* Kopfzeile wird beim Scrollen zur Glasleiste */
.bar { transition: background .25s; }
.bar.scrolled { background: var(--surface); }

/* Lesefortschritt auf den Regelseiten */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); z-index: 11; pointer-events: none; }

/* Regeln: verlinkter oder angefahrener Paragraph bekommt die Kante */
.rule { padding-left: 20px; border-left: 2px solid transparent; transition: border-color .2s; }
.rule:hover, .rule:target { border-left-color: var(--accent); }


@supports (animation-timeline: view()) {
  .progress { animation: fill linear both; animation-timeline: scroll(root); }
}
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; translate: none; transition: none; }
}
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 16px; padding: 12px 20px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1000px) {
  .book-split .wrap { grid-template-columns: 1fr; }
  .book-split aside { position: static; }
  .toc { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .bar .wrap { gap: 18px; }
  .bar nav { gap: 18px; }
  .brand span { display: none; }
  .toc { grid-template-columns: 1fr; }
  .btn { flex: 1 1 100%; justify-content: center; }
}
