/* -------------------------------------------------------------
 * Recytec AG - Stylesheet (Modern Industrial Style)
 * Anchored in DESIGN.md Guidelines
 * ------------------------------------------------------------- */

/* --- Custom Variables & Tokens --- */
:root {
  /* Colors */
  --color-background: #fcf9f8;
  --color-surface-white: #ffffff;
  --color-gravel-light: #f7f7f7;
  --color-gravel-medium: #e2e8f0;
  --color-machine-grey: #2d3748;

  --color-primary: #006d37;
  --color-primary-container: #2caa60;
  --color-primary-hover: #005228;
  --color-secondary-accent: #e67e22;
  /* Industrial Orange */
  --color-outline: #6e7a6e;
  --color-outline-variant: #bdcabc;
  --color-text-dark: #1c1b1b;
  --color-text-muted: #545f72;
  --color-text-light: #f3f0ef;

  /* Typography */
  --font-family-sans: 'Hanken Grotesk', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-family-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --spacing-unit: 8px;
  --gutter: 24px;
  --section-gap: 120px;
  --section-gap-mobile: 60px;

  /* Borders & Radius */
  --border-radius: 4px;
  --transition-speed: 0.3s;
}

/* --- CSS Reset & Global Base --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-speed) ease;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* --- Button Component --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-sans);
  font-size: 16px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-surface-white);
  border: 1px solid var(--color-primary);
}

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

.btn-secondary {
  background-color: transparent;
  color: var(--color-machine-grey);
  border: 2px solid var(--color-machine-grey);
  padding: 10px 22px;
}

.btn-secondary:hover {
  background-color: var(--color-machine-grey);
  color: var(--color-surface-white);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.w-full {
  width: 100%;
}

/* --- Header & Navigation --- */
.main-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background-color: rgba(252, 249, 248, 0.95);
  border-bottom: 1px solid var(--color-outline-variant);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 85px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-text {
  font-family: var(--font-family-sans);
  font-size: 24px;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.desktop-nav ul {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-link {
  font-family: var(--font-family-sans);
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-muted);
  position: relative;
  padding: 8px 0;
}

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

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
}

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

/* --- Mobile Menu Burger --- */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.mobile-menu-btn .bar {
  width: 100%;
  height: 2px;
  background-color: var(--color-machine-grey);
  transition: all var(--transition-speed) ease;
}

/* --- Mobile Navigation Drawer --- */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  height: 100%;
  background-color: var(--color-background);
  z-index: 200;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-drawer.open {
  right: 0;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--color-gravel-medium);
}

.drawer-close-btn {
  background: transparent;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: var(--color-machine-grey);
  line-height: 1;
}

.mobile-nav {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  height: 100%;
}

.mobile-nav ul {
  display: flex;
  flex-direction: column;
  list-style: none;
  gap: 24px;
}

.drawer-link {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.drawer-link.active {
  color: var(--color-primary);
  border-left: 3px solid var(--color-primary);
  padding-left: 12px;
}

.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(45, 55, 72, 0.4);
  backdrop-filter: blur(4px);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-speed) ease;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* --- Hero Section --- */
.hero-section {
  position: relative;
  height: 75vh;
  min-height: 480px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--color-surface-white);
}

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

.hero-bg-img,
.hero-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(5%) brightness(0.95);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: linear-gradient(135deg, rgb(27, 27, 27) 0%, rgba(45, 55, 72, 0.1) 100%);
}

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

.hero-title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 800px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.hero-subtitle {
  font-size: 18px;
  line-height: 1.6;
  max-width: 600px;
  margin-bottom: 32px;
  color: rgba(255, 255, 255, 0.9);
}

/* --- Services Area --- */
.services-section {
  margin-top: var(--section-gap);
  margin-bottom: var(--section-gap);
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 48px;
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 120px;
  height: 3px;
  background-color: var(--color-primary);
}

/* --- Services Grid --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
}

/* --- Service Card Component (Desktop Base) --- */
.service-card {
  background-color: var(--color-surface-white);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 109, 55, 0.2);
  box-shadow: 0 20px 35px -10px rgba(0, 109, 55, 0.12),
    0 1px 3px rgba(0, 109, 55, 0.04);
}

.card-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background-color: var(--color-gravel-light);
}

.card-img,
.card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover .card-img,
.service-card:hover .card-media video {
  transform: scale(1.03);
}

.card-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-header-info {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}


.card-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

.card-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-bottom: 24px;
  flex-grow: 1;
}

.card-link {
  font-family: var(--font-family-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.card-link:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

/* Grid Layout Customizations */
.card-wide {
  grid-column: span 2;
  flex-direction: row;
}

.card-wide .card-media {
  width: 45%;
  aspect-ratio: auto;
  height: 100%;
}

.card-wide .card-body {
  width: 55%;
}

.card-narrow {
  grid-column: span 1;
}



/* --- Footer --- */
.main-footer {
  margin-top: auto;
  background-color: var(--color-machine-grey);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 60px 0;
  color: var(--color-text-light);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
}

.footer-brand {
  max-width: 320px;
}

.footer-brand .logo-text {
  color: var(--color-surface-white);
  margin-bottom: 12px;
  display: block;
}

.footer-copyright {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 12px;
}

.footer-nav-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-link {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
}

.footer-link:hover {
  color: var(--color-surface-white);
  text-decoration: underline;
}



/* -------------------------------------------------------------
 * Responsive Media Queries
 * ------------------------------------------------------------- */

/* Medium Devices (Tablets, viewports < 1024px) */
@media (max-width: 1024px) {
  .hero-title {
    font-size: 38px;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-wide {
    grid-column: span 2;
  }


}

/* Small Devices & Mobile (viewports < 768px) */
@media (max-width: 768px) {
  .main-header {
    height: 70px;
  }

  .header-container {
    height: 70px;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .btn-nav {
    display: none;
  }

  .hero-section {
    height: 60vh;
    min-height: 380px;
  }

  .hero-title {
    font-size: 30px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .services-section {
    margin-top: var(--section-gap-mobile);
    margin-bottom: var(--section-gap-mobile);
  }

  .section-title {
    font-size: 28px;
    margin-bottom: 32px;
  }

  /* --- FORCE PRODUCT CARDS LAYOUT ON MOBILE --- */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Reset Wide Card on Mobile to stack vertically like portrait cards */
  .card-wide {
    grid-column: span 1;
    flex-direction: column;
  }

  .card-wide .card-media {
    width: 100%;
    aspect-ratio: 16 / 10;
  }

  .card-wide .card-body {
    width: 100%;
    padding: 24px;
  }

  .card-narrow {
    grid-column: span 1;
  }

  .card-body {
    padding: 24px;
  }



  /* --- Footer Mobile --- */
  .main-footer {
    padding: 40px 0;
  }

  .footer-container {
    flex-direction: column;
    gap: 30px;
  }
}