/* =========================================================
   ENGEL Elektroantriebe GmbH — Stylesheet
   ========================================================= */

:root {
  /* Color tokens */
  --ink: #14181C;
  --ink-soft: #2B333A;
  --paper: #F3F2EE;
  --paper-2: #E8E6DE;
  --white: #FFFFFF;
  --steel: #5B6670;
  --line: #DBD8CF;
  --copper: #C1752F;
  --copper-dark: #9C5B22;
  --circuit: #1F3A54;
  --circuit-2: #28425C;
  --success: #2E7D4F;
  --error: #B4402A;

  /* Type */
  --font-head: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  /* Layout */
  --wrap: 1180px;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(20,24,28,0.06), 0 8px 24px rgba(20,24,28,0.06);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; }

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

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.18; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 4.3vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3vw, 2.35rem); }
h3 { font-size: 1.15rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--white);
  padding: 12px 18px; z-index: 200; border-radius: 0 0 4px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

.eyebrow {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--copper-dark);
  margin: 0 0 10px;
}

.section-lead { color: var(--steel); font-size: 1.05rem; max-width: 60ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: var(--radius);
  font-family: var(--font-head); font-weight: 600; font-size: 0.98rem;
  border: 1px solid transparent; transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--copper-dark); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); background: var(--paper-2); }
.btn-sm { padding: 9px 18px; font-size: 0.9rem; }
.btn-full { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(243,242,238,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { flex-shrink: 0; }
.brand-text { font-family: var(--font-head); font-weight: 700; font-size: 1.08rem; letter-spacing: -0.01em; }
.brand-text span { font-weight: 400; color: var(--steel); }

.main-nav ul { display: flex; gap: 34px; }
.main-nav a {
  font-family: var(--font-head); font-weight: 500; font-size: 0.96rem; color: var(--ink-soft);
  position: relative; padding: 4px 0;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px; background: var(--copper);
  transition: width 0.2s ease;
}
.main-nav a:hover::after { width: 100%; }

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

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 38px; height: 38px; background: none; border: 1px solid var(--line); border-radius: var(--radius);
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); margin: 0 auto; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding: 76px 0 64px; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.05fr 0.85fr; gap: 48px; align-items: center; }

.hero-lead { margin-top: 18px; font-size: 1.1rem; color: var(--steel); max-width: 52ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }

.hero-stats { display: flex; gap: 36px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.hero-stats dt { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; color: var(--ink); }
.hero-stats dd { font-size: 0.88rem; color: var(--steel); margin-top: 2px; max-width: 12ch; }

.hero-visual { display: flex; justify-content: center; }
.schematic { width: 100%; max-width: 400px; color: var(--circuit); }
.s-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.s-core { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1.5; }
.s-coils path { stroke: var(--steel); stroke-width: 2; stroke-linecap: round; }
.s-wire { fill: none; stroke: var(--copper); stroke-width: 2.5; stroke-linecap: round; opacity: 0.85; }
.s-wire-2 { stroke: var(--circuit); opacity: 0.55; }
.s-pulse { fill: var(--copper); animation: pulseFlow 3.2s ease-in-out infinite; }
.s-pulse-2 { fill: var(--circuit); animation: pulseFlow2 3.2s ease-in-out infinite; animation-delay: 0.4s; }

@keyframes pulseFlow {
  0% { offset-distance: 0%; opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}
@keyframes pulseFlow2 {
  0% { offset-distance: 0%; opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}
.s-pulse { offset-path: path("M210 116 A94 94 0 1 1 116 210"); animation-name: pulseFlow; }
.s-pulse-2 { offset-path: path("M210 304 A94 94 0 1 1 304 210"); animation-name: pulseFlow2; }

/* ---------- Trust strip ---------- */
.trust-strip { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trust-inner { display: flex; flex-wrap: wrap; gap: 12px 40px; justify-content: center; padding: 18px 28px; }
.trust-inner span { font-family: var(--font-head); font-size: 0.84rem; font-weight: 500; color: var(--steel); }

/* ---------- About ---------- */
.about { padding: 96px 0; }
.about-inner { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 60px; align-items: center; }
.about-media { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.about-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/5; }
.about-media-tag {
  position: absolute; left: 16px; bottom: 16px; background: rgba(20,24,28,0.82); color: var(--white);
  font-family: var(--font-head); font-size: 0.8rem; padding: 8px 14px; border-radius: var(--radius);
}
.about-copy p { color: var(--steel); margin-top: 14px; }
.about-copy h2 { margin-top: 2px; }

.about-facts { margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 28px; border-top: 1px solid var(--line); padding-top: 26px; }
.about-facts li { font-size: 0.95rem; color: var(--ink-soft); }
.about-facts span { display: block; font-family: var(--font-head); font-size: 0.78rem; font-weight: 600; color: var(--copper-dark); margin-bottom: 4px; }

/* ---------- Services ---------- */
.services { padding: 96px 0; background: var(--paper-2); }
.section-head { max-width: 62ch; margin-bottom: 52px; }
.section-head h2 { margin-top: 2px; margin-bottom: 12px; }

.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #cfcabf; }
.service-icon { width: 34px; height: 34px; stroke: var(--copper); stroke-width: 2; fill: none; margin-bottom: 18px; }
.service-card h3 { margin-bottom: 10px; }
.service-card p { color: var(--steel); font-size: 0.96rem; }

/* ---------- Why Us ---------- */
.why-us { padding: 96px 0; background: var(--circuit); color: var(--paper); }
.section-head-light .eyebrow { color: #E3A56A; }
.section-head-light h2 { color: var(--white); }

.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.12); margin-top: 8px; }
.why-item { background: var(--circuit); padding: 30px 28px; }
.why-item h3 { color: var(--white); margin-bottom: 10px; }
.why-item p { color: #C4D0DA; font-size: 0.95rem; }

/* ---------- Contact ---------- */
.contact { padding: 96px 0; }
.contact-inner { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 60px; }

.contact-details { margin-top: 32px; display: flex; flex-direction: column; gap: 22px; }
.contact-details li { display: flex; gap: 14px; align-items: flex-start; }
.contact-details svg { width: 22px; height: 22px; flex-shrink: 0; stroke: var(--copper); stroke-width: 1.6; margin-top: 2px; }
.contact-details span { display: block; font-family: var(--font-head); font-size: 0.78rem; font-weight: 600; color: var(--copper-dark); margin-bottom: 3px; }
.contact-details a:hover { color: var(--copper-dark); }

.contact-form { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow); }
.contact-form h3 { margin-bottom: 22px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-family: var(--font-head); font-size: 0.86rem; font-weight: 500; margin-bottom: 7px; }
.form-field input, .form-field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.form-field input:focus, .form-field textarea:focus {
  border-color: var(--copper); box-shadow: 0 0 0 3px rgba(193,117,47,0.14); outline: none;
}
.form-field textarea { resize: vertical; min-height: 110px; }
.form-field.invalid input, .form-field.invalid textarea { border-color: var(--error); }
.error-msg { display: block; font-size: 0.8rem; color: var(--error); margin-top: 6px; min-height: 1em; }

.form-status { margin-top: 16px; font-size: 0.92rem; text-align: center; min-height: 1.2em; }
.form-status.success { color: var(--success); }
.form-status.error { color: var(--error); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #C7CBCE; padding-top: 64px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-brand p { margin-top: 14px; font-size: 0.9rem; color: #9CA3A8; max-width: 34ch; }
.footer-brand .brand-text span { color: #9CA3A8; }
.footer-col h4 { font-family: var(--font-head); font-size: 0.88rem; color: var(--white); margin-bottom: 16px; }
.footer-col ul { display: flex; flex-direction: column; gap: 11px; font-size: 0.9rem; }
.footer-col a:hover { color: var(--white); }

.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding: 24px 28px; font-size: 0.84rem; flex-wrap: wrap; gap: 12px; }
.footer-legal { display: flex; gap: 22px; }
.footer-legal a:hover { color: var(--white); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 320px; margin: 0 auto; }
  .about-inner, .contact-inner { grid-template-columns: 1fr; }
  .about-media { max-width: 420px; margin: 0 auto; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .main-nav {
    position: absolute; top: 76px; left: 0; right: 0; background: var(--paper);
    border-bottom: 1px solid var(--line); max-height: 0; overflow: hidden; transition: max-height 0.25s ease;
  }
  .main-nav.open { max-height: 300px; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 8px 28px 18px; }
  .main-nav a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: flex; }
  .header-actions .btn-sm { display: none; }

  .hero-stats { gap: 22px; flex-wrap: wrap; }
  .services-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .about-facts { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
