@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
  /* Light theme */
  --text-primary: #000000;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --background: #ffffff;
  --border: #e5e5e5;
  --hover: #f5f5f5;
  --link-hover: #f0f0f0;
}

[data-theme="dark"] {
  /* Dark theme */
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-tertiary: #666666;
  --background: #000000;
  --border: #333333;
  --hover: #1a1a1a;
  --link-hover: #2a2a2a;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--background);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.header {
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 64px;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 18px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.theme-toggle:hover {
  background-color: var(--hover);
  border-color: var(--text-tertiary);
}

.theme-icon {
  display: block;
  line-height: 1;
}

/* Main Content */
.main {
  margin-bottom: 128px;
}

/* Hero Section */
.hero {
  margin-bottom: 96px;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
}

.hero-text {
  min-width: 0; /* Allows text to shrink */
}

.hero h1 {
  font-size: 48px;
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.hero-description {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.5;
}

.hero-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Profile Image */
.hero-image {
  flex-shrink: 0;
}

.profile-pic {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
}

.profile-pic:hover {
  transform: scale(1.05);
  border-color: var(--text-tertiary);
}

/* Social Links */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  background-color: var(--background);
}

.social-link:hover {
  background-color: var(--link-hover);
  border-color: var(--text-tertiary);
  transform: translateY(-1px);
}

.social-icon {
  font-size: 14px;
  line-height: 1;
}

/* Sections */
.section {
  margin-bottom: 96px;
}

.section h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 32px;
  letter-spacing: -0.01em;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.content p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Links */
.link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

/* Work Items */
.work-item {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.work-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.work-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.work-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.work-period {
  font-size: 14px;
  color: var(--text-tertiary);
}

.work-title {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 500;
}

.work-description {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Project Items */
.project-item {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

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

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

.project-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  background-color: var(--background);
}

.project-link:hover {
  background-color: var(--link-hover);
  border-color: var(--text-tertiary);
  transform: translateY(-1px);
}

.link-icon {
  font-size: 12px;
  line-height: 1;
}

.project-description {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Writing Items */
.writing-item {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.writing-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.writing-link {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  text-decoration: none;
  padding: 16px;
  transition: background-color 0.2s ease;
  border-radius: 8px;
  margin: -16px;
  gap: 16px;
}

.writing-link:hover {
  background-color: var(--hover);
}

.writing-link:hover .link-arrow {
  transform: translateX(4px);
}

.writing-title {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.writing-description {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.link-arrow {
  color: var(--text-tertiary);
  font-size: 14px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.writing-all {
  margin-top: 16px;
  padding-top: 24px;
}

.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.view-all-link:hover {
  color: var(--text-secondary);
}

.view-all-link:hover .link-arrow {
  transform: translateX(4px);
}

/* Footer */
.footer {
  padding: 64px 0 32px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer p {
  color: var(--text-tertiary);
  font-size: 14px;
}

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

  .header {
    padding: 24px 0;
    margin-bottom: 48px;
  }

  .nav {
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
  }

  .nav-right {
    width: 100%;
    justify-content: space-between;
  }

  .nav-links {
    gap: 24px;
  }

  .hero {
    margin-bottom: 64px;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  .hero-image {
    order: -1; /* Show image first on mobile */
  }

  .hero h1 {
    font-size: 36px;
    margin-bottom: 20px;
  }

  .hero-description {
    font-size: 16px;
    margin-bottom: 24px;
  }

  .hero-links {
    gap: 12px;
    justify-content: center;
  }

  .section {
    margin-bottom: 64px;
  }

  .section h2 {
    font-size: 20px;
    margin-bottom: 24px;
  }

  .content {
    gap: 24px;
  }

  .work-header,
  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .work-item,
  .project-item {
    padding-bottom: 24px;
  }

  .main {
    margin-bottom: 96px;
  }

  .footer {
    padding: 48px 0 24px;
  }

  .writing-link {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .link-arrow {
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero-description {
    font-size: 15px;
  }

  .nav-links {
    gap: 16px;
  }

  .hero-links {
    flex-direction: column;
    gap: 8px;
  }

  .social-link {
    width: 100%;
    justify-content: center;
  }

  .profile-pic {
    width: 100px;
    height: 100px;
  }
}

/* Focus styles for accessibility */
.theme-toggle:focus,
.social-link:focus,
.project-link:focus,
.writing-link:focus,
.view-all-link:focus {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}