:root {
  --bg: #0d1117;
  --bg-soft: #131920;
  --panel: #181e25;
  --panel-2: #222a33;
  --olive: #7c8c64;
  --olive-light: #a6b58c;
  --text: #d8dadc;
  --muted: #929aa4;
  --white: #f7f8f8;
  --line: rgba(255,255,255,.11);
  --shadow: 0 24px 70px rgba(0,0,0,.32);
  --radius: 1.25rem;
  --shell: min(1180px, calc(100% - 2.5rem));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.6; }
body.dialog-open { overflow: hidden; }
img, video { display: block; width: 100%; }
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
.shell { width: var(--shell); margin-inline: auto; }
.section { padding: clamp(5rem, 10vw, 9rem) 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 999; padding: .8rem 1rem; background: var(--white); color: var(--bg); border-radius: .5rem; }
.skip-link:focus { top: 1rem; }

.site-header { position: fixed; inset: 0 0 auto; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 1rem max(1.25rem, calc((100vw - 1180px)/2)); border-bottom: 1px solid transparent; transition: .3s ease; }
.site-header.scrolled { background: rgba(13,17,23,.82); backdrop-filter: blur(18px); border-color: var(--line); }
.brand { display: inline-flex; align-items: center; gap: .8rem; }
.brand-mark { display: grid; place-items: center; width: 2.55rem; height: 2.55rem; border: 1px solid rgba(255,255,255,.32); border-radius: .65rem; font-weight: 900; color: var(--white); letter-spacing: -.06em; }
.brand-copy { display: grid; line-height: 1; }
.brand-copy strong { letter-spacing: .12em; font-size: .82rem; }
.brand-copy small { color: var(--olive-light); letter-spacing: .3em; font-size: .52rem; margin-top: .32rem; }
.main-nav { display: flex; gap: 1.8rem; font-size: .79rem; text-transform: uppercase; letter-spacing: .12em; }
.main-nav a { color: rgba(255,255,255,.72); transition: .2s ease; }
.main-nav a:hover { color: var(--white); }
.menu-toggle { display: none; width: 2.7rem; height: 2.7rem; padding: .7rem; border: 1px solid var(--line); background: rgba(0,0,0,.25); border-radius: .6rem; }
.menu-toggle span:not(.sr-only) { display: block; height: 1px; background: var(--white); margin: .28rem 0; }

.hero { min-height: 100svh; position: relative; display: grid; align-items: center; overflow: hidden; background: #111; }
.hero-media { position: absolute; inset: 0; background: url('../images/hero.jpg') 56% 44% / cover no-repeat; transform: scale(1.025); animation: hero-drift 18s ease-in-out infinite alternate; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,10,14,.96) 0%, rgba(8,10,14,.82) 37%, rgba(8,10,14,.2) 68%, rgba(8,10,14,.12) 100%), linear-gradient(0deg, rgba(8,10,14,.55), transparent 44%); }
.hero-grid { position: absolute; inset: 0; opacity: .13; background-image: linear-gradient(rgba(255,255,255,.14) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.14) 1px, transparent 1px); background-size: 70px 70px; mask-image: linear-gradient(to right, black, transparent 65%); }
.hero-content { position: relative; z-index: 2; padding-top: 5rem; }
.eyebrow { margin: 0 0 1.2rem; color: var(--olive-light); font-size: .72rem; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; }
.hero h1 { max-width: 760px; margin: 0; color: var(--white); font-size: clamp(4rem, 9vw, 8.5rem); line-height: .83; letter-spacing: -.075em; font-weight: 800; }
.hero h1 span { color: var(--olive-light); }
.hero-intro { max-width: 610px; margin: 2rem 0; color: rgba(255,255,255,.72); font-size: clamp(1rem, 1.4vw, 1.2rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3.15rem; padding: 0 1.35rem; border: 1px solid var(--line); border-radius: .65rem; font-weight: 750; font-size: .88rem; transition: .22s ease; }
.button-primary { background: var(--olive); color: #0d1117; border-color: var(--olive); }
.button-primary:hover { background: var(--olive-light); transform: translateY(-2px); }
.button-ghost { background: rgba(255,255,255,.04); backdrop-filter: blur(10px); }
.button-ghost:hover { background: rgba(255,255,255,.1); }
.scroll-cue { position: absolute; z-index: 2; bottom: 2rem; left: 50%; display: grid; justify-items: center; gap: .5rem; color: rgba(255,255,255,.55); font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; }
.scroll-cue span { width: 1px; height: 3rem; background: linear-gradient(var(--olive-light), transparent); }
@keyframes hero-drift { to { transform: scale(1.07) translate3d(1.2%, -.7%, 0); } }

.section-heading { max-width: 790px; margin-bottom: 3rem; }
.section-heading h2, .process-copy h2, .events-copy h2 { margin: 0; color: var(--white); font-size: clamp(2.5rem, 5.4vw, 5.4rem); line-height: .98; letter-spacing: -.055em; }
.section-heading > p:last-child, .process-copy > p, .events-copy > p { color: var(--muted); font-size: 1.04rem; }
.split-heading { max-width: none; display: grid; grid-template-columns: 1.25fr .75fr; gap: 4rem; align-items: end; }
.split-heading > p { margin-bottom: .6rem; }
.centered { text-align: center; margin-inline: auto; }

.explore { background: var(--bg); }
.pillar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.pillar-card { position: relative; min-height: 520px; overflow: hidden; border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.pillar-card img { height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.pillar-card:hover img { transform: scale(1.055); }
.pillar-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8,10,13,.95), rgba(8,10,13,.1) 66%); }
.pillar-content { position: absolute; inset: auto 1.4rem 1.4rem; }
.pillar-content span { color: var(--olive-light); font-size: .72rem; letter-spacing: .2em; }
.pillar-content h3 { margin: .25rem 0; color: var(--white); font-size: 1.7rem; }
.pillar-content p { margin: 0; color: rgba(255,255,255,.68); }

.design { background: #11161c; }
.product-showcase { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.product-card { position: relative; min-height: 510px; overflow: hidden; cursor: zoom-in; border: 1px solid var(--line); border-radius: var(--radius); background: #b7b7b7; box-shadow: var(--shadow); }
.product-card img { height: 100%; object-fit: cover; transition: transform .65s ease; }
.product-card:hover img { transform: scale(1.035); }
.product-wide { grid-column: span 2; min-height: 620px; }
.product-copy { position: absolute; inset: auto 1.25rem 1.25rem; max-width: calc(100% - 2.5rem); padding: 1rem 1.1rem; background: rgba(13,17,23,.82); backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.12); border-radius: .8rem; }
.product-copy p { margin: 0; color: var(--olive-light); font-size: .68rem; letter-spacing: .17em; text-transform: uppercase; }
.product-copy h3 { margin: .18rem 0; color: var(--white); font-size: 1.4rem; }
.product-copy span { color: var(--muted); font-size: .85rem; }

.process { background: var(--olive); color: #121610; }
.process-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 4rem; align-items: center; }
.process-copy .eyebrow { color: #293021; }
.process-copy h2 { color: #11150d; }
.process-copy > p { color: rgba(13,17,10,.7); }
.process-steps { list-style: none; margin: 2rem 0 0; padding: 0; border-top: 1px solid rgba(13,17,10,.22); }
.process-steps li { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid rgba(13,17,10,.22); }
.process-steps span { font-size: .7rem; font-weight: 900; }
.process-steps strong { font-size: 1rem; }
.process-visual { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 80px rgba(15,18,12,.32); }
.process-visual img { aspect-ratio: 4/3; object-fit: cover; }
.cad-badge { position: absolute; left: 1rem; bottom: 1rem; padding: .65rem .8rem; color: var(--white); background: rgba(13,17,23,.84); backdrop-filter: blur(14px); border-radius: .55rem; font-size: .7rem; letter-spacing: .12em; }
.cad-badge span { display: inline-block; width: .5rem; height: .5rem; margin-right: .35rem; border-radius: 50%; background: var(--olive-light); }

.build { background: var(--bg); }
.masonry { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 230px; gap: .85rem; }
.gallery-item { position: relative; grid-column: span 4; grid-row: span 1; padding: 0; border: 0; overflow: hidden; border-radius: 1rem; background: var(--panel); cursor: zoom-in; }
.gallery-item.tall { grid-row: span 2; }
.gallery-item.wide { grid-column: span 8; }
.gallery-item img { height: 100%; object-fit: cover; transition: transform .55s ease, filter .55s ease; }
.gallery-item:hover img { transform: scale(1.045); filter: brightness(.82); }
.gallery-item span { position: absolute; inset: auto 1rem 1rem; padding: .45rem .65rem; border-radius: .45rem; background: rgba(13,17,23,.75); backdrop-filter: blur(10px); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; }

.field { background: #080b0f; }
.light p { color: #a8afb7; }
.video-stage { position: relative; overflow: hidden; border-radius: var(--radius); background: #000; box-shadow: var(--shadow); }
.video-stage video { aspect-ratio: 16/8.5; object-fit: cover; filter: saturate(.82) contrast(1.06); }
.video-toggle { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 4.5rem; height: 4.5rem; padding: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,.34); background: rgba(13,17,23,.68); color: #fff; backdrop-filter: blur(14px); cursor: pointer; transition: opacity .25s ease, transform .25s ease, background .25s ease; }
.video-toggle:hover { transform: translate(-50%, -50%) scale(1.06); background: rgba(13,17,23,.84); }
.video-icon { position: relative; display: block; width: 1.35rem; height: 1.45rem; }
.video-icon::before { content: ""; position: absolute; left: .28rem; top: .12rem; width: 0; height: 0; border-top: .61rem solid transparent; border-bottom: .61rem solid transparent; border-left: .95rem solid currentColor; }
.video-toggle.is-playing .video-icon::before, .video-toggle.is-playing .video-icon::after { content: ""; position: absolute; top: .12rem; width: .32rem; height: 1.2rem; border: 0; border-radius: .08rem; background: currentColor; }
.video-toggle.is-playing .video-icon::before { left: .23rem; }
.video-toggle.is-playing .video-icon::after { right: .23rem; }
.video-stage.playing .video-toggle { opacity: 0; }
.video-stage:hover .video-toggle { opacity: 1; }
.video-caption { position: absolute; left: 1.2rem; right: 1.2rem; bottom: 1.2rem; display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border: 1px solid rgba(255,255,255,.11); background: rgba(13,17,23,.72); backdrop-filter: blur(12px); border-radius: .65rem; }
.video-caption strong { color: var(--white); }
.video-caption span { color: var(--muted); }
.field-grid { margin-top: 1rem; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.field-grid img { height: 410px; object-fit: cover; border-radius: 1rem; }

.events { background: #e6e7e5; color: #171b20; }
.events-layout { display: grid; grid-template-columns: .72fr 1.28fr; gap: 4rem; align-items: center; }
.events-copy .eyebrow { color: #657350; }
.events-copy h2 { color: #14181c; }
.events-copy > p { color: #5a6168; }
.event-marker { display: flex; align-items: center; gap: 1rem; margin: 2rem 0 1.1rem; font-weight: 900; }
.event-marker span { color: #657350; letter-spacing: .16em; }
.event-marker i { height: 1px; flex: 1; background: rgba(0,0,0,.18); }
.events-copy h3 { margin: 0; font-size: 1.65rem; }
.text-link { display: inline-flex; gap: .6rem; align-items: center; margin-top: 1rem; font-weight: 800; }
.event-image { position: relative; padding: 0; border: 0; overflow: hidden; border-radius: var(--radius); cursor: zoom-in; box-shadow: 0 24px 60px rgba(0,0,0,.18); }
.event-image img { aspect-ratio: 4/3; object-fit: cover; }
.event-image span { position: absolute; right: 1rem; bottom: 1rem; padding: .5rem .7rem; border-radius: .45rem; background: rgba(13,17,23,.75); color: var(--white); backdrop-filter: blur(10px); font-size: .75rem; }

.connect { background: var(--bg-soft); }
.social-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.social-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 1rem; align-items: center; min-height: 150px; padding: 1.4rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--panel); transition: .25s ease; }
.social-card:hover { transform: translateY(-3px); border-color: rgba(166,181,140,.55); background: var(--panel-2); }
.social-card small { grid-row: span 2; color: var(--olive-light); }
.social-card strong { color: var(--white); font-size: 1.25rem; }
.social-card span { color: var(--muted); font-size: .86rem; }
.social-card i { grid-row: span 2; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; color: var(--white); font-style: normal; font-size: 1.15rem; line-height: 1; transition: transform .25s ease, border-color .25s ease, background .25s ease; }
.social-card:hover i { transform: translateX(3px); border-color: rgba(166,181,140,.65); background: rgba(124,140,100,.13); }

.site-footer { padding: 2rem 0; background: #090c10; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1fr auto auto; gap: 2rem; align-items: end; }
.site-footer strong { color: var(--white); letter-spacing: .08em; }
.site-footer p { margin: .3rem 0 0; color: var(--muted); font-size: .8rem; }
.footer-links { display: flex; gap: 1rem; }
.footer-links button { padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.footer-links button:hover { color: var(--white); }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.75,.25,1); }
.reveal.visible { opacity: 1; transform: none; }

.lightbox, .legal-dialog { width: min(1100px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 1px solid var(--line); border-radius: 1rem; background: #0e1319; color: var(--text); box-shadow: 0 40px 120px rgba(0,0,0,.7); }
.lightbox::backdrop, .legal-dialog::backdrop { background: rgba(2,4,7,.82); backdrop-filter: blur(7px); }
.lightbox img { max-height: calc(100vh - 2rem); object-fit: contain; background: #b4b4b4; }
.dialog-close { position: absolute; z-index: 2; top: .7rem; right: .7rem; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; padding: 0; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; background: rgba(13,17,23,.78); color: var(--white); cursor: pointer; font-family: Arial, sans-serif; font-size: 1.45rem; font-weight: 300; line-height: 1; }
.legal-dialog article { padding: 3.5rem clamp(1.2rem, 4vw, 3rem) 2rem; }
.legal-dialog h2 { color: var(--white); font-size: 2rem; }
.legal-dialog h3 { margin-top: 1.6rem; color: var(--olive-light); }
.legal-dialog p { color: var(--muted); }

@media (max-width: 900px) {
  .main-nav { position: fixed; top: 4.7rem; left: 1rem; right: 1rem; display: grid; gap: 0; padding: .6rem; border: 1px solid var(--line); border-radius: .8rem; background: rgba(13,17,23,.96); backdrop-filter: blur(18px); opacity: 0; transform: translateY(-12px); pointer-events: none; transition: .2s ease; }
  .main-nav.open { opacity: 1; transform: none; pointer-events: auto; }
  .main-nav a { padding: .9rem; border-bottom: 1px solid var(--line); }
  .main-nav a:last-child { border-bottom: 0; }
  .menu-toggle { display: block; }
  .hero-media { background-position: 62% center; }
  .hero-overlay { background: linear-gradient(90deg, rgba(8,10,14,.95), rgba(8,10,14,.62) 65%, rgba(8,10,14,.3)); }
  .split-heading, .process-layout, .events-layout { grid-template-columns: 1fr; gap: 2rem; }
  .pillar-grid { grid-template-columns: 1fr; }
  .pillar-card { min-height: 440px; }
  .product-card, .product-wide { grid-column: auto; min-height: 440px; }
  .masonry { grid-auto-rows: 200px; }
  .gallery-item, .gallery-item.wide { grid-column: span 6; }
  .field-grid img { height: 330px; }
}

@media (max-width: 640px) {
  :root { --shell: min(100% - 1.25rem, 1180px); }
  .site-header { padding-inline: .75rem; }
  .brand-copy { display: none; }
  .hero-content { padding-top: 2rem; }
  .hero h1 { font-size: clamp(3.4rem, 17vw, 5.2rem); }
  .hero-media { background-position: 67% center; }
  .hero-overlay { background: linear-gradient(90deg, rgba(8,10,14,.95), rgba(8,10,14,.72) 70%, rgba(8,10,14,.4)); }
  .scroll-cue { display: none; }
  .section { padding: 4.8rem 0; }
  .section-heading h2, .process-copy h2, .events-copy h2 { font-size: 2.7rem; }
  .product-showcase, .social-grid { grid-template-columns: 1fr; }
  .product-card, .product-wide { min-height: 350px; }
  .masonry { grid-template-columns: 1fr; grid-auto-rows: 270px; }
  .gallery-item, .gallery-item.wide, .gallery-item.tall { grid-column: auto; grid-row: auto; }
  .video-stage video { aspect-ratio: 9/13; }
  .video-caption { display: grid; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid img { height: 360px; }
  .footer-grid { grid-template-columns: 1fr; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Build gallery completion and resilient Field Test video playback */
.video-stage video { display: block; width: 100%; }
.video-stage video::-webkit-media-controls-panel { background-image: linear-gradient(transparent, rgba(0,0,0,.72)); }
.video-stage.video-error::after {
  content: 'Video konnte nicht geladen werden.';
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  padding: .8rem 1rem;
  border-radius: .6rem;
  background: rgba(13,17,23,.88);
  color: #fff;
}

.legal-dialog a { color: var(--olive-light); text-decoration: underline; text-underline-offset: .18em; }

/* Interactive STL model */
.model-section { background: #0b0f14; overflow: hidden; }
.model-stage {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: #0d1117;
}
.model-stage canvas { display: block; width: 100%; height: 680px; cursor: grab; touch-action: none; }
.model-stage canvas:active { cursor: grabbing; }
.model-loading, .model-error {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-content: center;
  gap: .8rem;
  text-align: center;
  background: #0d1117;
  color: var(--muted);
}
.model-loading span {
  width: 2rem;
  height: 2rem;
  margin: 0 auto;
  border: 2px solid rgba(255,255,255,.15);
  border-top-color: var(--olive-light);
  border-radius: 50%;
  animation: model-spin .8s linear infinite;
}
.model-error span { max-width: 34rem; padding-inline: 1rem; color: var(--muted); }
.model-error strong { color: var(--white); }
.model-toolbar {
  position: absolute;
  z-index: 2;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .75rem .85rem;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: .85rem;
  background: rgba(13,17,23,.78);
  backdrop-filter: blur(14px);
}
.model-help { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; color: var(--muted); font-size: .8rem; }
.model-help span { color: var(--olive-light); }
.model-actions { display: flex; gap: .55rem; }
.model-actions button {
  min-height: 2.45rem;
  padding: .55rem .8rem;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: .55rem;
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor: pointer;
}
.model-actions button:hover, .model-actions button[aria-pressed="true"] { border-color: var(--olive); background: rgba(124,140,100,.15); color: var(--white); }
@keyframes model-spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .model-stage { min-height: 520px; }
  .model-stage canvas { height: 520px; }
  .model-toolbar { align-items: stretch; flex-direction: column; }
  .model-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

[hidden] { display: none !important; }
