/* ================================================================
   TOKENS - DISCORD PREMIUM PORTFOLIO
================================================================ */
:root {
  /* Discord-inspired palette - REVERTED */
  --blurple:     #5865F2;
  --blurple-dark:#4752C4;
  --blurple-glow:rgba(88,101,242,.35);

  --bg:      #0b0c10;
  --bg2:     #0e1016;
  --surface: #111318;
  --card:    #16191f;
  --card2:   #1c2028;
  --border:  rgba(255,255,255,.07);
  --border2: rgba(88,101,242,.18);

  --purple:  #9b59b6;
  --indigo:  #7289da;
  --cyan:    #00d4ff;
  --green:   #57F287;
  --yellow:  #FEE75C;
  --pink:    #eb459e;

  --text:      #dcddde;
  --text-2:    #b9bbbe;
  --text-dim:  #b9bbbe; /* Alias for text-2 */
  --text-muted:#72767d;

  --font: 'Outfit', sans-serif;
  --serif: 'Outfit', sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-full: 9999px;

  --accent: var(--blurple);
  --accent-glow: var(--blurple-glow);
  --border-rich: rgba(255,255,255,.15);

  --nav-h: 62px;
}

/* ================================================================
   RESET & BASE
================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ================================================================
   GRAIN & AMBIENT BACKGROUND
================================================================ */
#particles-canvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; opacity: 0.3;
  mix-blend-mode: screen;
}

.noise-overlay {
  display: none;
}

.ambient-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(circle at 10% 10%, rgba(88,101,242,.05) 0%, transparent 50%);
}

/* ================================================================
   NAVBAR
================================================================ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: all 0.4s ease;
}
.navbar.scrolled { padding: 5px 0; background: rgba(5, 5, 5, 0.9); }

.nav-inner {
  max-width: 1200px; margin: 0 auto;
  height: 100%; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--font);
  font-size: 1.4rem; font-weight: 800;
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -0.5px;
}
.nav-logo span { color: var(--blurple); }
.nav-avt {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border-rich);
}
.nav-links { display: flex; gap: 8px; }
.nav-link {
  font-size: 13px; font-weight: 500; color: var(--text-dim);
  padding: 8px 16px; border-radius: var(--r-full);
  transition: all 0.3s ease;
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }

/* ================================================================
   HERO SECTION
================================================================ */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: var(--nav-h) 32px 100px;
  z-index: 2;
}
.hero-inner {
  max-width: 1100px; width: 100%;
  display: flex; align-items: center; gap: 80px;
}

/* ========================================================
   DISCORD-STYLE AVATAR DECORATION - RESTORED
======================================================== */
.avatar-wrap {
  flex-shrink: 0;
  position: relative;
  width: 220px; height: 220px;
  display: flex;
  align-items: center; justify-content: center;
}

/* ── Ornate Discord Nitro frame ── */
.avt-frame {
  position: relative; z-index: 3;
  width: 180px; height: 180px;
  border-radius: 50%;
  /* No padding to keep image size precise */
  background: linear-gradient(
    135deg,
    #5865F2 0%,
    #9b59b6 25%,
    #00d4ff 50%,
    #eb459e 75%,
    #5865F2 100%
  );
  box-shadow:
    0 0 0 1px rgba(88,101,242,.3),
    0 0 20px rgba(88,101,242,.3),
    inset 0 0 0 1px rgba(255,255,255,.05);
  animation: frameBreath 3.5s ease-in-out infinite;
}
@keyframes frameBreath {
  0%,100% { box-shadow: 0 0 0 1px rgba(88,101,242,.3), 0 0 20px rgba(88,101,242,.3), inset 0 0 0 1px rgba(255,255,255,.05); }
  50%     { box-shadow: 0 0 0 2px rgba(88,101,242,.5), 0 0 40px rgba(88,101,242,.5), inset 0 0 0 1px rgba(255,255,255,.08); }
}

.avatar {
  position: absolute;
  top: 5px; left: 5px;
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  aspect-ratio: 1/1; /* Lock aspect ratio */
  border-radius: 50%;
  object-fit: cover;
  display: block;
  z-index: 2;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.4);
}

.avt-decor-overlay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 252px; height: 252px;
  z-index: 10;
  pointer-events: none;
  user-select: none;
  image-rendering: auto;
  animation: decorFadeIn .6s ease both;
}
@keyframes decorFadeIn { from { opacity: 0; } to { opacity: 1; } }

.has-decor .sparkle  { opacity: .25; }
.has-decor .orb      { opacity: .2; }
.has-decor .frame-gem { opacity: .3; }
.has-decor .frame-line { opacity: .2; }

/* ── Corner gems ── */
.frame-gem {
  position: absolute; z-index: 4;
  width: 14px; height: 14px; border-radius: 50%;
  animation: gemPulse 2.5s ease-in-out infinite;
}
.gem-tl { top: 6px; left: 6px; background: radial-gradient(circle, #fff 20%, #5865F2); box-shadow: 0 0 8px #5865F2, 0 0 2px #fff; animation-delay: 0s; }
.gem-tr { top: 6px; right: 6px; background: radial-gradient(circle, #fff 20%, #9b59b6); box-shadow: 0 0 8px #9b59b6, 0 0 2px #fff; animation-delay: -.6s; }
.gem-bl { bottom: 6px; left: 6px; background: radial-gradient(circle, #fff 20%, #00d4ff); box-shadow: 0 0 8px #00d4ff, 0 0 2px #fff; animation-delay: -1.2s; }
.gem-br { bottom: 6px; right: 6px; background: radial-gradient(circle, #fff 20%, #eb459e); box-shadow: 0 0 8px #eb459e, 0 0 2px #fff; animation-delay: -1.8s; }
@keyframes gemPulse { 0%,100% { opacity:.85; transform:scale(1); } 50% { opacity: 1; transform:scale(1.3); } }

/* ── Frame accent lines ── */
.frame-line { position: absolute; z-index: 4; border-radius: var(--r-full); animation: lineFade 3s ease-in-out infinite; }
.fl-top    { top:-2px; left:30%; width:40%; height:2px; background: linear-gradient(90deg,transparent,#fff,transparent); }
.fl-bottom { bottom:-2px; left:30%; width:40%; height:2px; background: linear-gradient(90deg,transparent,#5865F2,transparent); }
.fl-left   { left:-2px; top:30%; height:40%; width:2px; background: linear-gradient(180deg,transparent,#9b59b6,transparent); animation-delay:-1s; }
.fl-right  { right:-2px; top:30%; height:40%; width:2px; background: linear-gradient(180deg,transparent,#00d4ff,transparent); animation-delay:-2s; }
@keyframes lineFade { 0%,100% { opacity:.5; } 50% { opacity: 1; } }

/* ── Sparkle particles ── */
.sparkle {
  position: absolute; z-index: 5;
  font-size: 14px; line-height: 1;
  pointer-events: none; user-select: none;
  animation: sparkleAnim 3s ease-in-out infinite;
}
.sp-1 { top: -8px; left: 44%; color:#fff; font-size:12px; animation-delay: 0s; animation-duration:2.8s; }
.sp-2 { top: 20px; right:-12px; color:#5865F2; font-size:16px; animation-delay:-.7s; animation-duration:3.2s; }
.sp-3 { bottom:20px; right:-14px; color:#9b59b6; font-size:11px; animation-delay:-1.4s; animation-duration:2.5s; }
.sp-4 { bottom:-4px; left: 48%; color:#00d4ff; font-size:14px; animation-delay:-2.1s; animation-duration:3.6s; }
.sp-5 { bottom:22px; left: -14px; color:#eb459e; font-size:10px; animation-delay: -.4s; animation-duration:2.9s; }
.sp-6 { top: 22px; left: -12px; color:#FEE75C; font-size:13px; animation-delay:-1.1s; animation-duration:3.4s; }
.sp-7 { top: 52%; right:-20px; color:#fff; font-size: 9px; animation-delay:-1.8s; animation-duration:2.6s; }
.sp-8 { top: 52%; left: -20px; color:#57F287; font-size:10px; animation-delay:-2.5s; animation-duration:3.1s; }
@keyframes sparkleAnim { 0% { opacity:0; transform:scale(.4) rotate(0deg); } 30% { opacity:1; transform:scale(1.2) rotate(20deg); } 60% { opacity:.75; transform:scale(.9) rotate(-10deg); } 100% { opacity:0; transform:scale(.4) rotate(30deg); } }

/* ── Floating orbs ── */
.orb { position: absolute; border-radius: 50%; pointer-events: none; z-index: 2; animation: orbFloat 6s ease-in-out infinite; }
.orb-1 { width:8px; height:8px; background: radial-gradient(circle,#5865F2,transparent); box-shadow: 0 0 10px #5865F2; top:-20px; left:25%; animation-delay:0s; animation-duration:5s; }
.orb-2 { width:6px; height:6px; background: radial-gradient(circle,#eb459e,transparent); box-shadow: 0 0 8px #eb459e; bottom:-18px; right:28%; animation-delay:-2s; animation-duration:6s; }
.orb-3 { width:5px; height:5px; background: radial-gradient(circle,#00d4ff,transparent); box-shadow: 0 0 8px #00d4ff; top:45%; right:-25px; animation-delay:-3.5s; animation-duration:4.5s; }
@keyframes orbFloat { 0%,100% { transform:translateY(0) scale(1); opacity:.8; } 50% { transform:translateY(-16px) scale(1.4); opacity:1; } }

/* Status Badge */
.status-badge {
  position: absolute; bottom: -36px; left: 50%;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(87,242,135,.08);
  border: 1px solid rgba(87,242,135,.22);
  color: var(--green);
  font-size: 12px; font-weight: 600;
  padding: 5px 14px; border-radius: 999px;
  white-space: nowrap; letter-spacing: .4px;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: dotBlink 2s ease-in-out infinite; }
@keyframes dotBlink { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.7)} }

/* --- Hero Text --- */
.hero-text { flex: 1; }

.label-row { display: flex; gap: 8px; margin-bottom: 24px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 5px 14px;
  border-radius: var(--r-full); letter-spacing: .3px;
  border: 1px solid var(--border);
}
.badge-mc      { background:rgba(88,101,242,.14); border:1px solid rgba(88,101,242,.28); color:#a5b4fc; }
.badge-folia   { background:rgba(87,242,135,.1);  border:1px solid rgba(87,242,135,.2);  color:var(--green); }
.badge-discord { background:rgba(114,137,218,.12);border:1px solid rgba(114,137,218,.25);color:#93c5fd; }

.hero-name {
  font-size: clamp(2.2rem,5.5vw,3.8rem);
  font-weight: 900; line-height: 1.1; letter-spacing: -2px;
  color: #fff; margin-bottom: 22px;
  font-family: var(--font);
}
.gradient-text {
  background: linear-gradient(135deg, #7289da 0%, #9b59b6 40%, #eb459e 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.name-dot { color: var(--blurple); }

/* Typewriter - Subtle */
.typewriter-wrap {
  font-family: var(--mono); font-size: 13px; color: var(--text-muted);
  margin-bottom: 32px; display: flex; align-items: center;
  min-height: 20px; /* Prevent layout shift */
}
.tw-prefix { color: var(--blurple); margin-right: 8px; }

/* Lyrics widget */
.lyrics-widget {
  max-width: 520px;
  margin-bottom: 30px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

/* Header bar */
.lyrics-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(88,101,242,.1);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.lyrics-icon { font-size: 1.1rem; flex-shrink: 0; }
.lyrics-meta { flex: 1; display: flex; align-items: baseline; gap: 6px; overflow: hidden; }
.lyrics-title {
  font-size: 13px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lyrics-artist { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* Animated equalizer bars */
.lyrics-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  flex-shrink: 0;
}
.lyrics-bars span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: var(--blurple);
  animation: eqBar 1.1s ease-in-out infinite;
}
.lyrics-bars span:nth-child(1) { height: 60%; animation-delay: 0s;    animation-duration: 1.0s; }
.lyrics-bars span:nth-child(2) { height: 100%;animation-delay: -.25s; animation-duration: 0.85s; }
.lyrics-bars span:nth-child(3) { height: 70%; animation-delay: -.5s;  animation-duration: 1.2s; }
.lyrics-bars span:nth-child(4) { height: 45%; animation-delay: -.75s; animation-duration: 0.9s; }
@keyframes eqBar {
  0%,100% { transform: scaleY(1);   opacity: .8; }
  50%     { transform: scaleY(.35); opacity: 1;  }
}

/* Lyrics stage – clipping window showing ~4 lines */
.lyrics-stage {
  height: 100px;
  overflow: hidden;
  position: relative;
  padding: 0 16px;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 82%, transparent 100%);
}

/* Track scrolls upward continuously */
.lyrics-track {
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: lyricsScroll 80s linear infinite;
}
.lyrics-track p {
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .4s;
  padding: 1px 0;
}
.lyrics-track p:nth-child(3n+1) { color: var(--text); font-weight: 500; }

@keyframes lyricsScroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-100%); }
}

.lyrics-widget:hover .lyrics-track { animation-play-state: paused; }

.section-header { text-align:center; margin-bottom:48px; }
.section-eyebrow { font-family:var(--mono); font-size:12px; color:var(--blurple); margin-bottom:10px; letter-spacing:1.2px; }
.section-title { font-size:clamp(1.7rem,4vw,2.5rem); font-weight:800; color:#fff; line-height:1.2; }
.section-title span,
.title-accent {
  background: linear-gradient(135deg, var(--blurple), #9b59b6);
  -webkit-background-clip:text; 
  background-clip:text; 
  -webkit-text-fill-color:transparent;
}
.section-sub { font-size:.93rem; color:var(--text-muted); margin-top:12px; max-width:520px; margin-left:auto;margin-right:auto; }

/* Projects Grid */
.projects-grid {
  display:grid; grid-template-columns:repeat(3,1fr); gap:16px;
}
.proj-card {
  background:var(--card); border:1px solid var(--border);
  border-radius:var(--r-lg); padding:24px;
  display:flex; flex-direction:column; gap:16px;
  position:relative; overflow:hidden;
  transition: transform .22s, border-color .22s, box-shadow .22s;
}
.proj-card:hover { transform:translateY(-4px); border-color:rgba(88,101,242,.28); box-shadow:0 8px 32px rgba(0,0,0,.35); }

.proj-icon { font-size: 2rem; margin-bottom: 8px; }
.proj-name { font-size: 1.1rem; font-weight: 600; color: #fff; }
.proj-desc { font-size: 14px; color: var(--text-dim); line-height: 1.6; flex: 1; }

.proj-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 10px; font-weight: 500; background: rgba(255,255,255,0.03);
  padding: 3px 10px; border-radius: var(--r-full); border: 1px solid var(--border);
}

/* Filter tabs */
.filter-tabs {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 10px; margin-bottom: 40px;
}
.filter-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 20px; border-radius: var(--r-full);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease;
}
.filter-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
.filter-btn.active { background: var(--blurple); color: #fff; border-color: var(--blurple); box-shadow: 0 4px 15px var(--blurple-glow); }

.proj-count {
  text-align: center; margin-top: 40px;
  font-size: 13px; color: var(--text-muted); opacity: 0.8;
}
.proj-count strong { color: #fff; font-weight: 700; }

/* Stats - Minimal */
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; margin-bottom: 100px; }
.stat-card { text-align: center; padding: 20px; }
.stat-num {
  font-family: var(--font); font-size: 2.8rem; line-height: 1; font-weight: 800;
  background: linear-gradient(to bottom, #fff, var(--text-muted));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); margin-top: 8px; font-weight: 600; letter-spacing: 0.5px; }

/* ================================================================
   SKILLS SECTION
================================================================ */
.skills-section { padding-bottom: 100px; }
.skills-layout {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px;
}
.skill-group-title {
  font-size: 14px; color: var(--blurple); margin-bottom: 24px;
  font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px;
}
.skill-list { display: flex; flex-direction: column; gap: 18px; }

.skill-row { display: grid; grid-template-columns: 24px 1fr 40px; align-items: center; gap: 12px; }
.sk-icon { font-size: 16px; }
.sk-name { font-size: 14px; font-weight: 600; color: #fff; }
.sk-num { font-size: 12px; color: var(--text-muted); text-align: right; }

.sk-bar {
  grid-column: 2 / 3;
  width: 100%; height: 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px; overflow: hidden;
}
.sk-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--blurple), #9b59b6);
  border-radius: 3px;
  transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.sk-fill.animated { width: var(--pct); }

/* ================================================================
   CONTACT CARD
================================================================ */
.contact-section { padding: 120px 0 80px; }
.contact-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 80px 40px; text-align: center;
  position: relative; overflow: hidden;
  background: radial-gradient(circle at top right, rgba(88,101,242,.08), transparent 40%);
}
.contact-title { 
  font-size: clamp(2rem, 5vw, 3.2rem); 
  font-weight: 800; 
  margin-bottom: 16px; 
}
.contact-title span {
  background: linear-gradient(135deg, var(--blurple), #9b59b6);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.contact-sub { font-size: 0.95rem; color: var(--text-muted); max-width: 500px; margin: 0 auto 40px; }

.contact-btns { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

.btn-primary, .btn-ghost {
  padding: 14px 32px; border-radius: var(--r-full); 
  font-weight: 700; font-size: 14px; transition: all 0.3s ease;
  display: inline-flex; align-items: center; gap: 10px;
}
.btn-primary { background: #fff; color: #000; }
.btn-primary:hover { transform: translateY(-4px); box-shadow: 0 10px 25px rgba(255,255,255,0.15); }

.btn-ghost { border: 1px solid var(--border); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,0.05); border-color: #fff; }
.btn-ghost svg { width: 18px; height: 18px; }

/* ================================================================
   FOOTER
================================================================ */
.footer {
  padding: 80px 0 40px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 32px;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.footer-logo {
  font-size: 1.5rem; font-weight: 800; display: flex; align-items: center; gap: 12px;
}
.footer-avt { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--border-rich); }
.footer-copy { font-size: 13px; color: var(--text-muted); }
.footer-copy strong { color: #fff; }
.footer-sub { font-size: 11px; color: var(--text-muted); opacity: 0.6; }

/* ================================================================
   ANIMATIONS & REVEAL
================================================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 1024px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .skills-layout { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .hero-inner { flex-direction: column; text-align: center; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-layout { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero-inner { gap: 40px; }
  .label-row, .typewriter-wrap, .contact-btns { justify-content: center; }
  .contact-title { font-size: 2.2rem; }
}
