/* Variante 1 "Kontoblatt": Kassabuch-Papier, Tinte, Rotstift. */

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-opsz.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-opsz-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-wght.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --kassabuch: #E4ECE3;
  --blatt: #F7FAF6;
  --tinte: #12332D;
  --bleistift: #52625B;
  --linie: #B9CDBE;
  --rotstift: #B8261D;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --wrap: 74rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --row: 2rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--kassabuch);
  color: var(--tinte);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.6;
  font-optical-sizing: auto;
}

h1, h2, h3 { font-weight: 500; line-height: 1.1; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.9rem); letter-spacing: -0.01em; }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1em; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }

:focus-visible { outline: 3px solid var(--rotstift); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--tinte); color: var(--blatt); padding: .6rem 1rem; font-family: var(--sans);
}
.skip:focus { top: 1rem; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

/* Kopfzeile */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--kassabuch);
  border-bottom: 1px solid var(--linie);
  font-family: var(--sans);
  font-size: .95rem;
}
.top__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: grid; gap: .1rem; text-decoration: none; padding-block: .6rem; }
.brand__name { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }
.brand__sub { font-family: var(--sans); font-size: .8rem; color: var(--bleistift); line-height: 1.3; }
.brand__tld { color: var(--rotstift); }
.nav { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav a { text-decoration: none; padding-block: .5rem; }
.nav a:hover { text-decoration: underline; text-underline-offset: .3em; }
.nav .nav__cta { border: 1.5px solid var(--tinte); padding: .45rem .9rem; border-radius: 2px; }
@media (max-width: 47.99rem) {
  .nav li:not(:last-child) { display: none; }
}

/* Buttons und Links */
.btn {
  display: inline-block;
  font-family: var(--sans); font-weight: 600; font-size: 1rem;
  background: var(--tinte); color: var(--blatt);
  padding: .95rem 1.4rem; border-radius: 2px; text-decoration: none;
  transition: background-color .15s ease;
}
.btn:hover { background: #0A211D; }
.btn--light { background: var(--blatt); color: var(--tinte); }
.btn--light:hover { background: #FFFFFF; }
.link { font-family: var(--sans); font-weight: 500; text-underline-offset: .3em; }

/* Hero */
.hero {
  padding-block: clamp(3rem, 7vw, 6rem) clamp(3rem, 6vw, 5rem);
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--row) - 1px), var(--linie) calc(var(--row) - 1px) var(--row));
  background-position: 0 1.2rem;
  position: relative;
}
@media (min-width: 64rem) {
  .hero::before {
    content: ""; position: absolute; top: 0; bottom: 0;
    left: max(1rem, calc((100% - var(--wrap)) / 2 - 1.5rem));
    border-left: 2px solid color-mix(in srgb, var(--rotstift) 55%, transparent);
  }
}
.hero__grid { display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: start; }
@media (min-width: 60rem) { .hero__grid { grid-template-columns: 1.05fr 1fr; } }
.hero h1 {
  font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4.2rem);
  font-weight: 450;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  background: var(--kassabuch);
}
.lead { font-size: 1.3rem; max-width: 34em; background: var(--kassabuch); }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin-top: 2rem; }

/* Beleg */
.beleg { margin: 0; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.beleg__paper {
  position: relative;
  background: var(--blatt);
  padding: 1.6rem 1.6rem 1.4rem;
  box-shadow: 0 1px 0 var(--linie), 0 18px 40px -24px rgba(18, 51, 45, .45);
  transform: rotate(-1.2deg);
  font-size: .9rem;
  line-height: 1.45;
}
.beleg__head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.beleg__firm { margin: 0; }
.beleg__meta { margin: 0; text-align: right; color: var(--bleistift); }
.beleg__lines { width: 100%; border-collapse: collapse; }
.beleg__lines th { text-align: left; font-weight: 500; color: var(--bleistift); border-bottom: 1px solid var(--linie); padding: .3rem 0; font-size: .8rem; }
.beleg__lines td { padding: .35rem 0; border-bottom: 1px dotted var(--linie); }
.beleg__lines th:nth-child(n+2), .beleg__lines td:last-child { text-align: right; }
.beleg__lines td:nth-child(2) { text-align: right; padding-right: 1rem; }
.beleg__lines tfoot td { border-bottom: 0; }
.beleg__total td { font-weight: 700; border-top: 1.5px solid var(--tinte); }
.beleg__due { margin: 1rem 0 0; color: var(--bleistift); }

.mark { border-radius: 2px; padding: 0 .15em; margin: 0 -.15em; background: color-mix(in srgb, var(--tinte) 7%, transparent); }

.stamp {
  position: absolute; right: 1.4rem; bottom: 1.1rem;
  margin: 0;
  font-family: var(--sans); font-weight: 700; font-size: .95rem; letter-spacing: .02em;
  color: var(--rotstift);
  border: 2.5px solid var(--rotstift);
  padding: .35rem .7rem;
  border-radius: 3px;
  transform: rotate(-8deg);
  background: color-mix(in srgb, var(--blatt) 70%, transparent);
}

.notes { margin: 1.6rem 0 0; display: grid; font-size: .92rem; }
.note { display: grid; grid-template-columns: 6.5rem 1fr; gap: .75rem; padding: .4rem 0; border-bottom: 1px solid var(--linie); }
.note dt { font-weight: 600; }
.note dd { margin: 0; }
.beleg figcaption { margin-top: 1rem; font-size: .85rem; color: var(--bleistift); }
.beleg__replay { margin: .25rem 0 0; font-size: .85rem; }
.replay {
  font: inherit; color: var(--tinte); background: none; border: 0; padding: .25rem 0; margin-left: .25rem;
  text-decoration: underline; text-underline-offset: .25em; cursor: pointer;
}

/* Ladesequenz: einmal beim Laden, danach Ruhe. Ohne Bewegung ist der Endzustand sofort da. */
@media (prefers-reduced-motion: no-preference) {
  .is-playing .mark { animation: mark-hit .6s ease both; }
  .is-playing .note { opacity: 0; animation: note-in .45s ease forwards; }
  .is-playing .stamp { opacity: 0; animation: stamp-in .35s cubic-bezier(.2, 1.6, .4, 1) forwards; animation-delay: 4.1s; }
  .is-playing .mark--1, .is-playing .note--1 { animation-delay: .6s; }
  .is-playing .mark--2, .is-playing .note--2 { animation-delay: 1.3s; }
  .is-playing .mark--3, .is-playing .note--3 { animation-delay: 2s; }
  .is-playing .mark--4, .is-playing .note--4 { animation-delay: 2.7s; }
  .is-playing .mark--5, .is-playing .note--5 { animation-delay: 3.4s; }
}
@keyframes mark-hit {
  0% { background: transparent; box-shadow: inset 0 0 0 1.5px transparent; }
  40% { background: color-mix(in srgb, var(--tinte) 14%, transparent); box-shadow: inset 0 0 0 1.5px var(--tinte); }
  100% { background: color-mix(in srgb, var(--tinte) 7%, transparent); box-shadow: inset 0 0 0 1.5px transparent; }
}
@keyframes note-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes stamp-in { from { opacity: 0; transform: rotate(-8deg) scale(1.6); } to { opacity: 1; transform: rotate(-8deg) scale(1); } }

/* Abschnitte */
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); border-top: 1px solid var(--linie); }
.section--paper { background: var(--blatt); }
.section--ink { background: var(--tinte); color: var(--blatt); border-top: 0; }
.section__intro { color: var(--bleistift); max-width: 40em; margin-top: 1rem; }

/* Kontenauszug */
.ledger { margin-top: 2.5rem; font-family: var(--sans); font-size: 1rem; line-height: 1.5; border-top: 2px solid var(--tinte); }
.ledger__row {
  display: grid;
  grid-template-columns: 4.5rem 9rem 1fr 12rem;
  gap: 1.25rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--linie);
  align-items: baseline;
}
.ledger__row--head { font-size: .85rem; color: var(--bleistift); padding-block: .6rem; }
.ledger__nr { font-variant-numeric: tabular-nums; color: var(--bleistift); }
.ledger__area { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; }
.ledger__row > :last-child { color: var(--rotstift); font-weight: 500; }
.ledger__row--head > :last-child { color: var(--bleistift); font-weight: 400; }
@media (max-width: 52rem) {
  .ledger__row { grid-template-columns: 3.5rem 1fr; gap: .25rem 1rem; }
  .ledger__row > :nth-child(n+3) { grid-column: 2; }
  .ledger__row--head { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .ledger__row > :last-child::before { content: "Bei Ihnen: "; color: var(--bleistift); font-weight: 400; }
}

/* Brief: Simon stellt sich vor wie in einem Geschäftsbrief */
.letter {
  max-width: 40rem;
  margin-inline: auto;
  background: var(--blatt);
  padding: clamp(1.75rem, 5vw, 3.5rem);
  box-shadow: 0 1px 0 var(--linie), 0 24px 50px -34px rgba(18, 51, 45, .5);
  font-size: 1.15rem;
  line-height: 1.7;
}
.letter p { max-width: 34em; }
.letter__place { text-align: right; color: var(--bleistift); font-size: 1rem; margin-bottom: 2.5rem; }
.letter__salute { margin-bottom: 1.25rem; }
.letter__close { margin-top: 2rem; }
.letter__sign { display: flex; align-items: center; gap: 1.25rem; margin-top: 1rem; }
.letter__sign img { width: 5.5rem; height: 5.5rem; object-fit: cover; object-position: 50% 20%; border-radius: 2px; }
.letter__sign p { margin: 0; font-family: var(--sans); font-size: .9rem; line-height: 1.45; color: var(--bleistift); }
.letter__name { font-family: var(--serif); font-style: italic; font-size: 1.9rem; color: var(--tinte); line-height: 1.2; }

/* Offerte */
.offer { width: 100%; margin-top: 2.5rem; border-collapse: collapse; font-family: var(--sans); font-size: 1rem; line-height: 1.5; }
.offer caption { text-align: left; }
.offer th, .offer td { text-align: left; vertical-align: baseline; padding: 1rem 1.25rem 1rem 0; border-bottom: 1px solid var(--linie); }
.offer thead th { font-size: .85rem; font-weight: 400; color: var(--bleistift); border-bottom: 2px solid var(--tinte); padding-block: .6rem; }
.offer tbody th { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; white-space: nowrap; }
.offer td:first-child { color: var(--bleistift); font-variant-numeric: tabular-nums; width: 3rem; }
.offer td:last-child { white-space: nowrap; font-weight: 600; padding-right: 0; text-align: right; }
.offer thead th:last-child { text-align: right; padding-right: 0; }
@media (max-width: 44rem) {
  .offer thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .offer tr { display: grid; grid-template-columns: 2rem 1fr; gap: .25rem .75rem; padding: 1rem 0; border-bottom: 1px solid var(--linie); }
  .offer th, .offer td { border: 0; padding: 0; }
  .offer td:nth-child(n+3) { grid-column: 2; }
  .offer td:last-child { text-align: left; }
}

/* Kontakt */
.contact > * { max-width: 46rem; }
.contact h2 { font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4rem); margin-bottom: 1.25rem; }
.contact p { font-size: 1.3rem; }
.contact .btn { margin-top: 1rem; }
.contact .contact__mail { font-family: var(--sans); font-size: 1rem; opacity: .8; }
.section--ink :focus-visible { outline-color: var(--blatt); }

/* Fuss */
.foot { font-family: var(--sans); font-size: .9rem; color: var(--bleistift); padding-block: 2rem; }
.foot__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
.foot p { margin: 0; }
