/* ==========================================================================
   Design Tokens
   ========================================================================== */
:root {
  --bg: #F8F6F2;
  --text: #202020;
  --text-soft: #4A4A4A;
  --card: #FFFFFF;
  --card-border: rgba(32, 32, 32, 0.08);
  --accent: #1F83C6;
  --accent-strong: #025095;
  --accent-soft: rgba(31, 131, 198, 0.10);
  --header-bg: rgba(248, 246, 242, 0.72);
  --shadow: 0 20px 50px -25px rgba(2, 80, 149, 0.25);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.6s;
  color-scheme: light;
}

html.dark {
  --bg: #232323;
  --text: #F5F5F5;
  --text-soft: #B9B9B9;
  --card: #2D2D2D;
  --card-border: rgba(245, 245, 245, 0.08);
  --accent: #339ED9;
  --accent-strong: #6CC0F0;
  --accent-soft: rgba(51, 158, 217, 0.14);
  --header-bg: rgba(35, 35, 35, 0.66);
  --shadow: 0 20px 50px -25px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  z-index: 999;
}
.skip-link:focus {
  left: 20px;
  top: 20px;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3 { font-family: "Inter", sans-serif; letter-spacing: -0.03em; line-height: 1.05; margin: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.eyebrow::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  display: inline-block;
}

h2.section-title {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  font-weight: 800;
  max-width: 16ch;
}

p.section-lead {
  font-size: 1.05rem;
  color: var(--text-soft);
  max-width: 52ch;
  margin-top: 18px;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--card-border);
  transition: background-color 0.5s var(--ease), border-color 0.5s var(--ease);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.05rem;
}
.brand img { height: 34px; width: auto; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.main-nav a {
  position: relative;
  padding: 10px 16px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-soft);
  border-radius: 999px;
  transition: color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.main-nav a:hover { color: var(--text); background: var(--accent-soft); }
.main-nav a.active { color: var(--accent-strong); background: var(--accent-soft); }

.header-actions { display: flex; align-items: center; gap: 14px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 42px; height: 42px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
}
.nav-toggle:hover { background: var(--accent-soft); }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  position: relative;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* Theme toggle */
.theme-toggle {
  position: relative;
  width: 56px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--accent-soft);
  cursor: pointer;
  padding: 3px;
  display: flex;
  align-items: center;
}
.theme-toggle .knob {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(0);
  transition: transform 0.45s var(--ease), background-color 0.45s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
html.dark .theme-toggle .knob { transform: translateX(24px); }
.theme-toggle svg { width: 14px; height: 14px; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.96rem;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background-color 0.35s var(--ease);
  box-shadow: var(--shadow);
}
.btn:hover { transform: translateY(-3px); background: var(--accent-strong); }
.btn:active { transform: translateY(-1px); }
.btn.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--card-border);
  box-shadow: none;
}
.btn.btn-outline:hover { border-color: var(--accent); color: var(--accent-strong); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 84px;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 85% 20%, var(--accent-soft), transparent 70%);
  z-index: -1;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 60px;
  align-items: center;
}
.hero-copy h1 {
  font-size: clamp(2.6rem, 5.4vw, 4.6rem);
  font-weight: 800;
}
.hero-copy .lead {
  margin-top: 26px;
  font-size: 1.15rem;
  color: var(--text-soft);
  max-width: 46ch;
}
.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}
.hero-visual .logo-frame {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--card), var(--accent-soft));
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  padding: 40px;
}
.hero-visual .logo-frame img {
  width: 100%;
  filter: drop-shadow(0 18px 30px rgba(2, 80, 149, 0.2));
}

/* ==========================================================================
   Reveal animation
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-stagger.is-visible > * { }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }

/* ==========================================================================
   Sections
   ========================================================================== */
section { padding: 140px 0; }
section.tight { padding: 100px 0; }

/* Über mich */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 70px;
  align-items: center;
}
.about-portrait {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--card-border);
}
.about-text p { margin-top: 20px; color: var(--text-soft); font-size: 1.05rem; }

/* Leistungen */
.services-grid {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}
.service-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 36px 28px;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s var(--ease);
}
.service-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.service-card .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  color: var(--accent);
}
.service-card .icon svg { width: 22px; height: 22px; }
.service-card h3 { font-size: 1.15rem; font-weight: 700; }
.service-card p { margin-top: 10px; color: var(--text-soft); font-size: 0.95rem; }

/* Referenzen */
.ref-grid {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px;
}
.ref-card {
  position: relative;
  display: block;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 3.1;
  border: 1px solid var(--card-border);
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}
.ref-card:hover { border-color: var(--accent); }
.ref-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.ref-card:hover img { transform: scale(1.08); }
.ref-card .ref-info {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px;
  background: linear-gradient(0deg, rgba(2,10,20,0.72), transparent);
  color: #fff;
}
.ref-card .ref-info .cat {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.85;
}
.ref-card .ref-info .title { font-weight: 700; font-size: 1.05rem; margin-top: 4px; }

.ref-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(10, 12, 16, 0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
}
.ref-badge svg { width: 14px; height: 14px; }

/* Kontakt */
.contact-grid {
  margin-top: 60px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 70px;
}
.contact-list { display: flex; flex-direction: column; gap: 22px; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 1.02rem;
}
.contact-item .icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-item .icon svg { width: 20px; height: 20px; }

.contact-form { display: grid; gap: 18px; }
.form-row { display: grid; gap: 8px; }
.form-row label { font-size: 0.86rem; font-weight: 600; color: var(--text-soft); }
.form-row input, .form-row textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.98rem;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.form-row input:focus, .form-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.form-note { font-size: 0.82rem; color: var(--text-soft); }
.form-status { font-size: 0.9rem; font-weight: 600; min-height: 1.2em; }
.form-status.success { color: #2e9e63; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--card-border);
  padding: 34px 0;
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.9rem;
  color: var(--text-soft);
}
.footer-links { display: flex; gap: 22px; }
.footer-links a:hover { color: var(--accent-strong); }
.footer-links button {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
}
.footer-links button:hover { color: var(--accent-strong); }

/* ==========================================================================
   Cookie-Banner
   ========================================================================== */
.cookie-banner {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  max-width: 560px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 26px 26px 22px;
  transform: translateY(140%);
  opacity: 0;
  transition: transform 0.6s var(--ease), opacity 0.6s var(--ease);
}
.cookie-banner.is-visible { transform: translateY(0); opacity: 1; }
.cookie-banner[hidden] { display: none; }

.cookie-banner h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.cookie-banner p {
  font-size: 0.92rem;
  color: var(--text-soft);
  margin: 0 0 18px;
}
.cookie-banner p a { color: var(--accent-strong); font-weight: 600; text-decoration: underline; }

.cookie-options {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}
.cookie-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.88rem;
}
.cookie-option strong { font-size: 0.88rem; }
.cookie-option span.desc { color: var(--text-soft); display: block; margin-top: 2px; }

.cookie-switch {
  position: relative;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card);
  flex-shrink: 0;
  cursor: pointer;
}
.cookie-switch .dot {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--text-soft);
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease);
}
.cookie-switch.on .dot { transform: translateX(16px); background: var(--accent); }
.cookie-switch.disabled { opacity: 0.6; cursor: not-allowed; }

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cookie-actions .btn { padding: 12px 20px; font-size: 0.9rem; }
.cookie-settings-toggle {
  background: none;
  border: none;
  padding: 12px 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  text-decoration: underline;
}
.cookie-settings-toggle:hover { color: var(--text); }

@media (max-width: 480px) {
  .cookie-banner { left: 12px; right: 12px; bottom: 12px; padding: 22px 20px 18px; }
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(10, 12, 16, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox.is-visible { opacity: 1; }

.lightbox-figure {
  max-width: min(90vw, 1100px);
  max-height: 85vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: scale(0.96);
  transition: transform 0.4s var(--ease);
}
.lightbox.is-visible .lightbox-figure { transform: scale(1); }

.lightbox-figure img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: var(--radius-md);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.6);
  object-fit: contain;
  background: var(--card);
}
.lightbox-figure figcaption {
  color: #F5F5F5;
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 0.95rem;
}
.lightbox-figure figcaption .cat {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  opacity: 0.7;
}
.lightbox-figure figcaption .title { font-weight: 700; }

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(245, 245, 245, 0.25);
  background: rgba(245, 245, 245, 0.08);
  color: #F5F5F5;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.lightbox-close:hover { background: rgba(245, 245, 245, 0.18); transform: rotate(90deg); }
.lightbox-close svg { width: 20px; height: 20px; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(245, 245, 245, 0.25);
  background: rgba(245, 245, 245, 0.08);
  color: #F5F5F5;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.lightbox-nav:hover { background: rgba(245, 245, 245, 0.18); }
.lightbox-nav[hidden] { display: none; }
.lightbox-nav svg { width: 22px; height: 22px; }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-nav:hover.lightbox-prev { transform: translateY(-50%) translateX(-3px); }
.lightbox-nav:hover.lightbox-next { transform: translateY(-50%) translateX(3px); }

.lightbox-counter {
  margin-left: auto;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .lightbox-nav { width: 44px; height: 44px; }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}

@media (max-width: 600px) {
  .lightbox { padding: 20px; }
  .lightbox-close { top: 14px; right: 14px; width: 40px; height: 40px; }
}

/* Legal pages */
.legal-page { padding: 160px 0 120px; }
.legal-page h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; }
.legal-page h2 { font-size: 1.3rem; font-weight: 700; margin-top: 44px; }
.legal-page p, .legal-page li { color: var(--text-soft); font-size: 1rem; }
.legal-page .placeholder {
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}
.legal-notice {
  margin: 0 0 50px;
  padding: 18px 22px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--card-border);
  font-size: 0.92rem;
}
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 40px; color: var(--accent-strong); font-weight: 600; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 260px; margin: 0 auto; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 44px; }
}

@media (max-width: 720px) {
  section { padding: 90px 0; }
  .container { padding: 0 22px; }
  .main-nav, .header-actions .btn-outline { display: none; }
  .nav-toggle { display: flex; }
  .services-grid { grid-template-columns: 1fr; }
  .site-header.nav-open .main-nav {
    display: flex;
    position: absolute;
    top: 84px; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg);
    padding: 16px 22px 26px;
    border-bottom: 1px solid var(--card-border);
    gap: 4px;
  }
  .site-header.nav-open .main-nav a { width: 100%; }
  .site-footer .container { flex-direction: column; text-align: center; }
}
