/* =========================================================
   HUGETEC · Laptop Scroll-Hero · v2.2.0
   Vollbild-Notebook mit Caption-Overlay
   - 100vh sticky child, kein schwarzer Rand
   - Video/Poster covert das gesamte Viewport (object-fit: cover)
   - Caption sitzt absolut auf dem Notebook
   - Scroll-Scrub Animation läuft über 180vh-Runway
   ========================================================= */

/* IMPORTANT: scoped sticky-fix (overflow-x: hidden vs sticky) */
html.hugetec-has-laptop-hero,
html.hugetec-has-laptop-hero body{ overflow-x: clip; }
html.hugetec-has-laptop-hero .ht-site{ overflow: visible !important; }

/* ---- Runway: scroll-distance für die Animation ---------------------- */
.hugetec-laptop-scroll-hero{
  position: relative;
  width: 100%;
  /* 180vh = 0.8 Viewport Scroll-Distanz nach dem ersten Viewport.
     Reicht für eine flüssige Scrub-Animation, ohne Dead-Scroll. */
  min-height: 180vh;
  background: #050505;
  color: #eef4ff;
  isolation: isolate;
  overflow: visible;
  --hugetec-p: 0;
  --hugetec-p-ease: 0;
}

/* ---- Sticky container: 100vh, immer vollständig sichtbar ------------ */
.hugetec-laptop-sticky{
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  z-index: 1;
}

/* ---- Notebook: füllt das gesamte Sticky-Viewport -------------------- */
.hugetec-laptop-scroll-video,
.hugetec-laptop-fallback{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Desktop-Default: cover (Vollbild). Auf Mobile schaltet eine Media-
     Query unten auf contain um, damit das Notebook komplett sichtbar
     bleibt. Die dunklen Bereiche oben/unten blenden mit dem Section-
     Hintergrund (#050505) zusammen — wirken nicht wie schwarzer Rand. */
  object-fit: cover;
  object-position: center;
  background: transparent;
  border: 0;
  outline: 0;
  pointer-events: none;
}
.hugetec-laptop-scroll-video{
  filter:
    saturate(calc(0.95 + 0.10 * var(--hugetec-p-ease)))
    contrast(calc(0.97 + 0.06 * var(--hugetec-p-ease)));
  transition: filter 200ms linear, opacity 360ms ease;
  opacity: 0;
}
.hugetec-laptop-scroll-hero.is-ready .hugetec-laptop-scroll-video{ opacity: 1; }

.hugetec-laptop-fallback{ display: none; }

/* ---- Subtiler Vignette-Gradient damit Caption lesbar bleibt --------- */
.hugetec-laptop-sticky::after{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(0,0,0,0.55) 0%, transparent 55%),
    linear-gradient(180deg, rgba(0,0,0,0.25) 0%, transparent 25%, transparent 60%, rgba(0,0,0,0.65) 100%);
  z-index: 2;
}

/* ---- Loader-Bar (oben mittig, dezent) -------------------------------- */
.hugetec-laptop-loader{
  position: absolute;
  left: 50%;
  top: calc(var(--ht-header-h, 84px) + 24px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 3;
  pointer-events: none;
  transition: opacity 360ms ease, visibility 360ms ease;
}
.hugetec-laptop-loader-bar{
  width: min(220px, 50vw);
  height: 2px;
  background: rgba(255,255,255,0.10);
  border-radius: 999px;
  overflow: hidden;
}
.hugetec-laptop-loader-bar > span{
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #b88a32 0%, #d4af37 50%, #f1d18a 100%);
  box-shadow: 0 0 12px rgba(212,175,55,0.55);
  transition: width 120ms linear;
}
.hugetec-laptop-loader-label{
  font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", "Menlo", monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(241,209,138,0.7);
}
.hugetec-laptop-scroll-hero.is-ready .hugetec-laptop-loader{
  opacity: 0;
  visibility: hidden;
}

/* ---- Caption: ZENTRIERT AUF DEM NOTEBOOK ---------------------------- */
.hugetec-laptop-caption{
  position: absolute;
  left: 50%;
  bottom: clamp(48px, 10vh, 120px);
  transform: translate(-50%, calc(8px - 8px * var(--hugetec-p-ease)));
  z-index: 3;
  width: calc(100% - 32px);
  max-width: 880px;
  text-align: center;
  padding: 0 16px;
  opacity: calc(0.85 + 0.15 * var(--hugetec-p-ease));
  transition: opacity 220ms linear, transform 220ms linear;
}

.hugetec-laptop-eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", "Menlo", monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #f1d18a;
  padding: 6px 14px;
  border: 1px solid rgba(212,175,55,0.45);
  background: rgba(11,23,40,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  margin: 0 0 14px;
}
.hugetec-laptop-eyebrow::before{
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #d4af37;
  box-shadow: 0 0 10px #d4af37;
}

.hugetec-laptop-title{
  font-family: "Inter", "Helvetica Neue", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 800;
  font-size: clamp(24px, 3.2vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  color: #ffffff;
  text-shadow: 0 2px 18px rgba(0,0,0,0.55), 0 1px 3px rgba(0,0,0,0.5);
}
.hugetec-laptop-title-accent{
  background: linear-gradient(90deg, #d4af37 0%, #f1d18a 50%, #d4af37 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hugetec-laptop-sub{
  margin: 12px auto 0;
  color: rgba(238,244,255,0.92);
  font-size: clamp(13px, 1.2vw, 16px);
  line-height: 1.55;
  max-width: 62ch;
  text-shadow: 0 1px 12px rgba(0,0,0,0.55);
}

/* ---- Responsive — alle Devices ---------------------------------------- */

/* Ultra-Wide (4K, Cinema-Displays >= 1920px)
   Caption + Eyebrow dürfen kräftiger werden, Runway etwas länger
   damit die Scrub-Animation auf großen Screens nicht zu schnell endet. */
@media (min-width: 1921px){
  .hugetec-laptop-scroll-hero{ min-height: 200vh; }
  .hugetec-laptop-title{ font-size: clamp(36px, 2.6vw, 56px); }
  .hugetec-laptop-sub{ font-size: clamp(16px, 1.1vw, 19px); }
  .hugetec-laptop-caption{ bottom: clamp(80px, 11vh, 160px); }
}

/* Standard Desktop (1100–1920px) — Default-Werte gelten */

/* Laptop / großes Tablet quer (900–1100px) */
@media (max-width: 1100px){
  .hugetec-laptop-scroll-hero{ min-height: 170vh; }
  .hugetec-laptop-caption{ bottom: clamp(56px, 9vh, 110px); }
}

/* Tablet hochkant + kleines Laptop (720–900px) */
@media (max-width: 900px){
  .hugetec-laptop-scroll-hero{ min-height: 160vh; }
  .hugetec-laptop-title{ font-size: clamp(22px, 4vw, 36px); }
  .hugetec-laptop-sub{ font-size: clamp(13px, 1.6vw, 15px); }
  .hugetec-laptop-caption{
    bottom: clamp(48px, 8vh, 90px);
    max-width: 720px;
  }
  /* Auf Mobile/Tablet weiter cover, aber Object-Position so dass das
     HUGETEC-Logo auf dem Lid mittig sichtbar bleibt. Keine schwarzen
     Ränder oben/unten — das Notebook füllt das Viewport komplett. */
  .hugetec-laptop-scroll-video,
  .hugetec-laptop-fallback{
    object-fit: cover;
    object-position: 50% 40%;
  }
}

/* Großes Handy / Mini-Tablet hochkant (480–720px) */
@media (max-width: 720px){
  .hugetec-laptop-scroll-hero{ min-height: 150vh; }
  .hugetec-laptop-title{ font-size: clamp(20px, 5.4vw, 30px); }
  .hugetec-laptop-sub{
    font-size: clamp(12px, 3vw, 14px);
    max-width: 36ch;
  }
  .hugetec-laptop-eyebrow{
    font-size: 10px;
    padding: 5px 10px;
    letter-spacing: 0.16em;
  }
  .hugetec-laptop-caption{
    bottom: clamp(56px, 9vh, 88px);
    width: calc(100% - 24px);
    padding: 0 12px;
  }
  .hugetec-laptop-loader{
    top: calc(var(--ht-header-h, 84px) + 16px);
  }
  .hugetec-laptop-loader-bar{ width: min(180px, 60vw); }
  .hugetec-laptop-loader-label{ font-size: 9px; }
  /* Auf Handy: cover mit Logo zentriert, keine schwarzen Ränder. */
  .hugetec-laptop-scroll-video,
  .hugetec-laptop-fallback{
    object-fit: cover;
    object-position: 50% 38%;
  }
}

/* Handy (<480px) — typisch iPhone SE bis Pro Max */
@media (max-width: 480px){
  .hugetec-laptop-scroll-hero{ min-height: 140vh; }
  .hugetec-laptop-title{
    font-size: clamp(19px, 6vw, 26px);
    line-height: 1.18;
  }
  .hugetec-laptop-sub{
    font-size: 13px;
    line-height: 1.5;
    margin-top: 8px;
    max-width: 32ch;
  }
  .hugetec-laptop-eyebrow{
    font-size: 9px;
    padding: 4px 9px;
    letter-spacing: 0.14em;
    margin-bottom: 10px;
  }
  .hugetec-laptop-caption{
    bottom: clamp(64px, 10vh, 100px);
    width: calc(100% - 20px);
  }
  /* Auf kleinen Handys: Logo etwas höher positionieren da Caption mehr
     vertikalen Platz braucht. Kein schwarzer Rand. */
  .hugetec-laptop-scroll-video,
  .hugetec-laptop-fallback{
    object-fit: cover;
    object-position: 50% 35%;
  }
  /* Mehr Vignette unten damit Text auf kleinem Screen lesbar bleibt */
  .hugetec-laptop-sticky::after{
    background:
      radial-gradient(ellipse at 50% 100%, rgba(0,0,0,0.65) 0%, transparent 60%),
      linear-gradient(180deg, rgba(0,0,0,0.30) 0%, transparent 30%, transparent 55%, rgba(0,0,0,0.75) 100%);
  }
}

/* Kleines Handy hochkant (<360px) — alte iPhones, Galaxy Mini */
@media (max-width: 360px){
  .hugetec-laptop-title{ font-size: 18px; }
  .hugetec-laptop-sub{ font-size: 12px; }
  .hugetec-laptop-caption{ bottom: 56px; }
}

/* Landscape Mobile (Handy quer) — Caption hochziehen,
   sonst landet sie hinter der Browser-UI/Adressleiste */
@media (max-height: 480px) and (orientation: landscape){
  .hugetec-laptop-scroll-hero{ min-height: 200vh; }
  .hugetec-laptop-title{ font-size: clamp(16px, 3.2vh, 24px); }
  .hugetec-laptop-sub{ font-size: clamp(11px, 1.8vh, 13px); margin-top: 6px; }
  .hugetec-laptop-eyebrow{ font-size: 9px; margin-bottom: 6px; }
  .hugetec-laptop-caption{
    bottom: clamp(20px, 6vh, 40px);
    max-width: 600px;
  }
  .hugetec-laptop-loader{
    top: calc(var(--ht-header-h, 64px) + 8px);
  }
}

/* High-DPI Retina-Optimierung: stärkere Text-Shadows damit Caption
   auf sehr scharfen Displays nicht "flach" wirkt */
@media (min-resolution: 2dppx){
  .hugetec-laptop-title{
    text-shadow: 0 2px 22px rgba(0,0,0,0.6), 0 1px 4px rgba(0,0,0,0.55);
  }
  .hugetec-laptop-sub{
    text-shadow: 0 1px 14px rgba(0,0,0,0.6);
  }
}

/* Touch-Devices: Caption etwas weiter nach oben damit sie nicht von
   der Browser-Navigation überlappt */
@media (hover: none) and (pointer: coarse){
  .hugetec-laptop-caption{
    bottom: clamp(60px, 11vh, 120px);
  }
}

/* ---- Reduced motion: static fallback ----------------------------------- */
@media (prefers-reduced-motion: reduce){
  .hugetec-laptop-scroll-hero{ min-height: 100vh; }
  .hugetec-laptop-sticky{ position: relative; height: 100vh; }
  .hugetec-laptop-scroll-video{ display: none !important; }
  .hugetec-laptop-fallback{ display: block !important; }
  .hugetec-laptop-loader{ display: none !important; }
  .hugetec-laptop-caption{ opacity: 1 !important; transform: translate(-50%, 0) !important; }
}

/* =========================================================
   v2.8.4 Mobile Fallback-Animation
   ---------------------------------------------------------
   Falls Video-Scrubbing auf einem Mobile-Browser nicht
   funktioniert (iOS Safari ohne User-Gesture, oder Browser
   die video.currentTime nicht zuverlässig setzen können),
   sorgt diese CSS-only Animation für eine sichtbare
   Aufklapp-Wirkung. Sie nutzt die --hugetec-p-ease CSS-
   Variable, die das JS unabhängig vom Video-State setzt.

   Effekt: das Notebook-Bild wird sanft skaliert (von 70%
   auf 100%) und translatiert (von -10% auf 0%), wodurch
   visuell ein "Aufklapp"-Eindruck entsteht — selbst wenn
   das Video selbst nicht scrubbt.
   ========================================================= */
@media (max-width: 768px), (pointer: coarse) {
  .hugetec-laptop-scroll-video,
  .hugetec-laptop-fallback {
    transition: transform 0.08s linear, opacity 0.08s linear;
    will-change: transform, opacity;
  }

  /* Solange das Video nicht ready ist, zeigt der Fallback-Image
     die CSS-Animation. Sobald das Video ready ist (is-ready Class),
     übernimmt das Video-Scrubbing. */
  .hugetec-laptop-scroll-hero:not(.is-ready) .hugetec-laptop-fallback {
    display: block !important;
    opacity: 1;
  }
  .hugetec-laptop-scroll-hero:not(.is-ready) .hugetec-laptop-scroll-video {
    opacity: 0;
  }

  /* Scroll-driven CSS-Fallback: skaliert das Bild basierend auf der
     Scroll-Progress-Variable. Greift sowohl auf <video> als auch auf
     den Fallback-Image — funktioniert IMMER, auch wenn das Video
     nicht scrubbt. */
  .hugetec-laptop-scroll-video,
  .hugetec-laptop-fallback {
    transform:
      scale(calc(0.75 + (var(--hugetec-p-ease, 0) * 0.25)))
      translateY(calc((1 - var(--hugetec-p-ease, 0)) * -4%));
  }
}

/* Allerletzte Notbremse: wenn der Browser KEIN sticky kann
   (oder es durch overflow-x: hidden gebrochen wurde), sieht
   der User wenigstens das offene Notebook statisch. */
@supports not (position: sticky) {
  .hugetec-laptop-sticky {
    position: relative !important;
    height: auto !important;
    min-height: 100vh;
  }
  .hugetec-laptop-scroll-hero {
    min-height: auto !important;
  }
}

/* =========================================================
   v2.9.3 Handy: scrollgesteuerte Bildsequenz auf Canvas
   ---------------------------------------------------------
   Auf Touch-Geraeten zeichnet das JS die passende Frame-
   Grafik zur Scrollposition auf diese Canvas. Sie liegt
   deckungsgleich ueber dem (ausgeblendeten) Video und wird
   per JS mit "contain"-Logik gefuellt. Video und Fallback
   werden im JS per Inline-Style ausgeblendet (damit der
   Reduced-Motion-Fall mit statischem Poster unberuehrt
   bleibt).
   ========================================================= */
.hugetec-laptop-scroll-canvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  background: transparent;
  opacity: 0;
  transition: opacity 360ms ease;
}
.hugetec-laptop-scroll-hero.is-ready .hugetec-laptop-scroll-canvas{
  opacity: 1;
}
