:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --accent: #0284c7;
  --accent-soft: #0ea5e9;
  --border: #e5e7eb;
  --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  --mesh-1: hsla(210, 100%, 50%, 0.08);
  --mesh-2: hsla(190, 100%, 50%, 0.08);
  --mesh-3: hsla(220, 100%, 50%, 0.05);
  --mesh-4: hsla(230, 100%, 50%, 0.05);
  --title-gradient: linear-gradient(135deg, #111827 0%, #0284c7 100%);
  --novelty-bg: #f1f5f9;
  --novelty-text: #0284c7;
}

[data-theme="dark"] {
  --bg-primary: #000814;
  --bg-secondary: #001122;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent: #38bdf8;
  --accent-soft: #7dd3fc;
  --border: #001e3c;
  
  --mesh-1: hsla(210, 100%, 20%, 0.15);
  --mesh-2: hsla(190, 100%, 20%, 0.12);
  --mesh-3: hsla(220, 100%, 20%, 0.10);
  --mesh-4: hsla(230, 100%, 20%, 0.12);
  --title-gradient: linear-gradient(135deg, #ffffff 0%, #38bdf8 100%);
  --novelty-bg: #0c4a6e;
  --novelty-text: #e0f2fe;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary: #000814;
    --bg-secondary: #001122;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #38bdf8;
    --accent-soft: #7dd3fc;
    --border: #001e3c;
    --mesh-1: hsla(210, 100%, 20%, 0.15);
    --mesh-2: hsla(190, 100%, 20%, 0.12);
    --mesh-3: hsla(220, 100%, 20%, 0.10);
    --mesh-4: hsla(230, 100%, 20%, 0.12);
    --title-gradient: linear-gradient(135deg, #ffffff 0%, #38bdf8 100%);
    --novelty-bg: #0c4a6e;
    --novelty-text: #e0f2fe;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

::selection {
  background-color: var(--accent);
  color: #fff;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

.bg-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background-image: 
    radial-gradient(circle at 0% 0%, var(--mesh-1), transparent 50%),
    radial-gradient(circle at 100% 0%, var(--mesh-2), transparent 50%),
    radial-gradient(circle at 100% 100%, var(--mesh-3), transparent 50%),
    radial-gradient(circle at 0% 100%, var(--mesh-4), transparent 50%);
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  animation: mesh-float 30s ease-in-out infinite alternate;
}

@keyframes mesh-float {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.1) translate(2%, 2%); }
  100% { transform: scale(1) translate(-1%, 1%); }
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.02;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

#theme-toggle {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 100;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.6rem;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  animation: fade-in 0.8s ease forwards 1s;
}

#theme-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

#theme-toggle .sun { display: none; }
#theme-toggle .moon { display: block; }

[data-theme="dark"] #theme-toggle .sun { display: block; }
[data-theme="dark"] #theme-toggle .moon { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) #theme-toggle .moon { display: none; }
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

a::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease-out;
}

a:hover {
  color: var(--accent-soft);
}

a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

.site-header {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 4rem 0;
}

.header-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  text-align: center;
  perspective: 1000px;
}

@media (min-width: 768px) {
  .header-content {
    flex-direction: row;
    align-items: center;
    gap: 4rem;
    text-align: left;
  }
}

.profile-img {
  width: 320px;
  max-width: 100%;
  height: auto;
  border-radius: 24px;
  object-fit: contain;
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 
    0 10px 10px -5px rgba(0, 0, 0, 0.04),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  opacity: 0;
  transform: translateY(20px);
  animation: slide-up 0.8s ease forwards 0.2s;
}

.profile-img:hover {
  transform: scale(1.02) rotateY(5deg) rotateX(2deg);
}

.bio {
  opacity: 0;
  transform: translateY(20px);
  animation: slide-up 0.8s ease forwards 0.4s;
}

.bio h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  background: var(--title-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.bio p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 1.5rem;
}

.divider {
  height: 1px;
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  animation: fade-in 0.8s ease forwards 0.6s;
}

.site-footer {
  padding: 4rem 0;
  text-align: center;
  opacity: 0;
  animation: fade-in 0.8s ease forwards 0.8s;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.social-links img {
  width: 28px;
  height: 28px;
  filter: grayscale(1) opacity(0.6);
  transition: all 0.3s ease;
}

[data-theme="dark"] .social-links img,
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .social-links img {
    filter: invert(1) grayscale(1) opacity(0.6);
  }
}

.social-links a:hover img {
  filter: grayscale(0) opacity(1) drop-shadow(0 0 8px var(--accent));
  transform: translateY(-4px);
}

.copyright {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.novelty {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background-color: var(--novelty-bg);
  color: var(--novelty-text);
  border-radius: 6px;
  font-weight: 400;
  margin: 0 0.125rem;
  transition: all 0.4s ease;
}

/* Animations */
@keyframes slide-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}
