/* ==========================================================================
   Lot und Licht — gemeinsames Stylesheet
   Farbwelt: Indigo, warmes Gelb, Betongrau, Off-White.
   Gestaltungssprache: Vermessungsblatt — ein gerahmter Planbogen auf
   Millimeterpapier, Register statt Karten, Maßlinien, Senklot,
   harte Kontraste, großzügiger Weißraum.
   Keine externen Abhängigkeiten.
   ========================================================================== */

:root {
  /* Farbwelt */
  --indigo: #33378f;
  --indigo-deep: #22255f;
  --indigo-tint: #e9eaf6;
  --yellow: #eec02e;
  --yellow-soft: #fbf0cf;
  --concrete: #6f7076;
  --concrete-light: #d9d9d6;
  --offwhite: #f7f5f0;
  --paper: #fffdf9;
  --ink: #232326;

  /* Typografie — Systemstapel, passend für Deutsch (Deutschland) */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;

  /* Abstandsrhythmus (Basis 4 px) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --max-width: 62rem;
  --line: 1px solid var(--concrete-light);
}

/* ---------- Basis ---------- */

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

html {
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--offwhite);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  /* Millimeterpapier unter dem Planbogen */
  background-image:
    linear-gradient(to right, rgba(111, 112, 118, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(111, 112, 118, 0.06) 1px, transparent 1px);
  background-size: 2.5rem 2.5rem;
}

::selection {
  background: var(--yellow-soft);
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--indigo-deep);
  margin: 0;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.55rem, 1.25rem + 1.5vw, 2.1rem); }
h2 { font-size: clamp(1.45rem, 1.2rem + 1.2vw, 2rem); }
h3 { font-size: 1.25rem; }

p {
  margin: 0 0 var(--space-4);
  max-width: 44rem;
}

a {
  color: var(--indigo);
  text-decoration-color: var(--yellow);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
  color: var(--indigo-deep);
  text-decoration-color: var(--indigo);
}

ul {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-6);
  max-width: 44rem;
}

li {
  margin-bottom: var(--space-2);
}

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

/* ---------- Der Planbogen: Seite als gerahmte Zeichnung ---------- */

.sheet {
  position: relative;
  max-width: calc(var(--max-width) + 12rem);
  margin: clamp(0.5rem, 2.5vw, 1.75rem) auto;
  background: var(--paper);
  border: var(--line);
}

/* Innenrahmen wie am Planrand */
.sheet::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--indigo);
  pointer-events: none;
  z-index: 4;
}

.sheet-inner {
  padding: clamp(var(--space-6), 5vw, var(--space-16)) clamp(var(--space-5), 6vw, var(--space-16));
}

/* ---------- Kopfzeile ---------- */

.masthead-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-6);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand:hover,
.brand:focus-visible {
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  flex: 0 0 auto;
  width: clamp(3rem, 6vw, 4.25rem);
  height: auto;
}

.brand-name {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 1.5rem + 3vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--indigo-deep);
  line-height: 1.05;
  margin: 0;
}

.brand-tagline {
  display: block;
  font-size: 0.9rem;
  color: var(--concrete);
  line-height: 1.5;
  margin-top: var(--space-3);
  max-width: 34rem;
}

.site-nav {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
}

.site-nav a {
  text-decoration: none;
  color: var(--concrete);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--indigo-deep);
  border-bottom-color: var(--yellow);
}

/* Blattheader unter dem Kopf: Haarlinie + Bestandszeile */
.masthead-rule {
  height: 1px;
  background: var(--concrete-light);
  margin-top: var(--space-8);
  position: relative;
}

.masthead-rule::before,
.masthead-rule::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 1px;
  height: 9px;
  background: var(--concrete);
}

.masthead-rule::before { left: 0; }
.masthead-rule::after { right: 0; }

.masthead-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-6);
  padding-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--concrete);
}

/* ---------- Abschnittskopf ---------- */

.section-head {
  margin-bottom: var(--space-8);
}

.kicker {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--indigo);
  margin-bottom: var(--space-3);
}

.kicker::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  background: var(--yellow);
  flex: 0 0 auto;
}

.section-rule {
  display: block;
  height: 1px;
  background: var(--concrete-light);
  position: relative;
  margin-top: var(--space-5);
}

.section-rule::before,
.section-rule::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 1px;
  height: 9px;
  background: var(--concrete);
}

.section-rule::before { left: 0; }
.section-rule::after { right: 0; }

/* ---------- Einführung ---------- */

.intro {
  margin-bottom: var(--space-2);
}

.intro .lead {
  font-size: 1.12rem;
  line-height: 1.75;
}

/* Initiale wie im Buchsatz */
.intro .lead::first-letter {
  font-family: var(--font-serif);
  font-size: 3.2em;
  font-weight: 600;
  line-height: 0.82;
  float: left;
  padding: 0.04em 0.1em 0 0;
  color: var(--indigo-deep);
}

.intro p:last-child {
  margin-bottom: 0;
}

/* ---------- Senklot-Trenner ---------- */

.plumb-rule {
  display: flex;
  justify-content: center;
  margin: var(--space-12) 0;
}

.plumb-rule svg {
  height: 6.5rem;
  width: auto;
  display: block;
}

/* ---------- Das Register ---------- */

.register {
  list-style: none;
  margin: 0 calc(-1 * var(--space-3));
  padding: 0;
  max-width: none;
  border-top: 1px solid var(--concrete);
  border-bottom: 1px solid var(--concrete);
}

.entry {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  gap: var(--space-4) var(--space-6);
  align-items: baseline;
  padding: var(--space-5) var(--space-3);
  border-bottom: var(--line);
  transition: background-color 0.15s ease;
}

.entry:last-child {
  border-bottom: none;
}

.entry:hover,
.entry:focus-within {
  background: var(--indigo-tint);
}

.entry-no {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: var(--concrete);
  align-self: start;
  padding-top: 0.35rem;
}

.entry h3 {
  display: inline;
  font-size: 1.3rem;
  margin-right: 0.35rem;
}

.entry h3::after {
  content: ".";
}

.entry-desc {
  display: inline;
  color: var(--concrete);
  font-size: 0.98rem;
  margin: 0;
  max-width: none;
}

.entry-go {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  color: var(--indigo);
  border-bottom: 2px solid var(--yellow);
  padding-bottom: 3px;
}

.entry-go:hover,
.entry-go:focus-visible {
  color: var(--indigo-deep);
  border-bottom-color: var(--indigo);
}

.entry-go .arrow {
  color: var(--yellow);
  font-weight: 700;
}

/* ---------- Fließtext-Seiten (Datenschutz, Kontakt) ---------- */

.prose {
  max-width: 46rem;
}

.prose h2 {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: var(--line);
}

.prose h2:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: var(--space-6);
}

/* Kontakt-E-Mail als klarer, ruhiger Kasten */
.contact-box {
  background: var(--offwhite);
  border: var(--line);
  border-left: 4px solid var(--yellow);
  padding: var(--space-6) var(--space-8);
  margin: var(--space-6) 0 var(--space-8);
}

.contact-box a {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 0.85rem + 0.6vw, 1.2rem);
  font-weight: 600;
  color: var(--indigo-deep);
  text-decoration-color: var(--indigo);
  word-break: break-word;
}

/* ---------- Fußzeile ---------- */

.site-footer {
  margin-top: var(--space-16);
  background: var(--indigo-deep);
  color: var(--offwhite);
  position: relative;
}

/* Lichtstrich am oberen Rand der Fußzeile */
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--yellow) 0 3.5rem, rgba(255, 253, 249, 0.28) 3.5rem 100%);
}

.site-footer .sheet-inner {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3) var(--space-8);
}

.footer-brand {
  width: 100%;
  max-width: none;
  margin: 0 0 var(--space-2);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.footer-contact {
  margin: 0;
  font-size: 0.95rem;
}

.footer-contact a {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--yellow);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.footer-contact a:hover,
.footer-contact a:focus-visible {
  color: var(--yellow-soft);
  border-bottom-color: var(--yellow);
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
}

.footer-nav a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--offwhite);
  text-decoration: none;
  border-bottom: 2px solid var(--yellow);
  padding-bottom: 3px;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--yellow);
}

.footer-legal {
  width: 100%;
  max-width: none;
  margin: var(--space-4) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255, 253, 249, 0.2);
  font-size: 0.8rem;
  color: rgba(233, 234, 246, 0.7);
}

/* ---------- Schmale Geräte ---------- */

@media (max-width: 46rem) {
  .site-nav {
    margin-left: 0;
    width: 100%;
  }

  .entry {
    grid-template-columns: 2.5rem minmax(0, 1fr);
    gap: var(--space-3) var(--space-4);
  }

  .entry-go {
    grid-column: 2;
    justify-self: start;
    white-space: normal;
    word-break: break-all;
  }

  .intro .lead::first-letter {
    font-size: 2.6em;
  }
}
