
:root,
[data-theme="light"] {
  --bg:           #ffffff;
  --bg-alt:       #f8f9fa;
  --bg-card:      #ffffff;
  --text:         #212529;
  --text-muted:   #6c757d;
  --border:       #dee2e6;
  --border-light: #e9ecef;
  --accent:       #7209b7;   
  --accent-2:     #560bad;
  --accent-rgb:   114, 9, 183;
  --link:         #7209b7;
  --link-hover:   #560bad;
  --tag-bg:       #f3e8ff;
  --tag-text:     #7209b7;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.12);
  --radius:       8px;
  --radius-sm:    4px;
  --radius-pill:  999px;
  --max-width:    1100px;
  --sidebar-w:    260px;
  --font-serif:   "Noto Serif", Georgia, serif;
  --font-sans:    "Noto Sans", system-ui, sans-serif;
  --font-mono:    "Source Code Pro", monospace;
  --nav-h:        60px;
}

[data-theme="dark"] {
  --bg:           #1a1a2e;
  --bg-alt:       #16213e;
  --bg-card:      #0f3460;
  --text:         #e2e2e2;
  --text-muted:   #adb5bd;
  --border:       rgba(255,255,255,0.12);
  --border-light: rgba(255,255,255,0.07);
  --accent:       #bd93f9;
  --accent-2:     #d6adff;
  --accent-rgb:   189, 147, 249;
  --link:         #bd93f9;
  --link-hover:   #d6adff;
  --tag-bg:       rgba(189,147,249,0.15);
  --tag-text:     #bd93f9;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.5);
}

/* ── RESET & BASE ──────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 300ms, color 300ms;
}

img { max-width: 100%; display: block; }

a {
  color: var(--link);
  text-decoration: none;
  transition: color 180ms;
}
a:hover { color: var(--link-hover); text-decoration: underline; }

code, kbd, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--text);
  line-height: 1.25;
}

p { margin-bottom: 0; }

/* ── NAVBAR ───────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  height: var(--nav-h);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
}

.navbar__brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.navbar__brand:hover { color: var(--accent); text-decoration: none; }

.navbar__links {
  list-style: none;
  display: flex;
  gap: 4px;
}

.navbar__links li a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: background 180ms, color 180ms;
}
.navbar__links li a:hover,
.navbar__links li a.is-active {
  color: var(--accent);
  background: var(--tag-bg);
  text-decoration: none;
}
.navbar__links li a i {
  font-size: 0.82rem;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

/* ── THEME TOGGLE ─────────────────────────────────────── */
.theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-alt);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-muted);
  transition: background 180ms, border-color 180ms, color 180ms;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--tag-bg); border-color: var(--accent); color: var(--accent); }

/* ── NAVBAR CONTROLS (theme + hamburger) ─────────────── */
.navbar__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── HAMBURGER ────────────────────────────────────────── */
.navbar__hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-muted);
  transition: background 180ms, border-color 180ms, color 180ms;
}
.navbar__hamburger:hover { background: var(--tag-bg); border-color: var(--accent); color: var(--accent); }

/* ── PAGE WRAPPER ─────────────────────────────────────── */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 80px;
}

.page-section {
  padding: 52px 0;
  border-bottom: 1px solid var(--border-light);
}
.page-section:last-child { border-bottom: none; }

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 28px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  color: var(--text);
}

/* ── ABOUT / PROFILE ─────────────────────────────────── */
.about-section { padding-top: 48px; }

.about-grid {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

/* sidebar */
.profile-sidebar { text-align: center; }

.profile-photo-wrap {
  margin-bottom: 18px;
}

.profile-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tag-bg), rgba(var(--accent-rgb), 0.3));
  border: 3px solid var(--border);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  overflow: hidden;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.profile-role {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.profile-affiliation {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.profile-address {
  font-style: normal;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 18px;
}

.profile-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  align-items: center;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  padding: 8px 14px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  background: var(--bg-alt);
  transition: background 180ms, border-color 180ms, color 180ms;
}
.social-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--tag-bg);
  text-decoration: none;
}
.social-link i {
  font-size: 1rem;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-shrink: 0;
}
.social-link span { 
  white-space: nowrap;
  line-height: 1;
}

/* bio */
.about-bio > p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 20px;
}

.about-points {
  display: grid;
  gap: 10px;
  margin-bottom: 36px;
}

.about-point {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.about-point::before {
  content: "→";
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

/* News / latest posts feed */
.feed-block { margin-bottom: 36px; }

.feed-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-serif);
}

.news-table {
  width: 100%;
  border-collapse: collapse;
}

.news-table tr + tr td { border-top: 1px solid var(--border-light); }

.news-table td {
  padding: 9px 6px;
  vertical-align: top;
  font-size: 0.93rem;
  line-height: 1.5;
}

.news-date {
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 0.88rem;
  min-width: 100px;
  padding-right: 14px;
}

.news-item a {
  font-weight: 500;
}

/* ── SKILLS ──────────────────────────────────────────── */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.skill-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-weight: 500;
  transition: all 200ms;
  box-shadow: var(--shadow-sm);
}

.skill-pill:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ── FILTER BAR ──────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-pill {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 180ms, border-color 180ms, color 180ms;
}
.filter-pill:hover {
  background: var(--tag-bg);
  border-color: var(--accent);
  color: var(--accent);
}
.filter-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── PROJECTS ────────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0;
  -webkit-transition: box-shadow 200ms, -webkit-transform 200ms;
  transition: box-shadow 200ms, transform 200ms;
}
.project-card:hover {
  box-shadow: var(--shadow-md);
  -webkit-transform: translateY(-3px);
  -ms-transform: translateY(-3px);
  transform: translateY(-3px);
}

/* Project image slider */
.project-card__image-slider {
  position: relative;
  width: calc(100% - 32px);
  aspect-ratio: 16 / 10;
  background: var(--bg-alt);
  overflow: hidden;
  flex-shrink: 0;
  margin: 16px 16px 0 16px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.project-card__images {
  position: relative;
  width: 100%;
  height: 100%;
}

.project-card__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 400ms ease-in-out;
  pointer-events: none;
}

.project-card__image.is-active {
  opacity: 1;
  pointer-events: auto;
}

.project-slider__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 200ms, transform 200ms;
  z-index: 10;
}

.project-slider__btn:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.1);
}

.project-slider__btn--prev {
  left: 12px;
}

.project-slider__btn--next {
  right: 12px;
}

.project-slider__dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.project-slider__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0;
  transition: background 200ms, transform 200ms;
}

.project-slider__dot:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.2);
}

.project-slider__dot.is-active {
  background: white;
  transform: scale(1.3);
}

/* Project content area */
.project-card__content {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.project-card__year {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
}

.project-card__title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.project-card__summary {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.project-card__impact {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.6;
  padding: 10px 14px;
  background: var(--tag-bg);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  margin: 4px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.project-card__impact i {
  color: var(--accent);
  margin-top: 2px;
  flex-shrink: 0;
}

.project-card__details {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-card__details li {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
  padding-left: 18px;
  position: relative;
}

.project-card__details li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

.project-card__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-card__links {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

/* ── BLOG / WRITING ──────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-transition: box-shadow 200ms, -webkit-transform 200ms;
  transition: box-shadow 200ms, transform 200ms;
}
.blog-card:hover {
  box-shadow: var(--shadow-md);
  -webkit-transform: translateY(-3px);
  -ms-transform: translateY(-3px);
  transform: translateY(-3px);
}

.blog-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.blog-platform {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.blog-date {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.blog-card__title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.blog-card__excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

/* Blog card with thumbnail (Medium posts that have a cover image) */
.blog-card--thumb {
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.blog-card__thumb {
  width: 100%;
  height: 150px;
  overflow: hidden;
  flex-shrink: 0;
}

.blog-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 300ms;
}
.blog-card--thumb:hover .blog-card__thumb img { transform: scale(1.04); }

.blog-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  padding: 18px 20px;
}

/* For cards without thumbnail */
.blog-card:not(.blog-card--thumb) .blog-card__body {
  padding: 0;
}

/* Blog status message (loading / error) */
.blog-status {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 6px 0 16px;
  font-style: italic;
}

.text-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-link:hover { color: var(--accent-2); }

/* ── CERTIFICATES ────────────────────────────────────── */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  -webkit-transition: box-shadow 200ms, -webkit-transform 200ms;
  transition: box-shadow 200ms, transform 200ms;
}
.cert-card:hover {
  box-shadow: var(--shadow-md);
  -webkit-transform: translateY(-3px);
  -ms-transform: translateY(-3px);
  transform: translateY(-3px);
}

.cert-card__image-wrap {
  width: 100%;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: var(--bg-alt);
  flex-shrink: 0;
  position: relative;
}

.cert-card__image-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(var(--accent-rgb), 0.05) 100%);
  opacity: 0;
  transition: opacity 300ms;
  pointer-events: none;
}
.cert-card:hover .cert-card__image-wrap::before { opacity: 1; }

.cert-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms;
}
.cert-card:hover .cert-card__image { transform: scale(1.05); }

.cert-card__image-wrap a {
  display: block;
  width: 100%;
  height: 100%;
}

.cert-card__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 20px;
  line-height: 1.5;
}

.cert-card__content {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.cert-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.cert-card__issuer {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.cert-card__date {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.cert-card__title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.cert-card__title a {
  color: var(--text);
  transition: color 180ms;
}
.cert-card__title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.cert-card__id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.cert-card__keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.cert-card__actions {
  margin-top: auto;
  padding-top: 8px;
}

.btn-sm {
  font-size: 0.85rem;
  padding: 7px 16px;
}

/* ── CV / TIMELINE ───────────────────────────────────── */
.cv-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
}

.cv-column > h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.cv-entries {
  display: grid;
  gap: 0;
}

.cv-entry {
  position: relative;
  padding-left: 24px;
  padding-bottom: 28px;
}

.cv-entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.cv-entry:last-child { padding-bottom: 0; }
.cv-entry:last-child::before { display: none; }

.cv-entry__dot {
  position: absolute;
  left: -5px;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.cv-entry__period {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.cv-entry__role {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.cv-entry__org {
  font-size: 0.92rem;
  color: var(--accent);
  font-style: italic;
  margin-bottom: 8px;
}

.cv-entry__summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 8px;
}

.cv-entry__highlights {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 5px;
}

.cv-entry__highlights li {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}
.cv-entry__highlights li::before {
  content: "▪";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
  top: 3px;
}

/* ── CONTACT ─────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
}

.contact-intro > p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 22px;
}

.contact-links {
  display: grid;
  gap: 12px;
}

.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background 180ms, border-color 180ms;
  color: var(--text);
}
.contact-link:hover {
  background: var(--tag-bg);
  border-color: var(--accent);
  text-decoration: none;
}

.contact-link__label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.contact-link__value {
  font-size: 0.92rem;
  color: var(--accent);
  font-weight: 500;
}

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 180ms, border-color 180ms, box-shadow 180ms, transform 180ms;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover { background: var(--tag-bg); }

/* ── TAGS (shared by projects & blogs) ───────────────── */
.tag {
  font-size: 0.8rem;
  padding: 3px 10px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: var(--radius-pill);
  font-weight: 500;
  border: 1px solid rgba(var(--accent-rgb), 0.25);
}

/* ── FOOTER ──────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 28px 24px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-muted);
}
.site-footer code {
  background: none;
  padding: 0;
  color: var(--accent);
}

/* ── REVEAL ANIMATION ────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 1024px) {
  main { padding: 0 20px 60px; }
}

@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .profile-sidebar { text-align: left; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
  .profile-photo-wrap { margin-bottom: 0; }
  .profile-photo { width: 90px; height: 90px; font-size: 2rem; }
  .profile-social { justify-content: flex-start; }
  .cv-layout { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  /* ── Hamburger nav ── */
  .navbar__hamburger { display: flex; }

  .navbar__links {
    /* Hidden by default; becomes absolute dropdown when open */
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    flex-direction: column;
    padding: 6px 0 12px;
    z-index: 99;
    gap: 2px;
  }

  .navbar--open .navbar__links {
    display: flex;
  }

  .navbar__links li a {
    padding: 11px 20px;
    font-size: 0.95rem;
    border-radius: 0;
    gap: 12px;
  }
  .navbar__links li a i { font-size: 0.9rem; width: 18px; }

  /* ── Grids ── */
  .project-grid,
  .blog-grid,
  .cert-grid {
    grid-template-columns: 1fr;
  }
  .cv-layout { grid-template-columns: 1fr; }

  /* ── Page hero ── */
  .page-hero { padding: 28px 0 20px; }
  .page-hero .page-title { font-size: 1.75rem; }

  /* ── Profile sidebar on mobile ── */
  .profile-photo { width: 72px; height: 72px; font-size: 1.75rem; }
  .profile-name { font-size: 1.25rem; }

  /* ── CV ── */
  .cv-entry-v2 { grid-template-columns: 1fr; }
  .cv-entry-v2__date { text-align: left; font-weight: 600; padding-top: 0; }
  .cv-page-header { flex-direction: column; gap: 12px; }

  /* ── Footer ── */
  .site-footer { font-size: 0.8rem; padding: 20px 16px; }
}

@media (max-width: 400px) {
  main { padding: 0 14px 48px; }
  .navbar__inner { padding: 0 14px; }
  .navbar__brand { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .btn, .skill-pill, .project-card, .blog-card, .contact-link { transition: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ── PAGE HERO (blog / projects / cv / contact) ──────── */
.page-hero {
  padding: 44px 0 32px;
}

.page-hero .page-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.page-hero .page-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 640px;
}

.page-hero__actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── FEED TITLE ROW (title + "view all" inline) ──────── */
.feed-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.feed-title-row .feed-title {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.view-all {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.view-all:hover { color: var(--accent-2); text-decoration: underline; }

/* platform label in latest posts preview */
.post-platform {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* skills section on cv page */
.cv-skills-section {
  margin-top: 44px;
  padding-top: 40px;
  border-top: 1px solid var(--border-light);
}


/* Title row — title left, download button right */
.cv-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 40px 0 32px;
}

/* Wrap: main content + sticky TOC sidebar */
.cv-page-wrap {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

/* Main CV content column */
.cv-main {
  flex: 1;
  min-width: 0;
}

/* Each CV section (Experience, Education, etc.) */
.cv-section {
  margin-bottom: 32px;
  background: var(--bg-card);
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* Section heading with left accent border */
.cv-section-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.cv-section-title i { color: var(--accent); font-size: 1rem; }

/* Entry: date on left, content on right */
.cv-entries-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.cv-entry-v2 {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  align-items: start;
}

.cv-entry-v2__date {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: right;
  padding-top: 3px;
  line-height: 1.5;
  word-break: keep-all;
}

.cv-entry-v2__content { min-width: 0; }

.cv-entry-v2__role {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.cv-entry-v2__org {
  font-size: 0.92rem;
  color: var(--accent);
  font-style: italic;
  margin-bottom: 8px;
}

.cv-entry-v2__summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 8px;
}

.cv-entry-v2__highlights {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 4px;
}

.cv-entry-v2__highlights li {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}
.cv-entry-v2__highlights li::before {
  content: "◦";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.85rem;
}

/* Contact key-value grid */
.cv-contact-grid {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px 20px;
}

.cv-contact-row {
  display: contents;
}

.cv-contact-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  padding: 8px 0;
  align-self: start;
}

.cv-contact-value {
  font-size: 0.92rem;
  color: var(--text-muted);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  word-break: break-word;
}
.cv-contact-value:last-child { border-bottom: none; }
.cv-contact-value a { color: var(--accent); text-decoration: none; }
.cv-contact-value a:hover { text-decoration: underline; }

.cv-summary-text {
  font-size: 0.97rem;
  color: var(--text);
  line-height: 1.8;
}

/* Languages section */
.cv-languages-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.cv-language-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 200ms;
}

.cv-language-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.cv-language-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.cv-language-proficiency {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Right sticky TOC */
.cv-toc {
  width: 160px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  height: fit-content;
}

.cv-toc ul {
  list-style: none;
  border-left: 2px solid var(--border);
  padding: 0;
  margin: 0;
}

.cv-toc li a {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 5px 14px;
  transition: color 150ms, border-color 150ms;
  border-left: 2px solid transparent;
  margin-left: -2px;
  line-height: 1.4;
}

.cv-toc li a:hover,
.cv-toc li a.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
  text-decoration: none;
}

@media (max-width: 900px) {
  .cv-toc { display: none; }
  .cv-entry-v2 {
    grid-template-columns: 90px 1fr;
    gap: 10px;
  }
}

@media (max-width: 640px) {
  .cv-section {
    padding: 20px 18px;
    margin-bottom: 20px;
  }
  
  .cv-contact-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .cv-contact-label {
    font-weight: 700;
    padding: 4px 0;
  }
  
  .cv-contact-value {
    padding: 4px 0 8px;
  }
  
  .cv-languages-list {
    grid-template-columns: 1fr;
  }
  
  .cv-entry-v2 {
    grid-template-columns: 1fr;
  }
  .cv-entry-v2__date {
    text-align: left;
    padding-top: 0;
    font-weight: 600;
  }
  .cv-page-header { flex-direction: column; gap: 12px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   INTERACTIVE FEATURES - SETTINGS PANEL & EFFECTS
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Floating Settings Button ────────────────────────────────────────── */
.settings-float-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
}

.settings-float-btn:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 8px 32px rgba(var(--accent-rgb), 0.4);
}

.settings-float-btn:active {
  transform: scale(0.95) rotate(90deg);
}

/* ── Settings Modal ───────────────────────────────────────────────────── */
.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms;
}

.settings-modal.is-open {
  opacity: 1;
  pointer-events: all;
}

.settings-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.settings-modal__content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  max-width: 540px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-modal.is-open .settings-modal__content {
  transform: scale(1);
}

.settings-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
}

.settings-modal__header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-modal__header i {
  color: var(--accent);
}

.settings-modal__close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: all 200ms;
}

.settings-modal__close:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.settings-modal__body {
  padding: 28px;
  overflow-y: auto;
  flex: 1;
}

.settings-modal__desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 24px 0;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Settings Item ────────────────────────────────────────────────────── */
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 200ms;
}

.settings-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.settings-item__info {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
}

.settings-item__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--tag-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.settings-item__label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px 0;
}

.settings-item__desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ── Toggle Switch ───────────────────────────────────────────────────── */
.settings-toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}

.settings-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-toggle__slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  border-radius: 999px;
  transition: all 300ms;
}

.settings-toggle__slider::before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: all 300ms;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.settings-toggle input:checked + .settings-toggle__slider {
  background-color: var(--accent);
}

.settings-toggle input:checked + .settings-toggle__slider::before {
  transform: translateX(24px);
}

.settings-toggle:hover .settings-toggle__slider {
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.1);
}

/* ── Modal Footer ─────────────────────────────────────────────────────── */
.settings-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 28px;
  border-top: 1px solid var(--border);
}

/* ── Toast Notification ───────────────────────────────────────────────── */
.settings-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: var(--bg);
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 10001;
  opacity: 0;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.settings-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.settings-toast--success {
  background: #10b981;
  color: white;
}

.settings-toast--info {
  background: #3b82f6;
  color: white;
}

/* ── Reading Progress Bar ─────────────────────────────────────────────── */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 9998;
  width: 0%;
  transition: width 100ms ease-out;
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.5);
}

/* ── Cursor Trail Canvas ──────────────────────────────────────────────── */
.cursor-trail-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ── Mobile Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .settings-float-btn {
    width: 48px;
    height: 48px;
    bottom: 20px;
    right: 20px;
    font-size: 1.1rem;
  }

  .settings-modal__content {
    max-height: calc(100vh - 40px);
  }

  .settings-modal__header {
    padding: 20px;
  }

  .settings-modal__header h2 {
    font-size: 1.15rem;
  }

  .settings-modal__body {
    padding: 20px;
  }

  .settings-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .settings-modal__footer {
    flex-direction: column;
    padding: 16px 20px;
  }

  .settings-modal__footer .btn {
    width: 100%;
  }
}

/* ── Respect Reduced Motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .settings-float-btn,
  .settings-modal,
  .settings-modal__content,
  .settings-toggle__slider,
  .settings-toast {
    transition: none !important;
  }

  .settings-float-btn:hover {
    transform: none;
  }
}