/* Styles with larger header logo */
:root { --header-h: 88px; --anchor-gap: 10px; --primary:#1e88e5; --primary-dark:#1565c0; --accent:#0d47a1; --text:#0f2742; --bg:#f7fafc; --card:#fff; --muted:#5f7a97; --radius:16px; --shadow:0 10px 30px rgba(15,39,66,.12);}
*{box-sizing:border-box;}
body{margin:0;font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;color:var(--text);background:var(--bg);line-height:1.6;}
img{max-width:100%;display:block;}
a{color:var(--primary-dark);text-decoration:none;}
a:hover{text-decoration:underline;}

.site-header{position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;padding:12px 20px;background:#fff;box-shadow:var(--shadow);}
.brand{display:flex;align-items:center;gap:12px;font-weight:800;color:var(--text);}
.brand img{width:64px;height:64px;border-radius:14px;}
.main-nav{display:flex;gap:20px;align-items:center;}
.main-nav a{font-weight:600;color:var(--text);}
.btn{background:linear-gradient(135deg,var(--primary),var(--primary-dark));color:#fff;padding:10px 16px;border-radius:999px;box-shadow:var(--shadow);display:inline-block;font-weight:700;}
.btn.ghost{background:transparent;border:2px solid var(--primary);color:var(--primary-dark);}
.btn.small{padding:8px 12px;font-size:14px;}
.nav-toggle{display:none;background:none;border:0;}
.nav-toggle span{display:block;width:26px;height:3px;background:var(--text);margin:5px 0;border-radius:3px;}

@media (max-width: 860px){
  .main-nav{position:fixed;inset:60px 16px auto 16px;background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);padding:14px;display:none;flex-direction:column;}
  .main-nav.open{display:flex;}
  .nav-toggle{display:inline-block;}
  .brand img{width:56px;height:56px;}
}

.hero{display:grid;grid-template-columns:1.2fr .8fr;gap:24px;align-items:center;padding:64px 20px;max-width:1100px;margin:0 auto;}
.hero-content h1{font-size:clamp(32px,6vw,54px);line-height:1.1;margin:0 0 10px;}
.hero-content p{font-size:clamp(16px,2.5vw,20px);color:var(--muted);margin-bottom:18px;}
.hero-ctas{display:flex;gap:12px;flex-wrap:wrap;}
.hero-card{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:22px;}
.hero-card ul{margin:0;padding-left:18px;}
.br-md{display:none}
@media (max-width:860px){.hero{grid-template-columns:1fr;padding-top:28px;}.br-md{display:inline}}

.highlights{max-width:1100px;margin:10px auto 0;padding:0 20px 10px;display:grid;grid-template-columns:repeat(4,1fr);gap:12px;}
.kpi{background:linear-gradient(135deg,var(--primary),var(--accent));border-radius:var(--radius);padding:18px;color:#fff;text-align:center;box-shadow:var(--shadow);}
.kpi strong{display:block;font-size:22px;}
@media (max-width:860px){.highlights{grid-template-columns:repeat(2,1fr);}}

.section{max-width:1100px;margin:42px auto;padding:0 20px;}
.section h2{font-size:clamp(24px,4vw,36px);margin:0 0 16px;}
.section.alt{background:#eef4fb;padding:28px 20px;border-radius:var(--radius);}

.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;}
.card{background:var(--card);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow);}
.card .icon{font-size:28px;}
.card h3{margin-top:6px;}
.card ul{margin:10px 0 0 18px;}
@media (max-width:1000px){.cards{grid-template-columns:repeat(2,1fr);}}
@media (max-width:640px){.cards{grid-template-columns:1fr;}}

.timeline{list-style:none;padding:0;display:grid;gap:12px;}
.timeline li{background:var(--card);border-left:6px solid var(--primary);border-radius:12px;padding:14px 16px;box-shadow:var(--shadow);}
.timeline span{display:inline-block;width:34px;height:34px;background:var(--primary);color:#fff;border-radius:50%;text-align:center;line-height:34px;font-weight:700;margin-right:10px;}

.tech-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;}
.tech{background:var(--card);border-radius:999px;padding:10px 14px;text-align:center;box-shadow:var(--shadow);font-weight:700;}
@media (max-width:860px){.tech-grid{grid-template-columns:repeat(2,1fr);}}

.contact .grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;}
label{display:block;font-weight:600;}
input,textarea{width:100%;margin-top:6px;padding:12px 14px;border:2px solid #d9e3ef;border-radius:12px;outline:none;font:inherit;}
input:focus,textarea:focus{border-color:var(--primary);box-shadow:0 0 0 4px rgba(30,136,229,.15);}
.hidden{position:absolute;left:-10000px;}
.contact-meta{margin-top:12px;color:var(--muted);}

.site-footer{text-align:center;padding:26px 10px 40px;color:var(--muted);}
.footer-nav{display:flex;gap:14px;justify-content:center;margin-top:6px;}
.footer-nav a{color:var(--muted);}

dialog::backdrop{background:rgba(0,0,0,.45);}
dialog article{background:#fff;border:none;border-radius:16px;width:min(680px,92vw);box-shadow:var(--shadow);}
dialog header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid #eee;}
dialog section{padding:16px;}
.pill-row{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px;}
.pill{background:#e1eefc;color:var(--primary-dark);border-radius:999px;padding:8px 12px;font-weight:700;}

  .hero-logo img { width: 110px; }
}

.hero-emblem img{max-width:70%;height:auto;display:block;}
@media (max-width: 1100px){.hero-emblem img{max-width:70%;height:auto;display:block;}}
@media (max-width: 860px){
  .hero-right{display:flex;flex-direction:column;gap:20px;align-self:start;margin-top:-6px;}
  .hero-emblem img{max-width:70%;height:auto;display:block;}
}

/* Emblem card mirrors hero-card size; img centered */
.hero-emblem{display:flex;align-items:center;justify-content:center;}
.hero-emblem img{max-width:70%;height:auto;display:block;}

/* Ensure clean top with no phantom spacing */
.hero-right{display:flex;flex-direction:column;gap:20px;align-self:start;margin-top:-6px;}
.hero-right > .hero-card{margin:0;}

/* Hero right sizing */
.hero-right{display:flex;flex-direction:column;gap:20px;align-self:start;margin-top:-6px;} /* clear separation */
.hero-right .hero-card{} /* equal visual size */
@media (max-width:1100px){ .hero-right .hero-card{} }
@media (max-width:860px){ .hero-right .hero-card{} } /* mobile let them flow */
.hero-emblem{display:flex;align-items:center;justify-content:center;}
.hero-emblem img{max-width:70%;height:auto;display:block;}

@media (max-width: 860px){ .hero-right{ margin-top:0; } }

/* Desktop refinements for legal dialog */
@media (min-width: 861px){
  .legal-dialog{
    width: min(820px, 92vw);
    max-width: 820px;
    max-height: none;
    margin: auto;
    padding: 0;
    border: none;
  }
  .legal-sheet{ max-height: none; overflow: visible; }
  .legal-header{ position: static; }
  .legal-footer{ position: static; }
}


/* === Robust desktop centering and sizing for legal dialog === */
@media (min-width: 861px){
  dialog.legal-dialog{
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
    width: min(820px, 92vw);
    max-height: min(80vh, 90dvh);
    border: none;
    z-index: 1000;
  }
  dialog.legal-dialog .legal-sheet{
    max-height: inherit;
    overflow: auto;
  }
  dialog.legal-dialog .legal-header{ position: static; }
  dialog.legal-dialog .legal-footer{ position: sticky; bottom: 0; background:#fff; }
  /* Keep brand logo tiny regardless of global img rules */
  dialog.legal-dialog .brand-mini img{ width: 28px; height: 28px; object-fit: contain; }
}
/* Prevent large images inside legal content */
.legal-content img{ max-width:100%; height:auto; }


/* ===== Final Impressum polish ===== */
dialog.legal-dialog{ border:none; padding:0; }
dialog.legal-dialog::backdrop{ background: rgba(15,39,66,.55); }

/* Base sheet */
dialog.legal-dialog .legal-sheet{
  background:#fff; border:none; border-radius:24px;
  width:min(820px, 92vw); box-shadow: var(--shadow);
  overflow:hidden; /* header/footer rounded */
}

/* Header in brand look */
dialog.legal-dialog .legal-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color:#fff;
}
dialog.legal-dialog .brand-mini{ display:flex; align-items:center; gap:12px; font-size:18px; font-weight:800; }
dialog.legal-dialog .brand-mini img{ width:28px; height:28px; border-radius:8px; object-fit:contain; }
dialog.legal-dialog .icon-btn{ background: rgba(255,255,255,.2); border:0; color:#fff; font-size:20px; width:34px; height:34px; border-radius:10px; cursor:pointer; }
dialog.legal-dialog .icon-btn:hover{ background: rgba(255,255,255,.3); }

/* Content */
dialog.legal-dialog .legal-content{ padding:18px; display:grid; gap:18px; }
dialog.legal-dialog .legal-grid{ display:grid; gap:14px; }
@media (min-width: 900px){
  dialog.legal-dialog .legal-grid{ grid-template-columns: 1.2fr 1fr 1fr; }
}
@media (min-width: 600px) and (max-width: 899.98px){
  dialog.legal-dialog .legal-grid{ grid-template-columns: 1fr 1fr; }
}
dialog.legal-dialog .legal-card{ background:#f9fbfe; border:1px solid #e4edf8; border-radius:16px; padding:14px; }
dialog.legal-dialog .legal-card h3, 
dialog.legal-dialog .legal-card h4{ margin:0 0 6px; }
dialog.legal-dialog .legal-card p{ margin:0; color: var(--muted); }
dialog.legal-dialog .legal-note{ background:#fff; border:1px dashed #e0e8f4; border-radius:16px; padding:14px; color: var(--muted); }

/* Footer */
dialog.legal-dialog .legal-footer{ display:flex; justify-content:flex-end; gap:10px; padding:14px 18px; border-top:1px solid #eef2f8; background:#fff; }

/* Mobile sizing */
@media (max-width: 860px){
  dialog.legal-dialog{ max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); }
  dialog.legal-dialog .legal-sheet{ width:100%; max-height:inherit; overflow:auto; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  dialog.legal-dialog .legal-header{ position:sticky; top:0; z-index:1; }
  dialog.legal-dialog .legal-footer{ position:sticky; bottom:0; background:#fff; }
}

/* Desktop centering */
@media (min-width: 861px){
  dialog.legal-dialog{ position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); margin:0; max-height: min(80vh, 90dvh); }
  dialog.legal-dialog .legal-sheet{ max-height:inherit; overflow:auto; }
}

/* Safeguards */
dialog.legal-dialog .legal-content img{ max-width:100%; height:auto; }

html{scroll-behavior:smooth;scroll-padding-top:calc(var(--header-h) + var(--anchor-gap));}
/* anchor-offset */
section[id], h2[id], .hero{scroll-margin-top:calc(var(--header-h) + var(--anchor-gap));}
@media (max-width:860px){:root{--header-h:80px}}
