/* ===========================================
   TANMAY — 3D PERSONAL SPACE
   Dark cyberpunk aesthetic with neon accents
   =========================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

*:focus {
  outline: none !important;
}

:root {
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --text-xs:   clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-hero: clamp(3rem, 0.5rem + 7vw, 6rem);

  /* Dark cyberpunk palette */
  --color-bg: #0a0a0f;
  --color-surface: #12121a;
  --color-surface-2: #1a1a26;
  --color-border: rgba(255, 255, 255, 0.06);
  --color-text: #e8e6f0;
  --color-text-muted: #8a88a0;
  --color-text-faint: #4a4860;

  /* Neon accents */
  --color-accent: #6e00ff;
  --color-accent-glow: rgba(110, 0, 255, 0.4);
  --color-cyan: #00f0ff;
  --color-cyan-glow: rgba(0, 240, 255, 0.3);
  --color-pink: #ff006e;
  --color-pink-glow: rgba(255, 0, 110, 0.3);

  /* Spotify, Steam, Discord */
  --color-spotify: #1DB954;
  --color-steam: #1b2838;
  --color-discord: #5865F2;

  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  --transition-fast: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============ Canvas Background ============ */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ============ Page Layout ============ */
.page-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 3vw, 2rem);
  gap: clamp(2rem, 4vw, 3rem);
}

/* ============ Hero Section ============ */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding-top: clamp(2rem, 8vw, 5rem);
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Avatar */
.avatar-container {
  position: relative;
  width: clamp(120px, 20vw, 160px);
  height: clamp(120px, 20vw, 160px);
}

.avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  border: 2px solid rgba(110, 0, 255, 0.5);
}

.avatar-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(110, 0, 255, 0.3);
  animation: rotateRing 8s linear infinite;
}

.avatar-ring::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-accent-glow), 0 0 16px var(--color-accent-glow);
}

.ring-2 {
  inset: -18px;
  border-color: rgba(0, 240, 255, 0.15);
  animation: rotateRing 12s linear infinite reverse;
}

.ring-2::before {
  background: var(--color-cyan);
  box-shadow: 0 0 8px var(--color-cyan-glow), 0 0 16px var(--color-cyan-glow);
}

@keyframes rotateRing {
  to { transform: rotate(360deg); }
}

.avatar-glow {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-accent-glow) 0%, transparent 70%);
  z-index: 0;
  filter: blur(20px);
  opacity: 0.5;
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

/* Hero Text */
.hero-text {
  text-align: center;
}

.glitch-text {
  font-family: var(--font-body);
  font-size: var(--text-hero);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text);
  position: relative;
  text-shadow: 0 0 40px var(--color-accent-glow);
}

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

.glitch-text::before {
  color: var(--color-cyan);
  animation: glitch-1 4s infinite linear;
}

.glitch-text::after {
  color: var(--color-pink);
  animation: glitch-2 4s infinite linear;
}

@keyframes glitch-1 {
  0%, 88%, 92%, 100% { opacity: 0; transform: none; }
  89% { opacity: 0.6; transform: translate(-2px, -1px); clip-path: inset(20% 0 40% 0); }
  91% { opacity: 0.6; transform: translate(2px, 1px); clip-path: inset(60% 0 10% 0); }
}

@keyframes glitch-2 {
  0%, 90%, 94%, 100% { opacity: 0; transform: none; }
  91% { opacity: 0.6; transform: translate(2px, 1px); clip-path: inset(30% 0 30% 0); }
  93% { opacity: 0.6; transform: translate(-1px, -2px); clip-path: inset(50% 0 20% 0); }
}

.tagline {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

.separator {
  color: var(--color-accent);
  margin: 0 0.25rem;
}

/* Status */
.status-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(110, 0, 255, 0.08);
  border: 1px solid rgba(110, 0, 255, 0.15);
  border-radius: var(--radius-full);
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
  opacity: 0;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #00ff88;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0, 255, 136, 0.6);
  animation: statusPulse 2s ease-in-out infinite;
}

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

.status-text {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ============ Social Grid ============ */
.social-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  width: 100%;
  max-width: 420px;
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
  opacity: 0;
}

.social-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: transform var(--transition-fast),
              border-color var(--transition-fast),
              box-shadow var(--transition-fast),
              background var(--transition-fast);
  cursor: pointer;
}

.social-card svg {
  width: 22px;
  height: 22px;
  color: var(--color-text-muted);
  transition: color var(--transition-fast), filter var(--transition-fast);
}

.social-card span {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  transition: color var(--transition-fast);
}

.social-card:hover {
  transform: translateY(-4px);
  border-color: rgba(110, 0, 255, 0.3);
  box-shadow: 0 8px 32px rgba(110, 0, 255, 0.15), 0 0 0 1px rgba(110, 0, 255, 0.1);
  background: var(--color-surface-2);
}

.social-card:hover svg {
  color: var(--color-accent);
  filter: drop-shadow(0 0 6px var(--color-accent-glow));
}

.social-card:hover span {
  color: var(--color-text);
}

.social-card:active {
  transform: translateY(-1px);
}

/* ============ Link Cards ============ */
.links-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 420px;
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
  opacity: 0;
}

.link-card {
  position: relative;
  display: block;
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.link-card-bg {
  position: absolute;
  inset: 0;
  opacity: 0.9;
  transition: opacity var(--transition-fast);
  z-index: 0;
}

.wave {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000000;
  border-radius: inherit;
  transform: translateX(-100%);
  z-index: 1;
  pointer-events: none;
}

.link-card:hover .wave {
  animation: waterWave 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.link-card-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  color: #fff;
  z-index: 2;
}

.link-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.link-card-content span {
  flex: 1;
  font-weight: 600;
  font-size: var(--text-base);
  letter-spacing: 0.02em;
}

.arrow-icon {
  width: 16px;
  height: 16px;
  opacity: 0.5;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.link-card:hover {
  transform: translateY(-3px) scale(1.01);
}

.link-card:hover .arrow-icon {
  transform: translate(2px, -2px);
  opacity: 1;
}

.link-card:active {
  transform: translateY(0) scale(0.99);
}

/* Spotify */
.spotify .link-card-bg {
  background: linear-gradient(135deg, #1DB954 0%, #148f3f 100%);
}
.spotify:hover {
  box-shadow: 0 8px 32px rgba(29, 185, 84, 0.3), 0 0 0 1px rgba(29, 185, 84, 0.2);
}

/* Steam */
.steam .link-card-bg {
  background: linear-gradient(135deg, #1b2838 0%, #2a475e 100%);
}
.steam:hover {
  box-shadow: 0 8px 32px rgba(42, 71, 94, 0.4), 0 0 0 1px rgba(42, 71, 94, 0.3);
}

/* Discord */
.discord .link-card-bg {
  background: linear-gradient(135deg, #5865F2 0%, #4752c4 100%);
}
.discord:hover {
  box-shadow: 0 8px 32px rgba(88, 101, 242, 0.3), 0 0 0 1px rgba(88, 101, 242, 0.2);
}

/* About Me Button */
.about-me-card {
  width: 100%;
  border: none;
  background: none;
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
}
.about-me-card .link-card-bg {
  background: linear-gradient(135deg, #c8a900 0%, #f5c800 100%);
}
.about-me-card .link-card-content {
  color: #1a1200;
}
.about-me-card .link-icon {
  color: #1a1200;
}
.about-me-card .arrow-icon {
  color: #1a1200;
  opacity: 0.6;
}
.about-me-card:hover .wave {
  animation: waterWave 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.about-me-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 32px rgba(200, 169, 0, 0.35), 0 0 0 1px rgba(200, 169, 0, 0.2);
}
.about-me-card .wave {
  background: linear-gradient(90deg, #1a1200 0%, #f5c800 100%);
}
.about-me-card .link-card-content span {
  color: #1a1200;
  font-weight: 700;
}

/* ============ About Me Modal ============ */
.about-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(6px);
}
.about-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.about-modal {
  background: #0f0f17;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1.25rem;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(30px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(110,0,255,0.3) transparent;
}
.about-overlay.active .about-modal {
  transform: translateY(0) scale(1);
}

/* Close Button */
.about-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #e8e6f0;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.about-close:hover {
  background: rgba(255,255,255,0.15);
}

/* Banner */
.about-banner {
  width: 100%;
  height: 130px;
  overflow: hidden;
  border-radius: 1.25rem 1.25rem 0 0;
  background: #1a1a26;
}
.about-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Avatar */
.about-avatar-wrap {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 4px solid #0f0f17;
  overflow: hidden;
  margin: -44px 0 0 1.25rem;
  position: relative;
  z-index: 2;
  background: #1a1a26;
}
.about-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Profile Header */
.about-header {
  padding: 0.5rem 1.25rem 1rem;
}
.about-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: #e8e6f0;
  margin-bottom: 0.15rem;
}
.about-handle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #8a88a0;
  margin-bottom: 0.6rem;
}
.about-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.badge-dev   { background: rgba(110,0,255,0.18); color: #a855f7; border: 1px solid rgba(110,0,255,0.3); }
.badge-gamer { background: rgba(0,240,255,0.12); color: #22d3ee; border: 1px solid rgba(0,240,255,0.25); }
.badge-creator { background: rgba(255,0,110,0.12); color: #f472b6; border: 1px solid rgba(255,0,110,0.25); }

/* Sections */
.about-section {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 1rem 1.25rem;
}
.about-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e8e6f0;
  margin-bottom: 0.6rem;
  letter-spacing: 0.03em;
}
.about-bio {
  font-size: 0.875rem;
  color: #8a88a0;
  line-height: 1.65;
  margin-bottom: 0.75rem;
}
.about-facts {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.about-facts span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #6e6c85;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

/* Skills */
.about-skill-groups {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.skill-group-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #6e6c85;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.tag-html  { background: rgba(228,77,37,0.2); color: #f97316; border: 1px solid rgba(228,77,37,0.3); }
.tag-css   { background: rgba(38,77,228,0.2); color: #60a5fa; border: 1px solid rgba(38,77,228,0.3); }
.tag-js    { background: rgba(247,223,30,0.2); color: #fbbf24; border: 1px solid rgba(247,223,30,0.25); }
.tag-ts    { background: rgba(49,120,198,0.2); color: #38bdf8; border: 1px solid rgba(49,120,198,0.3); }
.tag-flutter { background: rgba(84,184,240,0.2); color: #38bdf8; border: 1px solid rgba(84,184,240,0.3); }
.tag-next  { background: rgba(255,255,255,0.08); color: #e8e6f0; border: 1px solid rgba(255,255,255,0.14); }
.tag-dart  { background: rgba(1,177,227,0.18); color: #22d3ee; border: 1px solid rgba(1,177,227,0.3); }
.tag-python { background: rgba(55,118,171,0.2); color: #93c5fd; border: 1px solid rgba(55,118,171,0.3); }
.tag-node  { background: rgba(51,153,51,0.2); color: #4ade80; border: 1px solid rgba(51,153,51,0.3); }
.tag-firebase { background: rgba(255,196,64,0.18); color: #fbbf24; border: 1px solid rgba(255,196,64,0.3); }
.tag-sql   { background: rgba(0,150,136,0.18); color: #2dd4bf; border: 1px solid rgba(0,150,136,0.3); }
.tag-git   { background: rgba(240,81,51,0.18); color: #f87171; border: 1px solid rgba(240,81,51,0.3); }

/* Find Me Pills */
.about-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.about-link-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  background: rgba(110,0,255,0.12);
  color: #a855f7;
  border: 1px solid rgba(110,0,255,0.25);
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.about-link-pill:hover {
  background: rgba(110,0,255,0.25);
  color: #c084fc;
}

/* Currently List */
.about-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0;
}
.about-list li {
  font-size: 0.875rem;
  color: #8a88a0;
  padding-left: 1rem;
  position: relative;
}
.about-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #6e00ff;
}

/* ============ Footer ============ */
footer {
  margin-top: auto;
  padding-top: 2rem;
  text-align: center;
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
  opacity: 0;
}

footer a {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  transition: color var(--transition-fast);
}

footer a:hover {
  color: var(--color-text-muted);
}

/* ============ Custom Cursor ============ */
.cursor-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.1s ease;
  box-shadow: 0 0 8px var(--color-accent-glow);
  transform: translate(-50%, -50%);
}

.cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(110, 0, 255, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
  transform: translate(-50%, -50%);
}

.cursor-ring.hovering {
  width: 50px;
  height: 50px;
  border-color: rgba(110, 0, 255, 0.7);
}

/* Hide custom cursor on touch devices */
@media (hover: none) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ============ Responsive ============ */
@media (max-width: 480px) {
  .social-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 300px;
  }
  
  .glitch-text {
    letter-spacing: 0.05em;
  }

  .cursor-dot, .cursor-ring { display: none; }
}

@media (min-width: 481px) {
  body { cursor: none; }
  a, button, [role="button"] { cursor: none; }
}
