/* ============================================================
   CSS CUSTOM PROPERTIES
============================================================ */
:root {
  --bg:        #0a0a0f;
  --bg2:       #0d0d15;
  --bg3:       #111120;
  --accent:    #00ffe0;
  --accent2:   #00c8b0;
  --accent3:   #005f55;
  --dim:       #1a1a2e;
  --border:    rgba(0,255,224,0.15);
  --text:      #c8d6e5;
  --text-dim:  #6b7fa3;
  --glass:     rgba(13,13,21,0.7);
  --glow:      0 0 12px rgba(0,255,224,0.35), 0 0 40px rgba(0,255,224,0.10);
  --glow-sm:   0 0 6px rgba(0,255,224,0.5);
  --mono:      'Share Tech Mono', monospace;
  --sans:      'Inter', sans-serif;
  --radius:    8px;
  --tr:        0.3s cubic-bezier(.4,0,.2,1);
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: crosshair;
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
}

a { color: var(--accent); text-decoration: none; transition: color var(--tr); }
a:hover { color: #fff; }

section { padding: 100px 0; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
  opacity: 0.8;
}

.section-title {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: #fff;
  margin-bottom: 48px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--accent);
  box-shadow: var(--glow-sm);
}

/* ============================================================
   SCROLLBAR
============================================================ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent3); border-radius: 4px; }

/* ============================================================
   INTERSECTION OBSERVER ANIMATIONS
============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }

.reveal-left {
  opacity: 0;
  transform: translateX(-48px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-left.visible { opacity: 1; transform: none; }

.reveal-fade {
  opacity: 0;
  transition: opacity 0.8s ease;
}
.reveal-fade.visible { opacity: 1; }

/* ============================================================
   NAV
============================================================ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--mono);
  font-size: 1.2rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-shadow: var(--glow-sm);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color var(--tr), text-shadow var(--tr);
}

.nav-links a:hover {
  color: var(--accent);
  text-shadow: var(--glow-sm);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav-hamburger span {
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: all 0.3s ease;
  display: block;
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    background: rgba(10,10,15,0.97);
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-hamburger { display: flex; }
}

/* ============================================================
   HERO
============================================================ */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding-top: 80px;
}

/* Animated grid background */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,255,224,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,224,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center center;
  animation: gridShift 20s linear infinite;
  pointer-events: none;
}

@keyframes gridShift {
  0%   { background-position: 0 0; }
  100% { background-position: 48px 48px; }
}

/* Scanline overlay */
.hero-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.08) 3px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
}

/* Radial glow center */
.hero-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,255,224,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 2; }

.hero-tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.6s 0.3s ease forwards;
}

.hero-title {
  font-family: var(--mono);
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  color: #fff;
  line-height: 1.05;
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.7s 0.5s ease forwards;
}

.glitch {
  position: relative;
  display: inline-block;
  color: #fff;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  overflow: hidden;
}

.glitch::before {
  color: var(--accent);
  animation: glitch1 3.5s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  left: -2px;
}

.glitch::after {
  color: #ff0066;
  animation: glitch2 3.5s infinite;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  left: 2px;
}

@keyframes glitch1 {
  0%, 90%, 100% { transform: none; opacity: 0; }
  92% { transform: translate(-3px, 1px) skewX(-2deg); opacity: 1; }
  94% { transform: translate(3px, -1px) skewX(1deg); opacity: 0.8; }
  96% { transform: none; opacity: 0; }
}

@keyframes glitch2 {
  0%, 88%, 100% { transform: none; opacity: 0; }
  90% { transform: translate(3px, 2px) skewX(1deg); opacity: 1; }
  93% { transform: translate(-2px, -1px); opacity: 0.6; }
  95% { transform: none; opacity: 0; }
}

.hero-subtitle {
  font-family: var(--mono);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-bottom: 40px;
  min-height: 1.5em;
  opacity: 0;
  animation: fadeUp 0.7s 0.9s ease forwards;
}

.cursor-blink {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: middle;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.7s 1.2s ease forwards;
}

.btn {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: all var(--tr);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: var(--glow);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
}

.btn-outline:hover {
  background: rgba(0,255,224,0.08);
  box-shadow: var(--glow);
  color: #fff;
}

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: scrollPulse 2s ease-in-out infinite;
  opacity: 0.6;
}

.scroll-indicator span {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
}

@keyframes scrollPulse {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
  50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   DISCORD SECTION
============================================================ */
#discord { background: var(--bg2); }

.discord-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  position: relative;
  overflow: hidden;
}

.discord-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.discord-banner {
  height: 80px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(135deg, #0d2233 0%, #001a14 50%, #0d0d1a 100%);
  margin: -32px -32px 0 -32px;
  position: relative;
  overflow: hidden;
}

.discord-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(0,255,224,0.03) 0px,
    rgba(0,255,224,0.03) 1px,
    transparent 1px,
    transparent 12px
  );
}

.discord-avatar-wrap {
  position: relative;
  margin-top: -28px;
  margin-bottom: 12px;
  display: inline-block;
}

.discord-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid var(--bg2);
  background: var(--dim);
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}

.discord-avatar-fallback {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid var(--bg2);
  background: linear-gradient(135deg, var(--accent3), #001a14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 1.4rem;
  color: var(--accent);
  font-weight: bold;
  position: relative;
  z-index: 1;
}

.discord-status-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--bg2);
  position: absolute;
  bottom: 2px;
  right: 2px;
  z-index: 2;
}

.discord-status-dot.online {
  background: #23a55a;
  box-shadow: 0 0 8px rgba(35,165,90,0.6);
  animation: statusPulse 2s ease-in-out infinite;
}

.discord-status-dot.dnd { background: #f23f43; }
.discord-status-dot.idle { background: #f0b232; }
.discord-status-dot.offline { background: #80848e; }

@keyframes statusPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(35,165,90,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(35,165,90,0); }
}

.discord-name {
  font-family: var(--mono);
  font-size: 1.25rem;
  color: #fff;
  font-weight: bold;
}

.discord-tag {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.discord-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.discord-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.discord-custom-status {
  font-size: 0.85rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.discord-activity {
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
}

.discord-activity-name {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 4px;
}

.discord-activity-detail {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.discord-elapsed {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent3);
  margin-top: 4px;
}

.discord-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.discord-text-side h2 { margin-bottom: 16px; }

.discord-text-side p {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .discord-layout { grid-template-columns: 1fr; }
}

/* ============================================================
   PERSONAL INFO
============================================================ */
#info { background: var(--bg); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.info-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color var(--tr), box-shadow var(--tr), transform var(--tr);
  position: relative;
  overflow: hidden;
}

.info-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--tr);
}

.info-card:hover {
  border-color: rgba(0,255,224,0.3);
  box-shadow: var(--glow);
  transform: translateY(-3px);
}

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

.info-icon {
  font-size: 1.4rem;
  margin-bottom: 12px;
  display: block;
}

.info-field {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.info-value {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 400;
}

/* ============================================================
   SKILLS
============================================================ */
#skills { background: var(--bg2); }

.skills-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
}

.skill-category-title {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.skill-category-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.skill-item {
  margin-bottom: 20px;
}

.skill-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.skill-name {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
}

.skill-pct {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.skill-bar-track {
  height: 4px;
  background: var(--dim);
  border-radius: 99px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent3), var(--accent));
  border-radius: 99px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(0,255,224,0.5);
  position: relative;
}

.skill-bar-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 4px;
  background: #fff;
  border-radius: 99px;
  opacity: 0.8;
  box-shadow: 0 0 6px var(--accent);
}

/* ============================================================
   MUSIC PLAYER
============================================================ */
#music-player {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  width: 280px;
  background: rgba(10,10,20,0.92);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  transition: all 0.4s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,255,224,0.05);
}

#music-player.collapsed {
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-collapse-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.7rem;
  font-family: var(--mono);
  padding: 2px 6px;
  border-radius: 4px;
  transition: color var(--tr);
}

.player-collapse-btn:hover { color: var(--accent); }

.player-icon-only {
  display: none;
  color: var(--accent);
  font-size: 1.2rem;
}

#music-player.collapsed .player-icon-only { display: flex; }
#music-player.collapsed .player-inner { display: none; }

.player-track-name {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: #fff;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 24px;
}

.player-artist {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 14px;
}

/* Visualizer */
.visualizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
  margin-bottom: 14px;
}

.viz-bar {
  flex: 1;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  opacity: 0.5;
  height: 4px;
  transition: height 0.1s;
}

#music-player.playing .viz-bar:nth-child(1) { animation: viz 0.8s ease-in-out infinite; }
#music-player.playing .viz-bar:nth-child(2) { animation: viz 0.6s 0.1s ease-in-out infinite; }
#music-player.playing .viz-bar:nth-child(3) { animation: viz 1.0s 0.05s ease-in-out infinite; }
#music-player.playing .viz-bar:nth-child(4) { animation: viz 0.7s 0.15s ease-in-out infinite; }
#music-player.playing .viz-bar:nth-child(5) { animation: viz 0.9s 0.08s ease-in-out infinite; }
#music-player.playing .viz-bar:nth-child(6) { animation: viz 0.55s 0.2s ease-in-out infinite; }
#music-player.playing .viz-bar:nth-child(7) { animation: viz 0.75s 0.12s ease-in-out infinite; }
#music-player.playing .viz-bar:nth-child(8) { animation: viz 1.1s 0.03s ease-in-out infinite; }

@keyframes viz {
  0%,100% { height: 4px; opacity: 0.4; }
  50% { height: 24px; opacity: 1; }
}

.player-progress {
  height: 3px;
  background: var(--dim);
  border-radius: 99px;
  margin-bottom: 12px;
  cursor: pointer;
  position: relative;
}

.player-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width 1s linear;
  box-shadow: var(--glow-sm);
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  border-radius: 50%;
  transition: color var(--tr), background var(--tr);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.ctrl-btn.play-btn {
  background: var(--accent);
  color: var(--bg);
  font-size: 0.9rem;
}

.ctrl-btn:hover { color: var(--accent); background: rgba(0,255,224,0.1); }
.ctrl-btn.play-btn:hover { background: var(--accent2); color: var(--bg); }

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.volume-wrap button {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  transition: color var(--tr);
  display: flex;
}

.volume-wrap button:hover { color: var(--accent); }

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 60px;
  height: 3px;
  background: var(--dim);
  border-radius: 99px;
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: var(--glow-sm);
}

@media (max-width: 640px) {
  #music-player { bottom: 16px; right: 16px; width: 240px; }
  #music-player.collapsed { width: 48px; height: 48px; }
}

/* ============================================================
   FOOTER
============================================================ */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 48px 24px;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  transition: color var(--tr), text-shadow var(--tr);
}

.footer-link:hover {
  color: var(--accent);
  text-shadow: var(--glow-sm);
}

.footer-icon {
  font-size: 1.1rem;
}

.footer-copy {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  opacity: 0.6;
}

/* ============================================================
   PARALLAX MOUSE EFFECT (hero grid)
============================================================ */
.hero-grid { will-change: transform; }

/* ============================================================
   LOADING INDICATOR FOR API
============================================================ */
.api-loading {
  opacity: 0.5;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}