/* ========================================================
   DIDAR LAHIRY — ENHANCED MOTION & MULTI-PAGE SYSTEM
   Cinematic Animations, Parallax Sheen & Fluid Transitions
   ======================================================== */

:root {
  --gold-glow: rgba(229, 176, 131, 0.4);
  --gold-accent: #e5b083;
  --amber-neon: #FF6500;
  --amber-glow: rgba(255, 101, 0, 0.35);
  --glass-bg: rgba(20, 15, 16, 0.75);
  --glass-border: rgba(228, 204, 175, 0.15);
}

/* =========================================
   1. PAGE TRANSITIONS & ENTRANCE REVEAL
   ========================================= */
@keyframes pageFadeUp {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-enter-animated {
  animation: pageFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Subtle top progress bar */
#page-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #b85e55, #e5b083, #FF6500);
  z-index: 9999;
  transform-origin: 0% 50%;
  transform: scaleX(0);
  transition: transform 0.2s ease-out;
  box-shadow: 0 0 10px var(--amber-glow);
}

/* =========================================
   2. CUSTOM LUMINOUS CURSOR (DESKTOP)
   ========================================= */
@media (hover: hover) and (pointer: fine) {
  .cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 7px;
    height: 7px;
    background-color: var(--gold-accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: transform 0.08s ease-out, opacity 0.2s ease;
    box-shadow: 0 0 12px var(--gold-glow);
  }

  .cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(229, 176, 131, 0.45);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
                height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
                border-color 0.3s ease,
                background-color 0.3s ease;
  }

  .cursor-ring.is-hovering {
    width: 58px;
    height: 58px;
    border-color: var(--amber-neon);
    background-color: rgba(255, 101, 0, 0.08);
    box-shadow: 0 0 25px var(--amber-glow);
  }
}

/* =========================================
   3. ACTIVE NAVIGATION PILL & INDICATOR
   ========================================= */
.site-nav > a.is-active {
  color: var(--gold-accent) !important;
  font-weight: 700 !important;
}

.site-nav > a.is-active::after {
  content: '' !important;
  height: 2px !important;
  width: 100% !important;
  position: absolute;
  left: 0;
  bottom: 5px;
  background: linear-gradient(90deg, var(--gold-accent), var(--amber-neon)) !important;
  box-shadow: 0 0 8px var(--amber-glow);
}

.site-nav > a.is-active::before {
  content: '✦';
  position: absolute;
  top: -4px;
  right: -8px;
  font-size: 8px;
  color: var(--amber-neon);
  animation: pulseRotate 4s linear infinite;
}

@keyframes pulseRotate {
  0% { transform: scale(0.9) rotate(0deg); opacity: 0.6; }
  50% { transform: scale(1.2) rotate(180deg); opacity: 1; }
  100% { transform: scale(0.9) rotate(360deg); opacity: 0.6; }
}

.mobile-menu__panel a.is-active {
  color: var(--gold-accent) !important;
  font-weight: 700;
  border-left: 2px solid var(--amber-neon);
  padding-left: 12px;
}

/* =========================================
   4. AMBIENT GLOW ORBS & BREATHING MOTION
   ========================================= */
@keyframes orbBreathe {
  0%, 100% {
    transform: scale(1) translate(-50%, 0);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.08) translate(-50%, -10px);
    opacity: 0.95;
  }
}

.ambient-motion-orb {
  animation: orbBreathe 10s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes subtleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.floating-subtle {
  animation: subtleFloat 5s ease-in-out infinite;
}

/* =========================================
   5. 3D CARD TILT & INTERACTIVE LIGHT SHEEN
   ========================================= */
.tilt-card {
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), 
              box-shadow 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.25s ease;
  transform-style: preserve-3d;
  position: relative;
  overflow: hidden;
}

.tilt-card:hover {
  border-color: rgba(229, 176, 131, 0.45) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 25px rgba(229, 176, 131, 0.15);
}

.tilt-card::before {
  content: '';
  position: absolute;
  inset: -100%;
  background: radial-gradient(circle 350px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.08), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

.tilt-card:hover::before {
  opacity: 1;
}

/* =========================================
   6. GLASSMORPHIC HERO BADGES & PULSES
   ========================================= */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.live-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--gold-accent);
  box-shadow: 0 0 16px var(--gold-glow);
}

.pulsing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ================================================================
   7. PAGE HEADER & EDITORIAL HERO (GUARANTEED VISIBILITY & BALANCE)
   ================================================================ */
.page-intro-header {
  padding: clamp(25px, 4vw, 45px) clamp(20px, 3.7vw, 74px) 20px !important;
  border-bottom: 1px solid var(--fine-rule) !important;
  position: relative !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: clamp(20px, 3vw, 40px) !important;
  background: linear-gradient(180deg, rgba(22, 14, 16, 0.4) 0%, transparent 100%) !important;
}

.page-header-text {
  flex: 1 1 500px !important;
  max-width: 820px !important;
  position: relative !important;
  z-index: 2 !important;
}

.page-intro-header .page-folio-tag {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--sand);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.page-intro-header .page-folio-tag i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber-neon);
  box-shadow: 0 0 8px var(--amber-neon);
}

.page-intro-header .page-title {
  font-family: var(--display);
  font-size: clamp(2.8rem, 6.5vw, 5.8rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0 0 14px 0;
  color: var(--cream);
  text-transform: uppercase;
}

.page-intro-header .page-title em {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  color: var(--gold-accent);
  text-transform: none;
}

.page-intro-header .page-subtitle {
  max-width: 680px;
  font-size: clamp(13px, 1.1vw, 16px);
  line-height: 1.6;
  color: var(--sand);
  margin: 0;
}

/* THE RIGHT-SIDE EDITORIAL PORTRAIT */
.page-header-portrait {
  flex: 0 0 auto !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 5 !important;
}

.page-header-portrait__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(180px, 20vw, 280px);
  height: clamp(180px, 20vw, 280px);
  background: radial-gradient(circle, rgba(255, 101, 0, 0.3) 0%, rgba(184, 94, 85, 0.2) 45%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: orbBreathe 8s ease-in-out infinite;
}

.page-header-portrait img {
  display: block !important;
  width: clamp(160px, 17vw, 240px) !important;
  height: auto !important;
  max-height: 290px !important;
  object-fit: contain !important;
  filter: drop-shadow(0 14px 35px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 15px rgba(229, 176, 131, 0.25)) !important;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
  user-select: none;
  -webkit-user-drag: none;
  position: relative;
  z-index: 1;
}

.page-header-portrait:hover img {
  transform: translateY(-5px) scale(1.03);
  filter: drop-shadow(0 20px 45px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 25px rgba(255, 101, 0, 0.45)) !important;
}

.page-header-portrait__badge {
  margin-top: -12px;
  padding: 5px 14px;
  border-radius: 9999px;
  background: rgba(18, 12, 14, 0.94);
  border: 1px solid rgba(229, 176, 131, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold-accent);
  text-transform: uppercase;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  z-index: 2;
  white-space: nowrap;
}

/* Responsiveness: NEVER hide the portrait! Stack gracefully if screen is very narrow */
@media (max-width: 820px) {
  .page-intro-header {
    flex-direction: column-reverse !important;
    align-items: center !important;
    text-align: center !important;
    gap: 20px !important;
  }
  .page-intro-header .page-folio-tag {
    justify-content: center !important;
  }
  .page-header-portrait img {
    width: 170px !important;
    max-height: 220px !important;
  }
}

/* =========================================
   8. SECTION PORTRAITS (SKILLS & PROJECTS HEADERS)
   ========================================= */
.eu__header {
  display: grid !important;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 300px) minmax(235px, 295px) !important;
  gap: clamp(24px, 3vw, 45px) !important;
  align-items: center !important;
  padding: 42px 0 52px !important;
}

.sw__intro {
  display: grid !important;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 300px) 250px !important;
  gap: clamp(24px, 3vw, 40px) !important;
  align-items: center !important;
  padding: clamp(46px, 5vw, 94px) 0 60px !important;
}

.section-header-portrait,
.eu__header-portrait,
.sw__intro-portrait {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 10 !important;
  flex-shrink: 0 !important;
  margin: 0 auto !important;
}

.section-header-portrait-glow,
.eu__header-portrait-glow,
.sw__intro-portrait-glow {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: clamp(220px, 24vw, 320px) !important;
  height: clamp(220px, 24vw, 320px) !important;
  background: radial-gradient(circle, rgba(255, 101, 0, 0.45) 0%, rgba(184, 94, 85, 0.28) 45%, transparent 72%) !important;
  border-radius: 50% !important;
  pointer-events: none !important;
  z-index: 0 !important;
  animation: orbBreathe 7s ease-in-out infinite !important;
}

.section-header-portrait img,
.eu__header-portrait img,
.sw__intro-portrait img {
  display: block !important;
  width: clamp(190px, 20vw, 270px) !important;
  height: auto !important;
  max-height: 330px !important;
  object-fit: contain !important;
  position: relative !important;
  z-index: 2 !important;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 25px rgba(229, 176, 131, 0.35)) !important;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), filter 0.45s ease !important;
}

.section-header-portrait:hover img,
.eu__header-portrait:hover img,
.sw__intro-portrait:hover img {
  transform: translateY(-8px) scale(1.04) !important;
  filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 35px rgba(255, 101, 0, 0.55)) !important;
}

.section-header-portrait-badge,
.eu__header-portrait-badge,
.sw__intro-portrait-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: -16px !important;
  padding: 7px 16px !important;
  background: rgba(18, 12, 14, 0.95) !important;
  border: 1px solid rgba(229, 176, 131, 0.45) !important;
  border-radius: 999px !important;
  font-family: var(--ui, 'Instrument Sans', sans-serif) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.18em !important;
  color: #fff4ea !important;
  text-transform: uppercase !important;
  backdrop-filter: blur(12px) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.75) !important;
  position: relative !important;
  z-index: 4 !important;
}

@media (max-width: 1100px) {
  .eu__header {
    grid-template-columns: minmax(0, 1fr) minmax(200px, 260px) !important;
    gap: 25px !important;
  }
  .eu__header-aside {
    grid-column: 1 / -1 !important;
    margin-top: 20px !important;
  }
  .sw__intro {
    grid-template-columns: minmax(0, 1fr) minmax(200px, 260px) !important;
    gap: 25px !important;
  }
  .sw__intro-aside {
    grid-column: 1 / -1 !important;
    margin-top: 20px !important;
  }
}

@media (max-width: 768px) {
  .eu__header,
  .sw__intro {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 28px !important;
  }
  .eu__header-portrait img,
  .sw__intro-portrait img {
    width: 200px !important;
    max-height: 250px !important;
  }
}

/* =========================================
   9. INDEX HERO PORTRAIT GUARANTEE
   ========================================= */
.hero__portrait-depth {
  bottom: 0 !important;
}

.hero__portrait {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

/* Button glow effect */
.btn-glow-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #b85e55, #a3483f);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 25px rgba(184, 94, 85, 0.35);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-glow-primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #c76a60, #b85e55);
  box-shadow: 0 14px 35px rgba(184, 94, 85, 0.55), 0 0 20px rgba(229, 176, 131, 0.3);
}

.btn-glow-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--cream);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid var(--fine-rule);
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-glow-secondary:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--gold-accent);
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px var(--gold-glow);
}

/* GUARANTEED PORTRAIT VISIBILITY OVERRIDE */
.hero__portrait-reveal {
  opacity: 1 !important;
  visibility: visible !important;
  clip-path: none !important;
  display: block !important;
}

.hero__portrait-depth {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  bottom: 0 !important;
}

.hero__portrait {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}
