/*
 * Modern CSS for Berger & Rosenstock GbR
 * Fully responsive, accessible (WCAG 2.2 AA), and professional design
 * Mobile-first approach with modern web standards
 */

/* ============================================
   CSS Custom Properties (Design System)
   ============================================ */
:root {
  /* Color Palette - Modern & Professional */
  --color-primary: #4F46E5;         /* Indigo - Primary brand color */
  --color-primary-hover: #4338CA;   /* Darker indigo for hover */
  --color-secondary: #0F172A;       /* Slate - Dark backgrounds */
  --color-background: #F9FAFB;      /* Light gray - Main background */
  --color-surface: #FFFFFF;         /* White - Cards and surfaces */
  --color-text: #1F2937;            /* Dark gray - Primary text */
  --color-text-light: #6B7280;      /* Medium gray - Secondary text */
  --color-border: #E5E7EB;          /* Light border color */
  --color-success: #10B981;         /* Green for success states */
  --color-error: #EF4444;           /* Red for error states */
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);
  
  /* Spacing Scale */
  --space-xs: 0.5rem;    /* 8px */
  --space-sm: 0.75rem;   /* 12px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4rem;     /* 64px */
  --space-4xl: 6rem;     /* 96px */
  --space-5xl: 8rem;     /* 128px */
  
  /* Border Radius */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Z-index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --color-background: #0F172A;
    --color-surface: #1E293B;
    --color-text: #F1F5F9;
    --color-text-light: #CBD5E1;
    --color-border: #334155;
  }
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-background);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  margin-bottom: var(--space-lg);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

h5 {
  font-size: clamp(1.125rem, 2vw, 1.25rem);
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: var(--space-lg);
  max-width: 70ch;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover,
a:focus-visible {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

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

strong, b {
  font-weight: 600;
  color: var(--color-text);
}

em, i {
  font-style: italic;
}

/* ============================================
   Layout Utilities
   ============================================ */
#page-wrapper {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#main-content {
  flex: 1;
  padding-top: 60px; /* Account for fixed header */
}

.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

@media (min-width: 640px) {
  .container {
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: var(--space-2xl);
    padding-right: var(--space-2xl);
  }
}

.section {
  padding-top: var(--space-4xl);
  padding-bottom: var(--space-4xl);
}

@media (min-width: 768px) {
  .section {
    padding-top: var(--space-5xl);
    padding-bottom: var(--space-5xl);
  }
}

/* ============================================
   Header & Navigation
   ============================================ */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  max-width: 1280px;
  margin: 0 auto;
}

.header-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition-base);
}

.header-logo:hover {
  color: var(--color-primary);
}

.header-logo:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

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

/* Language Switcher */
#language-switcher {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-xs);
  background: var(--color-background);
  border-radius: var(--radius-md);
}

.flag-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-base), opacity var(--transition-base), border-color var(--transition-base);
  opacity: 0.5;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.flag-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flag-icon:hover {
  transform: scale(1.1);
  opacity: 0.8;
}

.flag-icon:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.flag-icon.active {
  opacity: 1;
  border-color: var(--color-primary);
}

/* Menu Toggle Button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  min-width: 44px;
  min-height: 44px;
  color: var(--color-text);
  font-size: 1.5rem;
}

.menu-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ============================================
   Hero / Banner Section
   ============================================ */
#banner {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--color-secondary) 0%, #1E293B 100%);
  color: #FFFFFF;
  padding-top: var(--space-4xl);
  overflow: hidden;
}

#banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(79, 70, 229, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(79, 70, 229, 0.1) 0%, transparent 50%);
  z-index: 0;
}

.banner-inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-xl);
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#banner h2 {
  color: #FFFFFF;
  margin-bottom: var(--space-xl);
  font-size: clamp(2.5rem, 6vw, 4rem);
}

#banner .block {
  display: block;
  background: linear-gradient(135deg, var(--color-primary) 0%, #6366F1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#banner p {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  line-height: 1.6;
  max-width: 100%;
}

/* ============================================
   Content Sections
   ============================================ */
.wrapper {
  background-color: var(--color-background);
}

.wrapper.alt {
  background-color: var(--color-surface);
}

.spotlight {
  display: grid;
  gap: var(--space-3xl);
  align-items: center;
  padding: var(--space-4xl) 0;
}

@media (min-width: 768px) {
  .spotlight {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4xl);
  }
  
  .spotlight.style2 {
    direction: rtl;
  }
  
  .spotlight.style2 > * {
    direction: ltr;
  }
}

.spotlight .image {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.spotlight .image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

.spotlight .image img:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.spotlight .content {
  max-width: 600px;
}

.major {
  font-weight: 700;
  color: var(--color-text);
}

/* ============================================
   Projects Section
   ============================================ */
.features {
  display: grid;
  gap: var(--space-2xl);
  margin-top: var(--space-3xl);
}

@media (min-width: 768px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}

.features article {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.features article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.features article h3 {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
}

.features .image.main {
  width: 100%;
  margin-bottom: var(--space-lg);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.features iframe {
  width: 100%;
  height: 200px;
  border: none;
  border-radius: var(--radius-md);
}

/* ============================================
   Buttons & Links
   ============================================ */
.special {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  min-height: 44px;
  background-color: var(--color-primary);
  color: #FFFFFF !important;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.special:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.special:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

.special:active {
  transform: translateY(0);
}

/* ============================================
   Footer
   ============================================ */
#footer {
  background-color: var(--color-secondary);
  color: rgba(255, 255, 255, 0.9);
  padding: var(--space-4xl) var(--space-lg) var(--space-xl);
}

#footer .inner {
  max-width: 1280px;
  margin: 0 auto;
}

#footer .contact {
  display: grid;
  gap: var(--space-xl);
  margin-bottom: var(--space-3xl);
  list-style: none;
}

@media (min-width: 768px) {
  #footer .contact {
    grid-template-columns: repeat(3, 1fr);
  }
}

#footer .contact li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

#footer .contact .icon {
  color: var(--color-primary);
  font-size: 1.5rem;
  flex-shrink: 0;
}

#footer .contact a {
  color: rgba(255, 255, 255, 0.9);
  transition: color var(--transition-base);
}

#footer .contact a:hover {
  color: var(--color-primary);
}

#footer .copyright {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
  list-style: none;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#footer .copyright a {
  color: rgba(255, 255, 255, 0.7);
}

#footer .copyright a:hover {
  color: var(--color-primary);
}

/* ============================================
   Menu / Mobile Navigation
   ============================================ */
#menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 300px;
  height: 100vh;
  background-color: var(--color-surface);
  box-shadow: var(--shadow-xl);
  transition: right var(--transition-slow);
  z-index: var(--z-modal);
  overflow-y: auto;
}

#menu.visible {
  right: 0;
}

#menu .inner {
  padding: var(--space-xl);
}

#menu h2 {
  margin-bottom: var(--space-lg);
  font-size: 1.5rem;
}

#menu .links {
  list-style: none;
}

#menu .links li {
  margin-bottom: var(--space-sm);
}

#menu .links a {
  display: block;
  padding: var(--space-md);
  min-height: 44px;
  color: var(--color-text);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-base);
  display: flex;
  align-items: center;
}

#menu .links a:hover,
#menu .links a:focus-visible {
  background-color: var(--color-background);
  text-decoration: none;
}

#menu .close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  font-size: 1.5rem;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-base);
}

#menu .close:hover {
  background-color: var(--color-background);
}

#menu .close:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Menu Backdrop */
.menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
  z-index: calc(var(--z-modal) - 1);
}

.menu-backdrop.visible {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   Accessibility & Skip Links
   ============================================ */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: var(--space-sm) var(--space-lg);
  text-decoration: none;
  z-index: var(--z-tooltip);
}

.skip-link:focus {
  top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   Forms
   ============================================ */
input,
textarea,
select {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-text);
  background-color: var(--color-surface);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--color-primary);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 600;
  color: var(--color-text);
}

/* ============================================
   Lists
   ============================================ */
ul, ol {
  margin-bottom: var(--space-lg);
  padding-left: var(--space-xl);
}

ul {
  list-style: disc;
}

ol {
  list-style: decimal;
}

li {
  margin-bottom: var(--space-sm);
  line-height: 1.6;
}

ul.contact,
ul.copyright,
ul.links {
  list-style: none;
  padding-left: 0;
}

/* ============================================
   Horizontal Rules
   ============================================ */
hr {
  border: 0;
  border-top: 2px solid var(--color-border);
  margin: var(--space-3xl) 0;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center {
  text-align: center;
}

.text-primary {
  color: var(--color-primary);
}

.bg-primary {
  background-color: var(--color-primary);
}

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* ============================================
   Image Optimization
   ============================================ */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Handle lazy-loaded images for browsers without native support */
img[loading="lazy"]:not([src]) {
  opacity: 0;
}

img[loading="lazy"] {
  transition: opacity var(--transition-slow);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  #header,
  #menu,
  #banner,
  #footer {
    display: none;
  }
  
  body {
    color: black;
    background: white;
  }
  
  a {
    text-decoration: underline;
  }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   High Contrast Mode Support
   ============================================ */
@media (prefers-contrast: high) {
  :root {
    --color-border: #000000;
  }
  
  a:focus-visible {
    outline-width: 3px;
  }
}
