/* Home hero ("Alles Digitale. Ein Partner."): oversized headline, the 3D ANTRIVA symbol, one CTA.
   Light design, approved by the owner 2026-12-03 (prototype: /home-neu/hero-prototyp/).
   3D on screens from 768 px (assets/js/hero3d.js, Three.js); phones and fallback use the SVG symbol below. */

.h3 {
  --h3-bg: #f3f8f8;
  --h3-ink: var(--charcoal);
  --h3-accent: var(--teal);
  --h3-muted: var(--muted);
  --h3-line: rgba(21, 23, 25, 0.12);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(640px, calc(100svh - 128px), 920px);
  background: var(--h3-bg);
  color: var(--h3-ink);
}

/* Stage: canvas and static fallback share the same box. */
.h3-stage { position: absolute; z-index: 0; top: 0; right: 0; bottom: 0; width: 56%; pointer-events: none; }
.h3-canvas, .h3-fallback { position: absolute; inset: 0; width: 100%; height: 100%; }
.h3-canvas { display: block; opacity: 0; transition: opacity 0.9s ease; }
.h3-fallback { display: grid; place-items: center; transition: opacity 0.6s ease; }
.h3-fallback { --tilt: perspective(900px) rotateY(-20deg) rotateX(8deg); }
.h3-fallback svg { position: relative; z-index: 1; width: min(48%, 340px); height: auto; overflow: visible; transform: var(--tilt); }
/* soft floor shadow as its own element: no filter on the animated SVG, so frames stay cheap */
.h3-fallback::after { content: ""; position: absolute; left: 50%; bottom: 7%; width: min(42%, 280px); height: 34px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(4, 60, 62, 0.28), rgba(4, 60, 62, 0)); }
/* 2.5D symbol (phones, and the fallback everywhere): a dark side layer gives each block thickness. */
.h3-side { fill: url(#h3s); transform: translate(7px, 9px); }
.h3-face { fill: url(#h3g); }
.h3-stage.is-live .h3-canvas { opacity: 1; }
.h3-stage.is-live .h3-fallback, .h3-stage.is-loading .h3-fallback { opacity: 0; }

/* Copy */
.h3-inner { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; min-height: inherit; padding-block: clamp(48px, 7vh, 88px) clamp(72px, 9vh, 96px); }
.h3-title, .h3-bottom { position: relative; z-index: 1; }
.h3-title { margin: 0; font-family: var(--font-head); font-weight: 800; letter-spacing: -0.045em; line-height: 0.9; }
.h3-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: clamp(18px, 2.4vw, 30px); color: var(--h3-muted); font-family: var(--font-body); font-size: clamp(0.8125rem, 0.75rem + 0.25vw, 0.9375rem); font-weight: 600; letter-spacing: 0.08em; line-height: 1.4; text-transform: uppercase; }
.h3-eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--h3-accent); }
.h3-lines { display: block; padding-bottom: 0.06em; font-size: clamp(3.25rem, 1.2rem + 6.4vw, 8.75rem); }
.h3-line-2 { color: var(--h3-accent); }
/* English headline is about a third longer: smaller so it stays clear of the symbol. */
.h3-lines:lang(en) { font-size: clamp(3rem, 1rem + 5.2vw, 7.25rem); }

.h3-bottom { display: grid; gap: 22px; max-width: 520px; margin-top: clamp(32px, 6vh, 72px); }
.h3-lead { margin: 0; color: var(--h3-muted); font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); line-height: 1.6; }
.h3-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.h3-cta { min-height: 52px; padding-inline: 26px; font-size: 1rem; }
.h3-cta svg { transition: transform 0.35s var(--ease); }
.h3-cta:hover svg { transform: translateX(4px); }
.h3-tag { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 6px 0 0; padding-top: 18px; border-top: 1px solid var(--h3-line); color: var(--h3-ink); font-family: var(--font-head); font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; }
.h3-tag span + span::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 14px 2px 0; border-radius: 50%; background: var(--h3-accent); vertical-align: middle; }


/* Entrance of the headline: transform only, so the text paints at once. */
@media (prefers-reduced-motion: no-preference) {
  .h3-lines { animation: h3-rise 1s var(--ease) both; }
  .h3-bottom { animation: h3-rise-sm 1s var(--ease) 0.2s both; }
}
/* Same story as the 3D version: blocks fly in, lock together, then a slow float. */
@media (prefers-reduced-motion: no-preference) {
  .h3-p { transform-box: view-box; animation: h3-piece 1.5s var(--ease) both; animation-delay: calc(0.25s + var(--i) * 0.12s); }
  .h3-fallback svg { will-change: transform; animation: h3-lock 0.9s ease 1.35s both, h3-float 7s ease-in-out 2.4s infinite; }
  .h3-stage.is-loading .h3-p, .h3-stage.is-live .h3-p, .h3-stage.is-loading .h3-fallback svg, .h3-stage.is-live .h3-fallback svg { animation: none; }
}
@keyframes h3-piece { from { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(0.7); } }
@keyframes h3-lock { 50% { transform: var(--tilt) scale(1.035); } }
@keyframes h3-float { 50% { transform: var(--tilt) translateY(-6px) rotate(-0.6deg); } }
@keyframes h3-rise { from { transform: translateY(0.22em); } to { transform: none; } }
@keyframes h3-rise-sm { from { transform: translateY(12px); } to { transform: none; } }

/* Large desktop: headline overlaps the stage edge slightly, sculpture keeps its own space. */
@media (min-width: 1500px) { .h3-stage { width: 54%; } }

/* Tablet: headline across the top, sculpture and copy share the lower half. */
@media (max-width: 1099px) {
  .h3 { min-height: clamp(600px, 72svh, 900px); }
  .h3-inner { padding-block: 44px 72px; }
  .h3-lines { font-size: clamp(3.5rem, 1rem + 9.6vw, 6.5rem); }
  .h3-lines:lang(en) { font-size: clamp(3.25rem, 1rem + 7.6vw, 5.5rem); }
  .h3-stage { top: auto; bottom: 0; width: 60%; height: 74%; }
  .h3-bottom { max-width: 46%; margin-top: 56px; }
}

/* Phone: own composition. Headline, then the sculpture large in the flow, then copy and CTA. */
@media (max-width: 699px) {
  .h3-inner { padding-block: 24px 72px; }
  .h3-eyebrow { margin-bottom: 14px; }
  .h3-lines { font-size: clamp(2.75rem, 0.6rem + 11.6vw, 4.25rem); line-height: 0.94; }
  .h3-stage { position: relative; inset: auto; width: calc(100% + 2 * var(--gutter)); height: auto; aspect-ratio: 1 / 0.7; margin: 4px calc(-1 * var(--gutter)) 0; }
  .h3-bottom { max-width: none; margin-top: 0; gap: 16px; }
  .h3-lead { font-size: 1rem; line-height: 1.55; }
  .h3-cta { width: 100%; justify-content: center; }
}
@media (max-width: 699px) and (max-height: 500px) { .h3-stage { aspect-ratio: 16 / 9; } }

/* Landscape phones: two columns again so the sculpture stays in view. */
@media (min-width: 640px) and (max-width: 1099px) and (max-height: 520px) {
  .h3-stage { top: 0; height: 100%; width: 46%; }
  .h3-bottom { max-width: 50%; }
  .h3-lines { font-size: clamp(2.75rem, 7vw, 4.5rem); }
}
