/* NeruDev portfolio — custom styles (Tailwind handles the rest) */

html { color-scheme: light dark; }
html.dark { color-scheme: dark; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  font-family: 'Quicksand', sans-serif;
  overflow-x: hidden;
  transition: background-color .35s ease, color .35s ease;
}

.font-display { font-family: 'Baloo 2', sans-serif; }

/* Frosted panels */
.glass {
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.dark .glass { background: rgba(15, 23, 42, .78); }

.candy-text {
  background: linear-gradient(92deg, #0284C7 0%, #4F46E5 55%, #DB2777 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dark .candy-text {
  background: linear-gradient(92deg, #7DD3FC 0%, #A5B4FC 55%, #F9A8D4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.candy-btn {
  background: linear-gradient(135deg, #0EA5E9 0%, #6366F1 60%, #EC4899 100%);
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}
.candy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -12px rgba(14, 165, 233, .6);
  filter: saturate(1.12);
}
.candy-btn:active { transform: translateY(0) scale(.98); }

/* 3D tilt cards */
.card-tilt {
  transform-style: preserve-3d;
  transition: transform .25s ease, box-shadow .25s ease;
  will-change: transform;
}

/* Scroll reveal (stronger: rise + scale + de-blur) */
.reveal {
  opacity: 0;
  transform: translateY(34px) scale(.985);
}
.reveal.visible { opacity: 1; transform: none; }

/* Floating (ambient loop used by badges + profile photo) */
.animate-float { animation: float 6s ease-in-out infinite; }
.animate-float-slow { animation: float 9s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* Glare that follows the mouse on tilted cards */
.tilt-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .35), transparent 45%);
  z-index: 5;
}
.card-tilt:hover .tilt-glare { opacity: 1; }

/* Custom cursor ring (desktop, fine pointers only) */
#cursor-dot, #cursor-ring { position: fixed; left: -100px; top: -100px; pointer-events: none; z-index: 70; }
#cursor-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #0EA5E9; transform: translate(-50%, -50%);
}
#cursor-ring {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, .7);
  transform: translate(-50%, -50%);
  transition: width .25s ease, height .25s ease, border-color .25s ease, background .25s ease;
}
body.cursor-hover #cursor-ring {
  width: 54px; height: 54px;
  border-color: rgba(236, 72, 153, .85);
  background: rgba(236, 72, 153, .08);
}
@media (pointer: coarse) { #cursor-dot, #cursor-ring { display: none; } }

/* Backdrop grid */
.grid-bg {
  background-image:
    linear-gradient(rgba(125, 211, 252, .16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, .16) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 25%, black 55%, transparent 100%);
}
.dark .grid-bg {
  background-image:
    linear-gradient(rgba(56, 189, 248, .10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, .10) 1px, transparent 1px);
}

::selection { background: #BAE6FD; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(#7DD3FC, #F9A8D4); border-radius: 20px; }

/* Cursor glow follows the mouse (desktop only) */
#cursor-glow {
  position: fixed;
  left: -100px;
  top: -100px;
  width: 480px;
  height: 480px;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(125, 211, 252, .18) 0%, transparent 65%);
  transform: translate(-50%, -50%);
}
.dark #cursor-glow { background: radial-gradient(circle, rgba(99, 102, 241, .16) 0%, transparent 65%); }
@media (max-width: 768px) { #cursor-glow { display: none; } }

input, select, textarea { outline: none; }
input:focus, select:focus, textarea:focus {
  border-color: #38BDF8 !important;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .16);
}

/* Video players */
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0C4A6E;
  border-radius: 1rem;
  overflow: hidden;
}
.video-frame iframe,
.video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-swap { animation: videoIn .45s cubic-bezier(.22, 1, .36, 1); }
@keyframes videoIn {
  from { opacity: 0; transform: scale(.985) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Video tab thumbnails */
.vtab { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, opacity .2s ease; }
.vtab:hover { transform: translateY(-2px); }
.vtab:active { transform: translateY(0) scale(.98); }

/* About gradient panel */
.about-glow { background: linear-gradient(150deg, #0B3B5A 0%, #075985 45%, #4F46E5 80%, #DB2777 130%); }
.dark .about-glow { background: linear-gradient(150deg, #020617 0%, #0C2A4A 50%, #1E1B4B 80%, #3B0A2A 130%); }

/* FAQ accordion (native <details>, animated) */
.faq-item summary { list-style: none; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  line-height: 1;
  color: #0284C7;
  transition: transform .3s ease;
  flex-shrink: 0;
}
.dark .faq-item summary::after { color: #7DD3FC; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item { transition: border-color .3s ease, box-shadow .3s ease; }
.faq-item[open] { border-color: rgba(125, 211, 252, .8); box-shadow: 0 12px 32px -12px rgba(12, 74, 110, .18); }
.dark .faq-item[open] { border-color: rgba(56, 189, 248, .4); }
.faq-item .faq-body > div > p { opacity: 0; transform: translateY(-8px); transition: opacity .35s ease .05s, transform .35s cubic-bezier(.22, 1, .36, 1) .05s; }
.faq-item[open] .faq-body > div > p { opacity: 1; transform: translateY(0); }

/* Page-wipe transition between sections */
#page-wipe { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
#page-wipe span { position: absolute; inset: -10% -20%; transform: translateX(-110%) skewX(-8deg); }
#page-wipe span:first-child { background: linear-gradient(135deg, #0EA5E9 0%, #6366F1 55%, #EC4899 100%); }
#page-wipe span:last-child { background: #0B1220; }
#page-wipe.go span { animation: wipeSweep 1s cubic-bezier(.65, 0, .35, 1) forwards; }
#page-wipe.go span:last-child { animation-delay: .08s; }
@keyframes wipeSweep {
  0% { transform: translateX(-110%) skewX(-8deg); }
  45%, 55% { transform: translateX(0) skewX(-8deg); }
  100% { transform: translateX(110%) skewX(-8deg); }
}

/* Scrollspy active nav pill */
nav a.navlink.active { background: rgba(224, 242, 254, .95); color: #075985; box-shadow: inset 0 0 0 1px rgba(125, 211, 252, .5); }
.dark nav a.navlink.active { background: rgba(30, 41, 59, .95); color: #7DD3FC; box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .35); }

/* Snap carousel without visible scrollbars */
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.faq-item .faq-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .35s cubic-bezier(.22, 1, .36, 1);
}
.faq-item[open] .faq-body { grid-template-rows: 1fr; }
.faq-item .faq-body > div { overflow: hidden; }

/* Focus visibility for keyboard users */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(56, 189, 248, .6);
  outline-offset: 2px;
}

/* Reduced motion: honored by default, bypassed only when the user
   explicitly forces motion on via the nav toggle (.motion-on) */
@media (prefers-reduced-motion: reduce) {
  html:not(.motion-on) *, html:not(.motion-on) *::before, html:not(.motion-on) *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html:not(.motion-on) .reveal { opacity: 1; transform: none; filter: none; }
  html:not(.motion-on) .enter { opacity: 1; transform: none; }
  html:not(.motion-on) { scroll-behavior: auto; }
}

/* Staggered hero entrance (activated by .loaded on the root) */
.enter { opacity: 0; transform: translateY(26px); }
.loaded .enter {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .8s cubic-bezier(.22, 1, .36, 1), transform .8s cubic-bezier(.22, 1, .36, 1);
}
.loaded .enter-1 { transition-delay: .05s; }
.loaded .enter-2 { transition-delay: .15s; }
.loaded .enter-3 { transition-delay: .28s; }
.loaded .enter-4 { transition-delay: .4s; }
.loaded .enter-5 { transition-delay: .52s; }
.loaded .enter-6 { transition-delay: .62s; }

/* Rotating hero word */
.word-swap { display: inline-block; animation: wordIn .55s cubic-bezier(.22, 1, .36, 1); }
@keyframes wordIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Shimmering gradient text */
.candy-shine { background-size: 200% auto; animation: shine 7s linear infinite; }
@keyframes shine { to { background-position: 200% center; } }

/* Tech ticker */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  width: max-content;
  padding-right: 2.5rem;
  animation: marquee 28s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Shine sweep on primary buttons */
.btn-shine { position: relative; overflow: hidden; }
.btn-shine::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
  pointer-events: none;
}
.btn-shine:hover::after { left: 130%; }

/* Scroll progress bar */
#progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 60;
  background: linear-gradient(90deg, #7DD3FC, #818CF8, #F472B6);
  transform-origin: left;
  transform: scaleX(0);
}

/* Mobile menu pop */
.menu-pop { animation: menuIn .25s cubic-bezier(.22, 1, .36, 1); transform-origin: top; }
@keyframes menuIn {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Lenis smooth scroll */
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* Skip off-screen paint for heavy blocks */
.cv { content-visibility: auto; contain-intrinsic-size: auto 1000px; }

/* Loading screen */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  background: radial-gradient(1000px 620px at 50% 28%, #0C2A4A 0%, #020617 70%);
  transition: opacity .6s ease, visibility .6s ease;
}
#loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
#loader img { width: 96px; height: 96px; object-fit: contain; animation: loaderBounce 1s cubic-bezier(.28, .84, .42, 1) infinite; filter: drop-shadow(0 12px 24px rgba(56, 189, 248, .35)); }
@keyframes loaderBounce {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  30% { transform: translateY(-26px) scale(.94, 1.06); }
  55% { transform: translateY(0) scale(1.12, .88); }
  72% { transform: translateY(-8px) scale(.98, 1.02); }
}
.loader-title {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 30px;
  letter-spacing: .02em;
  background: linear-gradient(92deg, #7DD3FC 0%, #A5B4FC 55%, #F9A8D4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.loader-sub { color: rgba(186, 230, 253, .75); font-size: 13.5px; font-weight: 600; }
.loader-bar { width: 220px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .14); overflow: hidden; margin-top: 6px; }
.loader-bar span { display: block; height: 100%; width: 40%; border-radius: inherit; background: linear-gradient(90deg, #7DD3FC, #818CF8, #F472B6); animation: loaderSlide 1.2s ease-in-out infinite; }
@keyframes loaderSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(280%); }
}

/* RGB-split glitch burst on the rotating hero word (replays each swap) */
.glitch-burst { position: relative; display: inline-block; }
.glitch-burst::before, .glitch-burst::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: none;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.glitch-burst::before { color: #F472B6; animation: glitchA 2.6s infinite; }
.glitch-burst::after { color: #22D3EE; animation: glitchB 2.6s infinite; }
@keyframes glitchA {
  0% { opacity: 1; transform: translate(-5px, -2px); clip-path: inset(8% 0 58% 0); }
  4% { opacity: 1; transform: translate(5px, 1px); clip-path: inset(62% 0 4% 0); }
  8% { opacity: 1; transform: translate(-4px, 2px); clip-path: inset(28% 0 42% 0); }
  12%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 100% 0); }
}
@keyframes glitchB {
  0% { opacity: 1; transform: translate(5px, 2px); clip-path: inset(55% 0 12% 0); }
  5% { opacity: 1; transform: translate(-5px, -1px); clip-path: inset(12% 0 68% 0); }
  9% { opacity: 1; transform: translate(3px, -2px); clip-path: inset(38% 0 32% 0); }
  13%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 100% 0); }
}

/* Subtle glitch jitter on hover for section titles */
.glitch-hover:hover { animation: hoverGlitch .35s steps(2, end) 2; }
@keyframes hoverGlitch {
  0% { transform: translate(0); text-shadow: none; }
  25% { transform: translate(-2px, 1px) skewX(-2deg); text-shadow: 2px 0 #F472B6, -2px 0 #22D3EE; }
  50% { transform: translate(2px, -1px); text-shadow: -2px 0 #F472B6, 2px 0 #22D3EE; }
  75% { transform: translate(-1px, 0) skewX(1deg); text-shadow: 1px 0 #F472B6, -1px 0 #22D3EE; }
  100% { transform: none; text-shadow: none; }
}

/* Rimuru slime buddy */
.slime-buddy {
  background: none;
  border: 0;
  padding: 0;
  transform: rotate(var(--tilt, 0deg)) scaleX(var(--flip, 1));
  transition: transform .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.slime-buddy img {
  animation: slimeBob 2.6s ease-in-out infinite;
  pointer-events: none;
  user-select: none;
}
@keyframes slimeBob {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  50% { transform: translateY(-7px) scale(.97, 1.03); }
}
.slime-buddy.squish img { animation: slimeSquish .3s ease; }
@keyframes slimeSquish {
  0% { transform: scale(1, 1); }
  40% { transform: scale(1.18, .78); }
  100% { transform: scale(1, 1); }
}

/* Custom video player */
.ytb-host, .ytb-host iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ytb-track { touch-action: none; }
