/* ==========================================================================
   Clean Editorial Security Researcher & Developer Portfolio Styles
   For: Epenetus Matias Putra (ZeroX-404)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(161,161,170,0.35); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(161,161,170,0.65); }

/* Focus Rings */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid #18181b; outline-offset: 2px;
}
.dark a:focus-visible, .dark button:focus-visible,
.dark input:focus-visible, .dark textarea:focus-visible {
  outline: 2px solid #f4f4f5;
}

/* ==========================================================================
   HERO ENTRY ANIMATIONS
   ========================================================================== */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

#hero {
  animation: heroFadeUp 0.6s var(--ease-spring) forwards;
}

/* ==========================================================================
   SOUND WAVE EQUALIZER (Spotify Green)
   ========================================================================== */
@keyframes soundWave {
  0%, 100% { height: 3px; }
  50%       { height: 13px; }
}
.wave-bar-1 { animation: soundWave 1.1s ease-in-out infinite; }
.wave-bar-2 { animation: soundWave 0.8s ease-in-out infinite 0.25s; }
.wave-bar-3 { animation: soundWave 1.3s ease-in-out infinite 0.4s; }
.wave-bar-4 { animation: soundWave 0.95s ease-in-out infinite 0.15s; }

/* ==========================================================================
   STATUS DOT — pulsing glow ring
   ========================================================================== */
@keyframes statusRingPulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.status-dot {
  animation: statusRingPulse 2.2s ease-out infinite;
}

/* ==========================================================================
   AVATAR FLIP CARD
   ========================================================================== */
.avatar-container {
  perspective: 1000px;
  cursor: pointer;
  transition: transform 0.2s var(--ease-smooth);
}
.avatar-container:hover {
  transform: scale(1.06);
}

.avatar-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
}

.avatar-container.is-flipped .avatar-inner {
  transform: rotateY(180deg);
}

.avatar-front, .avatar-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 9999px;
  overflow: hidden;
}

.avatar-back {
  transform: rotateY(180deg);
}

/* ==========================================================================
   NAV LINKS — animated underline trace
   ========================================================================== */
nav a, .mobile-menu-link {
  position: relative;
}
nav a::after, .mobile-menu-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.3s var(--ease-spring);
}
nav a:hover::after, .mobile-menu-link:hover::after {
  width: 100%;
}

/* ==========================================================================
   HALL OF FAME CARDS — staggered reveal + card shimmer
   ========================================================================== */
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.hof-card {
  animation: cardReveal 0.5s var(--ease-spring) both;
  position: relative;
  overflow: hidden;
}
.hof-card:nth-child(1) { animation-delay: 0.08s; }
.hof-card:nth-child(2) { animation-delay: 0.16s; }
.hof-card:nth-child(3) { animation-delay: 0.24s; }
.hof-card:nth-child(4) { animation-delay: 0.32s; }
.hof-card:nth-child(5) { animation-delay: 0.40s; }
.hof-card:nth-child(6) { animation-delay: 0.48s; }
.hof-card:nth-child(7) { animation-delay: 0.56s; }
.hof-card:nth-child(8) { animation-delay: 0.64s; }

/* shimmer sweep on hover */
.hof-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg,
    transparent 35%,
    rgba(255,255,255,0.13) 50%,
    transparent 65%
  );
  transform: translateX(-100%);
  transition: transform 0s;
  pointer-events: none;
  z-index: 1;
}
.hof-card:hover::before {
  transform: translateX(100%);
  transition: transform 0.55s ease;
}

/* ==========================================================================
   PROJECT CARDS — 3D tilt on hover (applied via JS)
   ========================================================================== */
.project-card {
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  transform-style: preserve-3d;
  will-change: transform;
}
.project-card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,0.10);
}

/* ==========================================================================
   SCROLL REVEAL — smooth stagger
   ========================================================================== */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s var(--ease-spring),
    transform 0.7s var(--ease-spring);
  will-change: opacity, transform;
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger children when parent reveals */
.reveal-on-scroll.is-visible > *:nth-child(1) { transition-delay: 0.0s; }
.reveal-on-scroll.is-visible > *:nth-child(2) { transition-delay: 0.06s; }
.reveal-on-scroll.is-visible > *:nth-child(3) { transition-delay: 0.12s; }
.reveal-on-scroll.is-visible > *:nth-child(4) { transition-delay: 0.18s; }

/* ==========================================================================
   SOCIAL ICON LINKS — magnetic-like lift
   ========================================================================== */
.social-link {
  transition: transform 0.2s var(--ease-spring), color 0.2s ease;
  display: inline-flex;
}
.social-link:hover {
  transform: translateY(-3px) scale(1.18);
}

/* ==========================================================================
   BUTTON — tactile press & hover lift
   ========================================================================== */
.btn-tactile {
  transition: transform 0.18s var(--ease-spring), box-shadow 0.18s ease;
}
.btn-tactile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.btn-tactile:active {
  transform: scale(0.97) translateY(0);
  box-shadow: none;
}

/* ==========================================================================
   SPOTIFY / MUSIC WIDGET
   ========================================================================== */
#music-widget {
  display: inline-flex !important;
  opacity: 1 !important;
  transition: transform 0.2s var(--ease-spring), border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
#music-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(29, 185, 84, 0.12);
}
#music-widget:active {
  transform: scale(0.97) translateY(0);
}

/* ==========================================================================
   HEATMAP CELL
   ========================================================================== */
.heatmap-cell {
  transition: transform 0.12s ease, filter 0.12s ease;
  cursor: pointer;
}
.heatmap-cell:hover {
  transform: scale(1.5);
  filter: brightness(1.3);
  z-index: 10;
  position: relative;
}
#heatmap-tooltip {
  pointer-events: none;
  transition: opacity 0.12s ease;
  font-family: var(--font-mono);
}

/* ==========================================================================
   MODAL & DRAWER ANIMATIONS
   ========================================================================== */
.modal-backdrop {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: backdropFadeIn 0.2s ease forwards;
}
@keyframes backdropFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.animate-modal {
  animation: modalFadeIn 0.25s var(--ease-spring) forwards;
}

@keyframes drawerSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-drawer {
  animation: drawerSlideIn 0.28s var(--ease-spring) forwards;
}

/* ==========================================================================
   LIVE CLOCK — blink separator
   ========================================================================== */
@keyframes clockBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.3; }
}
.clock-sep {
  animation: clockBlink 1s step-end infinite;
}

/* ==========================================================================
   FOOTER GRADIENT BORDER TOP
   ========================================================================== */
footer {
  position: relative;
}
footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(113,113,122,0.4), transparent);
}

/* ==========================================================================
   REDACTED TEXT
   ========================================================================== */
.redacted {
  background: #18181b;
  color: transparent;
  user-select: none;
  border-radius: 3px;
  padding: 0 4px;
  display: inline-block;
  letter-spacing: 2px;
}
.dark .redacted { background: #27272a; }

/* ==========================================================================
   TOAST
   ========================================================================== */
#toast {
  transition: transform 0.3s var(--ease-spring), opacity 0.25s ease;
}

/* ==========================================================================
   LAMP / LIGHT SWITCH THEME TRANSITION ANIMATION
   ========================================================================== */
#lamp-beam {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#lamp-beam.lamp-active-light {
  background: radial-gradient(circle at var(--lamp-x, 50%) var(--lamp-y, 50%), rgba(255, 255, 255, 0.98) 0%, rgba(250, 250, 250, 0.8) 50%, transparent 85%);
  animation: lampFlashLight 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#lamp-beam.lamp-active-dark {
  background: radial-gradient(circle at var(--lamp-x, 50%) var(--lamp-y, 50%), rgba(9, 9, 11, 0.98) 0%, rgba(18, 18, 23, 0.85) 50%, transparent 85%);
  animation: lampFlashDark 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes lampFlashLight {
  0% {
    clip-path: circle(0px at var(--lamp-x, 50%) var(--lamp-y, 50%));
    opacity: 0.95;
  }
  50% {
    clip-path: circle(160vmax at var(--lamp-x, 50%) var(--lamp-y, 50%));
    opacity: 0.7;
  }
  100% {
    clip-path: circle(240vmax at var(--lamp-x, 50%) var(--lamp-y, 50%));
    opacity: 0;
  }
}

@keyframes lampFlashDark {
  0% {
    clip-path: circle(0px at var(--lamp-x, 50%) var(--lamp-y, 50%));
    opacity: 0.95;
  }
  50% {
    clip-path: circle(160vmax at var(--lamp-x, 50%) var(--lamp-y, 50%));
    opacity: 0.8;
  }
  100% {
    clip-path: circle(240vmax at var(--lamp-x, 50%) var(--lamp-y, 50%));
    opacity: 0;
  }
}

/* Theme Toggle Button Spin & Glow */
#theme-toggle {
  position: relative;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
#theme-toggle:hover {
  transform: rotate(20deg) scale(1.1);
}
#theme-toggle.toggling {
  transform: rotate(360deg) scale(1.2);
}

/* Proof Image Preview Container */
.proof-img-container {
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s ease;
}
.proof-img-container:hover {
  transform: scale(1.015);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   INFINITE MARQUEE SCROLL — Technical Stack
   ========================================================================== */
.stack-marquee-container {
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

@keyframes marqueeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes marqueeScrollReverse {
  0%   { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.animate-marquee {
  animation: marqueeScroll 30s linear infinite;
  width: max-content;
}

.animate-marquee-reverse {
  animation: marqueeScrollReverse 35s linear infinite;
  width: max-content;
}

/* Pause marquee on hover */
.stack-marquee-container:hover .animate-marquee,
.stack-marquee-container:hover .animate-marquee-reverse {
  animation-play-state: paused;
}

/* Stack Chip Pill — individual tech badge */
.stack-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid rgba(228, 228, 231, 0.7);
  background: rgba(250, 250, 250, 0.7);
  color: #3f3f46;
  backdrop-filter: blur(8px);
  transition: all 0.25s var(--ease-spring);
  cursor: default;
}

.dark .stack-chip {
  border-color: rgba(63, 63, 70, 0.6);
  background: rgba(24, 24, 27, 0.6);
  color: #d4d4d8;
}

.stack-chip:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  border-color: rgba(16, 185, 129, 0.4);
}

.dark .stack-chip:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   HALL OF FAME — Staggered Entry Animation
   ========================================================================== */
@keyframes hofCardReveal {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hof-card {
  opacity: 0;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease, border-color 0.3s ease;
}

.hof-card.hof-visible {
  animation: hofCardReveal 0.6s var(--ease-spring) forwards;
}

/* Stagger delays via nth-child */
.hof-card:nth-child(1).hof-visible { animation-delay: 0ms; }
.hof-card:nth-child(2).hof-visible { animation-delay: 80ms; }
.hof-card:nth-child(3).hof-visible { animation-delay: 160ms; }
.hof-card:nth-child(4).hof-visible { animation-delay: 240ms; }
.hof-card:nth-child(5).hof-visible { animation-delay: 320ms; }
.hof-card:nth-child(6).hof-visible { animation-delay: 400ms; }
.hof-card:nth-child(7).hof-visible { animation-delay: 480ms; }
.hof-card:nth-child(8).hof-visible { animation-delay: 560ms; }

/* Hall of Fame Card Hover Effects */
.hof-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(16, 185, 129, 0.15);
}

.dark .hof-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(16, 185, 129, 0.2);
}

/* Subtle shimmer on HOF cards */
@keyframes hofShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.hof-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 30%, rgba(16, 185, 129, 0.04) 50%, transparent 70%);
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.hof-card:hover::before {
  opacity: 1;
  animation: hofShimmer 2s ease-in-out infinite;
}

/* ==========================================================================
   TIMELINE ENTRIES & SOCIAL LINKS
   ========================================================================== */

/* LinkedIn & Instagram icon branded colors on hover */
.social-link[aria-label="LinkedIn"]:hover {
  color: #0A66C2 !important;
}
.social-link[aria-label="Instagram"]:hover {
  color: #E4405F !important;
}
.social-link[aria-label="GitHub"]:hover {
  color: #333 !important;
}
.dark .social-link[aria-label="GitHub"]:hover {
  color: #f0f0f0 !important;
}
