:root {
  --bg: #ffffff;
  --text: #111827;
  --gray: #6b7280;
  --light-gray: #f3f4f6;
  --border: #e5e7eb;
  --badge: #f9fafb;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --text: #f8fafc;
  --gray: #94a3b8;
  --light-gray: #1e293b;
  --border: #334155;
  --badge: #1e293b;
}

#dark-mode-toggle {
  display: none;
}

#dark-mode-toggle:checked ~ body,
#dark-mode-toggle:checked ~ body *,
body:has(#dark-mode-toggle:checked),
body:has(#dark-mode-toggle:checked) * {
  --bg: #0f172a;
  --text: #f8fafc;
  --gray: #94a3b8;
  --light-gray: #1e293b;
  --border: #334155;
  --badge: #1e293b;
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.theme-toggle-slider {
  position: relative;
  width: 50px;
  height: 24px;
  background: var(--light-gray);
  border-radius: 12px;
  transition: background 0.3s ease;
  border: 1px solid var(--border);
}

.theme-toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--text);
  border-radius: 50%;
  transition: transform 0.3s ease;
}

#dark-mode-toggle:checked ~ header .theme-toggle .theme-toggle-slider::before {
  transform: translateX(26px);
}

.theme-toggle-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.theme-toggle-icon.sun {
  left: 4px;
  opacity: 1;
}

.theme-toggle-icon.moon {
  right: 4px;
  opacity: 0;
}

#dark-mode-toggle:checked ~ header .theme-toggle .theme-toggle-icon.sun {
  opacity: 0;
}

#dark-mode-toggle:checked ~ header .theme-toggle .theme-toggle-icon.moon {
  opacity: 1;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  padding: 2rem;
  max-width: 1200px;
  margin: auto;
}

main {
  max-width: 760px;
  margin: 0 auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 2rem;
  position: relative;
  max-width: 1200px;
  margin: 0 auto 0 auto;
}

.logo {
  font-weight: 600;
  font-size: 1.125rem;
}

nav {
  display: flex;
}

nav a {
  margin-left: 1rem;
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--gray);
  font-weight: 500;
}

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

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.mobile-nav.active {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 0.5rem 0;
  margin: 0;
  text-decoration: none;
  color: var(--gray);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.mobile-nav a:last-child {
  border-bottom: none;
}

h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 2rem;
  margin-top: 2rem;
  color: var(--text);
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
}

h2::before {
  content: "## ";
  color: var(--gray);
}

.highlight {
  font-weight: 600;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.badges span {
  background: var(--badge);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.work-entry, .project-entry, .talk-entry, .learning-entry, .footer-entry {
  background: var(--light-gray);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.work-entry {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.company-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.work-content {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.work-details h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  color: var(--text);
}

.work-details p {
  margin: 0;
  color: var(--gray);
  font-size: 0.875rem;
}

.work-date {
  color: var(--gray);
  font-size: 0.875rem;
  text-align: right;
  white-space: nowrap;
}

footer {
  text-align: center;
  font-size: 0.875rem;
  color: var(--gray);
  margin-top: 3rem;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.project-entry {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 0.75rem;
}

.project-entry h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: var(--text);
}

.project-entry p {
  color: var(--gray);
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0 0 1rem 0;
}

.project-entry .badges {
  margin: 0;
  gap: 0.375rem;
}

.project-entry .badges span {
  background: var(--light-gray);
  color: var(--text);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.award-entry {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  display: block;
}

.award-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  color: var(--text);
}

.award-content p {
  margin: 0;
  color: var(--gray);
  font-size: 0.875rem;
}

.award-year {
  color: var(--gray);
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--light-gray);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  margin-top: 0.5rem;
  display: inline-block;
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
  }

  .mobile-menu-toggle {
    display: block;
    position: static;
  }

  nav {
    display: none;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.125rem;
    margin: 1.5rem 0 0.75rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .badges span {
    margin-bottom: 0.25rem;
  }

  .work-content {
    flex-direction: column;
    gap: 0.5rem;
  }

  .work-date {
    text-align: left;
    align-self: flex-start;
  }
}

@media (max-width: 480px) {
  body {
    padding: 1.25rem;
  }

  h1 {
    font-size: 1.25rem;
  }

  h2 {
    font-size: 1rem;
  }

  .work-entry, .project-entry, .talk-entry, .learning-entry, .footer-entry {
    padding: 0.75rem;
  }
}

.learning-entry {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 0.75rem;
}

.content-type {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--gray);
  font-size: 0.875rem;
  font-weight: 500;
}

.content-type-icon {
  width: 16px;
  /* height: 16px; */
}

.learning-entry h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: var(--text);
}

.learning-entry p {
  color: var(--gray);
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0 0 1rem 0;
}

.view-material {
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.view-material:hover {
  text-decoration: underline;
}

.pdf-section {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--light-gray);
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  display: none;
}

.pdf-section.active {
  display: block;
}

.pdf-section h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: var(--text);
}

.pdf-list {
  display: grid;
  gap: 0.5rem;
}

.pdf-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s ease;
}

.pdf-item:hover {
  background: var(--border);
}

.pdf-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pdf-icon {
  font-size: 1.25rem;
}

.pdf-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.download-icon {
  font-size: 0.875rem;
  color: var(--gray);
}

.talk-entry {
  background: var(--bg);
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  border-radius: 0;
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.talk-entry:last-child {
  border-bottom: none;
}

.talk-content {
  flex: 1;
}

.talk-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  color: var(--text);
}

.talk-content p, .talk-content span {
  color: var(--gray);
  font-size: 0.875rem;
  font-weight: 500;
}

.talk-content p, .talk-content span {
  margin: 0 0 0.25rem 0;
}

.talk-date {
  color: var(--gray);
  font-size: 0.75rem;
  white-space: nowrap;
}

.talk-link {
  color: var(--text);
  font-size: 0.75rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.talk-link:hover {
  text-decoration: underline;
}

.talk-content .talk-badge {
  background: var(--light-gray);
  color: var(--text);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  margin-right: 0.75rem;
}

.talk-stats {
  color: var(--gray);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.intro-section {
  margin-bottom: 3rem;
}

.intro-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gray);
  margin-bottom: 1.3rem;
}

.intro-text:last-of-type {
  margin-bottom: 2rem;
  display: inline-block;
}

.social-links {
  display: inline-flex;
  gap: 1rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--light-gray);
  color: var(--gray);
  text-decoration: none;
  font-size: 1.25rem;
  transition: all 0.2s ease;
}

.social-link:hover {
  background: var(--text);
  color: var(--bg);
}

.intro-highlight {
  color: var(--text);
  margin-bottom: 1rem;
}

/* Terminal Styles */
.terminal-section {
  margin: 3rem 0;
  text-align: center;
}

.terminal-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-bottom: 1rem;
}

.terminal-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
