/* ==========================================================================
   Sebastian Hanisch — Operations Research und Machine Learning
   Design-System: "Blaupause" — Technische-Zeichnung-Aesthetik, gebaut aus dem
   visuellen Vokabular von Operations Research selbst: Knoten, Kanten, Routen,
   Netzwerke. Kein generisches Business-Website-Layout.
   ========================================================================== */

:root {
  /* Farben */
  --ink:        #14233B;   /* Blaupausen-Navy — dunkle Flaechen, Fliesstext */
  --ink-soft:   #35486A;   /* Navy, weicher — sekundaerer Text auf Papier */
  --paper:      #EEEFEA;   /* Papier — helle Flaechen */
  --paper-line: #D6D9D0;   /* feine Rasterlinien auf Papier */
  --white:      #F7F6F1;   /* Text auf Navy */
  --gold:       #D68A2E;   /* die "optimierte Route" — Akzent, sparsam (nur auf Navy/Weiss als Flaeche, nicht als Fliesstext-Farbe: 2,4:1 auf Papier) */
  --gold-soft:  #E9C48F;
  --teal:       #3E8E86;   /* Graph-Akzent auf Navy (dort per .section-navy-Override) */
  --teal-text:  #2F6B65;   /* dieselbe Akzentfarbe, abgedunkelt fuer WCAG-AA-Kontrast (4.5:1) als Fliesstext auf Papier/Weiss */
  --link:       #955F1D;   /* Link-/Fliesstextfarbe auf Papier/Weiss, WCAG-AA-konform (4.5:1) - Buttons/Route-Grafik bleiben beim helleren --gold */

  /* Typografie */
  --f-display: 'IBM Plex Mono', 'JetBrains Mono', monospace;
  --f-body:    'IBM Plex Sans', -apple-system, sans-serif;

  /* Abstaende */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 7rem;

  --maxw: 1180px;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--f-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

/* Feines Hintergrundraster — evoziert Millimeterpapier / technische Zeichnung */
body {
  background-image:
    linear-gradient(var(--paper-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-line) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 var(--space-sm) 0;
  hyphens: auto;
  -webkit-hyphens: auto;
}

h1 { font-size: clamp(1.7rem, 4.4vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 2.8vw, 2.3rem); }
h3 { font-size: 1.25rem; }
@media (max-width: 400px) {
  h3 { font-size: 1.1rem; }
}

p { margin: 0 0 1.1em 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.eyebrow {
  font-family: var(--f-display);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-text);
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 0.9em;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--teal-text);
  display: inline-block;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ---------- Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #EEEFEA;
  border-bottom: 1px solid var(--paper-line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}
.brand {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex-shrink: 0; }

.nav-links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
  margin: 0; padding: 0;
  font-family: var(--f-display);
  font-size: 0.86rem;
}
.nav-links a {
  color: var(--ink-soft);
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--ink);
  text-decoration: none;
  border-bottom-color: var(--link);
}
.nav-toggle { display: none; }

@media (max-width: 820px) {
  .nav-links {
    position: fixed; inset: 64px 0 0 0;
    background: #EEEFEA;
    z-index: 60;
    flex-direction: column;
    padding: var(--space-md);
    gap: var(--space-sm);
    font-size: 1.05rem;
    transform: translateX(100%);
    transition: transform 0.28s ease;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle {
    display: block;
    background: none; border: none; cursor: pointer;
    width: 30px; height: 22px; position: relative;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: ""; position: absolute; left: 0; width: 100%; height: 2px;
    background: var(--ink); transition: transform 0.2s ease;
  }
  .nav-toggle span { top: 10px; }
  .nav-toggle span::before { top: -8px; }
  .nav-toggle span::after { top: 8px; }
}

/* ---------- Hero ---------- */
.hero {
  background: var(--ink);
  color: var(--white);
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  padding: var(--space-xl) 0 var(--space-lg);
  position: relative;
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-lg);
  align-items: center;
}
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-graphic { order: -1; }
}
.hero h1 { color: var(--white); }
.hero .lede {
  font-size: 1.18rem;
  color: var(--gold-soft);
  max-width: 44ch;
  margin-bottom: var(--space-sm);
}
.hero .body-text { color: #C4CBD8; max-width: 52ch; }

.hero-graphic svg { width: 100%; height: auto; display: block; }

/* Route-Zeichnung: zieht sich beim Laden nach, wie eine gezeichnete Strecke */
.route-path {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw-route 2.1s cubic-bezier(.4,0,.2,1) 0.2s forwards;
}
@media (prefers-reduced-motion: reduce) {
  .route-path { animation: none; stroke-dashoffset: 0; }
}
@keyframes draw-route {
  to { stroke-dashoffset: 0; }
}
.route-node {
  opacity: 0;
  animation: node-in 0.5s ease forwards;
}
@media (prefers-reduced-motion: reduce) { .route-node { opacity: 1; animation: none; } }

/* ---------- Buttons ---------- */
.btn-row { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: var(--space-md); }
.btn {
  font-family: var(--f-display);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.85rem 1.5rem;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--gold); color: var(--ink); }
.btn-primary:hover { background: #E39B44; }
.btn-ghost { border-color: rgba(247,246,241,0.35); color: var(--white); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-soft); }
.btn-ghost-dark { border-color: var(--ink-soft); color: var(--ink); }
.btn-ghost-dark:hover { border-color: var(--gold); color: var(--ink); background: rgba(214,138,46,0.08); }

/* ---------- Sections ---------- */
section { padding: var(--space-lg) 0; }
.section-paper { background: var(--paper); }
.section-navy {
  background: var(--ink); color: var(--white);
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 32px 32px;
}
.section-navy h2, .section-navy h3 { color: var(--white); }
.section-navy .eyebrow { color: var(--gold-soft); }
.section-navy .eyebrow::before { background: var(--gold-soft); }

.section-head { max-width: 62ch; margin-bottom: var(--space-md); }

/* ---------- Grids / Cards ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
.grid-cta { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--space-lg); align-items: center; }
.grid-profile { display: grid; grid-template-columns: 1fr 320px; gap: var(--space-lg); align-items: start; }
.grid-3 > *, .grid-2 > *, .grid-cta > *, .grid-profile > *, .route-stop { min-width: 0; }
@media (max-width: 820px) {
  .grid-3, .grid-2, .grid-cta, .grid-profile { grid-template-columns: 1fr; }
}

.card {
  background: #fff;
  border: 1px solid var(--paper-line);
  border-radius: 4px;
  padding: var(--space-md);
  position: relative;
  min-width: 0;
}
.card-navy {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.14);
}
.card-node {
  font-family: var(--f-display);
  font-size: 0.78rem;
  color: var(--teal-text);
  letter-spacing: 0.08em;
  margin-bottom: 0.8rem;
  display: block;
  overflow-wrap: break-word;
}

/* ---------- Route-Verbinder zwischen Karten (Leistungen etc.) ---------- */
.route-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  position: relative;
  margin-top: var(--space-md);
}
.route-grid::before {
  content: "";
  position: absolute;
  top: 28px; left: calc(16.6% ); right: calc(16.6%);
  height: 2px;
  background-image: linear-gradient(90deg, var(--gold) 60%, transparent 0%);
  background-size: 14px 2px;
  z-index: 0;
}
@media (max-width: 820px) {
  .route-grid { grid-template-columns: 1fr; }
  .route-grid::before { display: none; }
}
.route-stop { position: relative; padding: 0 var(--space-sm); z-index: 1; }
.route-stop:first-child { padding-left: 0; }
.route-stop:last-child { padding-right: 0; }
.route-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold); border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px var(--gold);
  margin: 0 auto var(--space-sm) auto;
}

/* ---------- Tabelle (Fakten Ueber mich) ---------- */
.fact-table { width: 100%; table-layout: fixed; border-collapse: collapse; margin: var(--space-sm) 0; }
.fact-table tr { border-bottom: 1px solid var(--paper-line); }
.fact-table tr:last-child { border-bottom: none; }
.fact-table td { padding: 0.85rem 0; vertical-align: top; overflow-wrap: break-word; word-break: break-word; }
.fact-table td:first-child {
  font-family: var(--f-display);
  font-size: 0.82rem;
  color: var(--teal-text);
  width: 34%;
  padding-right: var(--space-sm);
}
@media (max-width: 560px) {
  .fact-table td:first-child { width: 40%; }
}

/* ---------- Bilder ---------- */
.portrait {
  width: 100%; max-width: 320px; height: auto;
  border-radius: 4px;
  border: 1px solid var(--paper-line);
  display: block;
}
.figure-inline {
  display: flex; gap: var(--space-sm); align-items: flex-start;
  background: #fff; color: var(--ink); border: 1px solid var(--paper-line); border-radius: 4px;
  padding: var(--space-sm); margin: var(--space-md) 0;
}
.figure-inline img {
  width: 180px; height: 130px; object-fit: cover; border-radius: 3px; flex-shrink: 0;
}
@media (max-width: 620px) {
  .figure-inline { flex-direction: column; }
  .figure-inline img { width: 100%; height: 200px; }
}
.figure-caption { font-family: var(--f-display); font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.5rem; }

/* ---------- Abhaengigkeitsgraph (Konzepte-Linien) ---------- */
.diagram-scroll { overflow-x: auto; padding-bottom: 4px; }
.diagram-scroll svg { display: block; min-width: 700px; width: 100%; height: auto; }
.diagram-scroll a { cursor: pointer; }
.diagram-scroll rect { transition: stroke 0.15s ease, stroke-width 0.15s ease; }
.diagram-scroll a:hover rect, .diagram-scroll a:focus-visible rect { stroke: var(--gold); stroke-width: 2; }

/* ---------- Entscheidungshilfe (Konzepte-Clustering) ---------- */
.decision-flow { max-width: 640px; }
.decision-step {
  background: #fff; border: 1px solid var(--paper-line); border-radius: 4px;
  padding: var(--space-sm) var(--space-md);
}
.decision-step + .decision-step { margin-top: var(--space-sm); }
.decision-step p { margin: 0 0 0.7rem 0; }
.decision-num { color: var(--teal-text); font-weight: 600; }
.decision-outcomes {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem;
  font-family: var(--f-display); font-size: 0.86rem;
}
.decision-outcomes strong { color: var(--ink-soft); font-weight: 600; margin-right: 0.3em; }
.decision-outcomes a { font-weight: 600; }
.decision-continue { color: var(--ink-soft); }

/* ---------- Demo-Karten ---------- */
.demo-card {
  background: #fff; border: 1px solid var(--paper-line); border-radius: 4px;
  padding: var(--space-md);
  display: flex; flex-direction: column; gap: 0.8rem;
  min-width: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink); color: #9AA6BA;
  padding: var(--space-lg) 0 var(--space-md);
  font-size: 0.92rem;
}
.site-footer a { color: #C4CBD8; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--space-md);
  margin-bottom: var(--space-md);
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 {
  color: var(--white); font-size: 0.82rem; letter-spacing: 0.06em;
  text-transform: uppercase; margin-bottom: 0.9rem;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.5rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-sm);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  font-family: var(--f-display); font-size: 0.78rem;
}

/* ---------- Kontaktformular ---------- */
.form-field { margin-bottom: var(--space-sm); }
.form-field label {
  display: block; font-family: var(--f-display); font-size: 0.82rem;
  color: var(--ink-soft); margin-bottom: 0.4rem;
}
.form-field input, .form-field textarea {
  width: 100%; padding: 0.7rem 0.9rem; border: 1px solid var(--paper-line);
  border-radius: 3px; font-family: var(--f-body); font-size: 1rem;
  background: #fff; color: var(--ink);
}
.form-field input:focus, .form-field textarea:focus {
  outline: none; border-color: var(--link);
}
.form-checkbox { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.92rem; color: var(--ink-soft); }

/* ---------- Legal-Seiten (Impressum/Datenschutz) ---------- */
.legal-content h2 { margin-top: var(--space-md); font-size: 1.25rem; }
.legal-content h3 { margin-top: var(--space-sm); font-size: 1.05rem; color: var(--ink-soft); }
.legal-content { max-width: 74ch; }

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; }
.text-teal { color: var(--teal-text); }
.small { font-size: 0.9rem; color: var(--ink-soft); }
