/* Dark theme (default) */
:root {
  --bg: #0a0a0a;
  --fg: #ededed;
  --muted: #888;
  --accent: #3b82f6;
  --border: #222;
}

/* Light theme */
[data-theme="light"] {
  --bg: #fafafa;
  --fg: #1a1a1a;
  --muted: #666;
  --accent: #2563eb;
  --border: #ddd;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
}

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

.hero {
  margin-bottom: 4rem;
}

.hero-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.hero-text {
  flex: 1;
}

.hero-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  flex-shrink: 0;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tagline {
  color: var(--muted);
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.location {
  color: var(--muted);
  font-size: 1rem;
}

@media (max-width: 600px) {
  .hero-content {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
  }
  
  .hero-photo {
    width: 150px;
    height: 150px;
  }
}

section {
  margin-bottom: 3rem;
}

h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

h3 {
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

strong {
  color: var(--fg);
}

.experience-item {
  border-left: 2px solid var(--border);
  padding-left: 1.5rem;
  margin-bottom: 2rem;
}

.experience-item:last-child {
  margin-bottom: 0;
}

.company {
  color: var(--accent);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.company-icon {
  height: 15px;
  width: 15px;
  vertical-align: middle;
}

.dates {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.education-item {
  border-left: 2px solid var(--border);
  padding-left: 1.5rem;
}

.degree {
  margin-bottom: 0.25rem;
}

.specialization {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

#speaking p {
  color: var(--muted);
}

#awards p {
  margin: 0;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .nav {
  background: rgba(250, 250, 250, 0.8);
}

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

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-logo-img {
  height: 36px;
  width: auto;
}

.nav-logo:hover {
  text-decoration: none;
  opacity: 0.8;
}

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

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--fg);
  text-decoration: none;
}

.nav-link.active {
  color: var(--fg);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--fg);
  transition: transform 0.3s, opacity 0.3s;
}

.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav panel */
.mobile-nav {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 89;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.mobile-nav.open {
  transform: translateX(0);
}

.mobile-nav-content {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  gap: 1.5rem;
}

.mobile-nav-link {
  font-size: 1.5rem;
  color: var(--muted);
  text-decoration: none;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--fg);
  text-decoration: none;
}

@media (max-width: 600px) {
  .nav-links {
    display: none;
  }
  
  .nav-hamburger {
    display: flex;
  }
}

/* Adjust body for fixed nav */
body {
  padding-top: 60px;
}

/* Page header (for subpages) */
.page-header {
  margin-bottom: 3rem;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--muted);
  font-size: 1.1rem;
}

/* Book grid */
.book-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (max-width: 500px) {
  .book-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.book-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s;
}

.book-card:hover {
  transform: translateY(-4px);
  text-decoration: none;
}

.book-cover {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: var(--border);
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .book-cover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-info {
  text-align: center;
}

.book-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--fg);
}

.book-author {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (max-width: 700px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.project-card {
  display: block;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

[data-theme="light"] .project-card {
  background: linear-gradient(160deg, rgba(37, 99, 235, 0.04), rgba(37, 99, 235, 0));
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--muted);
}

.project-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.project-meta-pill {
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.project-github-icon {
  width: 18px;
  height: 18px;
  opacity: 0.45;
  transition: opacity 0.2s ease;
  filter: var(--github-icon-filter, invert(1));
}

[data-theme="light"] .project-github-icon {
  filter: none;
}

.project-card:hover .project-github-icon {
  opacity: 0.8;
}

.project-name {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
}

.project-description {
  color: var(--muted);
  margin: 0;
}

.accent-cobalt::before {
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

.accent-emerald::before {
  background: linear-gradient(90deg, #34d399, #10b981);
}

.accent-cobalt .project-meta-pill {
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(59, 130, 246, 0.12);
}

.accent-emerald .project-meta-pill {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(16, 185, 129, 0.12);
}

[data-theme="light"] .accent-cobalt .project-meta-pill {
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
}

[data-theme="light"] .accent-emerald .project-meta-pill {
  color: #047857;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: 70px;
  right: 1.25rem;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(10, 10, 10, 0.5);
}

[data-theme="light"] .theme-toggle {
  background: rgba(250, 250, 250, 0.5);
}

.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--muted);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

/* Dark mode: show sun icon (click to go light) */
:root:not([data-theme="light"]) .theme-toggle .icon-sun {
  display: block;
}

/* Light mode: show moon icon (click to go dark) */
[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}
