/**
 * Defiebre-Software — Auftritt: ruhiger, handwerklicher, weniger „Template“.
 * Lädt nach den Seiten-Styles und überschreibt nur gezielt.
 */

:root {
  /* Default Theme: Light Mode */
  --primary-color: #0f766e;
  --primary-dark: #115e59;
  --primary-light: #14b8a6;
  --secondary-color: #ea580c;
  --accent-color: #059669;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-light: #94a3b8;
  --bg-primary: #fafaf9;
  --bg-secondary: #f4f4f5;
  --bg-accent: #e7e5e4;
  --border-color: #e4e4e7;
  --bg-header: rgba(250, 250, 249, 0.95);
  --bg-header-dense: rgba(250, 250, 249, 0.92);
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06);
  --shadow-md: 0 6px 16px -4px rgb(15 23 42 / 0.1);
  --shadow-lg: 0 16px 40px -12px rgb(15 23 42 / 0.14);
  --shadow-xl: 0 24px 48px -16px rgb(15 23 42 / 0.16);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="dark"] {
  /* Dark Theme Override (Sleek Deep Dark) */
  --primary-color: #14b8a6;
  --primary-dark: #0f766e;
  --primary-light: #2dd4bf;
  --secondary-color: #f97316;
  --accent-color: #10b981;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-light: #64748b;
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-accent: #1e293b;
  --border-color: #1e293b;
  --bg-header: rgba(11, 15, 25, 0.95);
  --bg-header-dense: rgba(11, 15, 25, 0.92);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-md: 0 6px 16px -4px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 16px 40px -12px rgb(0 0 0 / 0.6);
  --shadow-xl: 0 24px 48px -16px rgb(0 0 0 / 0.7);
}

html {
  scroll-behavior: smooth;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  position: relative;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dezente Körnung — wirkt „gedruckt“, nicht glatt generisch */
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.35s var(--ease-out-expo), box-shadow 0.35s var(--ease-out-expo),
    border-color 0.35s ease;
}

.header.header--dense {
  background: var(--bg-header-dense);
  box-shadow: var(--shadow-md);
  border-bottom-color: var(--border-color);
}

/* Sun/Moon Theme Toggle Button Styling */
.theme-toggle {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.35rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
  margin-left: 1.5rem;
  z-index: 1002;
}

.theme-toggle:hover {
  background: var(--bg-accent);
  transform: rotate(15deg) scale(1.1);
}

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

@media (max-width: 768px) {
  .theme-toggle {
    margin-left: auto;
    margin-right: 0.75rem;
  }
  .nav__menu .btn-portal {
    width: 100%;
    text-align: left;
    margin-top: 0;
    padding: 1rem 0;
    background: none;
    color: var(--text-secondary);
    box-shadow: none;
    border-radius: 0;
    font-weight: 500;
    display: block;
  }
  .nav__menu .btn-portal:hover {
    background: none;
    color: var(--primary-color);
    transform: none;
    box-shadow: none;
  }
}

.hero {
  background: linear-gradient(165deg, #f4f4f5 0%, #fafaf9 42%, #ffffff 100%);
}

.hero::before {
  opacity: 0.35;
}

.hero__badge {
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.22);
  color: var(--primary-dark);
}

.hero__title {
  background: none;
  -webkit-text-fill-color: unset;
  background-clip: unset;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero__subtitle {
  color: var(--text-secondary);
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.125rem;
  line-height: 1.65;
}

.section-title h2 {
  background: none;
  -webkit-text-fill-color: unset;
  background-clip: unset;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  font-size: clamp(1.65rem, 3.5vw, 2.25rem);
  position: relative;
  padding-bottom: 0.75rem;
}

.section-title h2::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 3rem;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

.section-title p {
  color: var(--text-secondary);
  line-height: 1.65;
}

.about-text h2 {
  background: none;
  -webkit-text-fill-color: unset;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.service-card {
  transition: transform 0.45s var(--ease-out-expo), box-shadow 0.45s var(--ease-out-expo),
    border-color 0.3s ease;
  border-color: var(--border-color);
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgb(15 118 110 / 0.18);
}

.service-card::before {
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

.service-icon {
  background: linear-gradient(145deg, var(--primary-dark), var(--primary-color));
}

.btn-primary {
  background: linear-gradient(145deg, var(--primary-dark), var(--primary-color));
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-dark);
}

.stat-item {
  transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s ease;
}

.stat-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.contact {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.footer {
  background: #1c1917;
}

/* —— Scroll-Reveal —— */
.js-reveal {
  opacity: 0;
  transform: translateY(2rem);
  transition:
    opacity 0.75s var(--ease-out-expo),
    transform 0.75s var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0s);
}

.js-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero__content.js-reveal.is-visible .hero__badge,
.hero__content.js-reveal.is-visible .hero__title,
.hero__content.js-reveal.is-visible .hero__subtitle,
.hero__content.js-reveal.is-visible .hero__cta {
  animation: heroChildIn 0.7s var(--ease-out-expo) backwards;
}

.hero__content.js-reveal.is-visible .hero__badge {
  animation-delay: 0.05s;
}
.hero__content.js-reveal.is-visible .hero__title {
  animation-delay: 0.12s;
}
.hero__content.js-reveal.is-visible .hero__subtitle {
  animation-delay: 0.2s;
}
.hero__content.js-reveal.is-visible .hero__cta {
  animation-delay: 0.28s;
}

@keyframes heroChildIn {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero__content.js-reveal.is-visible .hero__badge,
  .hero__content.js-reveal.is-visible .hero__title,
  .hero__content.js-reveal.is-visible .hero__subtitle,
  .hero__content.js-reveal.is-visible .hero__cta {
    animation: none;
  }
}

/* Referenzen-Seite */
.page-referenzen .hero__title {
  background: none;
  -webkit-text-fill-color: unset;
  color: var(--text-primary);
}

.page-referenzen .reference-card {
  transition: transform 0.45s var(--ease-out-expo), box-shadow 0.45s ease;
}

.page-referenzen .reference-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.page-referenzen .section-title h2::after {
  left: 0;
  transform: none;
}

/* Clickable phone link styling */
.phone-link {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.25s ease;
}

.phone-link:hover {
  color: var(--primary-color);
}

/* Desktop Navbar spacing and size optimization for single-line fit of all 9 links */
@media (min-width: 769px) {
  .nav__menu {
    gap: 0.6rem 0.9rem !important;
  }
  .nav__link {
    font-size: 0.9rem !important;
  }
}

/* Active Nav Link Styling */
.nav__link--active {
  color: var(--primary-color) !important;
  font-weight: 600 !important;
}

.nav__link--active::after {
  width: 100% !important;
}
