/* =====================================================
   PAUL G. — Portfolio Index
   Intro animation · Fullscreen Hero · Glassmorphism
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* ─────────────────────────────────────────
   CSS VARIABLES
───────────────────────────────────────── */
:root {
  --bg-deep:       #07091e;
  --bg-base:       #0a0f2c;
  --blue:          #3b82f6;
  --blue-light:    #60a5fa;
  --violet:        #8b5cf6;
  --violet-light:  #a78bfa;
  --white:         #ffffff;
  --white-dim:     rgba(255,255,255,0.75);
  --white-muted:   rgba(255,255,255,0.45);
  --glass-bg:      rgba(255,255,255,0.06);
  --glass-border:  rgba(255,255,255,0.12);
  --glow-blue:     rgba(59,130,246,0.6);
  --glow-violet:   rgba(139,92,246,0.6);
  --ease-out:      cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─────────────────────────────────────────
   RESET
───────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-deep);
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

/* ─────────────────────────────────────────
   SCROLLBAR
───────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--violet), var(--blue));
  border-radius: 3px;
}

/* ─────────────────────────────────────────
   CUSTOM CURSOR
───────────────────────────────────────── */
body { cursor: none; }

.cursor {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: screen;
}
.cursor-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--white);
  transform: translate(-50%, -50%);
  transition: transform 0.1s, opacity 0.3s;
}
.cursor-ring {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(139,92,246,0.7);
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease-out),
              height 0.25s var(--ease-out),
              border-color 0.25s,
              transform 0.08s linear;
}
body.cursor-hover .cursor-ring {
  width: 56px; height: 56px;
  border-color: var(--violet);
}

/* ═══════════════════════════════════════
   INTRO SCREEN
═══════════════════════════════════════ */
#intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
}

/* Animated noise overlay inside intro */
#intro::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
}

/* Intro blobs */
.intro-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0;
  animation: introBlob 1.2s var(--ease-out) 0.2s forwards;
}
.intro-blob-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  top: -15%; left: -10%;
  animation-delay: 0.1s;
}
.intro-blob-2 {
  width: 450px; height: 450px;
  background: radial-gradient(circle, #8b5cf6, transparent 70%);
  bottom: -10%; right: -8%;
  animation-delay: 0.25s;
}
@keyframes introBlob {
  to { opacity: 0.28; }
}

/* PG initials */
.intro-initials {
  position: relative;
  z-index: 2;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(7rem, 20vw, 16rem);
  letter-spacing: -0.05em;
  line-height: 1;
  background: linear-gradient(135deg, #ffffff 0%, var(--blue-light) 40%, var(--violet-light) 75%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;

  opacity: 0;
  transform: scale(0.7);
  animation:
    introLetterIn   0.9s var(--ease-spring) 0.4s forwards,
    gradientShift   4s ease-in-out 1.4s infinite;
  filter: drop-shadow(0 0 0px transparent);
}

@keyframes introLetterIn {
  to {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 60px rgba(139,92,246,0.55))
            drop-shadow(0 0 20px rgba(59,130,246,0.4));
  }
}
@keyframes gradientShift {
  0%,100% { background-position: 0% 50%; }
  50%     { background-position: 100% 50%; }
}

/* Glow ring around PG */
.intro-ring {
  position: absolute;
  z-index: 1;
  width: clamp(260px, 40vw, 520px);
  height: clamp(260px, 40vw, 520px);
  border-radius: 50%;
  border: 1px solid rgba(139,92,246,0.25);
  opacity: 0;
  animation: ringPulse 0.8s var(--ease-out) 0.9s forwards;
}
.intro-ring::after {
  content: '';
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 1px solid rgba(59,130,246,0.15);
}
@keyframes ringPulse {
  0%   { opacity: 0; transform: scale(0.6); }
  60%  { opacity: 1; transform: scale(1.06); }
  100% { opacity: 0.7; transform: scale(1); }
}

/* Tagline under initials */
.intro-tagline {
  position: relative;
  z-index: 2;
  margin-top: 24px;
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--white-muted);
  opacity: 0;
  animation: taglineIn 0.7s var(--ease-out) 1.1s forwards;
}
@keyframes taglineIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Progress bar */
.intro-progress {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.intro-progress-track {
  width: 120px; height: 1.5px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.intro-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--violet));
  border-radius: 2px;
  animation: progressFill 2.2s var(--ease-out) 0.6s forwards;
}
@keyframes progressFill {
  to { width: 100%; }
}
.intro-progress-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  opacity: 0;
  animation: taglineIn 0.5s var(--ease-out) 0.8s forwards;
}

/* Outro: slide up wipe */
#intro.hide {
  animation: introWipe 0.9s var(--ease-out) forwards;
}
@keyframes introWipe {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-100%); opacity: 1; }
}
#intro.gone { display: none; }

/* ═══════════════════════════════════════
   MAIN CONTENT (hidden during intro)
═══════════════════════════════════════ */
#main {
  opacity: 0;
  transition: opacity 0.7s var(--ease-out);
}
#main.visible { opacity: 1; }

/* ─────────────────────────────────────────
   HERO
───────────────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Background image */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    url('https://images.unsplash.com/photo-1550745165-9bc0b252726f?auto=format&fit=crop&w=2000&q=80')
    center center / cover no-repeat;
  transform: scale(1.05);
  transition: transform 8s ease-out;
  will-change: transform;
}
.hero-bg.loaded { transform: scale(1); }

/* Layered overlays */
.hero-overlay-1 {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(7,9,30,0.55) 0%,
    rgba(10,15,44,0.35) 40%,
    rgba(10,15,44,0.60) 80%,
    rgba(7,9,30,0.90) 100%
  );
}
.hero-overlay-2 {
  position: absolute; inset: 0; z-index: 2;
  background: radial-gradient(
    ellipse 80% 60% at 50% 50%,
    rgba(59,130,246,0.08) 0%,
    rgba(139,92,246,0.06) 40%,
    transparent 70%
  );
}

/* Scanline texture */
.hero-scanlines {
  position: absolute; inset: 0; z-index: 3;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.04) 2px,
    rgba(0,0,0,0.04) 4px
  );
  pointer-events: none;
}

/* Hero content */
.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 clamp(20px, 6vw, 80px);
}

/* Name */
.hero-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(4rem, 13vw, 11rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.85) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;

  opacity: 0;
  transform: translateY(30px);
  animation: heroIn 0.9s var(--ease-out) var(--delay, 0s) forwards;
  --delay: 0s;
}

/* Glow behind name */
.hero-name::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--blue-light), var(--violet-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: blur(30px);
  opacity: 0.4;
  z-index: -1;
}

.hero-name a {
  background: inherit;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: filter 0.35s;
}
.hero-name a:hover {
  filter: drop-shadow(0 0 20px var(--glow-violet))
          drop-shadow(0 0 8px var(--glow-blue));
}

/* Divider line */
.hero-divider {
  width: 0;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  margin: 28px 0;
  animation: dividerExpand 0.8s var(--ease-out) 0.25s forwards;
}
@keyframes dividerExpand {
  to { width: 280px; }
}

/* Welcome text */
.hero-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--white-dim);
  opacity: 0;
  transform: translateY(16px);
  animation: heroIn 0.8s var(--ease-out) 0.3s forwards;
}

@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: heroIn 0.7s var(--ease-out) 0.6s forwards;
}
.hero-scroll-line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
  animation: scrollLine 2s ease-in-out 1s infinite;
}
@keyframes scrollLine {
  0%,100% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  50%     { transform: scaleY(0.4); opacity: 0.4; }
}
.hero-scroll-label {
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

/* Floating corner elements */
.hero-corner {
  position: absolute;
  z-index: 10;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  opacity: 0;
  animation: heroIn 1s var(--ease-out) 0.5s forwards;
}
.hero-corner-tl { top: 92px; left: clamp(20px,4vw,56px); }
.hero-corner-tr { top: 92px; right: clamp(20px,4vw,56px); text-align: right; }
.hero-corner span {
  display: block;
  font-family: 'Syne', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  margin-bottom: 2px;
}

/* ─────────────────────────────────────────
   NAVBAR (overlaid on hero)
───────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  padding: 0 clamp(20px,5vw,64px);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  transition: background 0.4s var(--ease-out), backdrop-filter 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
  opacity: 0;
  animation: heroIn 0.7s var(--ease-out) 0.1s forwards;
}
.navbar.scrolled {
  background: rgba(10,15,44,0.75);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-color: rgba(255,255,255,0.08);
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.7; }
.logo-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  display: grid; place-items: center;
  font-size: 0.7rem; font-weight: 800;
  box-shadow: 0 0 12px var(--glow-violet);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}
.nav-links a {
  font-size: 0.88rem;
  font-weight: 400;
  color: rgba(255,255,255,0.65);
  position: relative;
  padding-bottom: 3px;
  transition: color 0.25s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 100%;
  height: 1.5px;
  background: linear-gradient(90deg, var(--blue), var(--violet));
  border-radius: 2px;
  transition: right 0.3s var(--ease-out), box-shadow 0.3s;
}
.nav-links a:hover { color: var(--white); }
.nav-links a:hover::after {
  right: 0;
  box-shadow: 0 0 8px var(--glow-violet);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: none;
  background: none;
  border: none;
  padding: 6px;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.35s var(--ease-out), opacity 0.25s;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: fixed;
  inset: 68px 0 0 0;
  z-index: 199;
  background: rgba(7,9,30,0.97);
  backdrop-filter: blur(24px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 44px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out);
}
.mobile-nav.open { opacity: 1; pointer-events: all; }
.mobile-nav a {
  font-family: 'Syne', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  transition: color 0.2s;
}
.mobile-nav a:hover { color: var(--white); }

/* ─────────────────────────────────────────
   GRAIN OVERLAY (fixed, whole page)
───────────────────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.025;
}

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .mobile-nav { display: flex; }
  .hero-corner { display: none; }
  .hero-divider { margin: 20px 0; }
  body { cursor: auto; }
  .cursor { display: none; }
}

@media (max-width: 400px) {
  .hero-name { font-size: 3.4rem; }
}
