:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --text-primary: #ffffff;
  --text-secondary: #888888;
  --text-tertiary: #555555;
  --accent: #ffffff;
  --border: #222222;
  --neural-glow: #00ffff;
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --text-primary: #0a0a0a;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --accent: #000000;
  --border: #e5e5e5;
  --neural-glow: #0066cc;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-weight: 300;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}

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

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  text-align: center;
  max-width: 400px;
  padding: 2rem;
}

.robot-container {
  margin-bottom: 2rem;
  font-size: 3rem;
  animation: robotBounce 1.5s ease-in-out infinite;
}

.robot {
  display: inline-block;
  filter: grayscale(0);
}

.typing-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  font-family: 'Inter', monospace;
  text-align: left;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  max-width: 300px;
}

.typing-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.4;
  min-height: 30px;
  font-weight: 300;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background-color: var(--text-primary);
  margin-left: 2px;
  animation: blink 1s infinite;
}

/* Main Content */
.main-content {
  opacity: 0;
  transition: opacity 0.8s ease;
}

.main-content.visible {
  opacity: 1;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] header {
  background: rgba(255, 255, 255, 0.8);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
}

.logo {
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-right a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 300;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-right a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--text-primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-right a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-right a:hover::after {
  width: 80%;
}

.theme-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1rem;
  transition: color 0.3s ease;
  font-weight: 300;
}

.theme-toggle:hover {
  color: var(--text-primary);
}

/* Hero Section */
.hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  padding: 8rem 0 4rem;
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 3rem;
  width: 100%;
}

.hero-image {
  flex-shrink: 0;
}

.profile-img {
  width: 180px;
  height: 180px;
  border-radius: 0.5rem;
  object-fit: cover;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.profile-img:hover {
  border-color: var(--text-secondary);
  transform: scale(1.02);
}

.hero-text {
  flex: 1;
}

.hero-text h1 {
  font-size: 3.5rem;
  font-weight: 300;
  margin-bottom: 1rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  font-weight: 300;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.btn-minimal {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 300;
  font-size: 0.9rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-minimal::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s ease;
}

.btn-minimal:hover {
  color: var(--text-primary);
  border-color: var(--border);
  background: var(--bg-secondary);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-minimal:hover::before {
  left: 100%;
}

/* Sections */
section {
  padding: 5rem 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 300;
  margin-bottom: 3rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  text-align: left;
}

/* Experience Section */
#experience {
  padding: 3rem 0;
}

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  padding-left: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.5px;
  top: 0.5rem;
  width: 5px;
  height: 5px;
  background: var(--text-primary);
  border-radius: 50%;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
  font-weight: 300;
}

.timeline-content h3 {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.company {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 300;
}

.description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.5;
}

/* Projects Section */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
}

.project-item:last-child {
  border-bottom: none;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.project-item h3 {
  font-size: 1.1rem;
  font-weight: 400;
  margin: 0;
}

.project-item h3 a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.project-item h3 a:hover {
  color: var(--text-secondary);
}

.project-tech {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-weight: 300;
}

.project-item p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.5;
  margin-top: 0.5rem;
}

/* Chat Section */
#chat {
  padding: 3rem 0;
}

.chat-container {
  max-width: 700px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.chat-messages {
  height: 400px;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.5;
}

.message.user {
  align-self: flex-end;
  background: var(--text-primary);
  color: var(--bg-primary);
}

.message.bot {
  align-self: flex-start;
  background: var(--border);
  color: var(--text-primary);
}

.message.typing {
  align-self: flex-start;
  background: var(--border);
  color: var(--text-secondary);
}

.typing-indicator {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.typing-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

.welcome-message {
  text-align: center;
  color: var(--text-tertiary);
  font-style: italic;
  font-size: 0.9rem;
  padding: 2rem;
  font-weight: 300;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 1rem;
  border-radius: 0.375rem;
  margin: 1rem;
  text-align: center;
  font-size: 0.85rem;
}

.chat-input-container {
  padding: 1rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.chat-input-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.75rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 300;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  transition: border-color 0.3s ease;
}

.chat-input:focus {
  outline: none;
  border-color: var(--text-secondary);
}

.chat-input::placeholder {
  color: var(--text-tertiary);
}

.send-button {
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  border-radius: 0.375rem;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  font-weight: 300;
  position: relative;
  overflow: hidden;
}

.send-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.send-button:hover:not(:disabled) {
  background: var(--text-secondary);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.send-button:hover:not(:disabled)::before {
  left: 100%;
}

.send-button:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Connect Section */
#connect {
  padding: 3rem 0 5rem;
}

.connect-links {
  display: flex;
  gap: 2rem;
}

.connect-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 300;
  font-size: 0.9rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.connect-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s ease;
}

.connect-link:hover {
  color: var(--text-primary);
  border-color: var(--border);
  background: var(--bg-secondary);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.connect-link:hover::before {
  left: 100%;
}

/* Footer */
footer {
  text-align: left;
  padding: 2rem 0;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 300;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Animations */
@keyframes robotBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  10% {
    transform: translateY(-8px) rotate(-1deg);
  }
  30% {
    transform: translateY(-4px) rotate(1deg);
  }
  60% {
    transform: translateY(-6px) rotate(-0.5deg);
  }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@keyframes typing {
  0%, 80%, 100% { 
    transform: scale(0.8); 
    opacity: 0.5; 
  }
  40% { 
    transform: scale(1); 
    opacity: 1; 
  }
}

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

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

/* Mobile Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .nav-right {
    gap: 1rem;
  }

  .nav-right a {
    font-size: 0.8rem;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .profile-img {
    width: 140px;
    height: 140px;
  }

  .hero-text h1 {
    font-size: 2.5rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .timeline {
    padding-left: 1.5rem;
  }

  .timeline-item {
    padding-left: 1.5rem;
  }

  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .connect-links {
    flex-direction: column;
    gap: 1rem;
  }

  .chat-container {
    border-radius: 0.375rem;
  }
}