/* Kodari WMLE – Website
   Farben: Papier, Tusche, Planblau; Vorlauf-Rot nur als Linienfarbe.
   Schriften lokal gehostet (keine Verbindung zu Google). */

@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-condensed-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2"); }

:root {
  --paper: #f4f6f8;
  --sheet: #ffffff;
  --ink: #14212e;
  --ink-soft: #4a5a6a;
  --blue: #1f4e79;
  --blue-strong: #173d60;
  --on-blue: #ffffff;
  --line: #c9d3dd;
  --grid: rgba(31, 78, 121, 0.06);
  --supply: #d0342c;
  --return: #2f7fd1;
  --air: #2bb3c8;
  --placeholder-bg: #fff2c6;
  --placeholder-ink: #6b4d00;

  --f-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4.5rem; --s-9: 6.5rem;
  --wrap: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1720;
    --sheet: #13212d;
    --ink: #e3eaf1;
    --ink-soft: #9fb0c0;
    --blue: #7fb2e5;
    --blue-strong: #a5c9ee;
    --on-blue: #0d1720;
    --line: #28394a;
    --grid: rgba(127, 178, 229, 0.06);
    --supply: #ff6a5c;
    --return: #6fb0ff;
    --air: #5fd3e3;
    --placeholder-bg: #3b3012;
    --placeholder-ink: #ffd978;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1720;
  --sheet: #13212d;
  --ink: #e3eaf1;
  --ink-soft: #9fb0c0;
  --blue: #7fb2e5;
  --blue-strong: #a5c9ee;
  --on-blue: #0d1720;
  --line: #28394a;
  --grid: rgba(127, 178, 229, 0.06);
  --supply: #ff6a5c;
  --return: #6fb0ff;
  --air: #5fd3e3;
  --placeholder-bg: #3b3012;
  --placeholder-ink: #ffd978;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  padding-inline: 1rem;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-strong); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.05; margin: 0; text-wrap: balance; letter-spacing: 0.005em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); }
h2 { font-size: clamp(2rem, 4vw, 2.9rem); }
h3 { font-size: 1.5rem; }
p { margin: 0; max-width: 65ch; }

.wrap { max-width: var(--wrap); margin-inline: auto; }
.mono { font-family: var(--f-mono); font-size: 0.8125rem; letter-spacing: 0.02em; }
.label {
  font-family: var(--f-mono); font-size: 0.75rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-soft);
}
.ph { background: var(--placeholder-bg); color: var(--placeholder-ink); padding: 0 0.25em; border-radius: 2px; }

/* ---------- Kopfzeile ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  margin-inline: -1rem; padding-inline: 1rem;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding-block: var(--s-3); flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: var(--s-2); color: var(--ink); text-decoration: none; }
.brand-mark { font-family: var(--f-display); font-weight: 600; font-size: 1.55rem; letter-spacing: 0.04em; }
.brand-mark b { color: var(--blue); font-weight: 600; }
.brand img { height: 2.2rem; width: auto; }
.nav { display: flex; gap: var(--s-5); flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.nav a:hover { color: var(--blue); }

/* ---------- Hero ---------- */
.hero { padding-block: var(--s-8) var(--s-7); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s-7); align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: var(--s-5); }
.hero h1 .accent { color: var(--blue); }
.hero-lead { font-size: 1.15rem; color: var(--ink-soft); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font: 500 1rem/1 var(--f-body); padding: 0.9rem 1.3rem; border-radius: 3px;
  text-decoration: none; cursor: pointer; border: 1px solid var(--blue);
}
.btn-primary { background: var(--blue); color: var(--on-blue); }
.btn-primary:hover { background: var(--blue-strong); border-color: var(--blue-strong); color: var(--on-blue); }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-ghost:hover { background: var(--grid); }

.scope-note { display: flex; gap: var(--s-4); flex-wrap: wrap; }
.scope-note span { font-family: var(--f-mono); font-size: 0.8rem; color: var(--ink-soft); }
.scope-note span::before { content: "— "; color: var(--supply); }

/* Berechnungsauszug im Hero */
.calc-sheet {
  background: var(--sheet); border: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgba(20, 33, 46, 0.45);
}
.calc-sheet svg { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--line); }
.calc-sheet .flow { stroke-dasharray: 10 8; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -36; } }
@media (prefers-reduced-motion: reduce) { .calc-sheet .flow { animation: none; } }
.calc-head { display: flex; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
.calc-table-wrap { overflow-x: auto; }
.calc-table { width: 100%; border-collapse: collapse; font-family: var(--f-mono); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.calc-table th, .calc-table td { padding: 0.45rem var(--s-4); text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.calc-table th:first-child, .calc-table td:first-child { text-align: left; }
.calc-table th { font-weight: 500; color: var(--ink-soft); }
.calc-table tfoot td { font-weight: 500; border-bottom: 0; color: var(--blue); }
.calc-foot { padding: var(--s-2) var(--s-4) var(--s-3); color: var(--ink-soft); }

/* ---------- Abschnitte ---------- */
section { scroll-margin-top: 5rem; }
.section { padding-block: var(--s-8); border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: var(--s-5); margin-bottom: var(--s-6); align-items: baseline; }
.section-head p { color: var(--ink-soft); margin-top: var(--s-3); }

/* Leistungen */
.services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); }
.service { background: var(--sheet); border: 1px solid var(--line); padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-4); }
.service-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.service ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.service li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-3); padding-block: 0.6rem; border-top: 1px dashed var(--line); }
.service li .mono { color: var(--ink-soft); text-align: right; }
.layer-tags { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.layer-tags span { font-family: var(--f-mono); font-size: 0.72rem; padding: 0.1rem 0.45rem; border: 1px solid var(--line); color: var(--ink-soft); }
.boundary { margin-top: var(--s-5); padding: var(--s-4) var(--s-5); border-left: 3px solid var(--supply); background: var(--sheet); color: var(--ink-soft); max-width: none; }
.boundary strong { color: var(--ink); }

/* Ablauf */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5); counter-reset: step; }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: var(--s-2); padding-top: var(--s-4); border-top: 2px solid var(--ink); }
.steps li::before { content: "Schritt " counter(step); font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue); }
.steps p { color: var(--ink-soft); font-size: 0.97rem; }

/* Referenzen */
.refs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.refs li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) 9rem; gap: var(--s-5); padding-block: var(--s-4); border-bottom: 1px solid var(--line); align-items: baseline; }
.refs h3 { font-size: 1.35rem; }
.refs .where { color: var(--ink-soft); font-size: 0.95rem; }
.refs .year { text-align: right; color: var(--ink-soft); }
.gallery { display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: auto auto; gap: var(--s-4); margin-top: var(--s-7); }
.gallery figure { margin: 0; background: var(--sheet); border: 1px solid var(--line); }
.gallery figure:first-child { grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery .frame { overflow: hidden; background: #fff; }
.gallery figure:first-child .frame { aspect-ratio: 16 / 10; }
.gallery figure:not(:first-child) .frame { aspect-ratio: 16 / 7; }
.gallery figcaption { display: flex; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) var(--s-3); border-top: 1px solid var(--line); font-family: var(--f-mono); font-size: 0.75rem; color: var(--ink-soft); }

/* Software */
.tools { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--sheet); }
.tools div { padding: var(--s-4); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--s-1); }
.tools div:last-child { border-right: 0; }
.tools strong { font-family: var(--f-display); font-size: 1.3rem; font-weight: 600; }
.tools span { font-size: 0.85rem; color: var(--ink-soft); }

/* Über mich */
.about { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: var(--s-7); align-items: start; }
.portrait { aspect-ratio: 4 / 5; max-width: 100%; background: var(--sheet); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait .initials { font-family: var(--f-display); font-size: 4rem; color: var(--blue); }
.about-copy { display: flex; flex-direction: column; gap: var(--s-4); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); margin-top: var(--s-3); }
.facts div { border-top: 1px solid var(--line); padding-top: var(--s-2); }
.facts dt { font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 500; }

/* Kontakt */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--s-7); align-items: start; }
.contact-direct { display: flex; flex-direction: column; gap: var(--s-4); }
.contact-direct dl { margin: 0; display: grid; gap: var(--s-3); }
.contact-direct dt { font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-soft); }
.contact-direct dd { margin: 0; font-size: 1.15rem; font-weight: 500; }
.form-box { background: var(--sheet); border: 1px solid var(--line); min-height: 22rem; display: flex; flex-direction: column; }
.form-consent { padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-4); align-items: flex-start; }
.form-consent p { color: var(--ink-soft); font-size: 0.95rem; }
.form-box iframe { width: 100%; height: 900px; border: 0; background: transparent; }

/* Plankopf-Fußzeile */
.titleblock { margin-block: var(--s-8) var(--s-6); border: 1.5px solid var(--ink); background: var(--sheet); display: grid; grid-template-columns: 2fr 1.3fr 1fr 1fr; }
.titleblock > div { padding: var(--s-3) var(--s-4); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.15rem; }
.titleblock > div:nth-child(4n) { border-right: 0; }
.titleblock > div:nth-last-child(-n+4) { border-bottom: 0; }
.titleblock .tb-name { font-family: var(--f-display); font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.titleblock .val { font-size: 0.95rem; }
.titleblock a { color: var(--ink); }

/* Rechtstexte */
.legal { padding-block: var(--s-7); }
.legal .wrap { max-width: 48rem; display: flex; flex-direction: column; gap: var(--s-4); }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: var(--s-3); }
.legal h2 { font-size: 1.6rem; margin-top: var(--s-5); }
.legal .notice { border-left: 3px solid var(--supply); background: var(--sheet); padding: var(--s-3) var(--s-4); color: var(--ink-soft); }

/* ---------- Responsiv ---------- */
@media (max-width: 60rem) {
  .hero .wrap, .contact, .about { grid-template-columns: minmax(0, 1fr); }
  .section-head { grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tools div:nth-child(3n) { border-right: 0; }
  .tools div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .titleblock { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .titleblock > div:nth-child(4n) { border-right: 1px solid var(--line); }
  .titleblock > div:nth-child(2n) { border-right: 0; }
  .titleblock > div:nth-last-child(-n+4) { border-bottom: 1px solid var(--line); }
  .titleblock > div:nth-last-child(-n+2) { border-bottom: 0; }
  .about .portrait { max-width: 15rem; }
}
@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .nav { gap: var(--s-4); }
  .hero { padding-block: var(--s-6); }
  .section { padding-block: var(--s-7); }
  .services, .gallery { grid-template-columns: minmax(0, 1fr); }
  .gallery figure:first-child { grid-row: auto; }
  .service { padding: var(--s-5); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .refs li { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
  .refs .year { text-align: left; }
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .tools div:nth-child(2n) { border-right: 0; }
  .tools div:nth-last-child(-n+2) { border-bottom: 0; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .titleblock { grid-template-columns: minmax(0, 1fr); }
  .titleblock > div { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; }
  .titleblock > div:last-child { border-bottom: 0 !important; }
}
