/* ============ Design tokens ============ */
:root {
  --bg: #05070d;
  --bg-alt: #0a0e1a;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text: #f1f5f9;
  --text-muted: #97a3b8;
  --text-dim: #64748b;

  --primary: #38bdf8;
  --accent: #818cf8;
  --accent-2: #f472b6;
  --gradient: linear-gradient(135deg, #38bdf8 0%, #818cf8 55%, #f472b6 100%);
  --gradient-soft: linear-gradient(135deg, rgba(56,189,248,0.18), rgba(129,140,248,0.18), rgba(244,114,182,0.18));

  --on-primary: #05070d;

  --font-heading: 'Poppins', system-ui, sans-serif;
  --font-body: 'Open Sans', system-ui, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.5);
  --glow: 0 0 60px rgba(56, 189, 248, 0.25);

  --container-width: 1180px;
  --transition: 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: clip;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--text);
}

h1 { font-size: clamp(2.3rem, 4.2vw + 1rem, 4rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 2.6vw + 1rem, 2.6rem); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1em; color: var(--text-muted); }

ul, ol { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--primary);
  color: var(--on-primary);
  padding: 12px 20px;
  border-radius: 0 0 8px 0;
  z-index: 200;
  font-weight: 600;
}
.skip-link:focus { left: 0; top: 0; }

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

/* ============ Ambient texture ============ */
.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 420px;
  height: 420px;
  margin-left: -210px;
  margin-top: -210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 1;
  will-change: transform;
  transform: translate(-1000px, -1000px);
}
@media (max-width: 760px), (hover: none) {
  .cursor-glow { display: none; }
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  min-height: 44px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  position: relative;
}

.btn-primary {
  background: var(--gradient);
  color: var(--on-primary);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.25);
}
.btn-primary:hover { box-shadow: 0 10px 32px rgba(129, 140, 248, 0.4); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: var(--surface-strong); border-color: var(--border-strong); }

.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 7, 13, 0.7);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 76px;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  flex-shrink: 0;
}
.logo span {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.main-nav {
  display: flex;
  gap: 32px;
  margin-left: auto;
  margin-right: 32px;
}
.main-nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: 8px 2px;
  transition: color var(--transition);
}
.main-nav a:hover { color: var(--text); }

.header-cta { flex-shrink: 0; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: 140px 0 160px;
  overflow: hidden;
  min-height: 88vh;
  display: flex;
  align-items: center;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}
.hero-glow-1 { width: 520px; height: 520px; background: rgba(56, 189, 248, 0.22); top: -120px; left: -120px; }
.hero-glow-2 { width: 480px; height: 480px; background: rgba(244, 114, 182, 0.16); bottom: -160px; right: -100px; }
.hero-glow-3 { width: 600px; height: 600px; background: rgba(129, 140, 248, 0.2); top: 50%; left: 50%; transform: translate(-50%, -50%); }

.hero-inner { position: relative; z-index: 1; }
.hero-copy { max-width: 720px; }

.eyebrow {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 16px;
}

.hero-lead {
  font-size: 1.15rem;
  max-width: 46ch;
  margin-top: 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid var(--border-strong);
  border-radius: 20px;
  z-index: 1;
}
.scroll-cue span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--primary);
  animation: scrollcue 1.8s ease-in-out infinite;
}
@keyframes scrollcue {
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 0; transform: translateY(14px); }
}
@media (prefers-reduced-motion: reduce) { .scroll-cue span { animation: none; } }

/* ============ Values strip ============ */
.values {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 28px 0;
  position: relative;
  z-index: 1;
}
.values-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.value-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text);
}
.value-icon { width: 26px; height: 26px; color: var(--primary); flex-shrink: 0; }
.value-icon svg { width: 100%; height: 100%; }

/* ============ Stats ============ */
.stats {
  padding: 72px 0;
  border-bottom: 1px solid var(--border);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}
.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2rem, 3vw, 2.8rem);
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label {
  display: block;
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ============ Sections ============ */
.section { padding: 110px 0; position: relative; z-index: 1; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head { max-width: 640px; margin: 0 0 56px; }
.section-lead { font-size: 1.05rem; }

.section-head-light .eyebrow { color: #7dd3fc; }

/* ============ Cards ============ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg), var(--glow); }

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--gradient-soft);
  color: var(--primary);
  margin-bottom: 18px;
}
.card-icon svg { width: 24px; height: 24px; }

.card p { margin-bottom: 0; font-size: 0.95rem; }

/* Tilt cards get a 3D perspective wrapper via JS transform */
.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
}

/* ============ Industry cards (Branscher) ============ */
.industry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.industry-card {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.industry-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.industry-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 450ms ease;
}
.industry-card:hover .industry-photo { transform: scale(1.05); }

.industry-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.55) 42%, rgba(2, 6, 23, 0.05) 72%);
}

.industry-icon {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(5, 7, 13, 0.55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}
.industry-icon svg { width: 19px; height: 19px; }

.industry-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px;
}
.industry-body h3 { color: #fff; margin-bottom: 6px; }
.industry-body p { color: #cbd5e1; font-size: 0.9rem; margin-bottom: 0; }

.industry-footnote {
  text-align: center;
  margin: 40px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ============ Process ============ */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
.process-step {
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color var(--transition), transform var(--transition);
}
.process-step:hover { border-color: var(--border-strong); transform: translateY(-4px); }
.process-number {
  display: block;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.7rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}
.process-step p { font-size: 0.95rem; margin-bottom: 0; }

/* ============ Contact ============ */
.section-dark {
  background: var(--bg-alt);
  overflow: hidden;
}
.kontakt-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.kontakt-form {
  width: 100%;
  max-width: 720px;
  border-radius: var(--radius);
  padding: 44px;
  box-shadow: var(--shadow-lg);
}
.form-row { margin-bottom: 18px; }
.form-row label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text);
}
.form-row input,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color var(--transition);
  resize: vertical;
}
.form-row input::placeholder,
.form-row textarea::placeholder { color: var(--text-dim); }
.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--primary);
  outline: none;
}
.form-status { margin: 12px 0 0; font-size: 0.9rem; color: var(--primary); min-height: 1.2em; }
.form-status.is-success { color: #4ade80; }
.form-status.is-error { color: #f87171; }

.required-mark { color: var(--primary); }

.field-error {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: #f87171;
  min-height: 1.1em;
}

.form-row input.is-invalid,
.form-row textarea.is-invalid { border-color: #f87171; }

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Honeypot field — hidden from sighted users, still reachable by bots that fill every field */
.form-row-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.kontakt-details { width: 100%; max-width: 720px; text-align: center; }
.kontakt-label { font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.kontakt-email {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 2px;
  margin-bottom: 14px;
}
.kontakt-email:hover { color: var(--primary); }
.kontakt-note { color: var(--text-dim); font-size: 0.9rem; }

/* ============ Footer ============ */
.site-footer {
  background: #020309;
  padding: 32px 0;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.logo-footer { color: var(--text); }
.footer-inner p { color: var(--text-dim); font-size: 0.85rem; margin: 0; }

/* ============ Reveal defaults (JS toggles visible state) ============ */
[data-reveal] { opacity: 1; }
.js-motion [data-reveal] { opacity: 0; }
.js-motion [data-reveal].is-visible { opacity: 1; }

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .hero { min-height: auto; padding: 120px 0 100px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .industry-grid { grid-template-columns: repeat(2, 1fr); }
  .values-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .main-nav, .header-cta { display: none; }
  .nav-toggle { display: flex; }

  .main-nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: rgba(5, 7, 13, 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 24px;
    gap: 4px;
    box-shadow: var(--shadow-lg);
  }
  .main-nav.is-open a { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .main-nav.is-open a:last-child { border-bottom: none; }
}

@media (max-width: 620px) {
  .card-grid { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: 1fr; }
  .industry-grid { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 72px 0; }
  .hero { padding: 100px 0 72px; }
  .kontakt-form { padding: 28px; }
}

/* ============ Mobile hardening ============ */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body,
main,
.site-header,
.site-footer,
section {
  min-width: 0;
  max-width: 100%;
}

.container,
.header-inner,
.hero-inner,
.values-grid,
.stats-grid,
.card-grid,
.industry-grid,
.process-grid,
.kontakt-grid,
.stat-item,
.value-item,
.card,
.industry-card,
.process-step {
  min-width: 0;
}

#hero-canvas {
  max-width: 100%;
  overflow: hidden;
  touch-action: pan-y;
}

.stat-number,
.stat-label,
h1, h2, h3, p,
a {
  overflow-wrap: break-word;
}

@media (max-width: 620px) {
  .container { padding-left: 20px; padding-right: 20px; }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .stat-number {
    font-size: clamp(1.7rem, 8vw, 2.15rem);
    line-height: 1.18;
  }

  .stat-label {
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.95rem;
  }

  .values-grid { gap: 18px 12px; }
  .value-item { font-size: 0.95rem; }

  .hero-title {
    font-size: clamp(2.05rem, 10vw, 3rem);
    overflow-wrap: normal;
    word-break: normal;
  }

  .hero-lead { font-size: 1rem; }

  .industry-card {
    width: 100%;
    max-width: 100%;
  }

  .industry-photo {
    max-width: 100%;
  }
}

@media (max-width: 420px) {
  .container { padding-left: 16px; padding-right: 16px; }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn { width: 100%; }

  .kontakt-form { padding: 24px 18px; }
  .kontakt-email { font-size: 1.1rem; overflow-wrap: anywhere; }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 350px) {
  .values-grid { grid-template-columns: 1fr; }
}
