/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
}

/* ── DESIGN TOKENS ── */
:root {
  --accent: #1a4fa0;
  --accent-dark: #123a7a;
  --text-primary: #111111;
  --text-secondary: #5a5a5a;
  --bg-page: #f5f5f5;
  --bg-white: #ffffff;
  --bg-hover: #fafafa;
  --border: #dcdcdc;
}

/* ── SKIP LINK ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
}
.skip-link:focus { left: 0; }

*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.nav-toggle:focus-visible { outline-offset: 2px; }

/* ── HEADER ── */
#page-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 86px;
}
#logo img {
  height: 100px;
  display: block;
  transform-origin: left center;
  transition: transform 0.3s ease;
  will-change: transform;
}
#page-header.at-top #logo img {
  transform: scale(1.2);
}
#main-nav ul { list-style: none; display: flex; gap: 2rem; }
#main-nav a {
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
#main-nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Burger toggle (mobile only) */
.nav-toggle {
  display: none;
  background: transparent;
  border: 2px solid var(--accent);
  padding: 0;
  width: 40px;
  height: 40px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.header-stripe { height: 3px; background: var(--accent); }

/* ── HERO ── */
#page-hero {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
#page-hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}
#page-hero h1 em {
  font-style: normal;
  color: var(--accent);
  display: block;
  font-weight: 500;
}
.hero-slogan {
  font-size: 30px;
  color: var(--text-primary);
  margin-bottom: 2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding-left: 1rem;
  border-left: 4px solid var(--accent);
  line-height: 1.3;
}
.hero-image-wrap {
  position: relative;
  overflow: hidden;
}
.hero-image-wrap img {
  width: 100%;
  display: block;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.hero-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(26,79,160,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.hero-table {
  margin-top: 1.5rem;
  border-collapse: collapse;
  background: var(--bg-page);
  width: 100%;
}
.hero-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--accent);
}
.hero-table td {
  padding: 0.5rem 0.75rem;
  font-size: 18px;
  border-bottom: 1px solid var(--border);
}
.hero-table tr:last-child td { border-bottom: none; }
.hero-table td:first-child { font-weight: 600; }

/* ── SECTIONS ── */
section { padding: 4.5rem 0; scroll-margin-top: 95px; }
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-header {
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.icon-wrap {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: transparent;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-wrap svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.section-header h2 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section-header h2::before {
  content: '';
  display: block;
  width: 32px;
  height: 3px;
  background: var(--accent);
  margin-bottom: 0.4rem;
}
.section-header h3 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 0.15rem;
}

/* ── LISTS (Leistungen / Kompetenzen) ── */
.grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0;
}
.list-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transition: background 0.2s;
  cursor: default;
}
.list-item:hover { background: var(--bg-hover); }
.list-item .item-text {
  display: inline-block;
  transition: transform 0.2s ease;
  transform-origin: left center;
}
.list-item:hover .item-text {
  transform: scale(1.1);
  font-weight: 600;
}
.list-item .dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  background: var(--accent);
}

/* ── CONCEPT CARDS ── */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1px;
  background: var(--border);
}
.concept-card {
  background: var(--bg-white);
  padding: 1.75rem 1.5rem;
  transition: transform 0.25s ease, background 0.2s, box-shadow 0.25s;
}
.concept-card:hover {
  transform: translateY(-4px);
  background: var(--bg-hover);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.concept-card .card-num {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.18;
  line-height: 1;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.25s;
}
.concept-card:hover .card-num { opacity: 0.28; }
.concept-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.concept-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ── REFERENCES ── */
#references {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ref-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.ref-cell {
  height: 110px;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem;
  transition: background 0.2s;
}
.ref-cell:nth-child(3n) { border-right: none; }
.ref-cell:hover { background: var(--bg-hover); }
.ref-cell img {
  max-width: 130px;
  max-height: 50px;
  object-fit: contain;
  transition: transform 0.2s ease;
}
.ref-cell:hover img { transform: scale(1.12); }

/* ── CONTACT ── */
#contact { background: var(--bg-white); }
.contact-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4rem;
  align-items: start;
}
.contact-inner .section-header {
  grid-column: 1 / -1;
  margin-bottom: 0;
}
.contact-portrait {
  width: 110px;
  flex-shrink: 0;
  position: relative;
}
.contact-portrait img {
  width: 110px;
  height: 150px;
  object-fit: cover;
  display: block;
}
.contact-portrait::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: -8px;
  width: 100%;
  height: 100%;
  border: 3px solid var(--accent);
  pointer-events: none;
  z-index: -1;
}
.contact-name {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.contact-table {
  border-collapse: collapse;
  font-size: 0.9rem;
}
.contact-table tr td { padding: 0.5rem 1.25rem 0.5rem 0; }
.contact-table td:first-child {
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  white-space: nowrap;
}
.contact-table a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.contact-table a:hover { color: var(--accent); }

/* ── FOOTER ── */
footer {
  background: var(--text-primary);
  color: rgba(255,255,255,0.6);
  padding: 1.5rem 0;
  font-size: 0.85rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-nav { display: flex; gap: 1.5rem; list-style: none; }
.footer-nav a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
}
.footer-nav a:hover { color: #fff; }

/* ── LEGAL / CONTENT PAGES ── */
.legal-page {
  background: var(--bg-white);
  min-height: calc(100vh - 86px - 80px);
}
.legal-page .section-inner {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
  max-width: 900px;
}
.legal-page h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
.legal-page h1::before {
  content: '';
  display: block;
  width: 32px;
  height: 3px;
  background: var(--accent);
  margin-bottom: 0.6rem;
}
.legal-page h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}
.legal-page h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.35rem;
}
.legal-page p {
  margin-bottom: 0.85rem;
  color: var(--text-primary);
}
.legal-page ul,
.legal-page ol {
  margin: 0 0 1rem 1.5rem;
  color: var(--text-primary);
}
.legal-page li { margin-bottom: 0.35rem; }
.legal-page > .section-inner > ol {
  list-style: upper-roman;
  padding-left: 1.5rem;
}
.legal-page > .section-inner > ol > li {
  margin-bottom: 2rem;
  padding-left: 0.5rem;
}
.legal-page > .section-inner > ol > li > h3 {
  display: inline;
  margin: 0;
}
.legal-page > .section-inner > ol > li > h3 + p,
.legal-page > .section-inner > ol > li > h3 + ol,
.legal-page > .section-inner > ol > li > h3 + ul {
  margin-top: 0.75rem;
}
.legal-page > .section-inner > ol ol {
  list-style: decimal;
  margin-top: 0.5rem;
}
.legal-page > .section-inner > ol ol ol,
.legal-page > .section-inner > ol ol ul {
  margin-top: 0.35rem;
}
.legal-page small { color: var(--text-secondary); font-size: 0.8rem; }
.legal-page a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-page a:hover { color: var(--accent-dark); }
.legal-page .lead {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  #logo img { transition: none; }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .header-inner { padding: 0 1rem; height: 72px; }
  #logo img { height: 56px; }
  #page-header.at-top #logo img { transform: scale(1.15); }

  .nav-toggle { display: inline-flex; }
  #main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  #main-nav.open { max-height: 420px; }
  #main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
  }
  #main-nav li {
    border-bottom: 1px solid var(--border);
  }
  #main-nav li:last-child { border-bottom: none; }
  #main-nav a {
    display: block;
    padding: 0.85rem 0.25rem;
    font-size: 1rem;
    border-bottom: none;
  }
  #main-nav a:hover { color: var(--accent); border-bottom: none; }

  .hero-inner { grid-template-columns: 1fr; padding: 2.5rem 1rem; gap: 2rem; }
  .section-inner { padding: 0 1rem; }
  .ref-grid { grid-template-columns: repeat(2, 1fr); }
  .ref-cell:nth-child(3n) { border-right: 1px solid var(--border); }
  .ref-cell:nth-child(2n) { border-right: none; }
  .contact-inner { grid-template-columns: 1fr; padding: 0 1rem; gap: 2rem; }
  .footer-inner { padding: 0 1rem; }
}

@media (max-width: 400px) {
  #logo img { height: 48px; }
  .header-inner { padding: 0 0.75rem; }
}
