/* ==========================================================================
   CHIWWIE — 3D Immersive Universe Experience
   Styles & Cinematic Presentation
   ========================================================================== */

:root {
  --bg-deep: #020206;
  --accent-cyan: #00f2fe;
  --accent-violet: #8a2be2;
  --accent-magenta: #ff007a;
  --cursor-size: 8px;
  --ring-size: 38px;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: #ffffff;
  user-select: none;
  -webkit-user-select: none;
  cursor: none; /* Managed by 3D custom cursor */
  position: fixed;
  inset: 0;
}

/* Screen reader accessible element (Zero visible text clutter) */
.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;
}

/* ==========================================================================
   WebGL 3D Canvas
   ========================================================================== */

#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  display: block;
  outline: none;
}

/* ==========================================================================
   Cinematic Overlays
   ========================================================================== */

/* Vignette for filmic lens depth */
.cinematic-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 45%,
    rgba(2, 2, 6, 0.45) 75%,
    rgba(2, 2, 6, 0.9) 100%
  );
}

/* Opening Curtain: Starts pitch black, smoothly fades away */
.opening-curtain {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000000;
  z-index: 100;
  pointer-events: none;
  opacity: 1;
  transition: opacity 2.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.opening-curtain.loaded {
  opacity: 0;
}

/* ==========================================================================
   Custom Futuristic Cursor
   ========================================================================== */

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--cursor-size);
  height: var(--cursor-size);
  background: #ffffff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px #ffffff, 0 0 24px var(--accent-cyan);
  transition: width 0.3s ease, height 0.3s ease, background 0.3s ease;
  will-change: transform;
}

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--ring-size);
  height: var(--ring-size);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: 
    width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.35s ease,
    background-color 0.35s ease,
    box-shadow 0.35s ease;
  will-change: transform;
}

/* Cursor on 3D Object Hover */
.cursor-ring.is-hovering {
  width: 78px;
  height: 78px;
  border-color: rgba(0, 242, 254, 0.85);
  background-color: rgba(0, 242, 254, 0.06);
  box-shadow: 
    0 0 30px rgba(0, 242, 254, 0.35),
    inset 0 0 20px rgba(0, 242, 254, 0.15);
  backdrop-filter: blur(1.5px);
}

.cursor-dot.is-hovering {
  width: 5px;
  height: 5px;
  background: var(--accent-cyan);
}

/* Cursor on Click Shockwave */
.cursor-ring.is-clicking {
  transform: translate(-50%, -50%) scale(0.8);
  border-color: var(--accent-magenta);
}

/* Cursor custom colors when hovering social buttons */
.cursor-ring.is-hovering-fb {
  width: 68px;
  height: 68px;
  border-color: rgba(24, 119, 242, 0.95);
  background-color: rgba(24, 119, 242, 0.08);
  box-shadow: 0 0 35px rgba(24, 119, 242, 0.55), inset 0 0 18px rgba(24, 119, 242, 0.2);
}

.cursor-dot.is-hovering-fb {
  background: #1877f2;
  box-shadow: 0 0 16px #1877f2;
}

.cursor-ring.is-hovering-ig {
  width: 68px;
  height: 68px;
  border-color: rgba(225, 48, 108, 0.95);
  background-color: rgba(225, 48, 108, 0.08);
  box-shadow: 0 0 35px rgba(225, 48, 108, 0.55), inset 0 0 18px rgba(225, 48, 108, 0.2);
}

.cursor-dot.is-hovering-ig {
  background: #ff007a;
  box-shadow: 0 0 16px #ff007a;
}

/* ==========================================================================
   Floating Social Profiles Dock
   ========================================================================== */

.social-dock {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(8, 12, 24, 0.72);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  box-shadow: 
    0 14px 40px rgba(0, 0, 0, 0.7),
    0 0 24px rgba(0, 242, 254, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.18);
  pointer-events: auto;
  opacity: 0;
  animation: socialDockEnter 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
  will-change: transform, opacity;
}

@keyframes socialDockEnter {
  0% {
    opacity: 0;
    transform: translate(-50%, 24px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border-radius: 9999px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.82);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: 
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    color 0.35s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.social-btn .social-icon {
  display: block;
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.35s ease;
}

.social-btn .social-name {
  line-height: 1;
}

/* Facebook Specific Theme */
.social-btn.facebook:hover {
  color: #ffffff;
  background: rgba(24, 119, 242, 0.18);
  border-color: rgba(24, 119, 242, 0.55);
  box-shadow: 
    0 0 24px rgba(24, 119, 242, 0.45),
    inset 0 0 12px rgba(24, 119, 242, 0.2);
  transform: translateY(-2px);
}

.social-btn.facebook:hover .social-icon {
  color: #2d88ff;
  transform: scale(1.16);
}

/* Instagram Specific Theme */
.social-btn.instagram:hover {
  color: #ffffff;
  background: rgba(225, 48, 108, 0.18);
  border-color: rgba(225, 48, 108, 0.55);
  box-shadow: 
    0 0 24px rgba(225, 48, 108, 0.45),
    inset 0 0 12px rgba(225, 48, 108, 0.2);
  transform: translateY(-2px);
}

.social-btn.instagram:hover .social-icon {
  color: #fa3b7e;
  transform: scale(1.16);
}

.social-btn:active {
  transform: translateY(0px) scale(0.96);
}

/* Divider inside Dock */
.social-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 2px;
}

/* Mobile & Touch Devices */
@media (hover: none) and (pointer: coarse) {
  body {
    cursor: auto;
  }
  .cursor-dot, .cursor-ring {
    display: none !important;
  }
}

@media (max-width: 600px) {
  .social-dock {
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    padding: 5px 8px;
    gap: 4px;
  }
  .social-btn {
    padding: 7px 12px;
    font-size: 12px;
    gap: 6px;
  }
  .social-btn .social-icon {
    width: 17px;
    height: 17px;
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .opening-curtain {
    transition: none;
  }
  .social-dock {
    animation: none;
    opacity: 1;
  }
  .social-btn {
    transition: none;
  }
}
