:root {
  --paper: #f4f0e7;
  --paper-light: #ffffff;
  --ink: #17324d;
  --muted: #5d6674;
  --line: #c9c1b4;
  --blue: #17324d;
  --coral: #c87532;
  --yellow: #c87532;
  --max: 72rem;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/SourceSerif4-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/SourceSerif4-Semibold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/SourceSerif4-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/SourceSans3-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/SourceSans3-Semibold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/SourceSans3-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Sans 3", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

body { margin: 0; min-height: 100vh; }

a { color: inherit; text-underline-offset: 0.2em; }
a:hover { color: var(--blue); }
a:focus-visible, .button:focus-visible { outline: 3px solid var(--coral); outline-offset: 4px; }

.site-header {
  border-bottom: 1px solid var(--ink);
  background: rgba(244, 239, 229, 0.96);
}

.header-inner, main, .footer-inner {
  width: min(calc(100% - 2rem), var(--max));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 5.25rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 3.15rem;
}

.brand-logo--compact {
  display: none;
  height: 2.8rem;
}

nav ul, .footer-links { display: flex; flex-wrap: wrap; gap: 0.45rem 1.1rem; margin: 0; padding: 0; list-style: none; }
nav a { font-size: 0.92rem; font-weight: 700; text-decoration: none; }
nav a[aria-current="page"] { border-bottom: 0.18rem solid var(--blue); }

main { padding-block: clamp(3rem, 8vw, 7rem); }

.eyebrow {
  margin: 0 0 1rem;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1, h2, h3 { margin-top: 0; font-family: "Source Serif 4", Georgia, "Times New Roman", serif; line-height: 1.04; letter-spacing: -0.035em; }
h1 { max-width: 13ch; margin-bottom: 1.5rem; font-size: clamp(3rem, 9vw, 7.4rem); font-weight: 400; }
h2 { font-size: clamp(1.8rem, 4vw, 3.1rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { max-width: 68ch; }
.lede { max-width: 54ch; color: var(--muted); font-size: clamp(1.1rem, 2.1vw, 1.4rem); }

.hero {
  position: relative;
  padding-bottom: clamp(3rem, 7vw, 6rem);
}

.hero::after {
  position: absolute;
  right: 0;
  bottom: 2rem;
  width: clamp(5rem, 13vw, 10rem);
  height: clamp(5rem, 13vw, 10rem);
  border: 1px solid var(--ink);
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(23, 50, 77, 0.18) 10px 11px);
  content: "";
}

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.button {
  display: inline-block;
  border: 1px solid var(--ink);
  padding: 0.8rem 1rem;
  background: var(--blue);
  color: white;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0.28rem 0.28rem 0 var(--ink);
}
.button.secondary { background: var(--paper-light); color: var(--ink); }
.button:hover { color: white; transform: translate(-1px, -1px); box-shadow: 0.38rem 0.38rem 0 var(--ink); }
.button.secondary:hover { color: var(--blue); }

.rule-section { border-top: 1px solid var(--ink); padding-block: 2.5rem; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; }
.card {
  grid-column: span 4;
  min-height: 14rem;
  border: 1px solid var(--ink);
  padding: 1.35rem;
  background: var(--paper-light);
  box-shadow: 0.35rem 0.35rem 0 var(--line);
}
.card.wide { grid-column: span 6; }
.card p { color: var(--muted); }

.status {
  display: inline-block;
  margin-bottom: 1.1rem;
  border: 1px solid currentColor;
  padding: 0.22rem 0.48rem;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.status.blocked { color: #9d2d1e; }

.notice {
  margin: 2rem 0;
  border: 2px solid #9d2d1e;
  padding: 1rem 1.2rem;
  background: #fff1ec;
  color: #741d13;
  font-weight: 800;
}

.facts { display: grid; grid-template-columns: minmax(9rem, 0.7fr) 2fr; gap: 0; max-width: 52rem; border-top: 1px solid var(--line); }
.facts dt, .facts dd { margin: 0; border-bottom: 1px solid var(--line); padding: 0.85rem 0; }
.facts dt { font-weight: 800; }

.site-footer { border-top: 1px solid var(--ink); padding-block: 2rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1.5rem; }
.site-footer p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.footer-links a { font-size: 0.88rem; }

.book-hero::after { display: none; }
.book-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 280px); gap: 2.5rem; align-items: center; }
.book-cover { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }
.hand { font-style: italic; font-weight: 600; color: #C87532; }
@media (max-width: 760px) {
  .book-hero { grid-template-columns: 1fr; }
  .book-cover { max-width: 240px; }
  .header-inner, .footer-inner { align-items: flex-start; flex-direction: column; padding-block: 1rem; }
  .brand-logo--full { display: none; }
  .brand-logo--compact { display: block; }
  .card, .card.wide { grid-column: 1 / -1; min-height: auto; }
  .hero::after { opacity: 0.45; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { padding-bottom: 0.1rem; border-bottom: 0; }
  .facts dd { padding-top: 0.1rem; }
}

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

@media print {
  .site-header, .site-footer, .actions { display: none; }
  main { width: 100%; padding: 0; }
}

/* Budgetrechner */
.ohne-deko::after { display: none; }
.rechner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 2rem; align-items: start; margin: 2rem 0; }
.rechner fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.25rem 0.5rem; margin: 0 0 1.25rem; background: #fff; }
.rechner legend { font-weight: 700; padding: 0 0.4rem; }
.legende-text { font-size: 0.95rem; margin: 0 0 0.75rem; }
.feld { display: grid; grid-template-columns: minmax(0, 1fr) 9.5rem; gap: 0.75rem; align-items: center; padding: 0.45rem 0; border-top: 1px solid #eee7dc; }
.feld .hinweis { display: block; font-size: 0.85rem; opacity: 0.75; }
.eingabe { display: flex; align-items: center; gap: 0.35rem; }
.eingabe input { width: 100%; font: inherit; text-align: right; padding: 0.45rem 0.55rem; border: 1px solid #9c968c; border-radius: 4px; background: #fffdf9; }
.eingabe input:focus-visible { outline: 3px solid #C87532; outline-offset: 1px; }
.eingabe input[aria-invalid="true"] { border-color: #a12b1f; }
.rechner-ergebnis { position: sticky; top: 1rem; border: 2px solid currentColor; border-radius: 6px; padding: 1rem 1.25rem; background: #fff; }
.ergebnis { display: grid; grid-template-columns: 1fr auto; gap: 0.35rem 1rem; margin: 0 0 1rem; }
.ergebnis dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.ergebnis .summe { font-weight: 700; font-size: 1.25rem; border-top: 2px solid currentColor; padding-top: 0.4rem; }
.ergebnis-text { padding: 0.6rem 0.75rem; border-radius: 4px; background: #f4ede1; }
.ergebnis-text.minus { background: #f7e1dc; }
.ergebnis-text.knapp { background: #f6ead5; }
.ergebnis-text.plus { background: #e4eee0; }
.ergebnis-klein { font-size: 0.95rem; }
.speicher-hinweis { border-top: 1px solid var(--line); padding-top: 0.6rem; }
.rechner-einzug { grid-column: 1 / -1; }
button.button { font: inherit; cursor: pointer; }
@media (max-width: 760px) {
  .rechner { grid-template-columns: 1fr; }
  .rechner-ergebnis { position: static; }
  .feld { grid-template-columns: 1fr; gap: 0.3rem; }
}
@media print {
  .rechner-beispiele, .rechner .actions, .speicher-hinweis { display: none; }
  .rechner-ergebnis { position: static; }
  .rechner { grid-template-columns: 1fr; }
}
