@font-face {
  font-family: "Sofia Sans";
  src: url("fonts/sofia-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 1 1000;
  font-display: swap;
}
@font-face {
  font-family: "Sofia Sans Extra Condensed";
  src: url("fonts/sofia-sans-extra-condensed-latin-wght-normal.woff2") format("woff2");
  font-weight: 1 1000;
  font-display: swap;
}

:root {
  --papier: #fff;
  --tinte: #000;
  --blass: #55585e;
  --stift: #1a3fd6;
  --gelb: #ffd84a;
  --blau: #9cc8f4;
  --rosa: #f8b4b9;
  --gruen: #93d6a8;
  --rand: clamp(1rem, 3vw, 3rem);
  --leiste: 3.25rem;
  --breit: 106rem;
  --text: "Sofia Sans", "Helvetica Neue", Arial, sans-serif;
  --schmal: "Sofia Sans Extra Condensed", "Arial Narrow", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font: 400 1.0625rem/1.45 var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--stift); outline-offset: 2px; }

/* Kopf */
.kopf {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
  max-width: var(--breit);
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 3.5rem) var(--rand) clamp(1.5rem, 3vw, 2.75rem);
}
.kopf h1 {
  font: 900 clamp(4rem, 9.2vw, 10rem)/.86 var(--schmal);
  letter-spacing: -.005em;
}
.kopf h1 span { display: block; }
.kopf-text p {
  max-width: 36ch;
  margin-top: 1.25rem;
  font-size: clamp(1.125rem, 1.5vw, 1.375rem);
  line-height: 1.3;
}

/* Legende, gesetzt wie ein Formularblock */
.legende { border: 1.5px solid var(--tinte); }
.legende h2 {
  padding: .55rem .85rem .45rem;
  border-bottom: 1.5px solid var(--tinte);
  font: 700 1.0625rem/1.2 var(--text);
}
.legende-zeile {
  padding: .7rem .85rem .75rem;
  border-bottom: 1px solid var(--tinte);
}
.legende-zeile p {
  margin-top: .4rem;
  color: var(--blass);
  font-size: .9375rem;
  line-height: 1.3;
  text-align: center;
}
.legende-fuss {
  padding: .55rem .85rem .6rem;
  font-size: .9375rem;
  line-height: 1.3;
}

/* Skala: sieben Kästchen zwischen zwei Polen */
.skala {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: .6rem;
}
.pol { font-size: 1rem; line-height: 1.1; color: var(--blass); }
.pol-links { text-align: right; }
.pol.stark { color: var(--tinte); font-weight: 800; }
.kaestchen { display: inline-flex; gap: .25rem; }
.kaestchen i {
  position: relative;
  display: block;
  width: 1.3125rem;
  height: 1.3125rem;
  border: 1.5px solid var(--tinte);
  background: var(--papier);
}
.kreuz svg {
  position: absolute;
  inset: -.22rem;
  width: calc(100% + .44rem);
  height: calc(100% + .44rem);
  overflow: visible;
  fill: none;
  stroke: var(--stift);
  stroke-width: 2.5;
  stroke-linecap: round;
}

/* Reiter: bleibt oben stehen und wächst in die aktuelle Mappe hinein */
.reiter {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  gap: .25rem;
  height: var(--leiste);
  padding-inline: var(--rand);
  background: var(--papier);
}
.reiter a {
  flex: 1 1 auto;
  height: 2.625rem;
  padding: .45rem .8rem 0;
  background: var(--c);
  clip-path: polygon(.5rem 0, calc(100% - .5rem) 0, 100% 100%, 0 100%);
  font: 700 clamp(1.1875rem, 2vw, 1.75rem)/1.1 var(--schmal);
  text-decoration: none;
  white-space: nowrap;
  transition: height .18s ease-out;
}
.reiter a:hover { height: 3rem; }
.reiter a[aria-current="true"] { height: calc(var(--leiste) - .25rem); padding-top: .55rem; font-weight: 900; }
.reiter a:focus-visible { outline-offset: -5px; }
[data-reiter="privathaftpflicht"], #privathaftpflicht { --c: var(--gelb); }
[data-reiter="kfz"], #kfz { --c: var(--blau); }
[data-reiter="hausrat"], #hausrat { --c: var(--rosa); }
[data-reiter="altersvorsorge"], #altersvorsorge { --c: var(--gruen); }

/* Mappe je Sparte */
.mappe {
  background: var(--c);
  padding: clamp(1.25rem, 2.5vw, 2.25rem) var(--rand) clamp(2.5rem, 5vw, 5rem);
  scroll-margin-top: var(--leiste);
}
.mappe-titel {
  max-width: var(--breit);
  margin: 0 auto clamp(1rem, 2vw, 1.75rem);
  font: 900 clamp(4.25rem, 10.5vw, 11.5rem)/.82 var(--schmal);
  letter-spacing: -.005em;
}
.blaetter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 2rem);
  max-width: var(--breit);
  margin-inline: auto;
}

/* Blatt je Design */
.blatt {
  display: flex;
  flex-direction: column;
  background: var(--papier);
  border: 1.5px solid var(--tinte);
}
.buehne {
  display: block;
  border-bottom: 1.5px solid var(--tinte);
  background: #ddd;
}
.buehne img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.ansichten {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1.5px solid var(--tinte);
}
.ansichten button {
  position: relative;
  padding: 0;
  border: 0;
  border-right: 1.5px solid var(--tinte);
  background: #ddd;
  cursor: pointer;
}
.ansichten button:last-child { border-right: 0; }
.ansichten img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.ansichten button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 4px solid var(--stift);
}
.ansichten button:focus-visible { outline-offset: -7px; }

.zeile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border-bottom: 1px solid var(--tinte);
}
.feld { padding: .5rem .85rem .7rem; }
.feld-name {
  display: block;
  margin-bottom: .15rem;
  color: var(--blass);
  font-size: .875rem;
  line-height: 1.2;
}
.feld-design h3 {
  font: 900 clamp(2.25rem, 3.6vw, 3.5rem)/.95 var(--schmal);
}
.feld-sparte {
  min-width: 34%;
  border-left: 1px solid var(--tinte);
  background: var(--c);
}
.feld-sparte .feld-name { color: var(--tinte); }
.feld-sparte p {
  font: 800 clamp(1.5rem, 2.2vw, 2.125rem)/1.05 var(--schmal);
}
.feld-text { flex: 1; border-bottom: 1px solid var(--tinte); }
.feld-text p { max-width: 62ch; font-size: 1.125rem; line-height: 1.38; }
.feld-skalen { display: grid; gap: .45rem; padding-bottom: .95rem; }
.feld-skalen .feld-name { margin-bottom: .1rem; }

.oeffnen {
  display: block;
  padding: .7rem .85rem .75rem;
  background: var(--tinte);
  color: var(--papier);
  font: 800 clamp(1.5rem, 2vw, 1.875rem)/1.05 var(--schmal);
  text-align: center;
  text-decoration: none;
}
.oeffnen:hover { background: var(--stift); }
.oeffnen:focus-visible { outline-offset: -6px; outline-color: var(--papier); }

/* Fuß */
.fuss {
  max-width: var(--breit);
  margin-inline: auto;
  padding: 1.5rem var(--rand) 2.5rem;
  color: var(--blass);
  font-size: .9375rem;
}

/* Der eine Moment beim Laden: die Kreuze der Legende werden von Hand gesetzt */
@media (prefers-reduced-motion: no-preference) {
  .legende .kreuz svg use { stroke-dasharray: 26; stroke-dashoffset: 26; animation: ziehen .32s ease-out forwards; }
  .legende-zeile:nth-of-type(1) .kreuz use { animation-delay: .35s; }
  .legende-zeile:nth-of-type(2) .kreuz use { animation-delay: .7s; }
  .legende-zeile:nth-of-type(3) .kreuz use { animation-delay: 1.05s; }
}
@keyframes ziehen { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reiter a { transition: none; }
}

/* Schmal */
@media (max-width: 62rem) {
  .kopf { grid-template-columns: minmax(0, 1fr); }
  .kopf h1 { font-size: clamp(3rem, 15.5vw, 9rem); }
  .blaetter { grid-template-columns: minmax(0, 1fr); }
  .mappe-titel { font-size: clamp(3rem, 16vw, 9rem); }
}
@media (max-width: 30rem) {
  .reiter { gap: .125rem; padding-inline: .5rem; }
  .reiter a { padding-inline: .4rem; font-size: min(1.1875rem, 5vw); text-align: center; }
  .pol { font-size: .9375rem; }
  .kaestchen { gap: .1875rem; }
  .kaestchen i { width: 1.1875rem; height: 1.1875rem; }
  .feld-sparte { min-width: 0; }
}
@media (max-width: 23.4rem) {
  .skala { column-gap: .35rem; }
  .pol { font-size: .875rem; }
  .kaestchen { gap: .125rem; }
  .kaestchen i { width: 1rem; height: 1rem; }
  .zeile { grid-template-columns: minmax(0, 1fr); }
  .feld-sparte { border-left: 0; border-top: 1px solid var(--tinte); }
}
