/* ===========================
   Reset & Base
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===========================
   Theme Variables
   =========================== */
:root {
  /* Dark mode – default: purple → blue */
  --bg-a: #1a0533;
  --bg-b: #0d1b4b;
  --bg-c: #060e27;
  --orb-1: rgba(124, 58, 237, 0.5);
  --orb-2: rgba(37, 99, 235, 0.4);

  --card-bg: rgba(10, 6, 28, 0.62);
  --card-border: rgba(139, 92, 246, 0.22);
  --card-shadow:
    0 32px 80px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(139, 92, 246, 0.08);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;

  --btn-bg: rgba(255, 255, 255, 0.06);
  --btn-border: rgba(255, 255, 255, 0.1);
  --btn-hover-bg: rgba(255, 255, 255, 0.12);
  --btn-hover-border: rgba(255, 255, 255, 0.18);
  --btn-hover-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  --btn-text: #e2e8f0;
  --btn-arrow: rgba(255, 255, 255, 0.28);
  --btn-arrow-hover: rgba(255, 255, 255, 0.85);

  --avatar-gradient: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  --avatar-ring: rgba(139, 92, 246, 0.55);
  --avatar-glow: rgba(124, 58, 237, 0.25);

  --toggle-bg: rgba(255, 255, 255, 0.08);
  --toggle-border: rgba(255, 255, 255, 0.16);
  --toggle-color: #e2e8f0;
  --toggle-hover: rgba(255, 255, 255, 0.14);

  --footer-color: rgba(255, 255, 255, 0.28);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  /* Light mode – blue → cyan → green */
  --bg-a: #2563eb;
  --bg-b: #0891b2;
  --bg-c: #059669;
  --orb-1: rgba(59, 130, 246, 0.55);
  --orb-2: rgba(16, 185, 129, 0.45);

  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(255, 255, 255, 0.88);
  --card-shadow:
    0 32px 80px rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.55);

  --text-primary: #0f172a;
  --text-secondary: #475569;

  --btn-bg: rgba(255, 255, 255, 0.52);
  --btn-border: rgba(0, 0, 0, 0.07);
  --btn-hover-bg: rgba(255, 255, 255, 0.9);
  --btn-hover-border: rgba(0, 0, 0, 0.04);
  --btn-hover-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
  --btn-text: #1e293b;
  --btn-arrow: rgba(0, 0, 0, 0.22);
  --btn-arrow-hover: rgba(0, 0, 0, 0.7);

  --avatar-gradient: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
  --avatar-ring: rgba(59, 130, 246, 0.45);
  --avatar-glow: rgba(59, 130, 246, 0.18);

  --toggle-bg: rgba(255, 255, 255, 0.42);
  --toggle-border: rgba(255, 255, 255, 0.75);
  --toggle-color: #1e293b;
  --toggle-hover: rgba(255, 255, 255, 0.65);

  --footer-color: rgba(15, 23, 42, 0.32);
}

/* ===========================
   Base
   =========================== */
html {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, var(--bg-a) 0%, var(--bg-b) 52%, var(--bg-c) 100%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow-x: hidden;
  transition: background 0.5s var(--ease);
}

/* ===========================
   Background Orbs
   =========================== */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  transition: background 0.5s var(--ease);
}

.bg-orb--1 {
  width: 520px;
  height: 520px;
  background: var(--orb-1);
  top: -160px;
  left: -120px;
}

.bg-orb--2 {
  width: 460px;
  height: 460px;
  background: var(--orb-2);
  bottom: -110px;
  right: -90px;
}

/* ===========================
   Theme Toggle
   =========================== */
.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  color: var(--toggle-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.3s var(--ease);
  z-index: 100;
}

.theme-toggle:hover {
  background: var(--toggle-hover);
  transform: scale(1.1) rotate(12deg);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--toggle-color);
  outline-offset: 3px;
}

/* Icon visibility – CSS-driven, no JS class toggling needed */
.icon-sun,
.icon-moon {
  position: absolute;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

/* Default: dark mode shows sun, light mode shows moon */
[data-theme="dark"] .icon-sun  { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="dark"] .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.6); }

[data-theme="light"] .icon-sun  { opacity: 0; transform: rotate(90deg) scale(0.6); }
[data-theme="light"] .icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

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

/* ===========================
   Card
   =========================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 2.75rem 2.25rem 2rem;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  transition:
    background 0.45s var(--ease),
    border-color 0.45s var(--ease),
    box-shadow 0.45s var(--ease);
}

/* ===========================
   Profile
   =========================== */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2rem;
}

/* Avatar */
.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--avatar-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.375rem;
  flex-shrink: 0;
  position: relative;
  box-shadow:
    0 0 0 3px var(--avatar-ring),
    0 0 0 6px rgba(255, 255, 255, 0.04),
    0 16px 48px var(--avatar-glow);
  transition:
    background 0.45s var(--ease),
    box-shadow 0.45s var(--ease);
}

.avatar-initials {
  font-size: 2.25rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1;
  user-select: none;
}

/* Name */
.name {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.5rem;
  transition: color 0.45s var(--ease);
}

/* Bio */
.bio {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 300px;
  transition: color 0.45s var(--ease);
}

/* ===========================
   Link Buttons
   =========================== */
.links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.125rem;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: 16px;
  color: var(--btn-text);
  text-decoration: none;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition:
    background 0.22s var(--ease),
    border-color 0.22s var(--ease),
    box-shadow 0.22s var(--ease),
    transform 0.22s var(--ease);
  position: relative;
  overflow: hidden;
}

/* Shimmer overlay on hover */
.link-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.07) 50%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.22s var(--ease);
}

.link-btn:hover::after {
  opacity: 1;
}

.link-btn:hover {
  transform: translateY(-3px);
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-border);
  box-shadow: var(--btn-hover-shadow);
}

.link-btn:active {
  transform: translateY(-1px);
}

.link-btn:focus-visible {
  outline: 2px solid var(--toggle-color);
  outline-offset: 2px;
}

/* Icon pill */
.link-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  transition: transform 0.22s var(--ease);
}

.link-btn:hover .link-icon {
  transform: scale(1.1);
}

.link-icon--portfolio {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.link-icon--dribbble {
  background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.4);
}

.link-icon--linkedin {
  background: linear-gradient(135deg, #0077b5 0%, #0ea5e9 100%);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.link-icon--email {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Label */
.link-label {
  flex: 1;
}

/* Arrow */
.link-arrow {
  flex-shrink: 0;
  color: var(--btn-arrow);
  transition: color 0.22s var(--ease), transform 0.22s var(--ease);
}

.link-btn:hover .link-arrow {
  color: var(--btn-arrow-hover);
  transform: translateX(4px);
}

/* ===========================
   Footer
   =========================== */
.footer {
  text-align: center;
}

.footer p {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--footer-color);
  letter-spacing: 0.01em;
  transition: color 0.45s var(--ease);
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 520px) {
  .card {
    padding: 2rem 1.5rem 1.75rem;
    border-radius: 22px;
  }

  .name {
    font-size: 1.625rem;
  }

  .bg-orb--1 { width: 340px; height: 340px; }
  .bg-orb--2 { width: 300px; height: 300px; }
}

/* ===========================
   Reduced motion
   =========================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
