/* =========================
   Base / Tokens
   ========================= */
:root{
  --bg:#F5F7FA;
  --surface:#FFFFFF;
  --text:#111827;
  --muted:#6B7280;
  --border:rgba(17,24,39,.10);

  --brand:#243A5E;
  --brand2:#2F4F7A;

  --shadow: 0 14px 34px rgba(17,24,39,.10);
  --shadowSoft: 0 10px 24px rgba(17,24,39,.08);

  --radius:8px;
  --radiusSm:8px;

  --container:1120px;

  /* kann per JS gesetzt werden (partials.js), fallback bleibt */
  --headerH:92px;

  --focus: rgba(36,58,94,.35);
  --focusBg: rgba(36,58,94,.10);
}

/* Utilities (ersetzen Inline-Styles) */
.mw-70ch{ max-width:70ch; }
.mt-28{ margin-top:28px; }


/* =========================
   Reset / Base
   ========================= */
*,
*::before,
*::after{ box-sizing:border-box; }

html{ scroll-behavior:smooth; }

body{
  margin:0;
  padding-top:var(--headerH, 92px);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
  line-height:1.6;
}

a{ color:inherit; text-decoration:none; }
img{ display:block; max-width:100%; height:auto; }

.container{
  width:min(var(--container), calc(100% - 56px));
  margin-inline:auto;
}

p{ margin:0 0 12px; color: rgba(17,24,39,.72); }
p:last-child{ margin-bottom:0; }

/* =========================
   Typography
   ========================= */
h1{
  font-size:46px;
  line-height:1.08;
  margin:0 0 14px;
  letter-spacing:-.02em;
  color:var(--brand);
}
h2{ font-size:28px; margin:0 0 10px; color:var(--brand); }
h3{ font-size:18px; margin:0 0 8px; color:var(--brand); }

.lead{
  font-size:16px;
  color:rgba(17,24,39,.68);
  max-width:62ch;
  margin:0 0 18px;
}

/* =========================
   HEADER (FIXED)
   ========================= */
#site-header{ position:relative; z-index:4000; }

.header{
  position:fixed;
  top:0; left:0; right:0;
  z-index:4001;

  background: rgba(245,247,250,.92);
  padding:14px 0;
  backdrop-filter: blur(10px);

  border-bottom:none;
  box-shadow:none;

  transition: box-shadow .18s ease;
}

.header.is-scrolled{
  box-shadow: 0 8px 20px rgba(17,24,39,.12);
}

.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.logo{ height:55px; }

.nav{
  display:flex;
  gap:20px;
  align-items:center;
}

.nav a{
  font-weight:700;
  color:rgba(17,24,39,.75);
  padding:8px 6px;
  border-radius:8px;
}
.nav a:hover{ color: rgba(17,24,39,.90); }
.nav a[aria-current="page"]{ color: rgba(17,24,39,.92); }
.nav a:focus-visible{
  outline:3px solid var(--focus);
  outline-offset:3px;
}

/* Mobile: Burger + Dropdown */
.nav-panel[hidden]{ display:none !important; }

.nav-toggle{
  display:none;
  width:44px;
  height:44px;
  border-radius:8px;
  border:1px solid rgba(17,24,39,.12);
  background: rgba(255,255,255,.70);
  align-items:center;
  justify-content:center;
  gap:5px;
  cursor:pointer;
}
.nav-toggle:focus-visible{
  outline:3px solid var(--focus);
  outline-offset:4px;
}

.nav-toggle-line{
  display:block;
  width:18px;
  height:2px;
  background: rgba(17,24,39,.72);
  border-radius:2px;
  transition: transform .18s ease, opacity .18s ease;
}

/* X-Animation */
.header.nav-open .nav-toggle-line:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.header.nav-open .nav-toggle-line:nth-child(2){ opacity:0; }
.header.nav-open .nav-toggle-line:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

.no-scroll{ overflow:hidden; }

/* =========================
   Buttons
   ========================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:11px 16px;
  border-radius:8px;
  border:1px solid var(--border);
  font-weight:800;
  background:transparent;
  cursor:pointer;
  user-select:none;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.btn-primary{
  background:linear-gradient(180deg, var(--brand2), var(--brand));
  color:#fff;
  border:none;
}
.btn-ghost{ background:rgba(255,255,255,.7); }

.btn:hover{ transform: translateY(-1px); box-shadow: var(--shadowSoft); }
.btn:active{ transform: translateY(0); box-shadow:none; }

.btn:focus-visible{
  outline:3px solid var(--focus);
  outline-offset:4px;
}

/* =========================
   Sections
   ========================= */
.section{ padding:76px 0; background:#fff; }
.section.section-blue{ background: var(--bg); }
.section.section-white{ background:#fff; }

/* =========================
   HERO
   ========================= */
.section.hero{
  position:relative;
  background:var(--bg);
  overflow:hidden;
  isolation:isolate;
  margin-top:-1px; /* war "FINAL FIX" */
}
.section.hero::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(900px 520px at 70% 10%, rgba(36,58,94,.10), transparent 58%),
    radial-gradient(700px 500px at 20% 40%, rgba(36,58,94,.06), transparent 55%);
  pointer-events:none;
}
.section.hero > .container{ position:relative; z-index:1; }

.section.hero.hero-start{
  min-height: calc(100svh - var(--headerH, 92px));
  min-height: calc(100vh  - var(--headerH, 92px));
  display:flex;
  align-items:center;
  padding-top: clamp(48px, 7vh, 96px) !important;
  padding-bottom: clamp(48px, 7vh, 96px) !important;
}
.section.hero.hero-start > .container{ padding-block:0; }

.grid-2{
  display:grid;
  grid-template-columns:1.05fr .95fr;
  gap:44px;
  align-items:center;
}
.actions{ display:flex; gap:12px; flex-wrap:wrap; }

.hero-panel{
  border:1px solid rgba(17,24,39,.12);
  border-radius:8px;
  padding:10px;
  box-shadow:0 12px 28px rgba(17,24,39,.10);
  aspect-ratio:16 / 10;
  background:rgba(255,255,255,.35);
}
.hero-image{
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:8px;
}

.scroll-indicator{
  position:absolute;
  left:50%;
  bottom: clamp(18px, 3vh, 28px);
  transform: translateX(-50%);
  width:46px;
  height:46px;
  display:grid;
  place-items:center;
  border-radius:999px;
  z-index:5;

  background: rgba(255,255,255,.85);
  border:1px solid rgba(17,24,39,.18);
  box-shadow:0 8px 20px rgba(17,24,39,.12);
  color: rgba(17,24,39,.90);
}
.scroll-indicator::before{
  content:"";
  width:12px; height:12px;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform: rotate(45deg);
  margin-top:-2px;
}
.scroll-indicator:focus-visible{
  outline:3px solid var(--focus);
  outline-offset:4px;
}

/* =========================
   Cards
   ========================= */
.cards{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:18px;
}

.card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:18px;
  transition:none;
}

.section.section-blue :is(.card, .contact-card){
  background: rgba(255,255,255,.86);
}

/* Leistungen */
.section .cards-grid{ margin-top:28px; }

.cards-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:24px;
  align-items:stretch;
}
.cards-grid .card{ height:100%; }
.cards-grid .card ul{ margin-top:10px; }

/* Warum wir */
.bullets ul{ margin:0; padding-left:18px; }
.bullets li{ margin:10px 0; color:rgba(17,24,39,.72); }

/* =========================
   Projekte (Hover Bildwechsel)
   ========================= */
.projects-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:18px;
}

.project-card{
  display:flex;
  flex-direction:column;
  height:100%;
}
.project-card h3{
  margin-bottom:12px;
  line-height:1.25;
  min-height:3.1em; /* ≈ 2 Zeilen */
}

.project-media{
  position:relative;
  border-radius:8px;
  overflow:hidden;
  margin-bottom:12px;
  aspect-ratio: 4 / 3;
  background: rgba(17,24,39,.04);
}
.project-media img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  transition: opacity .35s ease;
}
.project-media .img-hover{ opacity:0; }
.project-card:hover .project-media .img-hover{ opacity:1; }
.project-card:hover .project-media .img-default{ opacity:0; }

.projects-grid .project-card p{ margin-top:auto; }

/* =========================
   Kontakt / Formular
   ========================= */
.form{ display:grid; gap:12px; margin-top:14px; }

label{
  display:grid;
  gap:6px;
  font-weight:800;
  color:rgba(17,24,39,.82);
}

input,
textarea{
  padding:12px;
  border-radius:8px;
  border:1px solid var(--border);
  font-family:inherit;
  font-size:16px;
  background:#fff;
  transition: border-color .18s ease, box-shadow .18s ease;
}
textarea{ min-height:120px; resize:vertical; }

input:focus,
textarea:focus{
  outline:none;
  border-color: var(--focus);
  box-shadow: 0 0 0 4px var(--focusBg);
}

.contact-card{
  background:rgba(255,255,255,.86);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:18px;
  box-shadow:none;
  transition: box-shadow .18s ease, border-color .18s ease;
}

/* =========================
   Footer
   ========================= */
#site-footer{
  background: rgba(245,247,250,.92);
  border-top:1px solid var(--border);
  padding:24px 0;
}
#site-footer .footer-inner{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  text-align:center;
}
#site-footer p{
  margin:0;
  color:rgba(17,24,39,.62);
  font-weight:700;
}
#site-footer a{
  color:rgba(17,24,39,.62);
  border-radius:8px;
  padding:6px 6px;
}
#site-footer a:hover{ text-decoration:underline; }
#site-footer a:focus-visible{
  outline:3px solid var(--focus);
  outline-offset:3px;
}

.footer-separator{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:14px;
  opacity:.45;
  user-select:none;
}

/* =========================
   Skip-Link
   ========================= */
.skip-link{
  position:fixed;
  left:12px;
  top:12px;
  z-index:9999;

  padding:10px 12px;
  border-radius:8px;
  background:#fff;
  border:1px solid rgba(17,24,39,.12);
  box-shadow:0 10px 24px rgba(17,24,39,.08);

  transform: translateY(-200%);
  opacity:0;
  pointer-events:none;

  transition: transform .18s ease, opacity .18s ease;
}
.skip-link:focus{
  transform: translateY(0);
  opacity:1;
  pointer-events:auto;

  outline:3px solid var(--focus);
  outline-offset:4px;
}

/* =========================
   Responsive
   ========================= */
@media (max-width:1100px){
  .cards-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width:1060px){
  .projects-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width:980px){
  h1{ font-size:44px; }
  .grid-2{ grid-template-columns:1fr; }
}

@media (max-width:680px){
  h1{ font-size:36px; }

  .container{ width:min(var(--container), calc(100% - 32px)); }

  .nav{ display:none; }
  .nav-toggle{ display:inline-flex; }

  .nav-panel{
    position:absolute;
    left:0; right:0;
    top:100%;
    z-index:4002;

    border-top:1px solid rgba(17,24,39,.10);
    background: rgba(245,247,250,.96);
    backdrop-filter: blur(10px);
  }

  .nav-panel-inner{
    padding:14px 0 18px;
    display:grid;
    gap:10px;
  }

  .nav-panel-inner a{
    padding:12px 12px;
    border-radius:8px;
    font-weight:800;
    color: rgba(17,24,39,.78);
    background: rgba(255,255,255,.70);
    border:1px solid rgba(17,24,39,.10);
  }

  .btn{ width:100%; }

  .projects-grid,
  .cards-grid,
  .cards{ grid-template-columns:1fr; }

  .section.hero.hero-start{ align-items:flex-start; }
}

/* =========================
   Reduced Motion
   ========================= */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *{ transition:none !important; }
}
