:root[data-theme='light'] {
  --bg: #ffffff;
  --text: #111111;
  --link: #0066cc;
  --card-bg: #f8fafc;
  --accent: #0066cc;
  --border: #e2e8f0;
  --shadow: rgba(0, 0, 0, 0.08);
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
}

:root[data-theme='dark'] {
  --bg: #0f172a;
  --text: #f1f5f9;
  --link: #60a5fa;
  --card-bg: #1e293b;
  --accent: #60a5fa;
  --border: #334155;
  --shadow: rgba(0, 0, 0, 0.4);
  --success: #34d399;
  --warning: #fbbf24;
  --error: #f87171;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

.fade-in {
  animation: fadeInUp 0.6s ease-out;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.7;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 16px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  z-index: 1000;
  transition: top 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.skip-link:focus {
  top: 6px;
  opacity: 1;
  visibility: visible;
}

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

nav {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex: 1;
  justify-content: center;
}

nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: color 0.2s ease;
}

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

.theme-toggle {
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--accent);
  color: white;
}

.theme-toggle svg {
  transition: transform 0.2s ease;
}

.theme-toggle:hover svg {
  transform: rotate(15deg);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  color: var(--text);
}

.social-links a:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.social-links a svg {
  transition: transform 0.2s ease;
}

.social-links a:hover svg {
  transform: scale(1.1);
}

.brand-name {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text) !important;
  text-decoration: none;
  transition: color 0.2s ease;
}

.brand-name:hover {
  color: var(--accent) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text);
  margin: 2px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.hero {
  padding: 6rem 0;
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg) 100%);
  position: relative;
  overflow: hidden;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  width: 100%;
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-photo {
  position: relative;
  width: 280px;
  height: 350px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px var(--shadow);
  border: 4px solid var(--accent);
  background: var(--card-bg);
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.profile-photo:hover img {
  transform: scale(1.05);
}

.profile-placeholder {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text);
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--card-bg), var(--bg));
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.profile-avatar svg {
  color: white;
}

.profile-info h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.profile-info p {
  font-size: 1rem;
  line-height: 1.4;
  margin: 0;
  opacity: 0.8;
}

.hero-text {
  text-align: left;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, var(--accent) 30%, var(--accent) 70%, transparent 70%);
  opacity: 0.02;
  transform: scale(1.5) rotate(12deg);
}

.hero-text h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--accent), var(--text));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text);
  opacity: 0.8;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

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

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

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

.btn-outline:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

section {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: var(--text);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.skill-category {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-align: center;
}

.skill-category h3 {
  color: var(--accent);
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.skill-tag {
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}

#projects {
  background: var(--card-bg);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 20px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px var(--shadow);
}

.project-image {
  position: relative;
  height: 200px;
  background: linear-gradient(135deg, var(--card-bg), var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: rgba(var(--accent), 0.05);
}

.project-emoji-large {
  font-size: 4rem;
  opacity: 0.8;
}

.project-content {
  padding: 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-status {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-status.live {
  background: var(--success);
  color: white;
}

.project-status.private {
  background: var(--border);
  color: var(--text);
}

.project-actions {
  margin-top: auto;
  padding-top: 1rem;
}

.project-emoji {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.project-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.project-card p {
  color: var(--text);
  opacity: 0.8;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.project-link {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.project-link:hover {
  color: var(--text);
}

.project-link::after {
  content: "→";
  margin-left: 0.5rem;
  transition: transform 0.2s ease;
}

.project-link:hover::after {
  transform: translateX(3px);
}

.project-link.disabled {
  color: var(--border);
  cursor: default;
}

.project-link.disabled:hover {
  color: var(--border);
}

.project-link.disabled::after {
  display: none;
}

.error-message {
  text-align: center;
  padding: 3rem;
  color: var(--error);
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.error-message h3 {
  color: var(--error);
  margin-bottom: 1rem;
}

.retry-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 1rem;
  transition: background 0.2s ease;
}

.retry-btn:hover {
  background: var(--text);
}

.loading-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tech-tag {
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-intro {
  text-align: center;
  margin-bottom: 4rem;
}

.lead {
  font-size: 1.25rem;
  color: var(--text);
  opacity: 0.9;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.about-grid {
  display: grid;
  gap: 3rem;
}

.about-section h2 {
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.about-section p {
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.skills-list {
  display: grid;
  gap: 1.5rem;
}

.skill-item {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.skill-item h3 {
  color: var(--text);
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.skill-item p {
  margin: 0;
  opacity: 0.8;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .nav-content {
    padding: 0 1rem;
    position: relative;
  }

  .nav-toggle {
    display: flex;
  }
  
  .nav-actions {
    order: 2;
  }
  
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    flex-direction: column;
    padding: 1rem;
    border-top: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    justify-content: flex-start;
    flex: none;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }
  
  .hero {
    padding: 4rem 0;
    min-height: auto;
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  
  .hero-text {
    text-align: center;
  }
  
  .hero-text h1 {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .profile-photo {
    width: 250px;
    height: 250px;
  }
  
  .cta-buttons {
    justify-content: center;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .skills-grid {
    grid-template-columns: 1fr;
  }
  
  .social-links {
    gap: 0.5rem;
  }
  
  .social-links a {
    width: 36px;
    height: 36px;
  }
}
