/* ==========================================================================
   Global Styles & Variables
   ========================================================================== */
:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --grey: #f8f8f8;
  --light-grey-border: #e0e0e0;
  --dark-grey: #4a4a4a;
  --light-grey-text: #767676;
  --accent-blue: #0099ff;
  --accent-blue-hover: #0077cc;

  --font-primary: "Inter", sans-serif;

  --transition-speed: 0.3s;
  --transition-fast: 0.2s;

  /* Fluid header height - scales smoothly between breakpoints */
  --header-height: clamp(68px, 8vw + 40px, 92px);
  /* iOS Safari safe area for notched devices */
  --safe-area-top: env(safe-area-inset-top, 0px);
  --radius: 12px;

  /* Spacing Scale - Modular spacing system */
  --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: 2.5rem;   /* 40px */
  --space-3xl: 3rem;     /* 48px */
  --space-4xl: 4rem;     /* 64px */
  --space-5xl: 5rem;     /* 80px */

  /* Section spacing */
  --section-padding: var(--space-5xl);
  --section-padding-mobile: var(--space-4xl);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  /* Prevent the thin white line below the footer */
  background-color: #111;
}


body {
  font-family: var(--font-primary);
  background: #111;
  color: var(--black);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: opacity 0.15s ease;
  min-height: 100vh;
  position: relative;
}

/* Loading state during language switch */
body.lang-switching {
  opacity: 0.6;
  pointer-events: none;
}

main {
  background: var(--white);
}

.container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 0 15px; }

img { max-width: 100%; height: auto; display: block; }

/* Skip to content link - accessibility */
.skip-link {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-blue);
  color: white;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: top 0.2s ease, opacity 0.2s ease;
}
.skip-link:focus {
  top: 0;
  opacity: 1;
  pointer-events: auto;
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

/* Shared image hover treatment (hero visuals, jobs, projects thumbnails) */
.image-content img,
.job-card img,
.projects-visual img {
  border-radius: var(--radius);
  transition: transform var(--transition-speed) ease, filter var(--transition-speed) ease;
}
.image-content:hover img,
.projects-visual:hover img {
  transform: scale(1.03);
  filter: brightness(1.05);
}

/* ==========================================================================
   Typography & Utilities
   ========================================================================== */
a { color: var(--accent-blue); text-decoration: none; transition: color var(--transition-fast) ease; }
a:hover { color: var(--accent-blue-hover); }

h1, h2, h3, h4 { margin-bottom: 1.2rem; font-weight: 700; line-height: 1.3; color: var(--black); }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.15rem; }

.large-header { font-size: 2.8rem; text-align: center; margin-bottom: 2.5rem; font-weight: 700; }

p { margin-bottom: 1.2rem; color: var(--dark-grey); }

.text-light-grey { color: var(--light-grey-text); }
.text-center { text-align: center; }

.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4xl); align-items: center; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 0.9rem 2.2rem;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-speed) ease,
              transform var(--transition-speed) ease,
              box-shadow var(--transition-speed) ease;
  margin-top: 1rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.btn-primary { background: var(--accent-blue); color: var(--white); }
.btn-primary:hover {
  background: var(--accent-blue-hover); color: #fff;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 15px rgba(0,153,255,0.3);
}
.btn-secondary { background: var(--black); color: var(--white); }
.btn-secondary:hover {
  background: var(--dark-grey); color: #fff;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* Hero CTA - Make it prominent and eye-catching */
.hero-content .btn-primary {
  font-size: 1.15rem;
  padding: 1.1rem 2.8rem;
  font-weight: 700;
  box-shadow: 0 8px 25px rgba(0,153,255,0.4);
  animation: ctaPulse 3s ease-in-out infinite;
}
.hero-content .btn-primary:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 35px rgba(0,153,255,0.5);
  animation: none; /* Stop pulse on hover */
}

@keyframes ctaPulse {
  0%, 100% {
    box-shadow: 0 8px 25px rgba(0,153,255,0.4);
  }
  50% {
    box-shadow: 0 8px 30px rgba(0,153,255,0.6);
  }
}

/* Career section CTA uses the primary (light blue) look */
.career-section .btn-secondary {
  background: var(--accent-blue);
  color: var(--white);
}
.career-section .btn-secondary:hover {
  background: var(--accent-blue-hover);
  color: #fff;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 15px rgba(0,153,255,0.3);
}

/* Center Career CTA on all screen sizes (intrinsic width) */
#career .btn-primary,
#career .btn-secondary {
  display: block;
  width: max-content;
  margin-left: auto;
  margin-right: auto;
  align-self: center;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  background: rgba(17, 17, 17, 0.85);
  height: var(--header-height);
  min-height: var(--header-height);
  display: flex; align-items: center;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: all 0.45s cubic-bezier(0.32, 0.08, 0.24, 1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  /* NO backdrop-filter here - it breaks sticky on iOS Safari */
}

/* Backdrop blur on pseudo-element (doesn't break sticky) */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  z-index: -1;
  pointer-events: none;
}
.site-header.scrolled {
  /* Keep same height - only change visual effects */
  background: rgba(17, 17, 17, 0.72);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.15);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.header-container {
  display:flex; align-items:center; gap: 1rem;
  width:90%; max-width:1200px; margin:0 auto; padding:0 15px;
  position: relative;
  z-index: 1;
}

/* Brand block (icon + stacked text) */
.logo { display: flex; align-items: center; }
.logo a {
  font-size:1.6rem; font-weight:700; color:#fff;
  display:inline-flex; align-items:center; gap:.5em;
  transition: color var(--transition-fast) ease;
}
.logo a:hover { color: var(--accent-blue); }

.logo a.brand { display: inline-flex; align-items: center; gap: 0.75em; }
.brand-text { display: flex; flex-direction: column; justify-content: center; line-height: 1; }
.brand-line1 {
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: clamp(1.3rem, 2.3vw, 2rem);
  color: #fff;
  transition: font-size .22s ease;
}
.brand-sub {
  margin-top: 4px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.65);
  font-size: clamp(0.68rem, 0.9vw, 0.85rem);
  max-height: calc(1.2em + 0.2em);
  line-height: 1.2;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 0.45s cubic-bezier(0.32, 0.08, 0.24, 1),
              opacity 0.45s cubic-bezier(0.32, 0.08, 0.24, 1),
              margin-top 0.45s cubic-bezier(0.32, 0.08, 0.24, 1),
              transform 0.45s cubic-bezier(0.32, 0.08, 0.24, 1);
}

/* Logo icon sizing */
.header-logo-icon {
  height: 2.4em; width: auto;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.25));
  transition: filter 0.45s cubic-bezier(0.32, 0.08, 0.24, 1);
}
.site-header.scrolled .header-logo-icon {
  /* Keep same size - only adjust shadow */
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.22));
}
/* Collapse subline on scroll */
.site-header.scrolled .brand-sub {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  transform: translateY(-4px);
}
/* Keep title size consistent on scroll */
.site-header.scrolled .brand-line1 {
  /* No size change - already at the right size */
  letter-spacing: 0.3px;
}
/* Disable hover shifts on brand */
.logo a.brand:hover .header-logo-icon { transform: none; }
.logo a.brand:hover .brand-line1 { color: #fff; }

/* Main navigation */
.main-nav { flex: 1 1 auto; min-width: 0; }
.main-nav ul { list-style:none; display:flex; gap:1.6rem; justify-content:center; }
.main-nav a {
  color:#fff; font-weight:600; padding:.5rem 0; position:relative;
  transition: color var(--transition-fast) ease;
}
.main-nav a:hover { color: var(--accent-blue); }
.main-nav a::after {
  content:''; position:absolute; width:0; height:3px; bottom:-5px; left:50%;
  transform:translateX(-50%); background: var(--accent-blue);
  transition: width var(--transition-speed) ease; border-radius:2px;
}
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }
.main-nav a.active { color: var(--accent-blue); }

/* Expandable language switcher */
.lang-switcher-container {
  position: relative;
  display: flex;
  align-items: center;
}

.lang-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50px;
  padding: 0.55rem 1rem 0.55rem 0.9rem;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.32, 0.08, 0.24, 1);
  min-width: 44px;
  min-height: 44px;
}
.lang-toggle-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
  transform: scale(1.02);
}
.lang-toggle-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
.lang-toggle-btn .fa-globe {
  font-size: 1.05rem;
  color: var(--accent-blue);
  opacity: 0.9;
}
.lang-toggle-btn .current-lang {
  font-weight: 600;
  letter-spacing: 0.2px;
  font-size: 0.9rem;
}

/* On mobile/narrow screens: icon-only, hide the language name */
@media (max-width: 768px) {
  .lang-toggle-btn {
    padding: 0;
    gap: 0;
    width: 44px;
    height: 44px;
  }
  .lang-toggle-btn .current-lang {
    display: none;
  }
  .lang-toggle-btn .fa-globe {
    font-size: 1.2rem;
  }
}

/* Very narrow screens: even more compact */
@media (max-width: 480px) {
  .header-container {
    gap: 0.5rem;
  }
  .lang-toggle-btn {
    width: 42px;
    height: 42px;
  }
}

/* Expandable panel - clean dropdown style */
.lang-switch-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(17,17,17,0.96);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
  backdrop-filter: blur(24px) saturate(180%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;
  transition: opacity 0.35s cubic-bezier(0.32, 0.08, 0.24, 1),
              transform 0.35s cubic-bezier(0.32, 0.08, 0.24, 1),
              visibility 0.35s;
  z-index: 1001;
  min-width: 140px;
}
.lang-switch-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Clean language buttons without slider */
.lang-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.75);
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.32, 0.08, 0.24, 1);
  text-align: left;
}
.lang-btn + .lang-btn {
  margin-top: 2px;
}
.lang-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.lang-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: -2px;
}
.lang-btn.active {
  background: rgba(0,153,255,0.15);
  color: #fff;
}
.lang-btn .lang-name {
  flex: 1;
}
.lang-btn .lang-check {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.32, 0.08, 0.24, 1);
  color: var(--accent-blue);
  font-size: 1.1rem;
  line-height: 1;
  margin-left: 0.5rem;
}
.lang-btn.active .lang-check {
  opacity: 1;
  transform: scale(1);
}

/* Mobile burger */
.mobile-nav-toggle {
  display:none; background:none; border:none; cursor:pointer;
  padding:8px; width:44px; height:44px; position:relative;
  transition: transform var(--transition-fast) ease;
}
/* Only apply hover scale on devices that actually have hover */
@media (hover: hover) and (pointer: fine) {
  .mobile-nav-toggle:hover {
    transform: scale(1.1);
  }
}

/* Hamburger icon container */
.hamburger-icon {
  display: flex; flex-direction: column; justify-content: space-between;
  width: 24px; height: 18px; position: relative;
}

/* Hamburger lines */
.hamburger-icon .line {
  display: block; height: 3px; width: 100%; background: #fff;
  border-radius: 2px; transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
  transform-origin: center;
}

/* Hover state - turn lines blue */
@media (hover: hover) and (pointer: fine) {
  .mobile-nav-toggle:hover .hamburger-icon .line {
    background: var(--accent-blue);
  }
}

/* Active state - transform to X */
.main-nav.active ~ .mobile-nav-toggle .hamburger-icon .line {
  background: var(--accent-blue);
}

.main-nav.active ~ .mobile-nav-toggle .hamburger-icon .line:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.main-nav.active ~ .mobile-nav-toggle .hamburger-icon .line:nth-child(2) {
  opacity: 0;
}

.main-nav.active ~ .mobile-nav-toggle .hamburger-icon .line:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}


/* ==========================================================================
   Hero (Video)
   ========================================================================== */
.hero-section {
  position: relative;
  min-height: clamp(520px, 75vh, 900px);
  display: grid; place-items: center;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--light-grey-border);
}
.hero-content { position: relative; z-index: 2; max-width: 720px; padding: 4rem 1rem; }

.hero-title { color: #fff; margin-bottom: 2rem; line-height: 1.05; font-weight: 800; text-shadow: 0 3px 22px rgba(0,0,0,.45); }
.hero-title .hero-line-1, .hero-title .hero-line-2 { display: block; }
.hero-title .hero-line-1 { font-weight: 800; font-size: clamp(1.6rem, 4vw, 3rem); letter-spacing: .2px; }
.hero-title .hero-line-2 { font-weight: 900; font-size: clamp(2.4rem, 6.5vw, 4.8rem); letter-spacing: .2px; margin-top: .06em; }

.hero-media { position:absolute; inset:0; z-index:0; pointer-events:none; }
.hero-video {
  position:absolute; inset:0; width:100%; height:100%;
  object-fit: cover; object-position:center; background:#0a0a0a;
  filter: brightness(1.16) contrast(1.05) saturate(1.08);
}
.hero-overlay { position:absolute; inset:0; background: linear-gradient(to bottom, rgba(0,0,0,0.08), rgba(0,0,0,0.18)); z-index:1; }

@media (max-width: 768px) {
  .hero-section { min-height: 68vh; }
  .hero-overlay { background: linear-gradient(to bottom, rgba(0,0,0,0.12), rgba(0,0,0,0.22)); }
}
@media (prefers-reduced-motion: reduce) { .hero-video { display:none; } }

/* ==========================================================================
   Content Sections (About, Career, Jobs, Projects)
   ========================================================================== */
.content-section { padding: var(--section-padding) 0; border-top: 1px solid var(--light-grey-border); }
#hero + .content-section { border-top: none; }

/* Über Uns */
#ueber-uns { padding-top: var(--section-padding); }
.about-grid { display:grid; grid-template-columns:1fr 1fr; gap:var(--space-3xl); margin:0 auto; }
.about-grid p { font-size: 1.05rem; }

/* Career */
.career-section .grid-2-col { align-items: start; }
.career-section .image-content { align-self: start; }
.career-section .image-content img {
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  margin-top: 0;
  background: #fff;
}

/* Jobs */
#jobs h2 { margin-bottom: var(--space-2xl); }
.jobs-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--space-2xl); }
.job-card {
  background: var(--grey);
  border: 1px solid var(--light-grey-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.07);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  display: flex; flex-direction: column;
}
.job-card:hover { transform: translateY(-8px); box-shadow: 0 12px 30px rgba(0,0,0,0.12); }
.job-card img {
  width:100%; height:220px; object-fit:cover;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--light-grey-border);
  transition: transform var(--transition-speed) ease;
}
.job-card:hover img { transform: scale(1.05); }
.job-card-content { padding:1.8rem; flex-grow:1; display:flex; flex-direction:column; }
.job-card h3 { margin-bottom: .8rem; font-size: 1.4rem; color: var(--black); }
.job-card p { font-size: .98rem; color: var(--dark-grey); flex-grow:1; }

/* ======================
   FAQ (Teaser) - styles
   ====================== */
#faq .section-title {
  text-align: center;
  margin-bottom: 1rem;
}

.faq-list {
  display: grid;
  gap: .75rem;
}

.faq-list details {
  border: 1px solid var(--light-grey-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 14px rgba(0,0,0,.04);
  overflow: hidden;
  transition: box-shadow .3s ease, border-color .3s ease, transform .2s ease;
}

.faq-list details:hover {
  box-shadow: 0 8px 16px rgba(0,0,0,.06);
  transform: translateY(-1px);
}

.faq-list details[open] {
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
  border-color: var(--accent-blue);
}

.faq-list summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  user-select: none;
  transition: background-color .2s ease;
}

.faq-list summary:hover {
  background-color: rgba(0, 153, 255, 0.03);
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  content: "▸";
  font-size: 1.05rem;
  line-height: 1;
  color: var(--accent-blue);
  transform: translateY(1px);
  transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1), color .2s ease;
  flex-shrink: 0;
}

.faq-list details[open] summary::after {
  transform: translateY(1px) rotate(90deg);
}

.faq-list .answer {
  padding: 0 16px 14px 16px;
  animation: fadeInDown .3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.faq-list .answer ul,
.faq-list .answer ol {
  margin: .5rem 0 0;
  padding-left: 1.25rem;
  list-style-position: outside;
}

.faq-list .answer p + p {
  margin-top: .5rem;
}

.faq-readall {
  text-align: center;
  margin-top: 1rem;
}

/* Read-all link — no underline ever */
.faq-readall a.faq-full-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 800;
  text-decoration: none;   /* kill underline */
  border: 0;               /* no bottom border */
  transition: transform .2s ease, opacity .2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .faq-readall a.faq-full-link:hover {
    text-decoration: none; /* keep off on hover */
    border: 0;
    transform: translateY(-1px);
    opacity: .9;
  }
}

/* Keep a visible keyboard focus without underlines */
.faq-readall a.faq-full-link:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 2px;
  text-decoration: none;
  border: 0;
}

/* FAQ page headings */
.page-title { text-align: center; margin-bottom: 1rem; }
.faq-category { margin-top: 1.25rem; }
.faq-category-title { font-weight: 800; font-size: 1.15rem; margin: 0 0 .6rem 0; }
.faq-list ul.tight li + li { margin-top: .25rem; }


/* FAQ page: push the first section below the fixed header (same as hero) */
.faq-section:first-of-type { margin-top: var(--header-height); } /* header height token */

/* Category headings: spacing + centered */
.faq-category { margin-top: 4rem; }
.faq-category-title { text-align: center; margin-bottom: 2rem; font-weight: 800; }

/* FAQ category accent — centered blue pill, no layout shift */
.faq-category-title { position: relative; }

.faq-category-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12px; /* sits within the existing margin-bottom, spacing stays identical */
  transform: translateX(-50%);
  width: clamp(20px, 5vw, 40px);
  height: 3px;
  background: var(--accent-blue);
  border-radius: 999px;
}


/* FAQ contact line */
#contact .faq-contact {
  text-align: center;
}


/* Legal / Imprint page */
.legal-hero {
  margin-top: var(--header-height);
  padding-top: 5rem;
  padding-bottom: 2.5rem;
}

.legal-hero .large-header {
  margin-bottom: 2.15rem;
}

.legal-hero + .content-section {
  border-top: none;
}

.legal-cards,
.legal-info {
  padding-top: 2rem;
}


.legal-intro {
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
}

.legal-company-details {
  margin: 1.6rem 0 0;
  width: 100%;
  text-align: left;
  display: grid;
  gap: 1.1rem;
  justify-items: start;
}

.legal-company-details .legal-contact-list {
  width: 100%;
}

.legal-details {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* Card layout retained for other legal pages */
.legal-card-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  justify-items: stretch;
  justify-content: center;
}

.legal-card {
  background: var(--grey);
  border: 1px solid var(--light-grey-border);
  border-radius: var(--radius);
  padding: 2.25rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition:
    transform var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
  overflow: hidden;
}

.legal-card:hover,
.legal-card:focus-within {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.12);
}

.legal-card p {
  margin: 0.5rem 0 0;
}

.legal-card p:first-of-type {
  margin-top: 0;
}

.legal-card h2 {
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
  color: var(--black);
}

.legal-card p,
.legal-card li {
  color: var(--dark-grey);
}

.legal-section h2 {
  font-size: 1.35rem;
  margin-bottom: 0.9rem;
  color: var(--black);
}

.legal-section p,
.legal-section li {
  color: var(--dark-grey);
}

.legal-section p {
  margin: 0.4rem 0 0;
}

.legal-section p:first-of-type {
  margin-top: 0;
}

.legal-company {
  font-weight: 700;
  color: var(--black);
}

.legal-contact-list,
.legal-list {
  padding: 0;
  margin: 1rem 0 0 0;
}

.legal-address p {
  margin: 0;
}

.legal-address {
  display: grid;
  gap: 0.15rem;
  margin-bottom: 1rem;
}

.legal-contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.legal-contact-list li {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
}

.legal-contact-label {
  font-weight: 600;
  color: var(--black);
}

.legal-list {
  list-style: disc;
  padding-left: 1.25rem;
  color: var(--dark-grey);
}

.legal-list li {
  margin: 0.35rem 0 0;
}

.legal-text-block {
  border-top: none;
  padding-top: 3.75rem;
  padding-bottom: 3.75rem;
}

.impressum-page .legal-text-block {
  padding-top: 2.7rem;
  padding-bottom: 3rem;
}

.impressum-page .legal-info + .legal-text-block {
  padding-top: 1.8rem;
}

.impressum-page .legal-text-block + .legal-text-block {
  padding-top: 2rem;
}

.legal-text {
  max-width: 900px;
  margin: 0 auto;
}

.legal-text h2 {
  text-align: center;
  margin-bottom: 1.75rem;
}

.legal-article + .legal-article {
  margin-top: 2rem;
}

.legal-article h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.legal-text p {
  color: var(--dark-grey);
}

.legal-text a {
  word-break: break-word;
}

.legal-subheading {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-weight: 700;
  color: var(--black);
  margin-top: 1.65rem;
}

.legal-subpoint-number {
  margin-right: 0;
}

@media (max-width: 768px) {
  .legal-intro {
    text-align: center;
  }

  .legal-card {
    padding: 1.9rem;
  }

  .legal-card-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .legal-article h3 {
    font-size: 1.2rem;
  }

  .legal-hero {
    margin-top: var(--header-height);
    padding-top: 4.25rem;
    padding-bottom: 2.2rem;
  }

  .legal-company-details {
    margin-top: 1rem;
    max-width: 100%;
    justify-items: center;
    text-align: center;
  }
}


/* Projects (gallery + copy) */
.projects-container { display:grid; grid-template-columns: 1.3fr 1fr; gap:4rem; align-items:center; }
.projects-visual img {
  width:100%; height:100%; object-fit:cover;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

/* Cross-fade carousel */
.projects-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 16 / 11;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  transition: box-shadow .45s ease;
}
.projects-carousel .slide {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0;
  transition: opacity .28s ease, transform var(--transition-speed) ease, filter var(--transition-speed) ease;
  pointer-events: none;
}
.projects-carousel .slide.is-active { opacity: 1; }

/* Carousel arrows */
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  border: 0; padding: 10px 12px; border-radius: 9999px;
  background: rgba(0,0,0,0.45); color: #fff; cursor: pointer; line-height: 0;
  backdrop-filter: blur(3px);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.carousel-arrow:hover {
  background: rgba(0,0,0,0.65);
  transform: translateY(-50%) scale(1.1);
}
.carousel-arrow.prev { left: 12px; }
.carousel-arrow.next { right: 12px; }
.carousel-arrow:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }
.carousel-arrow i { font-size: 20px; } /* ensure arrows stay visible */

@media (prefers-reduced-motion: reduce) { .projects-carousel .slide { transition: none; } }

/* ==========================================================================
   Network (Category Cards)
   ========================================================================== */
.network-section .large-header { text-align: center; margin-bottom: .5rem; }
.network-section .section-intro {
  margin: .25rem 0 2.5rem; color: var(--dark-grey); font-size: 1rem; text-align: center;
}

/* Equal-width columns at all breakpoints (never 1 column) */
.network-card-list {
  display: grid;
  gap: 0.9rem;
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));   /* phones: 2 cols */
}
@media (min-width: 640px) { .network-card-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .network-card-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1280px){ .network-card-list { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.network-card {
  background: var(--grey);
  border: 1px solid var(--light-grey-border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0; /* explicit spacing handled below */
}

/* Title: emphasized, robust wrapping, fixed block height; blue hairline under text */
#network .network-card-title {
  display: block;
  text-align: center;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.5rem 0;                          /* space to description */
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.20rem);
  letter-spacing: 0.005em;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  height: calc(2.6em + 0.9rem);                  /* 2 lines + hairline spacing */
}
#network .network-card-title::after {
  content: "";
  display: block;
  width: 28px; height: 2px;
  margin: 0.35rem auto 0;                        /* directly beneath the title */
  background: var(--accent-blue);
  opacity: 0.6;
  border-radius: 999px;
}
/* Allow 3 title lines on ultra-narrow screens */
@media (max-width: 360px) {
  #network .network-card-title { height: calc(3.9em + 0.9rem); }
}
/* Keep long words intact when wide; allow hyphenation when narrow */
@media (min-width: 992px) {
  #network .network-card-title { hyphens: none; overflow-wrap: normal; word-break: normal; }
}

/* Description: fixed height, centered, with equal spacing above/below */
#network .network-card-desc {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(1.4em * 2);                    /* ~2 lines */
  margin: 0 0 0.5rem 0;                           /* equal spacing to logos */
  color: var(--dark-grey);
  font-size: .95rem;
  line-height: 1.4;
  text-align: center;
}

/* Logos: single column, uniform tiles (rows line up across cards) */
#network .logos-grid { display: grid; gap: .75rem; grid-template-columns: 1fr; align-items: start; }
#network .logo-tile  {
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 16 / 9; padding: 8px;
  background: transparent; border: none; border-radius: 8px; margin-inline: auto;
}
#network .logo-tile img { width: 100%; height: 100%; object-fit: contain; }

/* Tiny screens: keep logos tidy inside smaller cards */
@media (max-width: 400px) {
  .logo-tile { width: 100%; max-width: 110px; padding: 6px; }
  .network-card-title { font-size: 1rem; }
  .network-card-desc  { font-size: .9rem; }
}

/* Hover affordance (respect reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  .network-card { transition: transform var(--transition-fast) ease, box-shadow var(--transition-fast) ease; }
  .network-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.06); }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer-main { padding: 4rem 0 1.5rem 0; background: #111; }
.footer-grid {
  display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:2.5rem; margin-bottom:2.5rem;
  border-bottom:1px solid #333; padding-bottom:2.5rem;
}
.footer-company-info h4,
.footer-links h4,
.footer-social h4 { color:#fff; margin-bottom:1rem; font-weight:600; }
.footer-company-info p,
.footer-links ul li { font-size:.95rem; color: rgba(255, 255, 255, 0.75); margin-bottom:.6rem; }

.footer-links ul { list-style:none; padding-left:0; }
.footer-links a {
  color: rgba(255, 255, 255, 0.75);
  transition: color var(--transition-fast) ease, transform var(--transition-fast) ease;
}
.footer-links a:hover { color:#fff; transform: translateX(2px); }

/* Footer company info links (e.g., email) */
.footer-company-info a { color: rgba(255, 255, 255, 0.75); text-decoration: none; transition: color var(--transition-fast) ease; }
.footer-company-info a:hover,
.footer-company-info a:focus { color: #fff; outline: none; }

/* Social icons */
.social-icons { display:flex; gap:1.2rem; justify-content:flex-start; }
.social-icons a {
  display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:50%;
  color:#d9d9d9; background: rgba(255,255,255,0.06);
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
.social-icons a:hover { background: rgba(255,255,255,0.14); color:#fff; transform: translateY(-1px); }
.social-icons i { font-size:1rem; }
/* Brand colors for social icons (icon only) */
.social-icons i.fa-linkedin-in { color: #0A66C2; }  /* LinkedIn Blue */
.social-icons i.fa-instagram   { color: #E4405F; }  /* Instagram Pink */
.social-icons i.fa-tiktok      { color: #ffffff; }  /* TikTok Cyan */

/* Keep brand colors on hover/focus (override anchor's color: #fff) */
.social-icons a:hover i.fa-linkedin-in,
.social-icons a:focus-visible i.fa-linkedin-in { color: #0A66C2; }

.social-icons a:hover i.fa-instagram,
.social-icons a:focus-visible i.fa-instagram { color: #E4405F; }

.social-icons a:hover i.fa-tiktok,
.social-icons a:focus-visible i.fa-tiktok { color: #ffffff; }


.footer-copyright { text-align:center; font-size:.9rem; padding-top:1.5rem; }
.footer-copyright p { color: rgba(255, 255, 255, 0.65); }
/* Match legal links spacing to address line-height */
.footer-legal ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0;
}

.footer-legal ul li {
  margin-bottom: 0;
  display: inline-flex;
  align-items: center;
}

.footer-legal ul li + li::before {
  content: "•";
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0.45rem;
  font-size: 0.9rem;
  line-height: 1;
}

.footer-legal a {
  display: inline-flex;
  align-items: center;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: color var(--transition-fast) ease;
}

.footer-legal a:hover,
.footer-legal a:focus-visible {
  color: #fff;
  text-decoration: none;
  transform: none;
}

@media (max-width: 768px) {
  .footer-legal {
    text-align: center;
  }

  .footer-legal ul {
    justify-content: center;
    width: 100%;
  }
}


/* Footer contact icons (phone + email) */
.footer-contact .contact-line {
  display: inline-flex;
  align-items: baseline;
  gap: .5rem;            /* horizontal spacing between icon and text only */
}

.footer-contact-icon {
  font-size: .95rem;     /* small icon */
  line-height: 1;
  flex: 0 0 auto;
  opacity: .9;
  transform: translateY(1px); /* subtle baseline alignment */
}

/* Make sure the email row’s icon follows link hover color */
.footer-company-info a.contact-line:hover i,
.footer-company-info a.contact-line:focus i {
  color: #fff;
}



/* ==========================================================================
   Lightbox (career image zoom)
   ========================================================================== */
.career-section .image-content { position: relative; }

.image-zoom-trigger {
  position: absolute; inset: 0; background: transparent; border: 0; padding: 0;
  cursor: zoom-in; border-radius: var(--radius);
}
.image-zoom-trigger:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }
.image-zoom-trigger .open-label {
  position: absolute; right: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 600; font-size: .85rem; color: #fff;
  background: rgba(0,0,0,0.45); padding: 6px 10px; border-radius: 9999px; backdrop-filter: blur(3px);
}

/* Overlay */
.lightbox[hidden] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.85); padding: 24px;
}
.lightbox img {
  max-width: min(1200px, 95vw); max-height: 85vh;
  border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,0.35); background: #fff;
}
.lightbox-close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(0,0,0,0.55); color: #fff; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px; padding: 8px 10px; cursor: pointer;
}
body.no-scroll { overflow: hidden; }

/* ==========================================================================
   Scroll-in Animations
   ========================================================================== */
.scroll-target {
  opacity:0; transform: translateY(40px);
  transition: opacity .9s cubic-bezier(.645,.045,.355,1),
              transform .9s cubic-bezier(.645,.045,.355,1);
}
.no-js .scroll-target {
  opacity: 1;
  transform: none;
}
.scroll-target.visible { opacity:1; transform: translateY(0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  /* Mobile nav dropdown */
  .main-nav {
    display:none; position:absolute; top: var(--header-height); left:0; width:100%;
    background:#fff; box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    flex-direction: column; padding:0; text-align:left; max-height:0; overflow:hidden;
    transition: max-height 0.4s ease-out;
  }
  .main-nav.active { display:flex; max-height: calc(100vh - var(--header-height)); }
  .main-nav ul { flex-direction: column; gap:0; width:100%; }
  .main-nav li { width:100%; border-bottom:1px solid var(--light-grey-border); }
  .main-nav li:last-child { border-bottom:none; }
  .main-nav a { display:block; padding:1.2rem 1.5rem; font-weight:600; color:var(--dark-grey); }
  .main-nav a::after { display:none; }

  /* Keep header items on a single line and push controls to the right */
  .header-container { flex-wrap: nowrap; }

  /* Burger to the LEFT of the language switcher; both pushed right */
  .mobile-nav-toggle { display: block; order: 2; margin-left: auto; }
  .lang-switcher { order: 3; }
}

@media (max-width: 992px) {
  h2 { font-size: 2.2rem; }
  .large-header { font-size: 2.5rem; }

  .grid-2-col, .projects-container { grid-template-columns: 1fr; gap: 3rem; }
  .about-grid { grid-template-columns: 1fr; gap: 1.2rem; }
  .about-grid p { margin: 0; }

  .career-section .image-content img { margin: 0 auto; max-width: 100%; width: 100%; display: block; }

  /* Center the Career CTA with a comfortable gap above it */
  #career .btn-primary, #career .btn-secondary { display: block; width: max-content; margin-left: auto; margin-right: auto; align-self: center; }
  #career .text-content p:last-of-type { margin-bottom: 3rem; }

  /* Projects: reorder when stacked — Title → Gallery → Text → Button */
  #projects .projects-container {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "gallery"
      "desc"
      "cta";
    gap: 2.5rem;
  }
  #projects .projects-content { display: contents; }
  #projects h2.large-header { grid-area: title; margin-bottom: 0; text-align: center; }
  #projects .projects-carousel { grid-area: gallery; }
  #projects .projects-content p { grid-area: desc; margin: 0 auto; }
  #projects .projects-content .btn { grid-area: cta; justify-self: center; }
}

@media (max-width: 768px) {
  html { font-size: 15px; }
  .large-header { font-size: 2.2rem; }

  :root {
    /* Header height now uses fluid clamp() - no override needed */
    --section-padding: var(--space-4xl);
  }

  /* iOS Safari fix: remove transitions that cause position shifts */
  .site-header {
    transition: none;
  }

  /* No height changes on mobile - header stays the same size */
  .logo a { font-size: 1.45rem; }

  #ueber-uns { padding-top: var(--section-padding); }
  .content-section { padding: var(--section-padding-mobile) 0; }
  .jobs-grid { grid-template-columns: 1fr; gap: var(--space-xl); }

  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .social-icons { justify-content: center; }
}

@media (max-width: 480px) {
  .network-visuals { grid-template-columns: repeat(2, 1fr); }
}
/* --- Projects: left-align section header on wide layouts --- */
@media (min-width: 993px) {
  #projects h2.large-header {
    text-align: left;
  }
}
/* --- Career: left-align the CTA on wide screens --- */
@media (min-width: 993px) {
  #career .btn-primary,
  #career .btn-secondary {
    margin-left: 0;       /* no auto-centering */
    margin-right: 0;
    align-self: flex-start; /* anchor to the left within the text column */
  }
}
/* ============================
   NETWORK — Compact Logo Wall
   ============================ */

/* Filter chips */
#network .brand-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  margin: 0 0 1.25rem 0;
}
#network .network-status {
  font-size: 0.95rem;
  color: var(--mid-grey);
  text-align: center;
  margin-bottom: 1.25rem;
}
#network .brand-filters .chip {
  appearance: none;
  border: 1px solid var(--light-grey-border);
  background: #fff;
  color: var(--black);
  border-radius: 9999px;
  padding: .4rem .9rem;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, border-color .2s ease, transform .2s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#network .brand-filters .chip:hover { transform: translateY(-1px); }
#network .brand-filters .chip.active,
#network .brand-filters .chip[aria-pressed="true"] {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
  box-shadow: 0 6px 16px rgba(0,153,255,.22);
}

/* Logo grid */
#network .brand-grid {
  display: grid;
  gap: .9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));           /* phones: 2 cols */
}
@media (min-width: 540px) { #network .brand-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 768px) { #network .brand-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (min-width: 1024px){ #network .brand-grid { grid-template-columns: repeat(5, minmax(0,1fr)); } }
@media (min-width: 1280px){ #network .brand-grid { grid-template-columns: repeat(6, minmax(0,1fr)); } }

/* Brand tiles (small, airy, consistent) */
#network .brand-tile {
  display: flex; align-items: center; justify-content: center;
  height: 72px;                      /* desktop default height */
  padding: 10px 12px;
  border: 1px solid var(--light-grey-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 14px rgba(0,0,0,.04);
  transition: transform .20s ease, box-shadow .20s ease, border-color .2s ease;
}
@media (max-width: 1023.98px) { #network .brand-tile { height: 60px; } }
@media (max-width: 767.98px)  { #network .brand-tile { height: 52px; } }

#network .brand-tile:hover,
#network .brand-tile:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(0,153,255,.45);
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
  outline: none;
}

/* Logos: calm by default → color on hover */
#network .brand-tile img {
  width: 100%; height: 100%; object-fit: contain;
  filter: grayscale(1) saturate(0) contrast(1.05) opacity(.9);
  transition: filter .2s ease;
}
#network .brand-tile:hover img,
#network .brand-tile:focus-visible img {
  filter: none;
}
/* --- Network / Logo Wall: center tiles under filters & use black hover border --- */

/* Center the tiles for every filter (including "Alle") */
#network .brand-grid {
  display: flex;              /* override previous grid */
  flex-wrap: wrap;
  justify-content: center;    /* center each row when there’s leftover space */
  gap: .9rem;
}

/* Keep the same column counts as before, now with flex-basis widths */
#network .brand-tile { flex: 0 1 calc((100% - .9rem) / 2); }                  /* phones: 2 cols */
@media (min-width: 540px)  { #network .brand-tile { flex-basis: calc((100% - 2*.9rem) / 3); } }
@media (min-width: 768px)  { #network .brand-tile { flex-basis: calc((100% - 3*.9rem) / 4); } }
@media (min-width: 1024px) { #network .brand-tile { flex-basis: calc((100% - 4*.9rem) / 5); } }
@media (min-width: 1280px) { #network .brand-tile { flex-basis: calc((100% - 5*.9rem) / 6); } }

/* Hover/focus: black border instead of blue to avoid clashing with logo colors */
#network .brand-tile:hover,
#network .brand-tile:focus-visible {
  border-color: var(--black);
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
  transform: translateY(-2px);
  outline: none;
}
/* --- Network: add a bit more breathing room before the footer --- */
@media (min-width: 769px) {
  #network { padding-bottom: 7rem; } /* was 5rem via .content-section */
}
@media (max-width: 768px) {
  #network { padding-bottom: 5rem; } /* slightly more than other sections */
}

/* ============================
   NETWORK — Partners subsection
   ============================ */
#network .partners-block { margin-top: 2.25rem; }

#network .partners-divider {
  width: min(220px, 40%);
  height: 1px;
  margin: 1.5rem auto 1.25rem;
  background: var(--light-grey-border);
  opacity: .7;
  border-radius: 999px;
}

#network .partners-title {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 1rem 0;
}

/* Grid matches the compact logo wall, centered rows */
#network .partner-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .9rem;
}

/* Tile look mirrors .brand-tile but insulated from filters */
#network .partner-tile {
  display: flex; align-items: center; justify-content: center;
  flex: 0 1 calc((100% - .9rem) / 2);          /* phones: 2 cols */
  height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--light-grey-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 14px rgba(0,0,0,.04);
  transition: transform .20s ease, box-shadow .20s ease, border-color .2s ease;
}
@media (min-width: 540px)  { #network .partner-tile { flex-basis: calc((100% - 2*.9rem) / 3); } }
@media (min-width: 768px)  { #network .partner-tile { flex-basis: calc((100% - 3*.9rem) / 4); } }
@media (min-width: 1024px) { #network .partner-tile { flex-basis: calc((100% - 4*.9rem) / 5); } }
@media (min-width: 1280px) { #network .partner-tile { flex-basis: calc((100% - 5*.9rem) / 6); } }
/* Match brand-tile responsive heights */
@media (max-width: 1023.98px) { #network .partner-tile { height: 60px; } }
@media (max-width: 767.98px)  { #network .partner-tile { height: 52px; } }


#network .partner-tile:hover,
#network .partner-tile:focus-visible {
  transform: translateY(-2px);
  border-color: var(--black);
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
  outline: none;
}

/* Same grayscale→color hover treatment as sub-brands */
#network .partner-tile img {
  width: 100%; height: 100%; object-fit: contain;
  filter: grayscale(1) saturate(0) contrast(1.05) opacity(.9);
  transition: filter .2s ease;
}
#network .partner-tile:hover img,
#network .partner-tile:focus-visible img { filter: none; }


/* ===========================
   Back-to-top Arrow
   =========================== */
.back-to-top {
  position: fixed;
  bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
  right: clamp(1rem, 3vw, 1.5rem);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  pointer-events: none;
  transition:
    opacity var(--transition-speed) ease,
    transform var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease,
    background-color var(--transition-speed) ease;
  z-index: 1000; /* above content/footer */
}
.back-to-top i { font-size: 18px; line-height: 1; }

.back-to-top.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Hover/focus: mirror .btn-primary’s vibe */
.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--accent-blue-hover);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 15px rgba(0,153,255,0.3);
  outline: none; /* you already have a global :focus-visible outline */
}

/* Be polite on touch + reduced motion */
@media (hover: none) { .back-to-top:hover { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: none; transform: none; }
  .back-to-top.show { opacity: 1; }
}

/* ==========================================================================
   Landscape Mobile Orientation Optimizations
   ========================================================================== */
@media (max-width: 900px) and (orientation: landscape) {
  /* Reduce header height for more content space */
  :root {
    --header-height: 64px;
    --section-padding: var(--space-3xl);
  }

  .site-header {
    height: 64px;
  }

  /* NO height change on scroll - keep header stable */

  /* Compact header logo */
  .header-logo-icon {
    height: 2.2em;
  }

  /* Hide brand subtitle to save space */
  .brand-sub {
    display: none;
  }

  /* Reduce section padding */
  .content-section {
    padding: var(--space-3xl) 0;
  }

  /* Reduce hero height */
  .hero-section {
    min-height: 85vh;
  }

  /* Make large headers more compact */
  .large-header {
    font-size: 2rem;
    margin-bottom: var(--space-lg);
  }

  /* Reduce FAQ answer spacing */
  .faq-list details {
    margin-bottom: var(--space-sm);
  }

  /* More compact job cards */
  .jobs-grid {
    gap: var(--space-lg);
  }

  /* Reduce network grid spacing */
  .brand-grid {
    gap: var(--space-sm);
  }

  /* Compact footer */
  .site-footer-main {
    padding: var(--space-2xl) 0 var(--space-lg);
  }
}
