/* Thermal Grid Design System CSS */
:root {
  /* Farbpalette - Thermal Grid */
  --terracotta: #C97B63;
  --graphit: #1A2230;
  --creme: #F5F2EA;
  --dunkelblau: #0B1220;
  --hellgrau: #A7B0BD;
  
  /* Typografie - Modulare Skala */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
  --text-5xl: 3rem;      /* 48px */
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  
  /* Grid */
  --max-width: 1200px;
  --grid-columns: 12;
  --grid-gap: 1rem;
  
  /* Karten */
  --card-radius: 16px;
  --card-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  --card-hover-shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
  
  /* Animation */
  --transition-fast: 160ms ease;
  --transition-normal: 220ms ease;
  --transition-slow: 320ms ease;
}

/* Reset und Basis-Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--graphit);
  background-color: var(--creme);
  overflow-x: hidden;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--space-4);
  color: var(--graphit);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-4);
  font-size: var(--text-base);
  color: var(--dunkelblau);
}

a {
  color: var(--terracotta);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--graphit);
}

/* Preloader mit Thermal Grid Animation */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--creme);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.thermal-grid-loader {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.thermal-grid-loader .grid-cell {
  width: 20px;
  height: 20px;
  background: linear-gradient(45deg, var(--terracotta), var(--dunkelblau));
  border-radius: 4px;
  animation: thermal-pulse 2s ease-in-out infinite;
}

.thermal-grid-loader .grid-cell:nth-child(1) { animation-delay: 0s; }
.thermal-grid-loader .grid-cell:nth-child(2) { animation-delay: 0.2s; }
.thermal-grid-loader .grid-cell:nth-child(3) { animation-delay: 0.4s; }
.thermal-grid-loader .grid-cell:nth-child(4) { animation-delay: 0.6s; }
.thermal-grid-loader .grid-cell:nth-child(5) { animation-delay: 0.8s; }
.thermal-grid-loader .grid-cell:nth-child(6) { animation-delay: 1s; }
.thermal-grid-loader .grid-cell:nth-child(7) { animation-delay: 1.2s; }
.thermal-grid-loader .grid-cell:nth-child(8) { animation-delay: 1.4s; }
.thermal-grid-loader .grid-cell:nth-child(9) { animation-delay: 1.6s; }

@keyframes thermal-pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Header Navigation */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(245, 242, 234, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  transition: all var(--transition-normal);
  border-bottom: 1px solid rgba(167, 176, 189, 0.2);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.nav-logo h1 {
  font-size: var(--text-xl);
  color: var(--graphit);
  margin: 0;
}

.nav-menu {
  display: flex;
  list-style: none;
  align-items: center;
  gap: var(--space-6);
}

.nav-item {
  position: relative;
}

.nav-link {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--graphit);
  padding: var(--space-2) var(--space-3);
  border-radius: 8px;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link:hover,
.nav-link.active {
  color: var(--terracotta);
  background: rgba(201, 123, 99, 0.1);
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--creme);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: var(--space-3);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-normal);
  list-style: none;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  margin-bottom: var(--space-1);
}

.dropdown-menu li:last-child {
  margin-bottom: 0;
}

.dropdown-menu a {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: 6px;
  color: var(--graphit);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.dropdown-menu a:hover {
  background: rgba(201, 123, 99, 0.1);
  color: var(--terracotta);
}

.dropdown-arrow {
  font-size: var(--text-xs);
  transition: transform var(--transition-fast);
}

.dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--graphit);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--creme) 0%, rgba(201, 123, 99, 0.05) 100%);
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.thermal-grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 2px;
  opacity: 0.1;
}

.thermal-grid-overlay .grid-cell {
  background: linear-gradient(45deg, var(--terracotta), var(--dunkelblau));
  border-radius: 2px;
  animation: thermal-flow 6s ease-in-out infinite;
}

.thermal-grid-overlay .grid-cell[data-intensity="high"] {
  animation-duration: 4s;
  opacity: 0.8;
}

.thermal-grid-overlay .grid-cell[data-intensity="medium"] {
  animation-duration: 6s;
  opacity: 0.6;
}

.thermal-grid-overlay .grid-cell[data-intensity="low"] {
  animation-duration: 8s;
  opacity: 0.4;
}

@keyframes thermal-flow {
  0%, 100% { 
    transform: scale(1);
    filter: hue-rotate(0deg);
  }
  50% { 
    transform: scale(1.1);
    filter: hue-rotate(30deg);
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-content .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.hero-title {
  font-size: var(--text-5xl);
  line-height: 1.1;
  margin-bottom: var(--space-6);
  color: var(--graphit);
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--dunkelblau);
  margin-bottom: var(--space-8);
  line-height: 1.5;
}

.hero-cta {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero-image {
  position: relative;
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-slow);
}

.hero-image:hover img {
  transform: scale(1.02);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: var(--space-3) var(--space-6);
  border-radius: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: all var(--transition-normal);
  text-decoration: none;
  font-size: var(--text-base);
  line-height: 1;
}

.btn-primary {
  background: var(--terracotta);
  color: white;
  box-shadow: 0 4px 12px rgba(201, 123, 99, 0.3);
}

.btn-primary:hover {
  background: var(--graphit);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(201, 123, 99, 0.4);
}

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

.btn-secondary:hover {
  background: var(--terracotta);
  color: white;
  transform: translateY(-2px);
}

/* Section Styling */
section {
  padding: var(--space-20) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  font-size: var(--text-lg);
  color: var(--hellgrau);
  max-width: 600px;
  margin: 0 auto;
}

/* Stats Section */
.stats-section {
  background: var(--graphit);
  color: white;
}

.stats-section .section-header h2,
.stats-section .section-header p {
  color: white;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-8);
}

.stat-card {
  text-align: center;
  padding: var(--space-8);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--card-radius);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-icon {
  margin-bottom: var(--space-4);
  color: var(--terracotta);
}

.stat-number {
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--terracotta);
  margin-bottom: var(--space-2);
  line-height: 1;
}

.stat-label {
  font-size: var(--text-base);
  color: rgba(255, 255, 255, 0.9);
}

/* Benefits Section */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-8);
}

.benefit-card {
  background: white;
  padding: var(--space-8);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  transition: all var(--transition-normal);
  border: 1px solid rgba(201, 123, 99, 0.1);
}

.benefit-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--card-hover-shadow);
}

.benefit-icon {
  margin-bottom: var(--space-6);
  color: var(--terracotta);
}

.benefit-card h3 {
  margin-bottom: var(--space-4);
  color: var(--graphit);
}

.benefit-card p {
  margin-bottom: var(--space-6);
  color: var(--dunkelblau);
}

.benefit-link {
  font-weight: 600;
  color: var(--terracotta);
  transition: color var(--transition-fast);
}

.benefit-link:hover {
  color: var(--graphit);
}

/* Articles Section */
.articles-section {
  background: white;
}

.articles-category {
  margin-bottom: var(--space-16);
}

.category-title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-8);
  color: var(--graphit);
  text-align: left;
  padding-left: var(--space-4);
  border-left: 4px solid var(--terracotta);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-8);
}

.article-card {
  background: white;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: all var(--transition-normal);
  border: 1px solid rgba(167, 176, 189, 0.2);
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-hover-shadow);
}

.article-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.article-card:hover img {
  transform: scale(1.05);
}

.article-content {
  padding: var(--space-6);
}

.badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: 20px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-3);
}

.badge-effizienz {
  background: rgba(201, 123, 99, 0.1);
  color: var(--terracotta);
}

.badge-waermeschutz {
  background: rgba(26, 34, 48, 0.1);
  color: var(--graphit);
}

.badge-modernisierung {
  background: rgba(11, 18, 32, 0.1);
  color: var(--dunkelblau);
}

.article-content h4 {
  margin-bottom: var(--space-3);
  color: var(--graphit);
  line-height: 1.3;
}

.article-content p {
  color: var(--dunkelblau);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

.article-link {
  font-weight: 600;
  color: var(--terracotta);
  transition: color var(--transition-fast);
}

.article-link:hover {
  color: var(--graphit);
}

/* Filter Chips */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-12);
  justify-content: center;
}

.chip {
  padding: var(--space-2) var(--space-4);
  background: rgba(167, 176, 189, 0.1);
  border: 1px solid rgba(167, 176, 189, 0.3);
  border-radius: 20px;
  color: var(--graphit);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--text-sm);
  font-weight: 500;
}

.chip:hover,
.chip.active {
  background: var(--terracotta);
  color: white;
  border-color: var(--terracotta);
}

/* Reviews Section */
.reviews-section {
  background: var(--dunkelblau);
  color: white;
}

.reviews-section .section-header h2,
.reviews-section .section-header p {
  color: white;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-8);
}

.review-card {
  background: rgba(255, 255, 255, 0.05);
  padding: var(--space-8);
  border-radius: var(--card-radius);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform var(--transition-normal);
}

.review-card:hover {
  transform: translateY(-5px);
}

.review-rating {
  margin-bottom: var(--space-4);
}

.stars {
  color: var(--terracotta);
  font-size: var(--text-lg);
}

.review-card blockquote {
  font-style: italic;
  margin-bottom: var(--space-6);
  font-size: var(--text-base);
  line-height: 1.6;
}

.review-author strong {
  color: var(--terracotta);
  display: block;
  margin-bottom: var(--space-1);
}

.review-author span {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--text-sm);
}

/* Newsletter Section */
.newsletter-section {
  background: linear-gradient(135deg, var(--terracotta) 0%, var(--graphit) 100%);
  color: white;
}

.newsletter-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.newsletter-text h3 {
  color: white;
  margin-bottom: var(--space-4);
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.form-group {
  display: flex;
  gap: var(--space-3);
}

.form-group input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border: none;
  border-radius: 12px;
  font-size: var(--text-base);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.form-group input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.form-group button {
  background: white;
  color: var(--terracotta);
  border: none;
  padding: var(--space-3) var(--space-6);
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.form-group button:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

.newsletter-form small {
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--text-xs);
}

/* Footer */
.footer {
  background: var(--graphit);
  color: white;
  padding: var(--space-16) 0 var(--space-8);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

.footer-section h4 {
  color: var(--terracotta);
  margin-bottom: var(--space-4);
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: var(--space-2);
}

.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  transition: color var(--transition-fast);
}

.footer-section a:hover {
  color: var(--terracotta);
}

.footer-contact p {
  margin-bottom: var(--space-2);
  color: rgba(255, 255, 255, 0.8);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-8);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 50px;
  height: 50px;
  background: var(--terracotta);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--card-shadow);
  transition: all var(--transition-normal);
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--graphit);
  transform: translateY(-3px);
}

/* Scroll Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Grid Helper */
@media (max-width: 768px) {
  .hero-content .container {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    text-align: center;
  }
  
  .newsletter-content {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    text-align: center;
  }
}