/* ============================================================
   ADVANCED ANIMATIONS — LAYER 2
   Cursor · Particles · Preloader · Ripples · Shimmer · 3D Card
   Skill Bars · Marquee · Border Sweep · Contact Rings
   ============================================================ */

/* ============================================================
   CUSTOM CURSOR
   ============================================================ */
body.cursor-active,
body.cursor-active * { cursor: none !important; }

.p-cursor-dot {
  position: fixed;
  z-index: 9998;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--p-accent);
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--p-accent), 0 0 20px var(--p-accent-glow);
  will-change: left, top;
}
.p-cursor-ring {
  position: fixed;
  z-index: 9997;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--p-accent-mid);
  pointer-events: none;
  transform: translate(-50%, -50%);
  will-change: left, top;
  animation: p-cursor-pulse 2.5s ease-in-out infinite;
}
@keyframes p-cursor-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--p-accent-dim); }
  50%       { box-shadow: 0 0 0 6px transparent; }
}

/* ============================================================
   PARTICLE CANVAS
   ============================================================ */
.p-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.65;
}

/* ============================================================
   ENHANCED PRELOADER
   ============================================================ */
@keyframes p-loader-fade-out {
  0%   { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; pointer-events: none; }
}
@keyframes p-loader-logo-in {
  from { opacity: 0; transform: scale(0.8) translateY(12px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
@keyframes p-loader-bar {
  from { width: 0; }
  to   { width: 100%; }
}

.p-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--p-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  animation: p-loader-fade-out 0.5s ease 1.8s forwards;
}
.p-preloader-logo {
  font-family: 'Playfair Display', serif;
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--p-accent);
  letter-spacing: -0.02em;
  animation: p-loader-logo-in 0.7s cubic-bezier(0.22,1,0.36,1) 0.1s both;
}
.p-preloader-logo span { color: #fff; }
.p-preloader-bar-outer {
  width: 200px;
  height: 2px;
  background: rgba(255,255,255,0.07);
  border-radius: 1px;
  overflow: hidden;
}
.p-preloader-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--p-accent), #ffd44d);
  border-radius: 1px;
  animation: p-loader-bar 1.6s ease forwards;
}
.p-preloader-label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--p-text-muted);
}

/* ============================================================
   AVATAR INITIALS + RIPPLE RINGS
   ============================================================ */
.p-avatar-ripple-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.p-avatar-ripple {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid var(--p-accent);
  opacity: 0;
  animation: p-ripple-expand 3s ease-out infinite;
}
.p-avatar-ripple:nth-child(1) { width: 88px;  height: 88px;  animation-delay: 0s; }
.p-avatar-ripple:nth-child(2) { width: 88px;  height: 88px;  animation-delay: 1s; }
.p-avatar-ripple:nth-child(3) { width: 88px;  height: 88px;  animation-delay: 2s; }
@keyframes p-ripple-expand {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(2.3); opacity: 0;   }
}
.p-avatar-initials {
  position: relative;
  z-index: 2;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--p-accent) 0%, #ffd44d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: #080b10;
  box-shadow: 0 0 24px var(--p-accent-mid);
  animation: p-avatar-glow 3s ease-in-out infinite;
}
@keyframes p-avatar-glow {
  0%, 100% { box-shadow: 0 0 16px var(--p-accent-mid); }
  50%       { box-shadow: 0 0 36px var(--p-accent-glow); }
}

/* ============================================================
   SHIMMER TEXT
   ============================================================ */
@keyframes p-text-shimmer {
  0%   { background-position: -300% center; }
  100% { background-position:  300% center; }
}
.p-shimmer {
  background: linear-gradient(
    90deg,
    var(--p-accent)  0%,
    #fff8e1         18%,
    var(--p-accent)  36%,
    #ffd44d         54%,
    #ffffff         70%,
    var(--p-accent) 100%
  );
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: p-text-shimmer 3.5s linear infinite;
  display: inline;
}

/* ============================================================
   3D FLOATING HERO CARD
   ============================================================ */
@keyframes p-card-float {
  0%   { transform: perspective(1000px) rotateY(-10deg) rotateX(6deg)  translateY(0px); }
  25%  { transform: perspective(1000px) rotateY(8deg)   rotateX(-4deg) translateY(-12px); }
  50%  { transform: perspective(1000px) rotateY(10deg)  rotateX(6deg)  translateY(-6px); }
  75%  { transform: perspective(1000px) rotateY(-6deg)  rotateX(-4deg) translateY(-10px); }
  100% { transform: perspective(1000px) rotateY(-10deg) rotateX(6deg)  translateY(0px); }
}
@keyframes p-card-shine-move {
  0%   { transform: translateX(-120%) rotate(25deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateX(250%)  rotate(25deg); opacity: 0; }
}

.p-hero-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}
.p-hero-text  { flex: 1; min-width: 0; }
.p-hero-card-area {
  flex-shrink: 0;
  width: 260px;
  padding-top: 12px;
}
.p-card-3d {
  background: linear-gradient(145deg, #131b2e 0%, #0d1117 60%, #1a1f32 100%);
  border: 1px solid var(--p-border-acc);
  border-radius: 20px;
  padding: 32px 24px;
  box-shadow:
    0 24px 60px rgba(0,0,0,0.5),
    0 0 0 1px rgba(255,174,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.05);
  animation: p-card-float 7s ease-in-out infinite;
  transform-style: preserve-3d;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.p-card-3d-shine {
  position: absolute;
  top: -60%;
  left: -60%;
  width: 60%;
  height: 220%;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255,255,255,0.06) 50%,
    transparent 60%
  );
  animation: p-card-shine-move 4.5s ease-in-out infinite 1.5s;
  pointer-events: none;
}
.p-card-3d-initials {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--p-accent), #ffd44d);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.9rem;
  font-weight: 800;
  color: #080b10;
  margin: 0 auto 14px;
  box-shadow: 0 0 28px var(--p-accent-mid);
}
.p-card-3d-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.3;
}
.p-card-3d-title {
  font-size: 0.72rem;
  color: var(--p-accent);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.p-card-3d-divider {
  height: 1px;
  background: var(--p-border);
  margin-bottom: 16px;
}
.p-card-3d-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 16px;
}
.p-card-3d-stat-val {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--p-accent);
  display: block;
  line-height: 1;
  margin-bottom: 3px;
}
.p-card-3d-stat-lbl {
  font-size: 0.6rem;
  color: var(--p-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.p-card-3d-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 100px;
  background: var(--p-accent-dim);
  border: 1px solid var(--p-border-acc);
  font-size: 0.7rem;
  color: var(--p-accent);
  font-weight: 600;
}
.p-card-3d-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--p-accent);
  animation: p-dot-blink 1.5s ease-in-out infinite;
}

/* ============================================================
   SCROLL REVEAL — SLIDE LEFT (supplement to existing slide-right)
   ============================================================ */
@keyframes p-slide-left {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}
.p-animate.p-slide-left.p-visible { animation-name: p-slide-left; }

/* ============================================================
   RESPONSIVE OVERRIDES FOR SKILL RINGS
   ============================================================ */
@media (max-width: 768px) {
  .p-sk-rings-grid { grid-template-columns: repeat(4, 1fr); gap: 14px 8px; }
  .p-sk-ring-wrap  { width: 78px; height: 78px; }
  .p-sk-ring-pct   { font-size: 0.95rem; }
}
@media (max-width: 480px) {
  .p-sk-rings-grid { grid-template-columns: repeat(4, 1fr); gap: 10px 6px; }
  .p-sk-ring-wrap  { width: 68px; height: 68px; }
  .p-sk-ring-name  { font-size: 0.62rem; }
  .p-sk-cats-grid  { grid-template-columns: 1fr; }
}

/* ============================================================
   COMPANY MARQUEE
   ============================================================ */
.p-marquee-section {
  padding: 16px 0 28px;
  overflow: hidden;
}
.p-marquee-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--p-text-muted);
  text-align: center;
  margin-bottom: 14px;
}
.p-marquee-outer {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
}
.p-marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: p-marquee-scroll 22s linear infinite;
}
.p-marquee-track:hover { animation-play-state: paused; }
@keyframes p-marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.p-marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 32px;
  border-right: 1px solid var(--p-border);
  white-space: nowrap;
  transition: color var(--p-transition);
}
.p-marquee-item:hover .p-marquee-name { color: var(--p-accent); }
.p-marquee-item i { color: var(--p-accent); font-size: 0.78rem; flex-shrink: 0; }
.p-marquee-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--p-text-muted);
  letter-spacing: 0.03em;
  transition: color var(--p-transition);
}
.p-marquee-logo {
  height: 22px;
  width: auto;
  max-width: 80px;
  object-fit: contain;
  filter: grayscale(1) brightness(0.65);
  transition: filter var(--p-transition);
  flex-shrink: 0;
}
.p-marquee-item:hover .p-marquee-logo {
  filter: grayscale(0) brightness(1);
}

/* ============================================================
   CONTACT — PULSING RIPPLE RINGS
   ============================================================ */
.p-contact-ripple-hero {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}
.p-contact-ripple-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.p-contact-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--p-accent);
  animation: p-contact-ripple 3s ease-out infinite;
  opacity: 0;
}
.p-contact-ring:nth-child(1) { width: 90px;  height: 90px;  animation-delay: 0s; }
.p-contact-ring:nth-child(2) { width: 90px;  height: 90px;  animation-delay: 1s; }
.p-contact-ring:nth-child(3) { width: 90px;  height: 90px;  animation-delay: 2s; }
@keyframes p-contact-ripple {
  0%   { transform: scale(1);   opacity: 0.65; }
  100% { transform: scale(2.9); opacity: 0;    }
}
.p-contact-center-icon {
  position: relative;
  z-index: 2;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--p-accent-dim);
  border: 1px solid var(--p-border-acc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--p-accent);
  animation: p-avatar-glow 3s ease-in-out infinite;
}

/* ============================================================
   RESPONSIVE OVERRIDES FOR NEW FEATURES
   ============================================================ */
@media (max-width: 900px) {
  .p-hero-layout      { flex-direction: column; gap: 28px; }
  .p-hero-card-area   { width: 100%; max-width: 300px; margin: 0 auto; padding-top: 0; }
  .p-skill-bars-grid  { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .p-hero-card-area   { max-width: 280px; }
  .p-marquee-item     { padding: 8px 20px; }
  .p-skill-bars-grid  { grid-template-columns: 1fr; }
  .p-card-3d          { padding: 24px 18px; }
}
@media (max-width: 480px) {
  .p-card-3d-initials { width: 64px; height: 64px; font-size: 1.6rem; }
  .p-hero-card-area   { max-width: 260px; }
}
