/* Barbarigo – Stylesheet
   Designsystem von artnim.io übernommen: Inter, Teal-Akzent, Dark als Standard.
   Schriften liegen lokal unter /fonts. Keine externen Requests, kein Tracking. */

@font-face { font-family: Inter; font-style: normal; font-weight: 300; font-display: swap; src: url(/fonts/inter-300.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/inter-400.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/inter-500.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/inter-600.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/inter-700.woff2) format("woff2"); }

:root {
  /* Hell – Standard, .dark überschreibt */
  --bg:      #f8f8fa;
  --surface: #ffffff;
  --card:    #f0f0f4;
  --text:    #1a1a2e;
  --muted:   #5a5a72;
  --border:  rgba(26, 26, 46, 0.10);
  --border-strong: rgba(26, 26, 46, 0.18);
  --hover:   rgba(26, 26, 46, 0.06);
  --accent:  #1a6c62;          /* abgedunkelt für Text auf hellem Grund */
  --accent-solid: #2a9d8f;     /* Markenton für Rahmen und Marker */
  --accent-fill: #227e72;      /* Flächen mit weißer Schrift, 4.89:1 */
  --accent-fill-hover: #1d6b61;
  --accent-hover: #114b44;
  --accent-glow: rgba(42, 157, 143, 0.14);
  --on-accent: #ffffff;
  --warn: #b4432c;

  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --r-sm: 0.25rem;
  --r-md: 0.375rem;
  --r-lg: 0.5rem;
  --r-xl: 0.75rem;

  --measure: 38rem;
  --gutter: clamp(1.25rem, 5vw, 2rem);
}

html.dark {
  --bg:      #0b0b0f;
  --surface: #12121a;
  --card:    #16161f;
  --text:    #e8e8ed;
  --muted:   #9a9ab0;
  --border:  rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --hover:   rgba(255, 255, 255, 0.06);
  --accent:  #35b3a3;
  --accent-solid: #2a9d8f;
  --accent-fill: #227e72;
  --accent-fill-hover: #1d6b61;
  --accent-hover: #4cc4b5;
  --accent-glow: rgba(42, 157, 143, 0.25);
  --on-accent: #ffffff;
  --warn: #e0705a;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* ── Grundraster ──────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ── Kopfleiste ───────────────────────────────────────────────────── */

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

.brand svg { width: 1.6rem; height: 1.6rem; flex: none; }
.brand sup { font-size: 0.52em; font-weight: 500; color: var(--muted); }

.top-nav { display: flex; align-items: center; gap: 1.4rem; }

.top-nav a {
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.top-nav a:hover { color: var(--text); }
.top-nav a[aria-current="page"] { color: var(--text); font-weight: 500; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem;
  border: none;
  border-radius: var(--r-lg);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover { color: var(--text); background: var(--hover); }
/* Gleiche Spezifität in allen vier Regeln, sonst gewinnt die Größenangabe
   gegen die Sichtbarkeit und es erscheinen beide Symbole. */
.theme-toggle svg { width: 1.15rem; height: 1.15rem; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html.dark .theme-toggle .icon-sun { display: block; }
html.dark .theme-toggle .icon-moon { display: none; }

@media (max-width: 40rem) {
  .top-nav { gap: 1rem; }
  .top-nav a { font-size: 0.85rem; }
  /* Rechtslinks bleiben über den Fuß erreichbar, die Kopfleiste bleibt schmal. */
  .top-nav .nav-secondary { display: none; }
}

/* ── Typografie ───────────────────────────────────────────────────── */

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 1rem; }

h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); }
h3 { font-size: 1.125rem; margin-top: 2.25rem; margin-bottom: 0.6rem; }

.page-title { font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.4rem); }

p { margin: 0 0 1.1rem; max-width: var(--measure); }

.lede {
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.2rem);
  font-weight: 300;
  color: var(--muted);
  line-height: 1.65;
}

.eyebrow, .section-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

a { color: var(--accent); text-underline-offset: 0.2em; transition: color 0.2s ease; }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: 2px solid var(--accent-solid); outline-offset: 3px; border-radius: var(--r-sm); }

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 1rem; top: 0.75rem; z-index: 100;
  background: var(--accent-fill); color: #ffffff;
  padding: 0.55rem 1rem; border-radius: var(--r-lg);
  font-size: 0.875rem; font-weight: 500; text-decoration: none;
}

/* ── Hero mit Akzentschein ────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3.5rem, 9vw, 6rem) 0 clamp(1.5rem, 3vw, 2.5rem);
}

.hero::before {
  content: "";
  position: absolute;
  top: -17rem; left: 32%;
  width: min(48rem, 150vw); height: 36rem;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero > * { position: relative; z-index: 1; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin: 2.75rem 0 0;
}

.stats > div { min-width: 6rem; }

.stats dt {
  font-size: clamp(1.4rem, 1.15rem + 0.9vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1.15;
}

.stats dd { margin: 0.15rem 0 0; font-size: 0.8rem; color: var(--muted); }

/* ── Abschnitte ───────────────────────────────────────────────────── */

.section { padding: clamp(2.75rem, 6vw, 4.5rem) 0; }
.section + .section { border-top: 1px solid var(--border); }
.section > :last-child { margin-bottom: 0; }

/* ── Karten ───────────────────────────────────────────────────────── */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin: 2rem 0 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.5rem;
  transition: border-color 0.2s ease;
}

.card:hover { border-color: var(--accent-solid); }
.card h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.card p { margin: 0; font-size: 0.925rem; color: var(--muted); max-width: none; }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1.1rem 0 0; }

.tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.15rem 0.45rem;
}

/* ── Kontenblatt: die eine Stelle, an der Barbarigo eigen wird ────── */

.ledger {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin: 2rem 0 1.1rem;
}

.ledger-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.ledger-head::before {
  content: "";
  width: 0.4rem; height: 0.4rem;
  border-radius: 50%;
  background: var(--accent-solid);
  flex: none;
}

.ledger-scroll { overflow-x: auto; }

.ledger table {
  width: 100%;
  min-width: 33rem;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.6;
}

.ledger th {
  text-align: left;
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.6rem 1.1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.ledger td {
  padding: 0.45rem 1.1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

/* Innerhalb eines Buchungssatzes keine Trennlinie – erst der nächste Satz
   beginnt eine neue. So bleibt sichtbar, was zusammengehört. */
.ledger tbody td { border-bottom: none; }
.ledger tbody tr.satz-start td { border-top: 1px solid var(--border); }
.ledger tbody tr:first-child td { border-top: none; }
.ledger tr.storno td { color: var(--accent); }

.ledger tfoot td {
  border-top: 1px solid var(--border-strong);
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  font-weight: 600;
  color: var(--text);
}

.num { text-align: right; white-space: nowrap; width: 1%; }
/* Höhere Spezifität nötig: die Kurzform in .ledger td setzt padding-left mit. */
.ledger td.indent { padding-left: 2.6rem; }
.ledger-note { font-size: 0.9rem; color: var(--muted); margin: 0; }

/* ── Registerzeilen (Impressum) ───────────────────────────────────── */

.register {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin: 0 0 2rem;
  max-width: 46rem;
}

.register-row {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0 1.5rem;
  padding: 0.95rem 1.4rem;
  border-bottom: 1px solid var(--border);
}

.register-row:last-child { border-bottom: none; }

.register-key {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.25rem;
}

.register-val { font-size: 0.95rem; }
.register-val p { margin: 0 0 0.3rem; max-width: none; }
.register-val p:last-child { margin-bottom: 0; }
.register-val .sub { color: var(--muted); font-size: 0.85rem; }

@media (max-width: 40rem) {
  .register-row { grid-template-columns: 1fr; gap: 0.25rem; }
}

.todo {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: #ffffff;
  background: #a63a24;
  border-radius: var(--r-sm);
  padding: 0.1rem 0.45rem;
}

/* ── Formular ─────────────────────────────────────────────────────── */

.form { max-width: 34rem; }
.field { margin: 0 0 1.35rem; }

.field > label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0 0 0.45rem;
}

.field .hint {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
}

/* Hinweis im Label läuft in der Zeile mit, nicht darunter. */
.field > label .hint { display: inline; margin: 0 0 0 0.4rem; }

.field input[type="text"],
.field input[type="email"],
.field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 0.65rem 0.85rem;
  transition: border-color 0.2s ease;
}

.field input:hover, .field textarea:hover { border-color: var(--accent-solid); }
.field textarea { min-height: 9.5rem; resize: vertical; line-height: 1.6; }

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: var(--measure);
}

.consent input { margin-top: 0.3rem; accent-color: var(--accent-solid); }
.consent label { font-weight: 400; font-size: inherit; margin: 0; }

/* Honigtopf gegen Bots. Kein Captcha, weil Captcha Drittdaten bedeutet. */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: #ffffff;
  background: var(--accent-fill);
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  padding: 0.7rem 1.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.button:hover { background: var(--accent-fill-hover); }
.button[disabled] { opacity: 0.55; cursor: default; }

.notice {
  font-size: 0.875rem;
  padding: 0.85rem 1.1rem;
  margin: 1.3rem 0 0;
  max-width: var(--measure);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-solid);
  border-radius: var(--r-lg);
  background: var(--card);
}

.notice[data-state="error"] { border-left-color: var(--warn); }
.notice[hidden] { display: none; }

/* ── Rechtstexte ──────────────────────────────────────────────────── */

.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.75rem; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.15rem; margin: 0 0 1.1rem; }
.prose li { margin: 0 0 0.45rem; }
.prose li::marker { color: var(--accent); }

/* ── Abstandshelfer ───────────────────────────────────────────────── */
/* Als Klassen statt style-Attribut: die CSP erlaubt kein 'unsafe-inline',
   Inline-Styles würden vom Browser stillschweigend verworfen. */

.mb-lg { margin-bottom: 2.3rem; }
.mt-md { margin-top: 1.6rem; }
.mt-sm { margin-top: 1.4rem; }

/* ── Fuß ──────────────────────────────────────────────────────────── */

.foot {
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 2rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
  color: var(--muted);
}

.foot nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); }

/* ── Bewegung ─────────────────────────────────────────────────────── */

.fade-in { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.fade-in.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; }
}

@media print {
  .top, .foot { display: none; }
  body { background: #fff; color: #000; }
}
