:root {
  color-scheme: light;
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --panel: rgba(255, 255, 255, 0.9);
  --text: #1e293b;
  --muted: rgba(30, 41, 59, 0.7);
  --accent: #3b82f6;
  --accent-strong: #2563eb;
  --border: rgba(30, 41, 59, 0.12);
  --card-border: rgba(30, 41, 59, 0.15);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft Yahei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 25%, #f0f9ff 50%, #fef3c7 75%, #f8fafc 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
}

.gradient {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.15), transparent 40%),
    radial-gradient(circle at center, rgba(59, 130, 246, 0.12), transparent 35%),
    radial-gradient(circle at bottom right, rgba(251, 191, 36, 0.1), transparent 40%);
  filter: blur(60px);
}

main {
  width: min(1100px, 90vw);
  margin: 0 auto;
  padding: 4rem 0 6rem;
  position: relative;
}

.page-section {
  display: none;
  animation: fadeIn 0.3s ease-in;
}

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

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

.site-header {
  width: min(1100px, 90vw);
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  gap: 1rem;
}

.logo {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
}

.header-photo {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--card-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo .dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
}

.logo .owner {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--text);
}

.logo .title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
}

nav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

nav a {
  text-decoration: none;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.5rem 0.75rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

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

nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hero {
  padding: 5rem 0 2rem;
  text-align: center;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  max-width: 1000px;
  margin: 0 auto;
}

.hero-text {
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
}

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

.hero-image img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 20px;
  border: 2px solid var(--card-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.hero h1 {
  font-size: clamp(2.8rem, 5vw, 3.6rem);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 60ch;
  margin: 0 auto;
}

.hero-cta {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn {
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
}

.btn.secondary {
  border-color: var(--border);
  color: var(--text);
}

.panel {
  margin-top: 3rem;
  padding: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.panel-header {
  text-align: center;
}

.panel-header h2 {
  margin: 0 0 0.8rem;
  font-size: 1.8rem;
}

.panel-body {
  text-align: center;
}

.panel-body p {
  color: var(--muted);
  margin-top: 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.pill-grid {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.pill-grid span {
  border: 1px solid var(--card-border);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  background: rgba(248, 250, 252, 0.8);
}

.timeline-item .role {
  font-weight: 600;
}

.timeline-item .company {
  color: var(--muted);
}

.timeline-item .description {
  color: var(--muted);
  margin: 0.5rem 0 0;
  text-align: left;
}

.project-grid,
.writing-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.7);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}

.card .badge {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.card h3 {
  margin: 0.6rem 0;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.card a {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  text-decoration: none;
}

.footer {
  width: min(1100px, 90vw);
  margin: 4rem auto;
  padding: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  text-align: center;
}

.footer h2 {
  margin-top: 0.2rem;
}

.footer .links {
  margin: 1.5rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

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

.footer span {
  color: var(--muted);
}

.footer .small {
  color: var(--muted);
}

@media (max-width: 768px) {
  .site-header {
    flex-direction: column;
    gap: 1rem;
    position: sticky;
  }

  nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  nav a {
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
  }

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

  .hero {
    text-align: center;
  }

  .hero-image {
    align-self: center;
  }

  .hero-image img {
    width: 180px;
    height: 180px;
  }

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

