:root[data-theme='dark'] {
  --bg: #0e0e0e;
  --bg-card: #111;
  --border: #1a1a1a;
  --border-nav: #1f1f1f;
  --text-primary: #f0f0f0;
  --text-body: #a0a0a0;
  --text-muted: #636363;
  --text-dim: #555;
  --text-dimmer: #3a3a3a;
  --text-dimmest: #303030;
  --text-nav: #777;
  --tag-bg: #111;
  --tag-border: #1e1e1e;
  --tag-text: #6a6a6a;
  --footer-text: #353535;
  --social-icon: #424242;
  --theme-btn-bg: #1a1a1a;
  --theme-btn-border: #2a2a2a;
  --theme-btn-text: #666;
  --theme-btn-hover: #aaa;
  --cv-btn-bg: #f0f0f0;
  --cv-btn-text: #0e0e0e;
  --cv-btn-hover-bg: #d4d4d4;
  --cv-btn-shadow: rgba(240, 240, 240, 0.08);
}

:root[data-theme='light'] {
  --bg: #fafaf8;
  --bg-card: #f4f4f0;
  --border: #e8e8e2;
  --border-nav: #e0e0da;
  --text-primary: #1a1a1a;
  --text-body: #555550;
  --text-muted: #888880;
  --text-dim: #aaa;
  --text-dimmer: #bbb;
  --text-dimmest: #ccc;
  --text-nav: #888;
  --tag-bg: #f0f0ec;
  --tag-border: #e0e0da;
  --tag-text: #777770;
  --footer-text: #bbb;
  --social-icon: #aaa;
  --theme-btn-bg: #efefeb;
  --theme-btn-border: #e0e0da;
  --theme-btn-text: #888;
  --theme-btn-hover: #333;
  --cv-btn-bg: #1a1a1a;
  --cv-btn-text: #fafaf8;
  --cv-btn-hover-bg: #333;
  --cv-btn-shadow: rgba(0, 0, 0, 0.1);
}

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

body {
  background: var(--bg);
  color: var(--text-body);
  font-family: 'Sora', sans-serif;
  min-height: 100vh;
  transition:
    background 0.25s ease,
    color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Nav */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border-nav);
  transition: border-color 0.25s ease;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.nav-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-nav);
}
.nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.nav-name {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
  transition: color 0.25s;
}
.nav-role {
  font-size: 0.75rem;
  color: var(--text-dim);
  transition: color 0.25s;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.nav-links {
  display: flex;
  gap: 1.6rem;
  font-size: 0.84rem;
  color: var(--text-nav);
  transition: color 0.25s;
}
.nav-links a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

/* Theme toggle */
.theme-toggle {
  background: var(--theme-btn-bg);
  border: 1px solid var(--theme-btn-border);
  color: var(--theme-btn-text);
  cursor: pointer;
  padding: 0.28rem 0.52rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1;
}
.theme-toggle:hover {
  color: var(--theme-btn-hover);
  border-color: var(--theme-btn-hover);
}
.theme-toggle svg {
  width: 13px;
  height: 13px;
}

/* Layout */
.container {
  max-width: 750px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Section */
section {
  padding: 2.4rem 0;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.25s;
}
section:last-child {
  border-bottom: none;
}
.section-title {
  font-size: 0.78rem;
  color: var(--text-nav);
  letter-spacing: 0.04em;
  margin-bottom: 1.2rem;
  font-weight: 400;
  transition: color 0.25s;
}

/* About */
.about-text {
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.8;
  transition: color 0.25s;
}
.about-text p {
  margin-bottom: 0.75rem;
}
.about-text p:last-child {
  margin-bottom: 0;
}
.about-text strong {
  color: var(--text-primary);
  font-weight: 600;
  transition: color 0.25s;
}

/* Certifications */
.cert-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.6rem 0.9rem;
}
.cert-card {
  flex: 0 0 calc((100% - 3 * 0.9rem) / 4);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
}
.cert-badge {
  height: 130px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.cert-name {
  font-size: 0.78rem;
  color: var(--text-primary);
  line-height: 1.4;
  transition: color 0.25s;
}
.cert-issuer {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
  transition: color 0.25s;
}
@media (max-width: 600px) {
  .cert-card {
    flex-basis: calc((100% - 0.9rem) / 2);
  }
  /* Nav: name + theme toggle on the first row, links on the second */
  nav {
    flex-wrap: wrap;
    row-gap: 0.9rem;
  }
  .nav-right {
    display: contents;
  }
  .nav-links {
    order: 3;
    flex-basis: 100%;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.8rem;
  }
}

/* Blogs */
.blog-intro {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
  transition: color 0.25s;
}
.blog-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0;
  color: inherit;
  text-decoration: none;
}
.blog-item + .blog-item {
  border-top: 1px solid var(--border);
  transition: border-color 0.25s;
}
.blog-item:hover {
  text-decoration: none;
}
.blog-item:hover .project-name {
  text-decoration: underline;
}
.blog-logos {
  display: flex;
  flex-shrink: 0;
}
.blog-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
}
.blog-logo + .blog-logo {
  margin-left: -18px;
  box-shadow: 0 0 0 2px var(--bg);
}

/* Projects */
.project-item {
  padding: 0.75rem 0;
}
.project-item + .project-item {
  border-top: 1px solid var(--border);
  transition: border-color 0.25s;
}
.project-name {
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 500;
  transition: color 0.25s;
}
.project-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.18rem;
  line-height: 1.5;
  transition: color 0.25s;
}
.view-all {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.9rem;
  font-size: 0.81rem;
  color: var(--text-dim);
}
.view-all a:hover {
  color: var(--text-nav);
  text-decoration: none;
}
.view-all a::after {
  content: ' →';
}

/* Skills */
.skill-group {
  margin-bottom: 1.1rem;
}
.skill-group:last-child {
  margin-bottom: 0;
}
.skill-group-label {
  font-size: 0.69rem;
  color: var(--text-dimmer);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  transition: color 0.25s;
}
.skill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}
.skill-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  color: var(--tag-text);
  padding: 0.25rem 0.58rem;
  border-radius: 4px;
  transition:
    background 0.25s,
    border-color 0.25s,
    color 0.25s;
}

/* Experience */
.exp-item {
  margin-bottom: 1.6rem;
}
.exp-item:last-child {
  margin-bottom: 0;
}
.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.15rem;
}
.exp-title {
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 500;
  transition: color 0.25s;
}
.exp-date {
  font-size: 0.71rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  transition: color 0.25s;
}
.exp-company {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
  transition: color 0.25s;
}
.exp-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}
.exp-bullets li {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.7;
  padding-left: 1rem;
  position: relative;
  margin-bottom: 0.28rem;
  transition: color 0.25s;
}
.exp-bullets li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--text-dimmest);
  transition: color 0.25s;
}

/* Download CV button area */
.cv-section {
  padding: 2rem 0 2.5rem;
  display: flex;
  justify-content: center;
}

.cv-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--cv-btn-bg);
  color: var(--cv-btn-text);
  border: none;
  padding: 0.75rem 1.6rem;
  border-radius: 8px;
  font-family: 'Sora', sans-serif;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 2px 12px var(--cv-btn-shadow);
  letter-spacing: 0.01em;
}
.cv-btn:hover {
  background: var(--cv-btn-hover-bg);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--cv-btn-shadow);
  text-decoration: none;
  color: var(--cv-btn-text);
}
.cv-btn:active {
  transform: translateY(0);
}
.cv-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Footer */
footer {
  padding: 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  font-size: 0.74rem;
  color: var(--footer-text);
  transition:
    border-color 0.25s,
    color 0.25s;
}
.social-icons {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}
.social-icons a {
  color: var(--social-icon);
  transition: color 0.15s;
  display: flex;
}
.social-icons a:hover {
  color: var(--text-nav);
  text-decoration: none;
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
nav {
  animation: fadeUp 0.35s ease both;
}
section {
  animation: fadeUp 0.45s ease both;
}
.cv-section {
  animation: fadeUp 0.45s ease both;
  animation-delay: 0.38s;
}
section:nth-child(1) {
  animation-delay: 0.06s;
}
section:nth-child(2) {
  animation-delay: 0.12s;
}
section:nth-child(3) {
  animation-delay: 0.18s;
}
section:nth-child(4) {
  animation-delay: 0.24s;
}
section:nth-child(5) {
  animation-delay: 0.3s;
}
section:nth-child(6) {
  animation-delay: 0.36s;
}
