/* ==========================================================================
 * hero-animations.css — Allybees Hero: Vanta NET + Device Mockups
 * Additive only — does NOT override any existing main.css rules
 * except those explicitly noted.
 * ========================================================================== */


/* ── Hero section base ───────────────────────────────────────────────────────
 *
 * Vanta injects its <canvas> as first child of the target.
 * We give it a deep-dark background (matches existing dark-hero aesthetic)
 * so white text stays readable.  The existing .overlay is made transparent
 * here so it doesn't obscure the Vanta NET lines.
 *
 * ─────────────────────────────────────────────────────────────────────────── */

#home.s-home {
  background-color: #0d0d0d;  /* fallback while Vanta loads */
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

/* Vanta auto-injects <canvas> — keep it behind everything */
#home.s-home > canvas {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 0 !important;
  pointer-events: none;
}

/* The existing dark overlay would double-darken the NET — make it transparent */
#home.s-home .overlay {
  background: transparent !important;
}

/* Keep the bottom shadow-vignette but soften it */
#home.s-home .shadow-overlay {
  z-index: 1;
  opacity: 0.6;
}

/* Lift all hero content layers above Vanta canvas */
#home.s-home .home-content,
#home.s-home .home-content__scroll,
#home.s-home .home-content__line,
#home.s-home .home-social {
  position: relative;
  z-index: 2;
}


/* ── Override CSS entrance animation → GSAP takes over ──────────────────────
 *
 * main.css triggers a 2-second CSS fadeIn on .home-content__main when
 * html.cl-loaded is set.  Disable it so GSAP can orchestrate the stagger.
 *
 * ─────────────────────────────────────────────────────────────────────────── */

html.cl-loaded .home-content__main {
  -webkit-animation: none !important;
  animation: none !important;
  opacity: 1 !important;
}

html.cl-preload .home-content__main {
  opacity: 0;
}


/* ── Scroll-progress bar ─────────────────────────────────────────────────────
 *
 * 2px gold bar pinned at the very top of the viewport.
 * Width is driven by JS on the scroll event.
 *
 * ─────────────────────────────────────────────────────────────────────────── */

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #FFB800, #FF9900);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}


/* ══════════════════════════════════════════════════════════════════════════
   MOCKUP SCENE CONTAINER
══════════════════════════════════════════════════════════════════════════ */

.mockup-scene {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 28px;
  padding: 32px 0 0;
  position: relative;
  z-index: 2;
  width: 100%;
}


/* ══════════════════════════════════════════════════════════════════════════
   MACBOOK PRO MOCKUP
══════════════════════════════════════════════════════════════════════════ */

.mockup-macbook {
  position: relative;
  width: 420px;
  flex-shrink: 0;
  -webkit-animation: floatMac 5s ease-in-out infinite;
  animation: floatMac 5s ease-in-out infinite;
  filter:
    drop-shadow(0 28px 44px rgba(0, 0, 0, 0.45))
    drop-shadow(0 6px 14px rgba(255, 184, 0, 0.12));
}

@-webkit-keyframes floatMac {
  0%, 100% { -webkit-transform: translateY(0px) rotate(-1deg); transform: translateY(0px) rotate(-1deg); }
  50%       { -webkit-transform: translateY(-12px) rotate(-1deg); transform: translateY(-12px) rotate(-1deg); }
}
@keyframes floatMac {
  0%, 100% { transform: translateY(0px) rotate(-1deg); }
  50%       { transform: translateY(-12px) rotate(-1deg); }
}

/* ── Lid (screen half) ── */
.mac-lid {
  width: 100%;
  background: linear-gradient(160deg, #d6d6d8 0%, #b0b0b2 45%, #c8c8ca 100%);
  border-radius: 14px 14px 4px 4px;
  padding: 0 8px 6px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12),
    0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Camera notch bar — sits above the screen glass */
.mac-notch-bar {
  width: 100%;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mac-camera-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #444;
  box-shadow: 0 0 0 1px #2a2a2a, 0 0 3px rgba(0, 0, 0, 0.4);
}

/* Screen bezel (black frame around the glass) */
.mac-screen-bezel {
  background: #080808;
  border-radius: 6px 6px 2px 2px;
  padding: 4px;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

/* Inner screen (content area) */
.mac-screen-inner {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  overflow: hidden;
  background: #111827;
  position: relative;
}

.mac-screen-content {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 3px;
}

/* Placeholder — shown until a real GIF is dropped in */
.mac-screen-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  color: rgba(255, 255, 255, 0.35);
  font-family: "Larsseit", sans-serif;
  font-size: 11px;
  text-align: center;
  padding: 12px;
}

.mac-screen-placeholder code {
  font-size: 10px;
  color: #FFB800;
  background: rgba(255, 184, 0, 0.12);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: monospace;
}

/* Hide placeholder when GIF loads successfully */
.mac-screen-content:not([src=""]):not([src="images/mockup-desktop.gif"]) ~ .mac-screen-placeholder,
img.mac-screen-content[style*="display: none"] ~ .mac-screen-placeholder {
  display: none;
}

/* ── Hinge ── */
.mac-hinge {
  width: 100%;
  height: 4px;
  background: linear-gradient(180deg, #909090 0%, #a0a0a0 100%);
  position: relative;
  z-index: 1;
}

/* ── Base (keyboard tray) ── */
.mac-base {
  width: 100%;
  background: linear-gradient(180deg, #c2c2c4 0%, #a8a8aa 100%);
  border-radius: 0 0 10px 10px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 6px 12px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.mac-keyboard-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  padding: 0 16px;
}

.mac-keyboard {
  width: 85%;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 3px,
    transparent 3px,
    transparent 6px
  );
  border-radius: 1px;
  opacity: 0.7;
}

.mac-trackpad {
  width: 24%;
  height: 3px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 1px;
}

/* ── Rubber feet ── */
.mac-foot {
  position: absolute;
  bottom: -3px;
  width: 36px;
  height: 3px;
  background: linear-gradient(180deg, #888, #777);
  border-radius: 0 0 3px 3px;
}
.mac-foot-left  { left: 36px; }
.mac-foot-right { right: 36px; }


/* ══════════════════════════════════════════════════════════════════════════
   IPHONE 15 PRO MOCKUP
══════════════════════════════════════════════════════════════════════════ */

.mockup-iphone {
  position: relative;
  flex-shrink: 0;
  margin-bottom: 16px;
  -webkit-animation: floatPhone 5s ease-in-out infinite;
  animation: floatPhone 5s ease-in-out infinite;
  animation-delay: 0.8s;
  filter:
    drop-shadow(0 24px 36px rgba(0, 0, 0, 0.50))
    drop-shadow(0 4px 10px rgba(255, 184, 0, 0.14));
}

@-webkit-keyframes floatPhone {
  0%, 100% { -webkit-transform: translateY(0px) rotate(2deg); transform: translateY(0px) rotate(2deg); }
  50%       { -webkit-transform: translateY(-16px) rotate(2deg); transform: translateY(-16px) rotate(2deg); }
}
@keyframes floatPhone {
  0%, 100% { transform: translateY(0px) rotate(2deg); }
  50%       { transform: translateY(-16px) rotate(2deg); }
}

/* ── Body shell ── */
.iphone-body {
  width: 155px;
  background: linear-gradient(145deg, #2c2c2e 0%, #1a1a1c 50%, #3a3a3c 100%);
  border-radius: 44px;
  padding: 12px 8px;
  position: relative;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Side rail highlight */
.iphone-body::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 44px;
  background: linear-gradient(135deg, rgba(255,255,255,0.07) 0%, transparent 50%);
  pointer-events: none;
}

/* ── Side buttons ── */
.iphone-side-btn {
  position: absolute;
  background: linear-gradient(180deg, #3c3c3e, #2c2c2e);
  border-radius: 2px;
}

/* Left: silent toggle */
.left-btn-1 {
  left: -3px; top: 88px;
  width: 3px; height: 26px;
  border-radius: 2px 0 0 2px;
  box-shadow: -1px 0 2px rgba(0, 0, 0, 0.45);
}
/* Left: volume up */
.left-btn-2 {
  left: -3px; top: 126px;
  width: 3px; height: 50px;
  border-radius: 2px 0 0 2px;
  box-shadow: -1px 0 2px rgba(0, 0, 0, 0.45);
}
/* Left: volume down */
.left-btn-3 {
  left: -3px; top: 186px;
  width: 3px; height: 50px;
  border-radius: 2px 0 0 2px;
  box-shadow: -1px 0 2px rgba(0, 0, 0, 0.45);
}
/* Right: power */
.right-btn {
  right: -3px; top: 128px;
  width: 3px; height: 68px;
  border-radius: 0 2px 2px 0;
  box-shadow: 1px 0 2px rgba(0, 0, 0, 0.45);
}

/* ── Screen area ── */
.iphone-screen-area {
  background: #000;
  border-radius: 36px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 9 / 19.5;
}

/* ── Dynamic Island ── */
.iphone-dynamic-island {
  position: absolute;
  top: 10px;
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  width: 76px;
  height: 26px;
  background: #000;
  border-radius: 20px;
  z-index: 10;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ── Screen inner ── */
.iphone-screen-inner {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
}

.iphone-screen-content {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder */
.iphone-screen-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
  color: rgba(255, 255, 255, 0.35);
  font-family: "Larsseit", sans-serif;
  font-size: 10px;
  text-align: center;
}

.iphone-screen-placeholder code {
  font-size: 9px;
  color: #FFB800;
  background: rgba(255, 184, 0, 0.12);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
  word-break: break-all;
}

/* Hide placeholder when GIF loads */
.iphone-screen-content:not([src=""]):not([src="images/mockup-mobile.gif"]) ~ .iphone-screen-placeholder,
img.iphone-screen-content[style*="display: none"] ~ .iphone-screen-placeholder {
  display: none;
}


/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════════════ */

/* Tablet — stack vertically */
@media (max-width: 1024px) {
  .mockup-scene {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  .mockup-macbook {
    width: 340px;
  }
}

/* Below the hero's own breakpoint (900px) the columns stack, mockup fills width */
@media (max-width: 900px) {
  .mockup-scene {
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
    padding-top: 24px;
  }
  .mockup-macbook {
    width: 280px;
  }
  .iphone-body {
    width: 120px;
  }
  /* Adjust side button positions for smaller body */
  .left-btn-1 { top: 68px; height: 20px; }
  .left-btn-2 { top: 98px; height: 38px; }
  .left-btn-3 { top: 146px; height: 38px; }
  .right-btn  { top: 98px; height: 52px; }
}

/* Mobile — hide MacBook, iPhone only */
@media (max-width: 768px) {
  .mockup-macbook { display: none; }
  .mockup-iphone {
    margin: 0 auto;
    animation-delay: 0s;
  }
  .iphone-body { width: 130px; }
}

/* Small mobile */
@media (max-width: 480px) {
  .iphone-body { width: 110px; }
}
