/* Self-hosted fonts */
@font-face { font-family: 'Lexend'; src: url('/fonts/Lexend-300.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Lexend'; src: url('/fonts/Lexend-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Lexend'; src: url('/fonts/Lexend-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Lexend'; src: url('/fonts/Lexend-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Lexend'; src: url('/fonts/Lexend-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Source Sans 3'; src: url('/fonts/SourceSans3-300.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Source Sans 3'; src: url('/fonts/SourceSans3-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Source Sans 3'; src: url('/fonts/SourceSans3-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Source Sans 3'; src: url('/fonts/SourceSans3-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Source Sans 3'; src: url('/fonts/SourceSans3-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

/* ============================================
   BPMI AG — Design System
   Style: Trust & Authority
   Palette: Banking/Traditional Finance (Navy + Gold)
   Typography: Lexend (headings) / Source Sans 3 (body)
   ============================================ */

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Design Tokens */
:root {
  /* Colors — Banking/Traditional Finance */
  --primary: #0F172A;
  --primary-on: #FFFFFF;
  --secondary: #1E3A8A;
  --secondary-on: #FFFFFF;
  --accent: #A16207;
  --accent-hover: #92550A;
  --accent-light: #D4A84B;
  --bg: #F8FAFC;
  --fg: #020617;
  --card: #FFFFFF;
  --card-fg: #020617;
  --muted: #E8ECF1;
  --muted-fg: #64748B;
  --border: #E2E8F0;
  --destructive: #DC2626;

  /* Typography */
  --font-heading: 'Lexend', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Type Scale (1.25 ratio) */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  /* Spacing (8dp system) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: 200ms ease-out;
  --transition-slow: 300ms ease-out;
}

/* Base */
html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: 3.5rem;
}

body {
  font-family: var(--font-body);
  color: var(--fg);
  line-height: 1.7;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

a {
  color: var(--secondary);
  text-decoration: none;
  transition: color var(--transition);
  cursor: pointer;
}

a:hover {
  color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- Header ---- */
.header {
  background: var(--primary);
  color: var(--primary-on);
  padding: var(--space-4) 0;
  border-bottom: 2px solid var(--accent);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.header-tagline {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-light);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.logo-bpmi {
  background: var(--accent);
  color: var(--primary-on);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-lg);
  padding: 0.25rem 0.75rem;
  letter-spacing: 0.08em;
  border-radius: 2px;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 300;
  letter-spacing: 0.03em;
  opacity: 0.85;
}

/* ---- Sticky Nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: box-shadow var(--transition-slow);
}

.nav.scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.25rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-1);
  align-items: center;
  margin: 0;
}

.nav-links a {
  color: rgba(255,255,255,0.7);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-on);
  background: rgba(255,255,255,0.08);
}

.nav-links a:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: -2px;
}

.nav-cta {
  background: var(--accent) !important;
  color: var(--primary-on) !important;
  font-weight: 600 !important;
  padding: var(--space-2) var(--space-4) !important;
  border-radius: var(--radius-sm) !important;
}

.nav-cta:hover {
  background: var(--accent-hover) !important;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary-on);
  transition: transform var(--transition), opacity var(--transition);
  border-radius: 1px;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Hero ---- */
.hero {
  background: linear-gradient(160deg, var(--secondary) 0%, var(--primary) 60%);
  background-size: cover;
  background-position: center center;
  color: var(--primary-on);
  padding: var(--space-20) 0 var(--space-16);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(13,42,79,0.82) 0%, rgba(13,42,79,0.65) 100%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
  position: relative;
}

.hero h1::after {
  content: '';
  display: block;
  width: 3.5rem;
  height: 3px;
  background: var(--accent-light);
  margin-top: var(--space-4);
  border-radius: 2px;
}

.hero-lead {
  font-size: var(--text-lg);
  line-height: 1.8;
  margin-bottom: var(--space-5);
  opacity: 0.95;
  max-width: 680px;
}

.hero p {
  margin-bottom: var(--space-4);
  opacity: 0.85;
  font-weight: 300;
  max-width: 680px;
}

.hero strong {
  font-weight: 600;
}

.hero .note {
  font-size: var(--text-base);
  font-weight: 500;
  opacity: 1;
  color: var(--accent-light);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255,255,255,0.15);
  letter-spacing: 0.01em;
}

/* ---- Service Sections ---- */
.section {
  padding: var(--space-16) 0;
}

.section-alt {
  background: var(--muted);
}

.section h2 {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-6);
  position: relative;
  padding-bottom: var(--space-4);
}

.section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 2.5rem;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.section p {
  margin-bottom: var(--space-4);
  color: var(--muted-fg);
  font-size: var(--text-base);
  line-height: 1.75;
  max-width: 680px;
}

.section ul {
  margin: var(--space-5) 0 var(--space-6) var(--space-5);
  color: var(--muted-fg);
}

.section li {
  margin-bottom: var(--space-2);
  padding-left: var(--space-2);
  line-height: 1.65;
}

.section li::marker {
  color: var(--accent);
}

.section ul ul {
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}

/* ---- Section with image ---- */
.section-body {
  display: flex;
  gap: var(--space-10);
  align-items: flex-start;
}

.section-body--reverse {
  flex-direction: row-reverse;
}

.section-text {
  flex: 1;
  min-width: 0;
}

.section-img {
  flex: 0 0 340px;
  width: 340px;
  padding-top: 0.4rem;
}

.section-img img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  display: block;
}

/* ---- Contact ---- */
.section-contact {
  background: linear-gradient(160deg, #EFF4FC 0%, #E8ECF1 100%);
}

.section-contact h2 {
  color: var(--primary);
}

.contact-card {
  background: var(--card);
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  border: 1px solid var(--border);
  transition: box-shadow var(--transition-slow);
}

.contact-card:hover {
  box-shadow: var(--shadow-xl);
}

.contact-card h3 {
  font-size: var(--text-xl);
  color: var(--primary);
  margin-bottom: var(--space-1);
}

.contact-role {
  color: var(--accent) !important;
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: var(--space-4) !important;
  letter-spacing: 0.02em;
}

.contact-card p {
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  color: var(--muted-fg);
  line-height: 1.6;
}

.contact-card a {
  color: var(--secondary);
  font-weight: 500;
}

.contact-card a:hover {
  color: var(--accent);
}

/* ---- Footer ---- */
.footer {
  background: var(--primary);
  color: rgba(255,255,255,0.7);
  padding: var(--space-12) 0 var(--space-6);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-12);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer h3 {
  color: var(--accent-light);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-4);
}

.footer p {
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
  line-height: 1.65;
}

.footer a {
  color: rgba(255,255,255,0.75);
  transition: color var(--transition);
}

.footer a:hover {
  color: var(--accent-light);
}

.footer-nav ul {
  list-style: none;
}

.footer-nav li {
  margin-bottom: var(--space-2);
}

.footer-nav a {
  font-size: var(--text-sm);
  font-weight: 400;
}

.footer-bottom {
  padding-top: var(--space-6);
  text-align: center;
  font-size: var(--text-xs);
  opacity: 0.5;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    text-align: center;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 3.25rem;
    left: 0;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    padding: var(--space-2) var(--space-4) var(--space-4);
    gap: 0;
    border-bottom: 2px solid var(--accent);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: var(--space-3) var(--space-3);
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
  }

  .hero {
    padding: var(--space-12) 0 var(--space-10);
  }

  .hero h1 {
    font-size: var(--text-3xl);
  }

  .section {
    padding: var(--space-10) 0;
  }

  .section h2 {
    font-size: var(--text-2xl);
  }

  .contact-card {
    padding: var(--space-6);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .section-body,
  .section-body--reverse {
    flex-direction: column;
  }

  .section-img {
    width: 100%;
    flex: none;
  }

  .section-img img {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: var(--text-2xl);
  }

  .section h2 {
    font-size: var(--text-xl);
  }

  .container {
    padding: 0 var(--space-4);
  }
}

/* ---- Language Switcher ---- */
.nav-lang {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.3em 0.7em;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: #ffffff !important;
}

.nav-links a.lang-switch {
  color: #ffffff !important;
  text-decoration: none !important;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-links a.lang-switch:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: var(--accent-light) !important;
  color: var(--accent-light) !important;
}

@media (max-width: 768px) {
  .nav-lang {
    margin-left: 0;
    justify-content: center;
    padding: var(--space-2) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: var(--space-2);
  }
}

/* ---- Prose (Impressum / Datenschutz) ---- */
.prose {
  color: var(--text-secondary);
  line-height: 1.8;
}

.prose h1 {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-4);
  border-bottom: 3px solid var(--accent);
}

.prose h2 {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--primary);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}

.prose h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--primary);
  margin-top: var(--space-8);
  margin-bottom: var(--space-2);
}

.prose p {
  margin-bottom: var(--space-4);
}

.prose a {
  color: var(--accent);
  text-decoration: none;
}

.prose a:hover {
  text-decoration: underline;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-8) 0;
}

.prose ul {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

.prose ul li {
  margin-bottom: var(--space-2);
}

/* ---- Back to Top Button ---- */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary-on);
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
  z-index: 999;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

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

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
