/* ==========================================================================
   THE MODERN BLUEPRINT - DESIGN SYSTEM & STYLESHEET
   Russ Heizung Sanitär erneuerbare Energien
   ========================================================================== */

/* 1. Font Faces (System fallback for ultimate performance and zero 404 errors) */

/* 2. Custom Properties / Tokens */
:root {
  /* Color system - OKLCH */
  --primary: oklch(0.58 0.21 42);          /* Copper Orange (Heating/Solar) */
  --primary-hover: oklch(0.50 0.21 42);
  --secondary: oklch(0.48 0.22 260);       /* Hydro Blue (Plumbing/Water) */
  --secondary-hover: oklch(0.40 0.22 260);
  --bg: oklch(0.98 0.005 60);              /* Mortar Warm White */
  --text: oklch(0.18 0.003 60);            /* Slate Deep */
  --text-muted: oklch(0.45 0.005 60);      /* Muted Slate */
  --border: oklch(0.90 0.005 60);          /* Zinc Gray */
  --border-light: oklch(0.94 0.003 60);
  --white: oklch(1.0 0.0 0);               /* Pure white for container surface */
  
  /* Font Stacks */
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Spacing Scale (Rhythm) */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 3rem;      /* 48px */
  --space-xxl: 5rem;     /* 80px */
  
  /* Radii Scale */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  
  /* Typography scale ratio */
  --size-display: clamp(2.25rem, 5.5vw, 3.75rem);
  --size-h1: clamp(1.85rem, 4vw, 2.5rem);
  --size-h2: clamp(1.4rem, 3vw, 1.85rem);
  --size-h3: clamp(1.2rem, 2vw, 1.4rem);
  --size-body: clamp(1rem, 1.1vw, 1.125rem);
  --size-label: 0.875rem;

  /* Layout maximum measure */
  --max-width: 1200px;
  --ch-body: 70ch;
}

/* 3. Base / Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 4. Typographical elements */
h1, h2, h3, h4, .display-font {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02e;
}

p {
  font-size: var(--size-body);
  line-height: 1.6;
  max-width: var(--ch-body);
}

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

.uppercase-label {
  font-size: var(--size-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

/* 5. Utility / Layout Elements */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

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

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

/* Section Spacing */
section {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border);
}
section:last-of-type {
  border-bottom: none;
}

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

/* 6. Header / Navigation */
header {
  border-bottom: 2px solid var(--border);
  background-color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--text);
}

.logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.company-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1;
}

.company-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
}

.nav-link {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 1rem;
  padding: var(--space-xs) 0;
  position: relative;
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-link.active::after {
  transform: scaleX(1);
  transition: none;
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    /* When active */
    flex-direction: column;
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    background-color: var(--white);
    border-bottom: 2px solid var(--border);
    padding: var(--space-lg);
    gap: var(--space-md);
  }
  
  .nav-menu.show {
    display: flex;
  }
  
  .mobile-nav-toggle {
    display: block;
  }
}

/* 7. Components */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease,
              transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.2s ease;
  border: none;
  box-shadow: 0 1px 3px oklch(0.18 0.003 60 / 0.06);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px oklch(0.18 0.003 60 / 0.10);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px oklch(0.18 0.003 60 / 0.06);
}

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

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

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

.btn-secondary:hover {
  background-color: var(--secondary-hover);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--text);
  background-color: var(--border-light);
}

/* Blueprint Cards */
.card {
  background-color: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transition: border-color 0.2s ease,
              box-shadow 0.25s ease,
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 28px oklch(0.18 0.003 60 / 0.07);
  transform: translateY(-3px);
}

.card-title {
  font-size: var(--size-h3);
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.form-label {
  font-weight: 500;
  font-size: 0.95rem;
}

.form-control {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--white);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  border-color: var(--primary);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* 8. Hero Sections */
.hero {
  background-color: var(--white);
  border-bottom: 2px solid var(--border);
  padding-top: var(--space-xxl);
  padding-bottom: var(--space-xxl);
  display: flex;
  align-items: center;
}

.hero-title {
  font-size: var(--size-display);
  margin-bottom: var(--space-md);
}

.hero-subtitle {
  font-size: var(--size-h2);
  color: var(--text-muted);
  max-width: var(--ch-body);
  margin-bottom: var(--space-lg);
  font-weight: 400;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* 9. Footers */
footer {
  background-color: var(--white);
  border-top: 2px solid var(--border);
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

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

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.footer-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-link {
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
  }
}

.copyright {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-legal-links {
  display: flex;
  gap: var(--space-lg);
}

/* 10. Helper Badges / Decorative accents */
.tag {
  display: inline-flex;
  padding: 4px 8px;
  background-color: var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  width: fit-content;
}

.tag-heating {
  background-color: oklch(0.95 0.02 42);
  color: var(--primary);
}

.tag-plumbing {
  background-color: oklch(0.95 0.02 260);
  color: var(--secondary);
}

.icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* 11. Image utilities */
.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.section-photo {
  width: 100%;
  border-radius: var(--radius-lg);
  object-fit: cover;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
}

.section-photo-wide {
  width: 100%;
  border-radius: var(--radius-lg);
  object-fit: cover;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
}

.service-icon {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.hero-photo-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 3;
  position: relative;
}

.hero-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.contact-hero-bg {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.contact-hero-bg img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: right center;
  display: block;
  filter: brightness(0.85);
}

.ref-card-photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: block;
  border-bottom: 1px solid var(--border);
}

.job-poster {
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: block;
  margin: 0 auto;
}

/* ============================================================
   12. Delight: Handwerk im Detail
   Tactile micro-interactions — solid, immediate, precise.
   No bounce. No elastic. Ease-out-quart throughout.
   ============================================================ */

/* Scroll Reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Logo hover */
.logo-img {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.logo-link:hover .logo-img {
  transform: scale(1.05);
}

/* Service icon hover (via parent card) */
.service-icon {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.card:hover .service-icon {
  transform: scale(1.1);
}

/* Stats strip */
.stats-strip {
  display: flex;
  gap: var(--space-xl);
  flex-wrap: wrap;
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}
.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-number {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  display: block;
}
.stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
}

/* Form success: animated checkmark */
.success-animated {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  background-color: oklch(0.97 0.01 140);
  border: 1px solid oklch(0.82 0.07 140);
  border-radius: var(--radius-md);
  margin-top: var(--space-md);
}
.success-animated.show {
  display: flex;
}
.check-svg {
  width: 60px;
  height: 60px;
  fill: none;
  stroke: oklch(0.42 0.14 140);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}
.check-svg .ring {
  stroke-dasharray: 175;
  stroke-dashoffset: 175;
}
.check-svg .ring.animate {
  animation: draw-ring 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.check-svg .tick {
  stroke-dasharray: 55;
  stroke-dashoffset: 55;
}
.check-svg .tick.animate {
  animation: draw-tick 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards;
}
@keyframes draw-ring {
  to { stroke-dashoffset: 0; }
}
@keyframes draw-tick {
  to { stroke-dashoffset: 0; }
}
.success-animated strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 600;
  color: oklch(0.35 0.12 140);
}
.success-animated p {
  font-size: 0.95rem;
  color: oklch(0.45 0.08 140);
  margin: 0;
  max-width: 42ch;
}

/* Reduced-motion safety net */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .logo-img,
  .service-icon {
    transition: none;
  }
  .btn {
    transition: background-color 0.15s ease;
  }
  .btn:hover {
    transform: none;
    box-shadow: none;
  }
  .card {
    transition: border-color 0.15s ease;
  }
  .card:hover {
    transform: none;
  }
  .nav-link::after {
    transition: none;
  }
  .check-svg .ring.animate,
  .check-svg .tick.animate {
    animation: none;
    stroke-dashoffset: 0;
  }
}
