/* Base & Resets */
body,
html {
  margin: 0;
  padding: 0;
  background-color: #f4f5f7;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Only hijack the cursor on real mouse pointers. On touch devices —
   or if the cursor JS never runs — the native cursor stays visible. */
@media (hover: hover) and (pointer: fine) {
  body,
  html {
    cursor: none;
  }
}

/* Noise / Grain Overlay - Fixed across the whole site */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Custom Dot Cursor */
.custom-cursor {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition:
    width 0.3s ease,
    height 0.3s ease,
    background 0.3s ease;
}
@media (hover: hover) and (pointer: fine) {
  .custom-cursor {
    display: block;
  }
}
.custom-cursor.hover {
  width: 48px;
  height: 48px;
  background: #fff;
}

/* Paper.js Canvas - Serves as the dynamic background for the whole page */
#paper-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* Glassmorphism Utilities */
.glass-panel {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 8px 32px 0 rgba(166, 180, 200, 0.15),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

/* Interactive Glass Cards for Bento Grid */
.glass-card {
  transition:
    transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
    box-shadow 0.4s ease,
    background 0.4s ease;
}
.glass-card:hover {
  transform: translateY(-8px);
  background: rgba(255, 255, 255, 0.65);
  box-shadow:
    0 16px 40px 0 rgba(166, 180, 200, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 1);
}

/* Metallic Text Gradient */
.text-metallic {
  background: linear-gradient(
    135deg,
    #374151 0%,
    #111827 40%,
    #4b5563 60%,
    #111827 100%
  );
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shine 6s linear infinite;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

/* --- THE "ONLY PAPER" BUTTON EFFECT --- */
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes spin-angle {
  to {
    --angle: 360deg;
  }
}

.liquid-metal-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 48px;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: 0.05em;
  color: #1f2937;
  text-transform: uppercase;
  border-radius: 9999px;
  background: #f0f2f5;
  cursor: pointer;
  text-decoration: none;
  box-shadow:
    -12px -12px 24px rgba(255, 255, 255, 0.9),
    12px 12px 24px rgba(166, 180, 200, 0.4),
    inset 2px 2px 4px rgba(255, 255, 255, 0.8),
    inset -2px -2px 4px rgba(0, 0, 0, 0.05);
  transition:
    transform 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    box-shadow 0.3s ease;
  z-index: 10;
  isolation: isolate;
}

.liquid-metal-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    -16px -16px 32px rgba(255, 255, 255, 1),
    16px 16px 32px rgba(166, 180, 200, 0.5),
    inset 2px 2px 4px rgba(255, 255, 255, 0.8),
    inset -2px -2px 4px rgba(0, 0, 0, 0.05);
}

/* Chromatic Aberration & Spinning Border Mask */
.liquid-metal-btn::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  background: conic-gradient(
    from var(--angle),
    rgba(255, 0, 85, 0.6),
    rgba(255, 255, 255, 0.9),
    rgba(0, 240, 255, 0.6),
    rgba(255, 255, 255, 0.9),
    rgba(255, 0, 85, 0.6)
  );
  animation: spin-angle 4s linear infinite;
  filter: blur(6px);
  z-index: -2;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.liquid-metal-btn::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: linear-gradient(145deg, #ffffff, #e6e8eb);
  border-radius: 9999px;
  z-index: -1;
}

/* Specular Highlight */
.btn-specular {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: linear-gradient(
    105deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.8) 40%,
    rgba(255, 255, 255, 0) 60%
  );
  z-index: 1;
  pointer-events: none;
  opacity: 0.6;
  mix-blend-mode: overlay;
}

.btn-text {
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, #1f2937, #6b7280);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* GSAP Utilities */
.reveal-overflow {
  overflow: hidden;
  display: block;
}
.reveal-text {
  display: block;
  transform-origin: left top;
}

/* Asymmetrical Image Processing */
.img-chrome {
  filter: grayscale(85%) contrast(120%) brightness(1.1);
  transition:
    filter 0.5s ease,
    transform 0.5s ease;
}
.glass-card:hover .img-chrome {
  filter: grayscale(20%) contrast(110%) brightness(1);
  transform: scale(1.05);
}
