:root {
  --bg: #0f1115;
  --bg-soft: #171a21;
  --card: #1b1f28;
  --border: #2a2f3a;
  --text: #e6e8ec;
  --text-muted: #a8aebb;
  --accent: #4f8cff;
  --accent-soft: rgba(79, 140, 255, 0.12);
  --header-bg: rgba(15, 17, 21, 0.85);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-soft: #eef0f3;
  --card: #ffffff;
  --border: #dfe2e8;
  --text: #1a1d24;
  --text-muted: #5a6270;
  --accent: #2b63d9;
  --accent-soft: rgba(43, 99, 217, 0.1);
  --header-bg: rgba(244, 245, 247, 0.85);
  --shadow: 0 8px 24px rgba(20, 25, 40, 0.08);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 150px;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

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

main.container {
  padding-bottom: 130px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.avatar {
  width: 128px;
  height: 128px;
  border-radius: 20px;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.theme-toggle {
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}

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

.icon-sun, .icon-moon {
  display: inline-block;
}

body[data-theme="light"] .icon-sun,
body:not([data-theme="light"]) .icon-moon {
  display: none;
}

/* TOC nav */
.toc {
  margin-top: 8px;
}

.section-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 32px 6px 12px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2388909e' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.2s ease;
}

.section-select:hover {
  border-color: var(--accent);
}

.section-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  margin: 20px 0;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
}

.card p {
  color: var(--text);
}

.highlights {
  list-style: none;
  display: grid;
  gap: 10px;
}

.highlights li {
  padding-left: 22px;
  position: relative;
  color: var(--text);
}

.highlights li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--accent);
}

.summary {
  color: var(--text);
}

/* Competencies */
.competency {
  margin-bottom: 18px;
}

.competency:last-child {
  margin-bottom: 0;
}

.competency h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.competency p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Education */
.edu-list {
  list-style: none;
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.edu-list li {
  padding-left: 22px;
  position: relative;
}

.edu-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.edu-note {
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 12px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
}

/* Experience */
.job {
  margin-bottom: 26px;
}

.job:last-child {
  margin-bottom: 0;
}

.job-head {
  margin-bottom: 12px;
}

.job-head h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.role {
  display: block;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: 2px;
}

.dates {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
}

.job ul {
  list-style: none;
  display: grid;
  gap: 10px;
}

.job ul li {
  position: relative;
  padding-left: 20px;
  color: var(--text);
  font-size: 0.95rem;
}

.job ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.job ul li strong {
  color: var(--text);
}

/* Footer */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  margin-top: 40px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.contact-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-link {
  font-size: 0.95rem;
  font-weight: 600;
}

.copyright {
  color: var(--text-muted);
  font-size: 0.75rem;
}

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

.site-footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 560px) {
  .brand-text h1 {
    font-size: 1.25rem;
  }
  .tagline {
    font-size: 0.8rem;
  }
  .avatar {
    width: 96px;
    height: 96px;
  }
  .card {
    padding: 20px;
  }
}
