/* Core Design Tokens */
:root {
  color-scheme: light dark;
}

:root[data-theme="light"] {
  --bg-app: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.7);
  --border-card: rgba(255, 255, 255, 0.5);
  
  --text-main: #0f172a;
  --text-muted: #475569;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.1);
  
  --accent-1: #38bdf8;
  --accent-2: #818cf8;
  --accent-3: #c084fc;
  
  --tag-bg: rgba(15, 23, 42, 0.05);
  --tag-text: #334155;
  
  --shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
  --divider-color: #e2e8f0;
}

:root[data-theme="dark"] {
  --bg-app: #080b11;
  --bg-card: rgba(17, 24, 39, 0.65);
  --border-card: rgba(255, 255, 255, 0.06);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --primary: #60a5fa;
  --primary-hover: #93c5fd;
  --primary-light: rgba(96, 165, 250, 0.15);
  
  --accent-1: #0ea5e9;
  --accent-2: #6366f1;
  --accent-3: #a855f7;
  
  --tag-bg: rgba(255, 255, 255, 0.05);
  --tag-text: #cbd5e1;
  
  --shadow: 0 15px 50px -15px rgba(0, 0, 0, 0.4);
  --divider-color: #1f2937;
}

/* Global Reset & Base Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  padding: 2rem 1rem;
  position: relative;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Typography Custom Rules */
h1, h2, h3 {
  text-wrap: balance;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: var(--divider-color);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Background Animated Gradient Blobs */
.bg-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  filter: blur(100px);
  pointer-events: none;
  opacity: 0.6;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: float-bubble 25s infinite alternate ease-in-out;
}

.bubble-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--accent-1) 0%, rgba(255,255,255,0) 70%);
  top: -10%;
  left: -10%;
  animation-duration: 20s;
}

.bubble-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-2) 0%, rgba(255,255,255,0) 70%);
  bottom: -15%;
  right: -5%;
  animation-duration: 25s;
  animation-delay: -5s;
}

.bubble-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, var(--accent-3) 0%, rgba(255,255,255,0) 70%);
  top: 40%;
  left: 30%;
  animation-duration: 22s;
  animation-delay: -10s;
}

@keyframes float-bubble {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(80px, 50px) scale(1.1);
  }
  100% {
    transform: translate(-40px, -60px) scale(0.95);
  }
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 680px;
  position: relative;
  z-index: 1;
}

/* Header & Theme Control */
.header-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-main);
  padding: 0.75rem;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  transform: translateY(-2px) scale(1.05);
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-light);
}

.btn-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  transition: transform 0.5s ease;
}

/* Icon Switching based on theme */
:root[data-theme="light"] .moon-icon { display: block; }
:root[data-theme="light"] .sun-icon { display: none; }
:root[data-theme="dark"] .moon-icon { display: none; }
:root[data-theme="dark"] .sun-icon { display: block; }

/* Profile Card Structure */
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

/* Profile Avatar Section */
.avatar-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 1.75rem;
}

.avatar-img {
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.avatar-container:hover .avatar-img {
  transform: scale(1.08) rotate(2deg);
  border-color: var(--primary);
}

.status-badge {
  position: absolute;
  bottom: 0;
  right: -5px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ping-animation {
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
  position: relative;
  display: inline-block;
}

.ping-animation::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #22c55e;
  border-radius: 50%;
  animation: ping 1.5s infinite ease-out;
}

@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Profile Details */
.title {
  font-size: 2.25rem;
  margin-bottom: 0.35rem;
  background: linear-gradient(135deg, var(--text-main) 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1.125rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 1.25rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bio {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 2rem;
}

/* Social Grid Links */
.social-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--tag-bg);
  border: 1px solid transparent;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-icon {
  width: 1.15rem;
  height: 1.15rem;
}

.social-link:hover {
  background: var(--bg-card);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.divider {
  border: 0;
  height: 1px;
  background-color: var(--divider-color);
  margin-bottom: 2.5rem;
}

/* Projects Section */
.projects-section {
  text-align: left;
}

.section-title {
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.project-card {
  background: var(--tag-bg);
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover {
  background: var(--bg-card);
  border-color: var(--border-card);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.project-header {
  margin-bottom: 0.75rem;
}

.project-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  background-color: var(--primary-light);
  color: var(--primary);
  display: inline-block;
  margin-bottom: 0.5rem;
}

.project-badge.offline {
  background-color: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

.project-name {
  font-size: 1.1rem;
  color: var(--text-main);
}

.project-desc {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 1.25rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-tags span {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background-color: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--border-card);
}

/* Footer Section */
.card-footer {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2rem;
}

/* Responsive Rules */
@media (max-width: 600px) {
  body {
    padding: 1rem 0.5rem;
  }
  
  .profile-card {
    padding: 2rem 1.5rem;
  }
  
  .social-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
