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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:root {
  --primary:       #0d1b2a;
  --primary-light: #1a2f4a;
  --accent:        #2d7ff9;
  --accent-dark:   #1a64d6;
  --accent-bg:     #dbeafe;
  --accent-border: #bfdbfe;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --bg:            #ffffff;
  --bg-subtle:     #f8fafc;
  --border:        #e2e8f0;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  margin: 0;
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── HEADER ──────────────────────────────── */
header {
  background: var(--primary);
  padding: 16px 48px;
  padding-left: max(48px, env(safe-area-inset-left));
  padding-right: max(48px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

header .logo {
  height: 36px;
  width: auto;
  flex-shrink: 0;
}

header .header-label {
  color: rgba(255,255,255,0.45);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── HERO ────────────────────────────────── */
.hero {
  background: linear-gradient(140deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 84px 48px 96px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 80% 20%, rgba(45,127,249,0.13) 0%, transparent 70%);
  pointer-events: none;
}

.hero-bg-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Dunkles Vignette-Oval hinter dem Text – SVG bleibt an den Rändern sichtbar */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 62% 72% at 50% 50%,
    rgba(9,15,30,0.48) 0%,
    rgba(9,15,30,0.18) 55%,
    transparent 75%);
  pointer-events: none;
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  font-weight: 700;
  margin: 0 0 20px;
  letter-spacing: -0.025em;
  line-height: 1.2;
  text-shadow: 0 2px 28px rgba(0,0,0,0.55), 0 1px 6px rgba(0,0,0,0.35);
}

.hero .subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.88);
  margin: 0 0 40px;
  line-height: 1.7;
  text-shadow: 0 1px 14px rgba(0,0,0,0.45);
}

.hero-cta {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  min-height: 48px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.18s ease;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 14px rgba(45,127,249,0.38);
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(45,127,249,0.44);
}

.btn-ghost {
  border: 1.5px solid rgba(255,255,255,0.28);
  color: rgba(255,255,255,0.88);
  background: transparent;
}

.btn-ghost:hover {
  border-color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.07);
}

/* ─── SECTIONS ────────────────────────────── */
section {
  padding: 76px 48px;
}

.section-inner {
  max-width: 980px;
  margin: 0 auto;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 10px;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 16px;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.section-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 580px;
  margin: 0 0 52px;
  line-height: 1.75;
}

/* ─── SERVICES ────────────────────────────── */
.services-section {
  background: var(--bg-subtle);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 18px;
}

.service-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.service-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.service-icon {
  width: 46px;
  height: 46px;
  background: var(--accent-bg);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.service-card h3 {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 9px;
  line-height: 1.35;
}

.service-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.65;
}

/* ─── ABOUT ───────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 56px;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  line-height: 1.8;
  margin: 0 0 18px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.about-text p:last-of-type { margin-bottom: 0; }

.orcid-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 26px;
  padding: 11px 18px;
  min-height: 48px;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  color: var(--accent-dark);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.18s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.orcid-link:hover {
  background: var(--accent-border);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.stat-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px 20px;
  text-align: center;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.04em;
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 7px;
  line-height: 1.45;
}

/* ─── CONTACT ─────────────────────────────── */
.contact-section {
  background: var(--primary);
}

.contact-section .eyebrow       { color: rgba(255,255,255,0.4); }
.contact-section .section-title { color: white; }
.contact-section .section-lead  { color: rgba(255,255,255,0.6); margin-bottom: 28px; }
.contact-section .btn-open-modal { margin-bottom: 40px; gap: 8px; }
.contact-section .contact-items  { margin-top: 0; }

.contact-items {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.75);
  font-size: 0.95rem;
}

.contact-item a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.contact-item a:hover { text-decoration: underline; }

.contact-icon {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.1);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ─── FOOTER ──────────────────────────────── */
footer {
  background: var(--primary);
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 22px 48px;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
  padding-left: max(48px, env(safe-area-inset-left));
  padding-right: max(48px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

footer .logo { height: 22px; opacity: 0.4; }

footer p {
  color: rgba(255,255,255,0.35);
  font-size: 0.8rem;
  margin: 0;
}

/* ─── DIVIDER ─────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

/* ─── RESPONSIVE ──────────────────────────── */

/* Tablet / large mobile */
@media (max-width: 720px) {
  header {
    padding: 16px 20px;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  section { padding: 56px 20px; }

  .hero {
    padding: 60px 20px 68px;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  footer {
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  .about-grid { grid-template-columns: 1fr; gap: 40px; }

  .section-lead { margin-bottom: 36px; }
}

/* Small mobile */
@media (max-width: 480px) {
  header .header-label { display: none; }

  section { padding: 48px 16px; }

  .hero {
    padding: 52px 16px 60px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  /* Full-width buttons in hero */
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .hero-cta .btn { width: 100%; }

  /* ORCID link full width */
  .orcid-link {
    display: flex;
    justify-content: center;
  }

  .services-grid { grid-template-columns: 1fr; }

  .contact-items { flex-direction: column; gap: 14px; }

  footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .hero h1 br { display: none; }
}

/* ─── KONTAKTFORMULAR-BUTTON ──────────────── */
.btn-open-modal {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  min-height: 44px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-open-modal:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

/* ─── MODAL ───────────────────────────────── */
#contact-modal {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 560px;
  width: calc(100% - 32px);
  max-height: min(90dvh, 720px);
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
}

#contact-modal::backdrop {
  background: rgba(13,27,42,0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  letter-spacing: -0.02em;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-subtle);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, color 0.18s;
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--border);
  color: var(--text);
}

/* ─── FORMULARFELDER ──────────────────────── */
#contact-form {
  padding: 20px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--primary);
}

.form-group label span {
  color: var(--accent);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.18s, box-shadow 0.18s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,127,249,0.12);
}

.form-group textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

/* Honeypot: unsichtbar für Menschen, aber nicht display:none (wegen mancher Bots) */
.form-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ─── FORMULAR-STATUS ─────────────────────── */
.form-status {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
  display: none;
}

.form-status.success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  display: block;
}

.form-status.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  display: block;
}

#submit-btn {
  align-self: flex-start;
  border: none;
  margin-top: 2px;
}

#submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── MODAL RESPONSIVE ────────────────────── */
@media (max-width: 480px) {
  #contact-modal {
    border-radius: 12px;
    width: calc(100% - 24px);
    max-height: 88dvh;
  }

  .modal-header { padding: 20px 20px 0; }
  #contact-form  { padding: 16px 20px 22px; }

  .form-row { grid-template-columns: 1fr; }

  #submit-btn {
    align-self: stretch;
    width: 100%;
  }
}
