:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --border: #30363d;
  --text-main: #c9d1d9;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-green: #3fb950;
  --accent-cyan: #38bdf8;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Nav */
header {
  border-bottom: 1px solid var(--border);
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
}

.brand img {
  width: 32px;
  height: 32px;
  display: block;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

nav a:hover, nav a.active {
  color: var(--accent);
}

/* Main Container */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  flex: 1;
  width: 100%;
}

/* Hero Section */
.hero {
  padding: 2.5rem 0 3.5rem 0;
  border-bottom: 1px solid var(--border);
}

.hero-avatar {
  width: 72px;
  height: 72px;
  margin-bottom: 1.5rem;
  display: block;
}

.hero h1 {
  font-size: 2.4rem;
  color: #fff;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero .role {
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.hero .bio {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 680px;
  line-height: 1.7;
}

/* Projects Section */
.section-title {
  font-size: 1.4rem;
  color: #fff;
  margin: 2.5rem 0 1.5rem 0;
  letter-spacing: -0.01em;
}

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

.project-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

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

.project-card h3 {
  color: #fff;
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  flex: 1;
  margin-bottom: 1.25rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--accent-cyan);
}

.tag.tag-phys {
  color: var(--accent-green);
}

/* Project Detail Page */
.project-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.project-header h1 {
  font-size: 2.2rem;
  color: #fff;
  margin-bottom: 0.75rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.content-block {
  margin-bottom: 2.5rem;
}

.content-block h2 {
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 0.8rem;
}

.content-block p {
  color: var(--text-main);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.spec-table th, .spec-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.spec-table th {
  background: var(--bg-tertiary);
  color: #fff;
  font-weight: 600;
}

.spec-table tr:last-child td {
  border-bottom: none;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
